-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[5.8] CMake: fix missing SWIFT_CONCURRENCY_GLOBAL_EXECUTOR
#66246
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds. Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.
It is only used in the stdlib build, so really has no business being set in the root `CMakeLists.txt`.
MaxDesiatov
added
concurrency
Feature: umbrella label for concurrency language features
cmake
swift 5.8
labels
May 31, 2023
@swift-ci test |
swiftlang/swift-integration-tests#118 @swift-ci build toolchain |
…act deduplication # Conflicts: # lib/DriverTool/autolink_extract_main.cpp
…goes after fixing ordering
MaxDesiatov
added
🍒 release cherry pick
Flag: Release branch cherry picks
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Linux
Platform: Linux
build-script
Area → utils: The build script
labels
May 31, 2023
@swift-ci test |
swiftlang/swift-integration-tests#118 @swift-ci build toolchain |
cc @shahmishal |
tomerd
approved these changes
May 31, 2023
airspeedswift
approved these changes
Jun 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
build-script
Area → utils: The build script
cmake
concurrency
Feature: umbrella label for concurrency language features
Linux
Platform: Linux
🍒 release cherry pick
Flag: Release branch cherry picks
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Resolves issues with static linking on Linux
Risk: Medium, affects Linux builds and top-level CMake declarations.
Original PRs: #65795 and #64312 for
main
, #65824 and #64633 forrelease/5.9
Reviewed by: @al45tair @drexin @etcwilde
Resolves: some of the issues reported in #65097, also resolves #58380
Tests: Added in swiftlang/swift-integration-tests#118
SWIFT_CONCURRENCY_GLOBAL_EXECUTOR
is defined instdlib/cmake/modules/StdlibOptions.cmake
, which is not included during the first pass of evaluation of the rootCMakeLists.txt
. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, whereusr/lib/swift_static/linux/static-stdlib-args.lnk
didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds.Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.
Additionally, since our trivial lit tests previously didn't link Dispatch statically, they didn't expose a bug where
%import-static-libdispatch
substitution had a missing value. To fix that I had to updatelit.cfg
and clean up some of the related path computations to infer a correct substitution value.