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

Add .targets.<triple> to a channel output #116

Open
dpc opened this issue Sep 28, 2023 · 1 comment
Open

Add .targets.<triple> to a channel output #116

dpc opened this issue Sep 28, 2023 · 1 comment

Comments

@dpc
Copy link

dpc commented Sep 28, 2023

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
  ]);
@CobaltCause
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants