Skip to content

[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

Closed
wants to merge 1 commit into from

Conversation

zbowling
Copy link
Contributor

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

@zbowling
Copy link
Contributor Author

@jrose-apple @gparker42 @gottesmm also split off off from #12955 PR and should be good to land on it's own.

@gottesmm
Copy link
Contributor

@Rostepher ping

@zbowling
Copy link
Contributor Author

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.

Copy link
Contributor

@Rostepher Rostepher left a 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)
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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'),
Copy link
Contributor

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!

@Rostepher Rostepher changed the title Add extra-stdlib-deployment-targets to build-util [build-script] Add extra-stdlib-deployment-targets to build-util Nov 30, 2017
@zbowling
Copy link
Contributor Author

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. :)

@zbowling
Copy link
Contributor Author

zbowling commented Dec 5, 2017

Updated to the options system and rebased on master. Please review.

@Rostepher
Copy link
Contributor

@swift-ci please test

@Rostepher
Copy link
Contributor

@swift-ci please smoke test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 5, 2017

Build failed
Swift Test Linux Platform
Git Sha - 1b4b562cf2969f5e7a387f1743ca55300f459910

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2017

Build failed
Swift Test OS X Platform
Git Sha - 1b4b562cf2969f5e7a387f1743ca55300f459910

@zbowling
Copy link
Contributor Author

zbowling commented Dec 6, 2017

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")
Copy link
Contributor

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,
Copy link
Contributor

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.

@CodaFi
Copy link
Contributor

CodaFi commented Nov 21, 2019

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.

@CodaFi CodaFi closed this Nov 21, 2019
@allevato allevato deleted the extra-stdlib branch October 7, 2020 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants