-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add System to the toolchain #84057
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
base: main
Are you sure you want to change the base?
Add System to the toolchain #84057
Conversation
456fa51
to
488f04e
Compare
|
||
Whether this product is produced by build-script-impl. | ||
""" | ||
return True |
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.
We should avoid to implement new build products in build-script-impl
unless it is absolutely necessary -- at first glance, it looks like SwiftSystem can build in the same "phase" as EarlySwiftDriver.
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.
Agree, we are trying to deprecate the bash script build-script-impl
, not add to it. Take a look at the cmark, Testing, or massive LLVM Python product config for examples.
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.
I would love to not have to touch build-script-impl. Would these python files and build.ps1
then be the only things that need to be touched?
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.
Yes, this file would be longer, as you'd move that build config from build-script-impl
here, as was done for LLVM before.
@@ -61,7 +61,7 @@ set TMPDIR=%BuildRoot%\tmp | |||
set NINJA_STATUS=[%%f/%%t][%%p][%%es] | |||
|
|||
:: Build the -Test argument, if any, by subtracting skipped tests | |||
set TestArg=-Test lld,lldb,swift,dispatch,foundation,xctest,swift-format,sourcekit-lsp, | |||
set TestArg=-Test lld,lldb,swift,dispatch,system,foundation,xctest,swift-format,sourcekit-lsp, |
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.
From a quick peek at build.ps1
, it looks we may need to change the Build-Foundation
function to add the SwiftSystem dependency.
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.
Yeah, we will need to re-organise the build a bit. We will need to add a new Build-System
invocations in the SDK phases (should measure with static and dynamic linking) and pass that to the Foundation build.
488f04e
to
1c0a249
Compare
@swift-ci Please Build Toolchain |
@swift-ci Please Build Toolchain |
1c0a249
to
e5b2ab2
Compare
"--lldb-build-type", args.lldb_build_variant, | ||
"--foundation-build-type", args.foundation_build_variant, | ||
# TODO: Do I have the option here? | ||
# "--swift-system-build-type", args.swift_system_build_variant, |
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.
I'm not sure if I should add the option here and do more plumbing, or if these arguments are just for the legacy build_script_impl path.
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.
Yes, these are only to pass flags to build-script-impl
, which you correctly are no longer using for this new build product, so nothing to add here.
def _for_each_host_target(self, base_target, body): | ||
body(base_target) | ||
|
||
# TODO: what do we do here? We're not built on Darwin |
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.
Note: I was cribbing off of SwiftTesting. Not sure whether I need all of this machinery. System won't be built on Darwin as part of the toolchain (it's like SwiftFoundation in that regard).
override_deployment_version = None | ||
|
||
# TODO: Do we need this, or should we adjust our own version? | ||
if host_target.startswith('macosx'): |
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.
Similarly, should this just go away?
@edymtt @finagolfin I pushed updates that get us off of modifying build_script_impl. Could you take a look? |
@swift-ci Please Build Toolchain |
const='Debug', | ||
help='build the Debug variant of System') | ||
|
||
option('--swift-system-tests-build-type', store('swift_system_tests_build_variant'), |
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.
I added this flag for Foundation only because it was super slow to build in release mode: is that a problem for System too? If not, no reason to add a separate flag for the test build variant.
# `install_with_cmake` later which already has the same prefix. | ||
self.cmake_options.define('CMAKE_INSTALL_PREFIX', '') | ||
|
||
self.cmake_options.define('CMAKE_BUILD_TYPE', self.args.build_variant) |
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.
This is the default build variant, you'll want to override it with the system_build_variant flag you are adding.
Add System to the toolchain, so that Foundation can depend on it.