Skip to content

Conversation

@cmcfarlen
Copy link
Contributor

Older (but not that old) compiler's can't see template specializations implemented in another translation unit without forward declaring them. This adds the forward declarations and also adds a unit test that was used to track down and verify this issue.

This is an alternative fix to #12433

@cmcfarlen cmcfarlen added this to the 10.2.0 milestone Aug 14, 2025
@cmcfarlen cmcfarlen requested review from maskit and zwoop August 14, 2025 22:31
@cmcfarlen cmcfarlen self-assigned this Aug 14, 2025
@cmcfarlen cmcfarlen added Build work related to build configuration or environment Bug labels Aug 14, 2025
@maskit
Copy link
Member

maskit commented Aug 14, 2025

Looks good to me. I'll close #12433.

endif()

add_executable(test_matcher matcher_tests.cc matcher.cc lulu.cc regex_helper.cc resources.cc)
add_test(NAME test_matcher COMMAND $<TARGET_FILE:test_matcher>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to land #12453 so we don't conflict with these.

bneradt
bneradt previously approved these changes Aug 15, 2025
@bneradt
Copy link
Contributor

bneradt commented Aug 15, 2025

[approve ci]

@bneradt
Copy link
Contributor

bneradt commented Aug 15, 2025

Here's the ubuntu build failure:
https://ci.trafficserver.apache.org/job/Github_Builds/job/ubuntu/6404/console

: && /usr/lib/llvm-12/bin/clang++ -D_FORTIFY_SOURCE=2 -fPIE -fstack-protector -pthread -g -pie -Wl,-z,relro -Wl,-z,now plugins/header_rewrite/CMakeFiles/test_matcher.dir/matcher_tests.cc.o plugins/header_rewrite/CMakeFiles/test_matcher.dir/matcher.cc.o plugins/header_rewrite/CMakeFiles/test_matcher.dir/lulu.cc.o plugins/header_rewrite/CMakeFiles/test_matcher.dir/regex_helper.cc.o plugins/header_rewrite/CMakeFiles/test_matcher.dir/resources.cc.o -o plugins/header_rewrite/test_matcher  -Wl,-rpath,/home/jenkins/workspace/Github_Builds/ubuntu/src/build/lib/swoc:/home/jenkins/workspace/Github_Builds/ubuntu/src/build/lib/yamlcpp  -ldl  src/tsutil/libtsutil.a  lib/swoc/libswoc.so.1.5.14  lib/yamlcpp/libyaml-cppd.so.0.8.0  -ldl  /usr/lib/x86_64-linux-gnu/libpcre2-8.so  /usr/lib/x86_64-linux-gnu/libpcre.so && :
/usr/bin/ld: plugins/header_rewrite/CMakeFiles/test_matcher.dir/matcher_tests.cc.o: in function `ProxyMutex::free()':
/home/jenkins/workspace/Github_Builds/ubuntu/src/build/../include/iocore/eventsystem/Lock.h:657: undefined reference to `ink_mutex_destroy(pthread_mutex_t*)'
/usr/bin/ld: /home/jenkins/workspace/Github_Builds/ubuntu/src/build/../include/iocore/eventsystem/Lock.h:658: undefined reference to `mutexAllocator'
/usr/bin/ld: plugins/header_rewrite/CMakeFiles/test_matcher.dir/matcher_tests.cc.o: in function `FreelistAllocator::free_void(void*)':
/home/jenkins/workspace/Github_Builds/ubuntu/src/build/../include/tscore/Allocator.h:73: undefined reference to `ink_freelist_free(_InkFreeList*, void*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@cmcfarlen cmcfarlen merged commit f4cd38b into apache:master Aug 19, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this to For v10.1.1 in ATS v10.1.x Aug 19, 2025
@cmcfarlen cmcfarlen deleted the hrw-unit-test branch August 20, 2025 14:49
@cmcfarlen cmcfarlen removed this from ATS v10.1.x Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Build work related to build configuration or environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants