Navigation Menu

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

Tracking Issue for target-applies-to-host #9453

Open
1 task done
jameshilliard opened this issue May 3, 2021 · 3 comments
Open
1 task done

Tracking Issue for target-applies-to-host #9453

jameshilliard opened this issue May 3, 2021 · 3 comments
Labels
C-tracking-issue Category: A tracking issue for something unstable. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. Z-target-applies-to-host Nightly: target-applies-to-host
Projects

Comments

@jameshilliard
Copy link
Contributor

jameshilliard commented May 3, 2021

Summary

Original issue: #3349
Implementation: #9322
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#target-applies-to-host
Issues: Z-target-applies-to-host Nightly: target-applies-to-host

The target-applies-to-host key in a config file can be used set the desired behavior for passing target config flags to build scripts.

Unresolved Issues

@jameshilliard jameshilliard added the C-tracking-issue Category: A tracking issue for something unstable. label May 3, 2021
@ehuss ehuss added this to Unstable, baking in Roadmap Aug 3, 2021
@ehuss ehuss added the Z-target-applies-to-host Nightly: target-applies-to-host label Jan 17, 2022
bors added a commit that referenced this issue Feb 28, 2022
Enable propagating host rustflags to build scripts

### What does this PR try to resolve?

This PR primarily fixes #10206, but in doing so it also slightly modifies the interface for the unstable `target-applies-to-host` feature (#9453), and adds the unstable `target-applies-to-host-kind` flag to mirror `target-applies-to-host` for build scripts and other host artifacts.

The commit messages have more in-depth discussion.

### How should we test and review this PR?

The test case from #10206 now works rather than producing an error. It has also been added a regression test case. A few additional test cases have also been added to handle the expected behavior around rustflags for build scripts with and without `target-applies-to-host-kind` enabled.

### Additional information

1. This changes the interface for `target-applies-to-host` so that it does not need to be specified twice to be used. And it can still be set through configuration files using the `[unstable]` table. However, we may(?) want to pick a stable format for in-file configuration of this setting unless we intend for it to only ever be a command-line flag.
2. It may be that `target-applies-to-host-kind` is never behavior we want users to turn on, and that it should therefore simply be removed and hard-coded as being `false`.
3. It's not entirely clear how `target-applies-to-host-kind` should interact with `-Zmultitarget`. If, for example, `requested_kinds = [HostTarget, SomeOtherTarget]` and `kind.is_host()`, should `RUSTFLAGS` take effect or not? For the time being I've just hard-coded the behavior for single targets, and the answer would be "no".
jameshilliard added a commit to jameshilliard/cargo that referenced this issue Mar 1, 2022
@rich-g
Copy link

rich-g commented Jun 17, 2022

Any chance of stabilizing this?

@rich-g
Copy link

rich-g commented Oct 19, 2022

Just bumping this again. Would really like this stabilized so I can get off of nightly builds. :)

@jameshilliard
Copy link
Contributor Author

Just bumping this again. Would really like this stabilized so I can get off of nightly builds. :)

Not sure what status of stabilizing this is, but if you want to use it on stable just set this in your env.

jameshilliard added a commit to jameshilliard/cargo that referenced this issue Oct 21, 2022
jameshilliard added a commit to jameshilliard/cargo that referenced this issue Dec 3, 2022
jameshilliard added a commit to jameshilliard/cargo that referenced this issue Apr 11, 2023
@ehuss ehuss added S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. labels Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for something unstable. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. Z-target-applies-to-host Nightly: target-applies-to-host
Projects
Status: Unstable, baking
Roadmap
  
Unstable, baking
Development

No branches or pull requests

3 participants