| 21 Oct 2025 |
Randy Eckenrode | I’ve got the source release updates building on aarch64-darwin. I’m glad I did some of this work back in July …. | 02:26:25 |
Randy Eckenrode | Once I confirm x86_64-darwin builds, I’ll split up the changes and open a PR. | 02:26:43 |
| Ralf joined the room. | 06:15:26 |
Randy Eckenrode | ICU tests fail on x86_64-darwin. ☹️
Triggered by Thread: 0
Exception Type: EXC_ARITHMETIC (SIGFPE)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 8, Floating point exception: 8
Terminating Process: exc handler [89045]
Thread 0 Crashed:
0 libicui18n.76.1.dylib 0x10e162427 icu::Calendar::roll(UCalendarDateFields, int, UErrorCode&) + 1735
1 intltest 0x10465c2f5 CalendarTest::Test22633RollTwiceGetTimeOverflow()::$_0::__invoke(icu::Calendar*, UCalendarDateFields) + 69
2 intltest 0x10465bd35 CalendarTest::RunTestOnCalendars(void (*)(icu::Calendar*, UCalendarDateFields)) + 565
3 intltest 0x1046e271c IntlTest::runTestLoop(char*, char*, char*) + 492
4 intltest 0x1046e2320 IntlTest::runTest(char*, char*, char*) + 128
5 intltest 0x1046e2152 IntlTest::callTest(IntlTest&, char*) + 82
6 intltest 0x1046eee00 IntlTestFormat::runIndexedTest(int, signed char, char const*&, char*) + 4016
7 intltest 0x1046e271c IntlTest::runTestLoop(char*, char*, char*) + 492
8 intltest 0x1046e2320 IntlTest::runTest(char*, char*, char*) + 128
9 intltest 0x1046e2152 IntlTest::callTest(IntlTest&, char*) + 82
10 intltest 0x1046f16ed MajorTestLevel::runIndexedTest(int, signed char, char const*&, char*) + 461
11 intltest 0x1046e271c IntlTest::runTestLoop(char*, char*, char*) + 492
12 intltest 0x1046e2320 IntlTest::runTest(char*, char*, char*) + 128
13 intltest 0x1046e5360 main + 3568
14 dyld 0x2050c5781 start + 3457
| 12:12:09 |
dbaynard | Hello folks, I want to PR darwin support for libtree (analysis of linked libraries) and I have questions about tests.
There's a passthru.tests attrset at https://github.com/NixOS/nixpkgs/blob/5e2a59a5b1a82f89f2c7e598302a9cacebb72a67/pkgs/by-name/li/libtree/package.nix#L28-L46 which tests ls from coreutils. On macos, by default, it checks the macOS build of ls, which is not an ELF. I can get it to work properly using pkgsCross, as in the following.
(libtree.override {
inherit (pkgsCross.aarch64-multiplatform) coreutils;
}).overrideAttrs
(old: {
meta = lib.recursiveUpdate (old.meta or { }) { platforms = lib.platforms.darwin; };
})
I presume that in this case libtree should always test the pkgsCross coreutils… but certainly the tests fail on macos without it. What's the idiomatic way of handling this case?
| 16:26:19 |
dbaynard | * Hello folks, I want to PR darwin support for libtree (analysis of linked libraries) and I have questions about tests.
There's a passthru.tests attrset at https://github.com/NixOS/nixpkgs/blob/5e2a59a5b1a82f89f2c7e598302a9cacebb72a67/pkgs/by-name/li/libtree/package.nix#L28-L46 which tests ls from coreutils. On macos, by default, it checks the macOS build of ls, which is not an ELF. I can get it to work properly using pkgsCross, as in the following.
(libtree.override {
inherit (pkgsCross.aarch64-multiplatform) coreutils;
}).overrideAttrs
(old: {
meta = lib.recursiveUpdate (old.meta or { }) { platforms = lib.platforms.darwin; };
})
I presume that in this case libtree should always test the pkgsCross coreutils… but certainly the tests fail on macos without it. What's the idiomatic way of handling this case?
[Edit: I don't mean idiomatic way of implementing the changes, as opposed to the override, I mean the idiomatic way of handling the cross-platform dependency in the tests.]
| 16:31:14 |
| Lun joined the room. | 18:35:15 |
Randy Eckenrode | You might want to ask in https://matrix.to/#/%23cross-compiling:nixos.org. | 20:09:54 |
Randy Eckenrode | I know there is a desire to move pkgsCross to variants.nix, which would prevent it from being used in nixpkgs. I assume that applies to passthru.tests. | 20:10:01 |
Randy Eckenrode | I feel like a better (more portable) test would be to use an unwrapped Clang and LLD to generate a shared library and link a trivial program against it. | 20:12:12 |
Randy Eckenrode | (I bet pkgsStatic.libtree.tests.checkCoreUtils fails.) | 20:13:58 |
Randy Eckenrode | * (I bet pkgsStatic.libtree.tests.checkCoreUtils fails on Linux.) | 20:14:16 |
emily | does it only support ELF even on Darwin? | 20:14:45 |
emily | looking at the code… does this program actually work on Darwin? | 20:15:34 |
emily | it seems to make a fair few assumptions about the system being ELF-y | 20:15:40 |
Randy Eckenrode | Yes. There’s an open issue for Mach-O support, but it’s old.
https://github.com/haampie/libtree/issues/22
| 20:16:05 |
JoelMcCracken | I heard something about nixpkgs dropping x86_64-darwin support, is that discussion happpening anywhere easy to find?
| 20:16:14 |
emily | it has paths like /usr/lib and /etc/ld.so.conf hardcoded though | 20:16:33 |
emily | it's in the 25.11 release notes, https://github.com/NixOS/nixpkgs/pull/415566 | 20:16:47 |
emily | I was meaning to post it on Discourse too though, I should do that | 20:16:56 |
Randy Eckenrode | Note that that wouldn’t happen until 26.11. The announcement about dropping support in DetNix is unrelated to our schedule. | 20:17:49 |
Randy Eckenrode | Does the latter even exist on NixOS? | 20:18:34 |
emily | I think no, but I guess it can not-exist gracefully | 20:18:54 |
emily | I'm just surprised if this program runs on macOS at all | 20:18:59 |
Randy Eckenrode | * | 20:49:58 |
dbaynard | > nix build -L '.#libtree.tests.checkCoreUtils' --no-link --print-out-paths
/nix/store/40xm11r0sklkl4x5cp8xdckp5sha0yfd-libtree-ls-test
> nix build -L '.#libtree.tests.checkCoreUtils' --no-link --print-out-paths | xargs bat
───────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ File: /nix/store/40xm11r0sklkl4x5cp8xdckp5sha0yfd-libtree-ls-test
───────┼──────────────────────────────────────────────────────────────────────────────────────────────
1 │ /nix/store/x2s54dnz7kd4vbslfcv1x3g69p30fz7y-coreutils-aarch64-unknown-linux-gnu-9.7/bin/ls
2 │ ├── libacl.so.1 [runpath]
3 │ │ └── libattr.so.1 [runpath]
4 │ ├── libattr.so.1 [runpath]
5 │ └── libgmp.so.10 [runpath]
───────┴──────────────────────────────────────────────────────────────────────────────────────────────
| 23:46:29 |
dbaynard | * > nix build -L '.#libtree.tests.checkCoreUtils' --no-link --print-out-paths
/nix/store/40xm11r0sklkl4x5cp8xdckp5sha0yfd-libtree-ls-test
> nix build -L '.#libtree.tests.checkCoreUtils' --no-link --print-out-paths | xargs bat
───────┬──────────────────────────────────────────────────────────────────────────────────────────────
│ File: /nix/store/40xm11r0sklkl4x5cp8xdckp5sha0yfd-libtree-ls-test
───────┼──────────────────────────────────────────────────────────────────────────────────────────────
1 │ /nix/store/x2s54dnz7kd4vbslfcv1x3g69p30fz7y-coreutils-aarch64-unknown-linux-gnu-9.7/bin/ls
2 │ ├── libacl.so.1 [runpath]
3 │ │ └── libattr.so.1 [runpath]
4 │ ├── libattr.so.1 [runpath]
5 │ └── libgmp.so.10 [runpath]
───────┴──────────────────────────────────────────────────────────────────────────────────────────────
This is the test result, making the above change to use the pkgsCross (but not pkgsStatic!) coreutils.
| 23:47:21 |
dbaynard | Thanks for your help. I should have been more explicit that this is working, reasonably, for me (I haven't used all the functionality but I have found it useful as a tool that works on macos that can analyze ELFs). I'll ask in the cross compile channel, when I return to this. | 23:50:07 |