-
Notifications
You must be signed in to change notification settings - Fork 2.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
when cross-compiling, look for RUSTFLAGS_HOST for rustc flags of build scripts #4428
Conversation
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks for the PR @RalfJung! The PR itself looks fine to me (although it'd be good to update In that sense there's I think a bit of design to happen here which we may want to not do in an ad-hoc fashion over time. I don't know precisely where we want to end up with this though. |
I don't see how having such env vars even helps. What I am looking for is setting a finite number of vars such that every build performed by cargo gets the flags from one of the vars. I actually thought this is so trivial that I was shocked to learn that it is not already the case. Having to know the full list of possible targets because we need to set More concretely, notice that such target-specific env vars would probably only make sense for the artifact we are building, right? And finally, having target-specific flags is already possible with target-specific selectors in the global cargo config file. Having flags for build scripts / plugins is outright impossible currently. |
Btw, the issue I am trying to solve here is japaric/xargo#162. |
☔ The latest upstream changes (presumably #4531) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased onto current master. |
☔ The latest upstream changes (presumably #4314) made this pull request unmergeable. Please resolve the merge conflicts. |
Ok I'm gonna close this due to inactivity, but it can of course be resubmitted! |
How is resubmitting going to be helpful? From all I know, this is not blocked by me, is it? |
Resubmitting often helps bump priority and/or get attention, something which has sat inert for 6+ months is unlikely to make any progress without changing something. |
The trouble is that I have no idea what I am supposed to change. :) Also, the original issue I was trying to work around was fixed, so I don't really have a use-case motivating this change any more (other than "that issue could come back any time"). I guess I'll just hope the entire cross-compilation/build scripts situation will be improved some day ;) |
Hey uh, I still need this. |
Fixes #4423
This does not fix the inconsistency around what is considered a host vs. target build, but instead just uses the existing classification and makes it possible to still set flags for all compiler invocations.
If this approach is acceptable, I can edit environment-variables.md to mention the new variables. Also, if setting
target.*.rustflags
in~/.cargo/...
is documented anywhere, that documentation should also be amended.