Skip to content

[test][CAS] Fix unused variable warning in unittest - #159594

Merged
cachemeifyoucan merged 1 commit into
mainfrom
users/cachemeifyoucan/spr/testcas-fix-unused-variable-warning-in-unittest
Sep 18, 2025
Merged

cachemeifyoucan merged 1 commit into
mainfrom
users/cachemeifyoucan/spr/testcas-fix-unused-variable-warning-in-unittest

Conversation

@cachemeifyoucan

Copy link
Copy Markdown
Contributor

Fix unused variable warning blocking AIX bot.

Created using spr 1.3.6
@cachemeifyoucan
cachemeifyoucan enabled auto-merge (squash) September 18, 2025 15:25
@cachemeifyoucan
cachemeifyoucan merged commit 24504c3 into main Sep 18, 2025
10 checks passed
@cachemeifyoucan
cachemeifyoucan deleted the users/cachemeifyoucan/spr/testcas-fix-unused-variable-warning-in-unittest branch September 18, 2025 15:56
@amy-kwan

Copy link
Copy Markdown
Member

Thanks for this fix @cachemeifyoucan! I don't think the AIX bot is building this commit yet, but I've tried it locally and now I'm seeing the same issue as the build prior to build 5822, specifically the issue in build 5821 where the issue looks like this:

FAILED: [code=8] unittests/CAS/CASTests 
: && /home/llvm/llvm-external-buildbots/clang.20.1.7/bin/clang++ -pthread -mcmodel=large -fPIC -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-bnoipath -Wl,-bglink=large unittests/CAS/CMakeFiles/CASTests.dir/ActionCacheTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/CASTestConfig.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ObjectStoreTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ProgramTest.cpp.o -o unittests/CAS/CASTests  -Wl,-blibpath:/usr/lib:/lib  lib/libLLVMSupport.a  lib/libLLVMCAS.a  lib/libLLVMTestingSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  -lrt  -lld  -lpthreads  -lm  lib/libLLVMDemangle.a  -lpthread && :
ld: 0711-317 ERROR: Undefined symbol: .flock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
clang++: error: linker command failed with exit code 8 (use -v to see invocation)

@cachemeifyoucan

Copy link
Copy Markdown
Contributor Author

Thanks for this fix @cachemeifyoucan! I don't think the AIX bot is building this commit yet, but I've tried it locally and now I'm seeing the same issue as the build prior to build 5822, specifically the issue in build 5821 where the issue looks like this:

FAILED: [code=8] unittests/CAS/CASTests 
: && /home/llvm/llvm-external-buildbots/clang.20.1.7/bin/clang++ -pthread -mcmodel=large -fPIC -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-bnoipath -Wl,-bglink=large unittests/CAS/CMakeFiles/CASTests.dir/ActionCacheTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/CASTestConfig.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ObjectStoreTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ProgramTest.cpp.o -o unittests/CAS/CASTests  -Wl,-blibpath:/usr/lib:/lib  lib/libLLVMSupport.a  lib/libLLVMCAS.a  lib/libLLVMTestingSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  -lrt  -lld  -lpthreads  -lm  lib/libLLVMDemangle.a  -lpthread && :
ld: 0711-317 ERROR: Undefined symbol: .flock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
clang++: error: linker command failed with exit code 8 (use -v to see invocation)

Did you delete CMakeCache.txt before you rebuild?

@amy-kwan

Copy link
Copy Markdown
Member

Thanks for this fix @cachemeifyoucan! I don't think the AIX bot is building this commit yet, but I've tried it locally and now I'm seeing the same issue as the build prior to build 5822, specifically the issue in build 5821 where the issue looks like this:

FAILED: [code=8] unittests/CAS/CASTests 
: && /home/llvm/llvm-external-buildbots/clang.20.1.7/bin/clang++ -pthread -mcmodel=large -fPIC -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-bnoipath -Wl,-bglink=large unittests/CAS/CMakeFiles/CASTests.dir/ActionCacheTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/CASTestConfig.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ObjectStoreTest.cpp.o unittests/CAS/CMakeFiles/CASTests.dir/ProgramTest.cpp.o -o unittests/CAS/CASTests  -Wl,-blibpath:/usr/lib:/lib  lib/libLLVMSupport.a  lib/libLLVMCAS.a  lib/libLLVMTestingSupport.a  lib/libllvm_gtest_main.a  lib/libllvm_gtest.a  -lrt  -lld  -lpthreads  -lm  lib/libLLVMDemangle.a  -lpthread && :
ld: 0711-317 ERROR: Undefined symbol: .flock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
clang++: error: linker command failed with exit code 8 (use -v to see invocation)

Did you delete CMakeCache.txt before you rebuild?

@cachemeifyoucan My local build was a clean build and this occurs. According to https://www.ibm.com/docs/en/aix/7.3.0?topic=l-lockfx-lockf-flock-lockf64-subroutine, flock is in libbsd.a, so I believe we may need a -lbsd on AIX for the CAS unittests.

@cachemeifyoucan

cachemeifyoucan commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor Author

@amy-kwan Can you give this PR a try? #159647

@amy-kwan

Copy link
Copy Markdown
Member

@amy-kwan Can you give this PR a try? #159647

Building/testing it locally now and will report back on the results. Thanks for the quick PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants