-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Enable build-std on a per target basis #8733
Comments
Is there any particular reason you don't want it for built-in targets? |
I want to support additional targets that aren't supported by default, hence my use of build-std. But I want the build in targets to keep working without any modification. But due to the issues mentioned in #7501 that is currently not possible. I have to admit I missed #7501 when opening this issue. If that is fixed it might also fix my issue. |
What we need at the very least is something like |
Hm, that approach sounds sound. Has there been any more progress on the |
Are there any reasons to use |
Yes. For example, multithreading requires rebuilding std with atomics support. Same for SIMD or other interesting features. |
Do the optimization options get used for build-std? e.g., would |
Any updates? WASM multithreading case isn't solvable without it (not easy, at least). |
One of the reasons to enable selection of targets is that, [unstable]
build-std = ["std", "panic_abort", "core", "alloc"]
build-std-features = ["panic_immediate_abort"] |
This would also be useful for building eBPF programs a la aya. |
Progress on #9451 and #10330 appears to have stalled. It seems like |
Any update on this? |
@ehuss I have someone able to work on this. Are you happy with this approach? It seems good to me given the variety of reasons one might enable build-std. For example, some provided rustflags break ABI (such as some target-features, which are target-specific) or necessitate being used on libstd as well as user code (such as sanitizers, which can be target-specific). It seems reasonable to me that someone might want to store these flags in the source control of a binary project together with build-std enabled on certain targets. #10308 was closed, and though rust-lang/wg-cargo-std-aware#43 needs more discussion I think the best option forward is to keep build-std available as a config flag.
|
Some of my custom targets require me to enable build-std, which currently I can enable through .cargo/config.toml
but this means it is enabled for every target. However I don't necessarily want it for build in targets, it would be nice if in my .cargo/config.toml I could specify something like
If this is already possible but with a different syntax consider this issue closed
The text was updated successfully, but these errors were encountered: