Skip to content
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

Add support for cargo feature flags #60

Closed
hobofan opened this issue Sep 25, 2020 · 7 comments
Closed

Add support for cargo feature flags #60

hobofan opened this issue Sep 25, 2020 · 7 comments
Labels
cli Trunk CLI application enhancement New feature or request good first issue Good for newcomers ready Ready to be implemented

Comments

@hobofan
Copy link

hobofan commented Sep 25, 2020

It would be great to have the ability to specify cargo feature flags for the internal invocation of cargo build.

Maybe it would even make more sense to make this even more generic and pass any number of arguments to the cargo invocation, as this would also cover other flags like "--no-default-features" etc., which otherwise have to be manually mirrored.

@thedodd
Copy link
Member

thedodd commented Oct 2, 2020

Hey @hobofan, thanks for opening this issue. I think this is a solid idea. My initial thought is that adding the following flags should do the trick: --features <FEATURES>..., --all-features, --no-default-features. I want to add -Z as well, however that has a slightly more complex command structure, and it might be best to leave that off for now as extra credit.

Anyway, @hobofan are you interested in hacking on this? I'm happy to help in whatever way.

@thedodd thedodd added cli Trunk CLI application enhancement New feature or request good first issue Good for newcomers ready Ready to be implemented labels Oct 2, 2020
@thedodd
Copy link
Member

thedodd commented Oct 6, 2020

Hey @hobofan just wanted to follow-up on this. Once #73 lands, we will have a pretty solid way to handle this. A little background, the idea with #73 is that we will be able to declare more specific details on the Rust project to be compile like so: <link data-trunk rel="rust" href="path/to/Cargo.toml"/>. That will be in place once #73 lands.

To address the feature requests you've mentioned here, we can add a new data-cargo-features="featureX featureY attribute which will cause trunk to pass those values directly along to the underlying Cargo invocation.

It will be super easy to implement this feature and any other like it. I'll keep this issue up-to-date. Once #73 lands (the 0.7.0 release), would you be interested in getting your feet wet and adding this functionality?

@Tanja-4732
Copy link
Contributor

Hey hobofan, thanks for opening this issue. I think this is a solid idea. My initial thought is that adding the following flags should do the trick: --features <FEATURES>..., --all-features, --no-default-features. I want to add -Z as well, however that has a slightly more complex command structure, and it might be best to leave that off for now as extra credit.

Anyway, hobofan are you interested in hacking on this? I'm happy to help in whatever way.

Well @thedodd, after submitting #160, I think I might give this one a go as well.

I've opened a PR, see #183. I expect this to be done in the next 1-4 days.

@Tanja-4732
Copy link
Contributor

I think my PR #183 should close this issue.

@mpfaff
Copy link

mpfaff commented Mar 8, 2022

I need to pass -Zbuild-std to Cargo. Is there any workaround while we're waiting for this issue?

@janhohenheim
Copy link
Contributor

Any updates on this?

@Tanja-4732
Copy link
Contributor

Any updates on this?

@janhohenheim I'm working on merging the changes into my PR.

Thanks for reminding me 👍

See #183 for details.

Tanja-4732 added a commit to Tanja-4732/trunk that referenced this issue Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Trunk CLI application enhancement New feature or request good first issue Good for newcomers ready Ready to be implemented
Projects
None yet
Development

No branches or pull requests

5 participants