-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Please propose a way to add / remove flags from a compilation step #15054
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
Comments
When using our makefiles, you can use the |
Well, no, unfortunately. I need to be able to remove flags... More over, I should be able to set the right flags when needed. Not as a global declaration. |
Potential solution: what about having a text file with the build flags used? The rust compiler could use that file and we, packager, could update it. |
Triage: @brson has been working on a lot of packaging stuff, but I believe we still only have |
Are there any standard ways to remove flags in a build system ala It would be easy to make all these settings overridable wherever they aren't, though I'm not sure that is powerful enough. |
I think that systems often give you both "yes" and "no" flags, and the last one wins. So you can append to My brain may have also just entirely made this up. |
FWIW, all user supplied *FLAGS & VARIABLES should be honoured, this includes CC, {C,L,PP,XX}FLAGS, LIBS et al. That is, they should be the last variable on any assignment line, and never appended to. |
I believe we mostly respect environment-variable set flags today; presumably that's sufficient for this use case? It's still relatively difficult to set different flags for different stages of compilation, but I would hope that it's not (ever) necessary to do so. If this is still a problem a specific reproducible example or want would be good to have. |
yeah, we (debian) don't need that anymore |
…do-not-transform-const-params, r=lowr fix: implement missing members doesn't transform const params and default types Fixes rust-lang/rust-analyzer#13363
In the context of packaging Rust, we might need to add or remove CFLAGS/CXXFLAGS during compilation time.
AFAIK, they are currently hardcoded (and computed) in the binary downloaded during the first step of the build.
For example, the full command line on my system is this one:
In this case, I would need to add a -L to point to the correct compiler-rt library (I know there are workaround for this, it is just an example). Adding or removing flags passed to the linker is also a common usage while packaging software.
The text was updated successfully, but these errors were encountered: