| 18 Oct 2025 |
matthewcroughan | to get a pkgs.nixos {} to compile with musl I had to nix.enable = false is the context here | 13:40:25 |
matthewcroughan | I'll make it simpler by just doing the native musl case where it fails too | 13:41:37 |
matthewcroughan | Ah, in that case the following happens, so it fails differently
> check flags: SHELL=/nix/store/idi6v58lxi4qp6l41n7w6914ggpxnmqr-bash-5.3p3/bin/bash VERBOSE=y test
┃ > "/nix/store/aqnlwa4lky3sf8mrzzdvi0d8mmc3g3ni-perl-5.40.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DBI.bs blib/arch/auto/DBI/DBI.bs 644
┃ > PERL_DL_NONLAZY=1 "/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
┃ > /nix/store/idi6v58lxi4qp6l41n7w6914ggpxnmqr-bash-5.3p3/bin/bash: line 1: /bin/perl: No such file or directory
┃ > make: *** [Makefile:1435: test_dynamic] Error 127
┃ For full logs, run:
┃ nix log /nix/store/b6chj56gypfcy72xikpga7qqg841qarc-perl5.40.0-DBI-1.644.drv
| 13:42:00 |
matthewcroughan | Alyssa Ross: That's great! I see your splicing fixed one thing but showed this error up | 13:48:37 |
matthewcroughan | The above /bin/perl not found issue happens when I apply your patch https://github.com/NixOS/nixpkgs/pull/452642#discussion_r2437030777 | 13:48:53 |
matthewcroughan | But is solved the headers/type issues like /nix/store/imi8qddc1zxz2s76m5xvmbyl945i1ppg-perl-5.40.0/lib/perl5/5.40.0/aarch64-linux-thread-multi/CORE/proto.h:10777:15: error: unknown type name 'off64_t'; did you mean 'off_t'? | 13:49:26 |
matthewcroughan | * But it solves the headers/type issues like /nix/store/imi8qddc1zxz2s76m5xvmbyl945i1ppg-perl-5.40.0/lib/perl5/5.40.0/aarch64-linux-thread-multi/CORE/proto.h:10777:15: error: unknown type name 'off64_t'; did you mean 'off_t'? | 13:49:34 |
matthewcroughan | Will put that in the PR for posterity | 13:50:01 |
Alyssa Ross | Try nix-diff | 13:50:43 |
matthewcroughan | - /nix/store/h19ly4ls25gwznag9i1xypif4a1a2sly-perl5.40.0-DBI-1.644-aarch64-unknown-linux-musl.drv:{out}
+ /nix/store/d24y94s4dv8x33b4r5q57vq9yzqwbc0z-perl5.40.0-DBI-1.644-aarch64-unknown-linux-musl.drv:{out}
• The set of input derivation names do not match:
- perl-5.40.0
• The environments do not match:
- AUTOMATED_TESTING=1
- PERL_AUTOINSTALL=--skipdeps
- PERL_USE_UNSAFE_INC=1
- fullperl=/nix/store/imi8qddc1zxz2s76m5xvmbyl945i1ppg-perl-5.40.0
+ NIX_CFLAGS_COMPILE= -Doff64_t=off_t
nativeBuildInputs=''
/nix/store/imi8qddc1zxz2s76m5xvmbyl945i1ppg-perl-5.40.0/nix/store/hm7smwqxxgvyja6rvfxnvf428k731gj9-perl-aarch64-unknown-linux-musl-5.40.
| 13:53:58 |
matthewcroughan | Ah.. I was still applying my NIX_CFLAGS_COMPILE | 13:54:04 |
matthewcroughan | But how exactly would that lead to perl not being found | 13:55:06 |
matthewcroughan | I guess something checks the types to decide on paths, weird | 13:55:50 |
matthewcroughan | [33/61] Compiling C++ object libnixutil.so.p/unix_file-descriptor.cc.o
FAILED: [code=1] libnixutil.so.p/unix_file-descriptor.cc.o
aarch64-unknown-linux-musl-clang++ -Ilibnixutil.so.p -I. -I.. -Iinclude -I../include -I../widecharwidth -Ilinux/include -I../linux/include -Iunix -I../unix -Iunix/include -I../unix/include -I/nix/store/2kq21fj8mcqbb2dk078kdkz0a4slp9y9-libarchive-aarch64-unknown-linux-musl-3.8.1-dev/include -I/nix/store/15nrd5ki3mn2wky0879jq6p8v3nl3ins-nlohmann_json-aarch64-unknown-linux-musl-3.12.>
../unix/file-descriptor.cc:174:20: error: use of undeclared identifier 'SYS_close_range'; did you mean 'unix_close_range'?
174 | return syscall(SYS_close_range, first, last, (unsigned int) flags);
| ^~~~~~~~~~~~~~~
| unix_close_range
../unix/file-descriptor.cc:171:12: note: 'unix_close_range' declared here
171 | static int unix_close_range(unsigned int first, unsigned int last, int flags)
| ^
../unix/file-descriptor.cc:174:12: error: no matching function for call to 'syscall'
174 | return syscall(SYS_close_range, first, last, (unsigned int) flags);
| ^~~~~~~
/nix/store/4w3bhgsi1al9v1jwgk9vc6ch20l7ynba-musl-aarch64-unknown-linux-musl-1.2.5-dev/include/unistd.h:180:6: note: candidate function not viable: no known conversion from 'int (unsigned int, unsigned int, int)' to 'long' for 1st argument
180 | long syscall(long, ...);
| ^ ~~~~
| 14:01:32 |
matthewcroughan | Is the suggestion that the compiler provides correct? | 14:01:39 |
matthewcroughan | use of undeclared identifier 'SYS_close_range'; did you mean 'unix_close_range'? | 14:01:46 |
matthewcroughan | SYS_close_range and unix_close_range are both used in the same file | 14:04:07 |
matthewcroughan | * SYS_close_range and unix_close_range are both used in the same file (src/libutil/unix/file-descriptor.cc) | 14:04:17 |
matthewcroughan | https://www.openwall.com/lists/musl/2025/09/13/1 | 14:05:32 |
dramforever | no because this is inside unix_close_range | 14:05:37 |
dramforever | #if defined(__linux__) || defined(__FreeBSD__)
static int unix_close_range(unsigned int first, unsigned int last, int flags)
{
# if !HAVE_CLOSE_RANGE
return syscall(SYS_close_range, first, last, (unsigned int) flags);
# else
return close_range(first, last, flags);
# endif
}
#endif
| 14:06:05 |
matthewcroughan | ah yes, so it's like, musl doesn't have it | 14:06:25 |
dramforever | implementing unix_close_range in terms of unix_close_range would be funny ... no it wouldn't work | 14:06:25 |
matthewcroughan | so it tries to use SYS_close_range | 14:06:29 |
dramforever | what musl version are you on again | 14:09:08 |
matthewcroughan | 1.25, everything I'm doing is based on staging-next always | 14:09:48 |
matthewcroughan | if I'm ever behind it's by a day or two | 14:09:55 |
matthewcroughan | * 1.2.5, everything I'm doing is based on staging-next always | 14:10:11 |
matthewcroughan | this is gnu-musl-llvm and musl-llvm though, I went back to musl native for testing, and I get a different error there in nix-expr | 14:10:55 |
matthewcroughan | the error about close_range is from llvm/musl, so I guess it's about tha | 14:11:09 |