| 9 Mar 2025 |
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 |
Andrew | so you're saying there should be a cache for llvm? | 16:21:24 |
Andrew | I'm not sure if you build the build tools for different target, how would I then be able to use them to build the program for that target if those build tools are not for my host target. | 16:23:02 |
emily | they are rebuilt for a different --target, but the same --host. | 16:23:18 |
Andrew | Or does it compile so that I can run them from the host target to build the target-target? | 16:23:26 |
emily | that is what pkgsCross.<system>.buildPackages means | 16:23:26 |
emily | no, I'm saying it's probably a packaging infelicity | 16:23:46 |