15 Sep 2025 |
matthewcroughan | nix build nixpkgs#pkgsLLVM.pkgsMusl.netbsd.compat -L works though 🤨 | 19:08:56 |
Tristan Ross | Do a nix-diff between the two drv files of pkgsLLVM.pkgsMusl.netbsd.compat as the base and what you're trying to build as the other. | 19:24:18 |
Tristan Ross | If you've configured cross correctly, they'll be the same. | 19:24:32 |
matthewcroughan | Is there no easy way to configure cross identically to `pkgsMusl? | 19:25:39 |
matthewcroughan | * Is there no easy way to configure cross identically to pkgsMusl ? | 19:25:43 |
Tristan Ross | There is | 19:25:52 |
Tristan Ross | Your localSystem needs to be the standard GNU triple | 19:26:13 |
matthewcroughan | LIke I can't do nixpkgs.hostPlatform = pkgsMusl.hostPlatform because that's infinite recursion | 19:26:17 |
matthewcroughan | but it's what I want to | 19:26:19 |
Tristan Ross | Take a look at pkgs/top-level/variants.nix or pkgs/top-level/stage.nix to see what pkgsMusl does | 19:26:49 |
matthewcroughan | I don't want the GNU triple, I want the same evaluation and code as in pkgs/top-level/variants.nix | 19:27:01 |
matthewcroughan | since it's always correctly configured there, it should be exposed | 19:27:12 |
Tristan Ross | You have to use the GNU triple for the buildPlatform | 19:27:16 |
Tristan Ross | For hostPlatform , just use the musl one | 19:27:28 |
matthewcroughan | so for pkgsMusl, the buildPlatform is gnu? | 19:27:58 |
matthewcroughan | and that's just some default of nixpkgs? | 19:28:02 |
Tristan Ross | Yes | 19:28:07 |
emily | if it's cross then buildPlatform is your main platform by definition | 19:28:36 |
emily | Musl has fully-bootstrapped stdenv so you can do non-cross | 19:28:43 |
matthewcroughan | Ah yes, I get the ld errors when I set buildPlatform to aarch64-unknown-linux-musl | 19:28:51 |
matthewcroughan | j/src/unistd/ttyname_r.lo obj/src/unistd/ualarm.lo obj/src/unistd/unlink.lo obj/src/unistd/unlinkat.lo obj/src/unistd/usleep.lo obj/src/unistd/write.lo obj/src/unistd/writev.lo obj/ldso/dlstart.lo obj/ldso/dynlink.lo
> aarch64-unknown-linux-musl-ranlib lib/libc.a
> collect2: fatal error: cannot find 'ld'
> compilation terminated.
> make: *** [Makefile:162: lib/libc.so] Error 1
> make: *** Waiting for unfinished jobs..
| 19:29:08 |
matthewcroughan | so now I'm using gnu I'll report back | 19:29:19 |
Tristan Ross | Matt is trying to mix it with LLVM which I don't think musl host into an LLVM cross is something which has been tested before. | 19:29:37 |
emily | ah | 19:29:59 |
matthewcroughan | Yeah I've successfully build a minimal native musl system, I'm now going for gold with LLVM | 19:30:00 |
matthewcroughan | * Yeah I've successfully built a minimal native musl system, I'm now going for gold with LLVM | 19:30:08 |
Tristan Ross | I've done pkgsMusl.pkgsLLVM but that's different | 19:30:17 |
emily | there's no bootstrapped LLVM Linux stdenv , yeah | 19:30:24 |
Tristan Ross | Yeah, it has errors if you try | 19:30:41 |
Tristan Ross | But Matt is trying to do a GCC host with Musl to an LLVM target with Musl | 19:31:06 |