-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 to stabilize --print target-spec-json #38338
Comments
We currently don't even seem to know about this unless -Zunstable-options is passed, which make it incredibly hard to discover. I think there's a note somewhere about that, but I don't know quite where. Just noting here. |
ping on possibly stabilizing this. |
We discussed this at the dev-tools meeting today. The general feeling was that while this is a fine feature with no obvious problems, there is not a lot of pressure to stabilise, and that given that target specs are unstable, it is probably best not to rush into that. @cardoe Is there motivation from your end to have this on stable, rather than nightly-only? |
Well I'd use it to generate the specs for Yocto. I've discussed it on other tickets but I can't use the built in targets because of the need for custom sysroots (e.g. the linked Cargo issue) Yocto has a host environment, which is effectively built for the running OS and then the target environment that things are being built for. In some cases they can both be x86_64 machines but they target different libc's and optimizations (e.g. avx on the host but not on the embedded x86_64 target). So I have to hand craft spec files and detect whenever something changes upstream and adjust them. But if I had this flag it could programmatically be done by making the necessary linker/compiler change to an existing target. It'd basically make it that I'd get newer Rust versions out to Yocto consumers quicker. I'm not sure if others would use it but that's my personal motivation. |
The option is only made available on nightly builds, for the obvious reason. While we're here, also prevent the unstable `target-spec-json` (tracking issue rust-lang#38338) from showing up in the --help on stable builds (although the way in which we accomplish this is slightly clumsy for lifetime reasons, as noted in the FIXME). We make REMOVED_FEATURES, ACCEPTED_FEATURES, &c. public for consistency, even though the functionality at issue only needs ACTIVE_FEATURES. The UI test will add a little bit of friction for future feature developers, but it's better than under-testing. Resolves rust-lang#38768.
I would also like to see this stabilized. My use-case is support for Rust in a build system ( Could we perhaps stabilize the output as "subject to change" in a sense that new values can be added and existing values removed only guaranteeing that the meaning of an existing value does not change? I think most consumers of this output will be perfectly capable of dealing with this. While at it, I would also suggest adding values printed with |
We discussed this in today's T-compiler backlog bonanza meeting The takeaways were:
So, overall, it seems like there's motivation to stabilize something here, but we would need the above questions resolved before we could move forward on that. @rustbot label +S-tracking-design-concerns |
BTW, if anyone is banging their head against this (i.e., needing to know the compiler's target but only able to get it if using the nightly Rust compiler), there is the |
In the meantime, perhaps we can consider adding the target triplet (which I believe is what the majority of use-cases are after) to the |
This issue is meant to track the stabilization of the rustc flag
--print target-spec-json
which will output the currently selected target as a valid target spec that can be loaded with--target
for only the same version of the compiler that generated it. This explicitly avoids saying that target specs are stable but instead intends to assist target spec users to know that their configuration will work with the current version of the compiler.ref #38061
The text was updated successfully, but these errors were encountered: