-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build][Linux] Create preset to run LLVM's TSan libdispatch tests #24330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When you ready to start test use For more info: |
utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py
Outdated
Show resolved
Hide resolved
(I've taken myself off the review list because this is outside my area of expertise, but I'll keep following this PR because I want to see how this works.) |
preset=buildbot_incremental_linux,tsan-libdispatch-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me.
When invoking the cmake configure step from my python script, I configure the clang to use like so: The path is constructed via: llvm_build_dir = os.path.join(self.build_dir, '../llvm-' + host_target)
cc_path = os.path.join(llvm_build_dir, 'bin/clang') When I build my preset locally, this folder contains the just-built clang. @shahmishal @gottesmm Any ideas why/what things could be different when compared to my local Ubuntu VM? Relevant build output:
|
utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better! = ).
Only comment is shouldn't you be using the toolchain as your CMAKE_PREFIX_PATH? You shouldn't have access to the original llvm build directory.
Maybe try making the path absolute? os.path.abspath(...)? I vaguely remember hitting that before. |
preset=buildbot_incremental_linux,tsan-libdispatch-test |
Using absolute paths got me one step further. Thanks for the tip! Next issue: cmake -GNinja -B/home/buildnode/jenkins/workspace/swift-PR-Linux-preset/branch-master/buildbot_incremental_tsan_libdispatch_test/tsanlibdispatch-linux-x86_64 ...
However:
Build files have been written to: /home/buildnode/jenkins/workspace/swift-PR-Linux-preset/branch-master
Leading to:
cmake --build /home/buildnode/jenkins/workspace/swift-PR-Linux-preset/branch-master/buildbot_incremental_tsan_libdispatch_test/tsanlibdispatch-linux-x86_64 --target tsan
Error: /home/buildnode/jenkins/workspace/swift-PR-Linux-preset/branch-master/buildbot_incremental_tsan_libdispatch_test/tsanlibdispatch-linux-x86_64 is not a directory Looks like cmake
|
@yln I would perform the invocation of cmake in that specific directory. We assume I think 3.4.3. We should update at some point soon once compnerd's changes in cmake itself land to enable swift as a language. |
preset=buildbot_incremental_linux,tsan-libdispatch-test |
0f82d0c
to
2d77de9
Compare
preset=buildbot_incremental_linux,tsan-libdispatch-test |
2d77de9
to
d3170c2
Compare
@swift-ci Please clean test |
preset=buildbot_incremental_linux,tsan-libdispatch-test |
I think I have finally found the problem for undefined references during the configure step for 'libcxx_tsan_x86_64'. The 'stable' branch is used for CI, but the following (required) change hasn't made it there yet: I could cherry-pick it into @shahmishal @gottesmm |
apple/swift-compiler-rt#39 |
@swift-ci Please test |
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2], ensuring that the link step succeeds for the prodcued dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013
apple/swift-compiler-rt#40 |
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2], ensuring that the link step succeeds for the prodcued dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013
apple/swift-compiler-rt#40 |
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2, 3], ensuring that the link step succeeds for the prodcued dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013 [3] https://reviews.llvm.org/rG0a9cb239a6c91a709a98c96bbf60b6c006d5a07b
apple/swift-compiler-rt#40 |
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2, 3], ensuring that the link step succeeds for the produced dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013 [3] https://reviews.llvm.org/rG0a9cb239a6c91a709a98c96bbf60b6c006d5a07b rdar://problem/50828689
apple/swift-compiler-rt#40 |
Required change to make "Swift CI preset for LLVM libdispatch tests" [1] work. This goes the opposite direction of [2, 3], ensuring that the link step succeeds for the produced dynamic library (*.so). In the future versions of compiler-rt this will not be necessary since we will create a static archive instead. [1] swiftlang/swift#24330 [2] https://reviews.llvm.org/D58013 [3] https://reviews.llvm.org/rG0a9cb239a6c91a709a98c96bbf60b6c006d5a07b rdar://problem/50828689
apple/swift-compiler-rt#40 |
It seems to work now. I just clicked merge on the PR for the required changes in swift-compiler-rt [swift-5.1-branch]. I will wait until those have propagated to [stable], and run the preset one more time to verify it works. @gottesmm @jrose-apple |
@swift-ci python lint |
Lets make sure this passes the python linter. If we pass, I am good with this. |
@yln can you fix the python lint issues? |
Build a separate compiler-rt instance for running the tests. It is built and tested against an installed toolchain instead of the llvm-build-dir. Install everything we need to run tests (CMake modules, FileCheck, etc.) into the toolchain directory. Add synthetic target 'all' for llvm-install-components. Also we must set LLVM_INSTALL_UTILS=ON, so the utilities required by tests (e.g., FileCheck) are included in the install target.
d3170c2
to
9631700
Compare
@swift-ci python lint |
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
preset=buildbot_incremental_linux,tsan-libdispatch-test |
@yln congrats! |
PR #25085 [1] enabled building and installing the static variant of the libdispatch library in build-script-impl. This broke the `tsan-libdispatch-test` preset [2]. Let's make sure we pass along the options specified in `libdispatch-cmake-options` when building the static variant. [1] #25085 [2] #24330 rdar://problem/49177823
Build a separate compiler-rt instance for running the tests. It is built
and tested against an installed toolchain instead of the llvm-build-dir.
Install everything we need to run tests (CMake modules, FileCheck, etc.)
into the toolchain directory.
Add synthetic target 'all' for llvm-install-components. Also we must set
LLVM_INSTALL_UTILS=ON, so the utilities required by tests (e.g.,
FileCheck) are included in the install target.
rdar://49396529