This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Use the from-scratch testing configuration by default
ClosedPublic

Authored by ldionne on Oct 19 2021, 9:06 AM.

Details

Summary

This commit switches libunwind from using the complicated logic in
libc++'s testing configuration to a from-scratch configuration.
I tried to make sure that all cases that were handled in the old
config were handled by this one too, so hopefully this shouldn't
break anyone. However, if you encounter issues with this change,
please let me know and feel free to revert if I don't reply quickly.

This change was engineered to be easily revertable.

Diff Detail

Event Timeline

ldionne created this revision.Oct 19 2021, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2021, 9:06 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested review of this revision.Oct 19 2021, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2021, 9:06 AM
ldionne updated this revision to Diff 380723.Oct 19 2021, 10:17 AM

Rebase onto main

ldionne accepted this revision.Oct 20 2021, 5:44 AM

Shipping this, as I mentioned please feel free to revert if this causes issues. If you do, please explain those issues so we can fix them before we try again.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 20 2021, 5:46 AM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Oct 20 2021, 9:57 AM

I think this may have broken our builders since all libunwind tests now fail with the same error:

Script:
--
: 'COMPILED WITH';  /b/s/w/ir/x/w/staging/llvm_build/./bin/clang++ /b/s/w/ir/x/w/llvm-project/libunwind/test/forceunwind.pass.cpp  --target=x86_64-unknown-linux-gnu -nostdinc++ -I /b/s/w/ir/x/w/llvm-project/libunwind/include -funwind-tables -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER  -nodefaultlibs /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a -ldl -lc -lpthread -Wl,--export-dynamic -o /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/Output/forceunwind.pass.cpp.dir/t.tmp.exe
: 'EXECUTED AS';  /b/s/w/ir/cipd_bin_packages/cpython3/bin/python3.8 /b/s/w/ir/x/w/llvm-project/libunwind/../libcxx/utils/run.py --execdir /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/Output/forceunwind.pass.cpp.dir --  /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/Output/forceunwind.pass.cpp.dir/t.tmp.exe
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "COMPILED WITH"
$ "/b/s/w/ir/x/w/staging/llvm_build/./bin/clang++" "/b/s/w/ir/x/w/llvm-project/libunwind/test/forceunwind.pass.cpp" "--target=x86_64-unknown-linux-gnu" "-nostdinc++" "-I" "/b/s/w/ir/x/w/llvm-project/libunwind/include" "-funwind-tables" "-std=c++2b" "-Werror" "-Wall" "-Wextra" "-Wshadow" "-Wundef" "-Wno-unused-command-line-argument" "-Wno-attributes" "-Wno-pessimizing-move" "-Wno-c++11-extensions" "-Wno-user-defined-literals" "-Wno-noexcept-type" "-Wno-atomic-alignment" "-Wsign-compare" "-Wunused-variable" "-Wunused-parameter" "-Wunreachable-code" "-Wno-unused-local-typedef" "-D_LIBCPP_DISABLE_AVAILABILITY" "-fcoroutines-ts" "-Werror=thread-safety" "-Wuser-defined-warnings" "-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER" "-nodefaultlibs" "/b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a" "-ldl" "-lc" "-lpthread" "-Wl,--export-dynamic" "-o" "/b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/Output/forceunwind.pass.cpp.dir/t.tmp.exe"
# command stderr:
clang-14: error: no such file or directory: '/b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a'

error: command failed with exit status: 1

--

The /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a is invalid, in the bootstrapping build it should be /b/s/w/ir/x/w/staging/llvm_build/lib/x86_64-unknown-linux-gnu/libunwind.a.

I think this may have broken our builders since all libunwind tests now fail with the same error:
[...]
The /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a is invalid, in the bootstrapping build it should be /b/s/w/ir/x/w/staging/llvm_build/lib/x86_64-unknown-linux-gnu/libunwind.a.

This is weird, the bootstrapping build does use the from-scratch config. Are you able to reproduce the issue if you specify -DLIBUNWIND_TEST_CONFIG=llvm-libunwind-shared.cfg.in manually? If so, can you share your build incantation so I can reproduce on my side?

I think this may have broken our builders since all libunwind tests now fail with the same error:
[...]
The /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/lib/libunwind.a is invalid, in the bootstrapping build it should be /b/s/w/ir/x/w/staging/llvm_build/lib/x86_64-unknown-linux-gnu/libunwind.a.

This is weird, the bootstrapping build does use the from-scratch config. Are you able to reproduce the issue if you specify -DLIBUNWIND_TEST_CONFIG=llvm-libunwind-shared.cfg.in manually? If so, can you share your build incantation so I can reproduce on my side?

Ahhhh! I guess it might be because you are using the Bootstrapping build AND the static library, which we are not testing. I'll try to reproduce locally.

Thanks a lot for the info. I'm trying to repro locally. I assume the issue is that the from-scratch config doesn't handle per-target runtime directories properly, but I want to see the details.

ldionne reopened this revision.Oct 22 2021, 11:38 AM
ldionne updated this revision to Diff 381614.Oct 22 2021, 11:38 AM

Rebase onto main after (hopefully) fixing the Fuchsia failures. @gulfem or @phosek could one of you please apply this patch locally and confirm it fixed the issues? I did it locally, but I might not have been using exactly the same setup.

ldionne accepted this revision.Oct 26 2021, 6:33 AM

I'm going to land this again and worst case we can revert it swiftly if it breaks bots.

This revision is now accepted and ready to land.Oct 26 2021, 6:33 AM
This revision was landed with ongoing or failed builds.Oct 26 2021, 6:34 AM
This revision was automatically updated to reflect the committed changes.

Hi @ldionne,
I had a bad internet connection yesterday, and I just found a chance to respond to you today.
With your reland, Fuchsia builders seems fine.

Hi @ldionne,
I had a bad internet connection yesterday, and I just found a chance to respond to you today.
With your reland, Fuchsia builders seems fine.

Awesome, thanks!

Hi @ldione,

these changes break the remote test execution on the cross toolchain builders. The libunwind tests get running on the local host instead of the remote target.
https://lab.llvm.org/buildbot/#/builders/60/builds/5235