-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build-script] Add extra-stdlib-deployment-targets to build-util #13106
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
@jrose-apple @gparker42 @gottesmm also split off off from #12955 PR and should be good to land on it's own. |
@Rostepher ping |
This is so I can build a darwin toolchain, with all the implicit targets that come by default when you don't set stdlib-deployment-targets (like macos, iOS, watch, tv, etc) for each supported arch, and then just tack on my "fuchsia-x86_64,fuchsia-aarch64,android-armv7" target archs. |
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.
Overall this looks pretty good.
I can see the need for this sort of flag, but would it be enough to consider multiple uses of --stdlib-deployment-targets
? It can be called multiple times to append more targets to build.
There's also some merge conflicts from #12954 which will need to be resolved.
help="list of additional targets to cross-compile the Swift standard " | ||
"library for in addition to default", | ||
action=arguments.action.concat, type=arguments.type.shell_split, | ||
default=None) |
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.
If this is meant as a list of deployment targets, why not make the default an empty list. I plan to change the --stdlib-deployment-targets
option to do the same.
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.
If possible would you mind also following the style changes from #12954, namely putting the help string last and action first in the list of kwargs.
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 empty list would work too.
@@ -507,6 +507,7 @@ class IgnoreOption(_BaseOption): | |||
AppendOption('--extra-cmake-options'), | |||
AppendOption('--extra-swift-args'), | |||
AppendOption('--stdlib-deployment-targets'), | |||
AppendOption('--extra-stdlib-deployment-targets'), |
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.
👍 Thanks for adding this to the test suite!
Yeah, it's not wanting to call stdlib-deployment-targets multiple times but I just want to append to the default implicit targets that build-util setups by default for the current OS that you get when you don't set it in the first place. For Linux it's only one arg but for Darwin it ends up being more than dozen (iOS-arm64, watch-arm64, macOS-x86_64, etc). I just don't want to recreate them all and keep the list up to date in our CI builder's ini. :) |
1b4b562
to
34517dc
Compare
Updated to the options system and rebased on master. Please review. |
@swift-ci please test |
@swift-ci please smoke test |
Build failed |
Build failed |
34517dc
to
82ece2d
Compare
82ece2d
to
00d8381
Compare
fixed the expected default value that broke the test. should be good to test. |
type=argparse.ShellSplitType(), | ||
default=None, | ||
help="list of additional targets to cross-compile the Swift standard " | ||
"library for in addition to default") |
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 will fail the Python linter test. Please indent put to the above quote and please use single quotes for string literals.
@@ -585,6 +585,12 @@ def create_argument_parser(): | |||
help='list of targets to compile or cross-compile the Swift ' | |||
'standard library for. %(default)s by default.') | |||
|
|||
option('--extra-stdlib-deployment-targets', append, | |||
type=argparse.ShellSplitType(), | |||
default=None, |
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.
Would you mind making the default an empty list? Then you wouldn't need this explicit line at all.
The review comments here were never addressed, and it's been a few years. If you'd like to pursue this change, please rebase this patch and address @Rostepher's comments. |
Adds a new
--extra-stdlib-deployment-targets
arg that appends insteads of replaces the default archs to build the stdlib lib for, which can be an extensive list, especially on Darwin, to recreate.Split from of #12955