fenix
fenix copied to clipboard
Add `.targets.<triple>` to a channel output
It seems like right now the only way to add targets is with fenix.packages.${system}targets.wasm32-unknown-unknown.stable.rust-std.
This however is a bit of a pain when working with any sort of abstractions on top of fenix.
Basically I see these levels:
- channel (stable, beta, complete, latest, custom)
- components (list of things to take from the channel)
- toolchain - add bunch of components from channel into one derivation; usually all components come from same toolchain, but it's not necessary
If I already selected a channel and have it in channel I wish I could:
fenixToolchainCrossWasm = combine ([
channel.cargo
channel.rustc
channel.targets.wasm32-unknown-unknown.rust-std
]);
But this doesn't seem to work. Instead I need to:
fenixToolchainCrossWasm = with fenix.packages.${system}; combine ([
channel.cargo
channel.rustc
targets.wasm32-unknown-unknown.stable.rust-std # The `stable` here is a problem, because at this point I already don't want to care how the original channel was named/sourced
]);
Another reason this is desirable is because, when using toolchainOf or similar, targets.foo.bar.rust-std might be a different rust version than the cargo/rustc in use, which causes rustc to fail to find std/alloc/core.