fenix icon indicating copy to clipboard operation
fenix copied to clipboard

Add `.targets.<triple>` to a channel output

Open dpc opened this issue 2 years ago • 1 comments

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
  ]);

dpc avatar Sep 28 '23 02:09 dpc

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.

CobaltCause avatar Jan 20 '24 00:01 CobaltCause