-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Statically compile libstdc++ everywhere if asked #94719
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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 blanket enable llvm-static-stdcpp in our CI (see
rust/src/ci/run.sh
Line 72 in 03918ba
It looks like that was originally added in #50336, but it seems like an odd thing to force opt-in users of the build system to with an orthogonal flag. Maybe you have a better sense here though!
I think this somewhat makes this PR a clearer "yes" to me, since if we're migrating to a simpler story of only enabling static stdcpp if asked explicitly, then doing that for everything makes sense. But if that's gated on llvm tools being enabled, it feels weird for that to apply to "not tools".
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.
It's a tough call. When you need
llvm-tools
, you'll very often want them with static libstdc++, because otherwise they may just not run on whatever host you try running them on, and you won't be able to tell until a user with an old host is bitten by it. But at the same time, as you point out, there's no fundamental reason they need to be coupled (at least as far as I can tell), which suggests the two flags should be decoupled. I think of this as an anti-footgun of havingllvm-tools
implystatic-libstdc++
because builders may not have thought through the implications of not linking it statically (they may not even be aware of thestatic-stdcpp
flag).Which is all to say — I think decoupling them gives more flexibility to builders, but at the cost of making it harder to get to a functioning build for someone who's trying to replicate the upstream build process. Which of those is more important, I'm not sure.
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.
Hm. Yes, that makes sense. I think we should probably be changing the default for static stdcpp, then, rather than specifically checking tools here, but that seems like a change that needs it's own PR.
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.
Oh, yeah, I like that idea! Can submit a PR for that tomorrow. And then you'd want this PR to just switch on
llvm_static_stdcpp
?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.
Actually, I think we should do a separate PR that changes the
if
condition to just bellvm_static_stdcpp
and flips its default. Otherwise, in the interrim (however short) we'll be changing the behavior of the code.