-
Notifications
You must be signed in to change notification settings - Fork 24
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
Support -Zbuild-std
#235
Support -Zbuild-std
#235
Conversation
src/dependencies.rs
Outdated
@@ -78,6 +78,26 @@ fn cfgs(config: &Config) -> Result<Vec<Cfg>, Errored> { | |||
Ok(cfgs) | |||
} | |||
|
|||
pub(crate) fn has_build_std(info: &DependencyBuilder) -> bool { |
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.
I think it would be simpler to have a build_std
bool field on DependencyBuilder
and manually inject the -Z
flags instead of expecting the user to supply them and have us detect them
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 couldn't be a bool
because sometimes its relevant to pass arguments like -Zbuild-std=std,panic_abort
.
But I could instead make it an Option<String>
?
I think another motivation to not add a configuration is that when rust-lang/wg-cargo-std-aware#20 is addressed, we wouldn't need a configuration either.
Let me know how you want me to proceed.
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.
But I could instead make it an
Option<String>
?
yea that seems good
I think another motivation to not add a configuration is that when rust-lang/wg-cargo-std-aware#20 is addressed, we wouldn't need a configuration either.
I'm doing regular major bumps anyway, seems fine to do another once that lands (or just mark it as deprecated then)
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.
Done.
After trying it out though I have to say its a bit weird, because now if the user supplies the -Zbuild-std
argument without enabling the DependencyBuilder::build_std
option, it won't work.
Old Version: daxpedda@72346fd (leaving this here just in case if you change your mind)
is there any reasonably small test that we can add here so I don't accidentally make it stop working in the future? |
Would love to, but I would need some guidance to do that, would you put the test in integration or unit tests? |
that one was specifically for cross compilation, which is a bit annoying. Here we can just build-std for the host itself. You can probably just add a copy of the config in
|
I had to use
I think it might be best to add a separate integration test entirely? |
88d7b8f
to
c882246
Compare
oof yea 😆 that makes sense |
a7d5546
to
145f21f
Compare
So I adjusted the integration test to take an env variable to set the folder and then just copied I think I could instead make a simple test using |
right, we only care that it works, not what the output is |
Done, let me know if you want any other adjustments. (sorry for the delay) |
Thanks! This is great! |
As discussed in #197 (comment).
Fixes #197.