| 9 Mar 2025 |
Andrew | Is there a different place where the different targets needs to go? | 15:39:52 |
Andrew | * Is there a different place where the different targets need to go? | 15:39:57 |
ghpzin | You probably need to do it differently with fenix, I would try with combine: https://github.com/nix-community/fenix/blob/6781661e331d1efe11023d4a35f2dfe65272f248/README.md?plain=1#L139-L151 | 15:53:37 |
ghpzin | You probably need to do it differently with fenix, I would try with combine: https://github.com/nix-community/fenix/blob/6781661e331d1efe11023d4a35f2dfe65272f248/README.md?plain=1#L139-L151 (ignoring how it would be better to do it in shell and not "globally" in your HM config) | 15:58:10 |
Andrew | home.packages = with pkgs; [
(fenix.combine [
(fenix.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
fenix.targets.wasm32-wasi.latest.rust-std
fenix.targets.wasm32-wasip1.latest.rust-std
fenix.targets.wasm32-wasip2.latest.rust-std
fenix.targets.wasm32-unknown-unknown.latest.rust-std
])
rust-analyzer-nightly
cargo-expand
pkg-config
];
| 15:59:17 |
Andrew | Doesn't work. | 15:59:25 |
Andrew | cb -r
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target wasm32-wasi --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
--- stderr
error: Error loading target specification: Could not find specification for target "wasm32-wasi". Run `rustc --print target-list` for a list of built-in targets
| 16:00:01 |
emily | why use fenix for latest stable? | 16:00:15 |
emily | you can just get it from Nixpkgs | 16:00:18 |
Andrew | Does it matter? | 16:00:42 |
emily | it might reduce your problems | 16:00:50 |
emily | generally Nixpkgs Rust is less headache-inducing for cross in my experience | 16:01:03 |
Andrew | Then how do I add these targets via nixpkgs? | 16:02:56 |
ghpzin | Regarding your error, there is no wasm32-wasi target in stable. I assume combine the way you want it, would look for it there. | 16:03:15 |
emily | wasm32-unknown-unknown comes out of the box. otherwise pkgsCross | 16:03:15 |
Andrew | I can't combine latest for main target and latest for other targets? | 16:04:28 |
Andrew | * I can't combine stable for main target and latest for other targets? | 16:04:37 |
emily | no, you cannot mix rustc version and std version | 16:04:55 |
emily | those are tightly coupled | 16:04:57 |
emily | also, target support is not solely in std. | 16:05:04 |
Andrew | this is what fenix tells | 16:05:30 |
Andrew | what is pkgsCross? | 16:09:55 |
emily | pkgsCross.<system> is a Nixpkgs configured for cross-compiling to that system. | 16:10:37 |
Andrew | And which package I need to install for those targets? | 16:11:37 |
emily | probably pkgsCross.<system>.buildPackages.rustc | 16:12:26 |
Andrew | well damn, 2600 MiB is kinda a lot | 16:17:47 |
Andrew | And it also builds something? Why is that? | 16:18:17 |
Andrew | builds llvm-19.1.7 | 16:18:29 |
Andrew | not in the nixos cache? | 16:19:04 |
emily | cross build packages get rebuilt for the new target. for some things that's dumb and should be fixed though, like LLVM | 16:20:43 |