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

Cargo.toml forced-target ignored by .cargo/config.toml target.<triple>/target.<cfg> #10518

Closed
4LT opened this issue Mar 30, 2022 · 3 comments
Closed
Labels
C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. Z-per-package-target Nightly: per-package-target

Comments

@4LT
Copy link

4LT commented Mar 30, 2022

Problem

When setting package.forced-target in Cargo.toml, the value used (e.g. "wasm32-unknown-unknown") is ignored as the target used in .cargo/config.toml [target.<triple>] or [target.<cfg>]

e.g. if I have the following in .cargo/config.toml

[target.'cfg(target_arch="wasm32")']
runner = "echo"

"echo" won't be used as the runner when running cargo test or cargo run

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.61.0-nightly (109bfbd 2022-03-17)
release: 1.61.0-nightly
commit-hash: 109bfbd055325ef87a6e7f63d67da7e838f8300b
commit-date: 2022-03-17
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1m)
os: Arch Linux Rolling Release [64-bit]
@4LT 4LT added the C-bug Category: bug label Mar 30, 2022
@ehuss ehuss added the Z-per-package-target Nightly: per-package-target label Apr 8, 2022
@epage epage added the S-triage Status: This issue is waiting on initial triage. label Nov 20, 2024
@weihanglo
Copy link
Member

weihanglo commented Nov 21, 2024

See #14833

Several places calling BuildConfig::requested_kinds don't consider anything from default-target or forced-target, so some target platform info may be missing.
...
The fix for the latter should be a bit easier. Managing all calls to requested_kinds through on a new requested_kinds method, which reuse a similar logic like this one. This should resolve the issue if only your top-level primary package has forced-target specified.

@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. and removed S-triage Status: This issue is waiting on initial triage. labels Nov 21, 2024
@weihanglo
Copy link
Member

The thing I am unsure is the future of the unstable feature itself. Whether we keep it or combine with -Zbindeps or any other directions.

@weihanglo
Copy link
Member

While this is an older issue and #14291 is a dup, that one contains more info so close this in favor of #14291.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. Z-per-package-target Nightly: per-package-target
Projects
None yet
Development

No branches or pull requests

4 participants