-
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
CMake: fix missing SWIFT_CONCURRENCY_GLOBAL_EXECUTOR
value
#65795
Changes from 2 commits
5897ab5
2db62ca
5275255
a25432d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1593,19 +1593,13 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows- | |
config.import_libdispatch = ('-I %s -I %s -L %s' | ||
% (libdispatch_source_dir, libdispatch_swift_module_dir, libdispatch_artifact_dir)) | ||
|
||
libdispatch_static_artifact_dir = config.libdispatch_static_build_path | ||
libdispatch_swift_static_module_dir = make_path(libdispatch_static_artifact_dir, 'src', 'swift', 'swift') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overlay path deleted as unused. |
||
libdispatch_static_artifact_dir = os.path.join(config.libdispatch_static_build_path, 'lib') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a |
||
libdispatch_static_artifacts = [ | ||
make_path(libdispatch_static_artifact_dir, 'src', 'libdispatch.a'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Built artifacts are located in |
||
make_path(libdispatch_static_artifact_dir, 'src', 'swift', 'libswiftDispatch.a'), | ||
make_path(libdispatch_swift_static_module_dir, 'Dispatch.swiftmodule')] | ||
Comment on lines
-1600
to
-1601
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need a Swift overlay for Dispatch to statically linked a simple executable, Dispatch is used directly without an overlay from the concurrency runtime. |
||
make_path(libdispatch_static_artifact_dir, 'libdispatch.a'), | ||
make_path(libdispatch_static_artifact_dir, 'libBlocksRuntime.a')] | ||
if (all(os.path.exists(p) for p in libdispatch_static_artifacts)): | ||
config.available_features.add('libdispatch_static') | ||
config.import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s' | ||
% (libdispatch_source_dir, libdispatch_swift_static_module_dir, | ||
make_path(libdispatch_static_artifact_dir, 'src'), | ||
make_path(libdispatch_static_artifact_dir, 'src', 'BlocksRuntime'), | ||
make_path(libdispatch_static_artifact_dir, 'src', 'swift'))) | ||
config.import_libdispatch_static = '-L %s' % libdispatch_static_artifact_dir | ||
Comment on lines
-1604
to
+1602
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since neither the overlay nor the headers are used for static linking, this is simplified to a single library search path flag. |
||
|
||
config.target_build_swift = ( | ||
'%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s' | ||
|
@@ -2649,6 +2643,10 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz | |
config.substitutions.append(('%FileCheck', run_filecheck)) | ||
config.substitutions.append(('%raw-FileCheck', shell_quote(config.filecheck))) | ||
config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', ''))) | ||
# WARNING: the order of components in a substitution name has to be different from the previous one, as lit does | ||
# a pure string substitution without understanding that these components are grouped together. That is, the following | ||
# subsitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with | ||
# the value of `%import-libdispatch` substitution with `-static` string appended to it. | ||
config.substitutions.append(('%import-static-libdispatch', getattr(config, 'import_libdispatch_static', ''))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While working on this fix I attempted to rename this to |
||
|
||
# Disable COW sanity checks in the swift runtime by default. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1901,7 +1901,7 @@ for host in "${ALL_HOSTS[@]}"; do | |
-DSWIFT_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${host} cmark)" | ||
-DSWIFT_PATH_TO_LIBDISPATCH_SOURCE:PATH="${LIBDISPATCH_SOURCE_DIR}" | ||
-DSWIFT_PATH_TO_LIBDISPATCH_BUILD:PATH="$(build_directory ${host} libdispatch)" | ||
-DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} libdispatch_static)" | ||
-DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} swift)/$(basename $(build_directory ${host} libdispatch))-static-prefix" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dispatch built as a dependency of the Swift compiler is located in the Swift build subdirectory, not in its own directory at the top level of the build. It also has that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, this is the dispatch built for the concurrency runtime. I think this will work for this use-case, but it is probably worth noting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For concurrency runtime and SourceKit IIUC |
||
) | ||
|
||
if [[ "${SWIFT_SDKS}" ]] ; then | ||
|
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.
Instead of including
StdlibOptions
here, why don't we move the following intoStdlibOptions
?AFAICT it is only used in the stdlib build, so really has no business being set in the root
CMakeLists.txt
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.
^ Was just thinking that.
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.
Good point, that's addressed now.