test failure (lix main on darwin): functional-nix-shell-basic #1042

Open
opened 2025-11-20 06:12:18 +00:00 by dustypomerleau · 10 comments

Describe the bug

Thanks for all the time you're putting into Lix!

Compiling Lix main on Darwin is failing during installcheck. The failed test, functional-nix-shell-basic appears unable to create files with touch due to an illegal byte sequence in the filename.

Steps To Reproduce

Compile Lix main on Darwin with rev f3b2f3496bd6d346cba475d0ba152a9d3a83dec7 or more recent. I have tested rev 2c73f3c49299af4628bb812469d0a0f2566f38ec today and get the same error.

Expected behavior

Successful installcheck after compilation.

nix --version output

nix (Lix, like Nix) 2.95.0-pre20251118-dev_1b7ad3a
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/dn/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/g9xdwgpd9xylw7dm4pcf8gcm5jlw7s8q-lix-2.95.0-pre20251118-dev_1b7ad3a/share

Additional context

The full log is available in this gist, but below is a snapshot of the failing test output:

[K 50/139 lix:installcheck / functional-nix-shell-basic                               FAIL            1.87s   exit status 1
>>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=139 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_BUILD_ROOT=/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/source/build /nix/store/1s8ldw92176ry0hcdlzm0090w5v2a42n-python3-3.13.9-env/bin/python3 /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/source/meson/run-test.py nix-shell/basic.sh
 ✀  
stdout:
clearing store...
/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/shell.drv!dev
/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/shell!dev
[FAIL]
stderr:
touch: cannot touch '/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/tmp.CVFqYl86mu/'$'\322''.txt': Illegal byte sequence
++(common/vars-and-functions.sh:314) trap onError ERR
+(init.sh:6) test -n /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic
+(init.sh:7) test -d /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic
+(init.sh:8) chmod -R u+w /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic
+(init.sh:10) killDaemon
+(common/vars-and-functions.sh:122) [[ '' == '' ]]
+(common/vars-and-functions.sh:123) return
+(init.sh:11) rm -rf /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic
+(init.sh:13) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic
+(init.sh:15) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/store
+(init.sh:16) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var
+(init.sh:17) mkdir -p /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/log/nix/drvs
+(init.sh:18) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/nix
+(init.sh:19) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/etc
+(init.sh:21) cat
++(init.sh:21) whoami
+(init.sh:35) cat
+(init.sh:42) nix-store --init
+(init.sh:45) test -e /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/nix/db/db.sqlite
touch: cannot touch '/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/tmp.tGtjeT98rg/'$'\322''.txt': Illegal byte sequence
## Describe the bug Thanks for all the time you're putting into Lix! Compiling Lix main on Darwin is failing during `installcheck`. The failed test, `functional-nix-shell-basic` appears unable to create files with `touch` due to an illegal byte sequence in the filename. ## Steps To Reproduce Compile Lix main on Darwin with rev `f3b2f3496bd6d346cba475d0ba152a9d3a83dec7` or more recent. I have tested rev `2c73f3c49299af4628bb812469d0a0f2566f38ec` today and get the same error. ## Expected behavior Successful `installcheck` after compilation. ## `nix --version` output ```sh nix (Lix, like Nix) 2.95.0-pre20251118-dev_1b7ad3a System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/dn/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/g9xdwgpd9xylw7dm4pcf8gcm5jlw7s8q-lix-2.95.0-pre20251118-dev_1b7ad3a/share ``` ## Additional context The full log is available in [this gist](https://gist.github.com/dustypomerleau/16533b321de229132ac38ae95f5e69f2), but below is a snapshot of the failing test output: ```sh [K 50/139 lix:installcheck / functional-nix-shell-basic FAIL  1.87s exit status 1 >>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=139 MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_BUILD_ROOT=/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/source/build /nix/store/1s8ldw92176ry0hcdlzm0090w5v2a42n-python3-3.13.9-env/bin/python3 /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/source/meson/run-test.py nix-shell/basic.sh ✀ stdout: clearing store... /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/shell.drv!dev /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/shell!dev [FAIL] stderr: touch: cannot touch '/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/tmp.CVFqYl86mu/'$'\322''.txt': Illegal byte sequence ++(common/vars-and-functions.sh:314) trap onError ERR +(init.sh:6) test -n /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic +(init.sh:7) test -d /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic +(init.sh:8) chmod -R u+w /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic +(init.sh:10) killDaemon +(common/vars-and-functions.sh:122) [[ '' == '' ]] +(common/vars-and-functions.sh:123) return +(init.sh:11) rm -rf /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic +(init.sh:13) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic +(init.sh:15) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/store +(init.sh:16) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var +(init.sh:17) mkdir -p /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/log/nix/drvs +(init.sh:18) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/nix +(init.sh:19) mkdir /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/etc +(init.sh:21) cat ++(init.sh:21) whoami +(init.sh:35) cat +(init.sh:42) nix-store --init +(init.sh:45) test -e /nix/var/nix/b/643hmw6bqirf365lmq28a124vz/nix-test/nix-shell/basic/var/nix/db/db.sqlite touch: cannot touch '/nix/var/nix/b/643hmw6bqirf365lmq28a124vz/tmp.tGtjeT98rg/'$'\322''.txt': Illegal byte sequence ```
Owner

Could you share more information about your /etc/nix/nix.conf? I received this error from some other folks but I compile aarch64-darwin a bunch of times and never encountered it... It seems filesystem driven too.

Could you share more information about your `/etc/nix/nix.conf`? I received this error from some other folks but I compile aarch64-darwin a bunch of times and never encountered it... It seems filesystem driven too.
Author

Thank you for your time, @raito.

My nix.conf is generated (contents below). My flake.nix is public if it helps.

# WARNING: this file is generated from the nix.* options in
# your nix-darwin configuration. Do not edit it!
allowed-users = *
auto-optimise-store = false
build-users-group = nixbld
builders = 
cores = 0
experimental-features = nix-command flakes
max-jobs = auto
nix-path = nixpkgs=flake:nixpkgs /nix/var/nix/profiles/per-user/root/channels
require-sigs = true
sandbox = false
sandbox-fallback = false
substituters = https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
trusted-substituters = 
trusted-users = @admin @root root
extra-sandbox-paths = 

Is there an issue with string concatenation in the creation of the filenames? I noticed there are extra single quotes within the file being touched.

Thank you for your time, @raito. My `nix.conf` is generated (contents below). My [`flake.nix`](https://github.com/dustypomerleau/config/blob/main/nix-darwin/flake.nix) is public if it helps. ``` # WARNING: this file is generated from the nix.* options in # your nix-darwin configuration. Do not edit it! allowed-users = * auto-optimise-store = false build-users-group = nixbld builders = cores = 0 experimental-features = nix-command flakes max-jobs = auto nix-path = nixpkgs=flake:nixpkgs /nix/var/nix/profiles/per-user/root/channels require-sigs = true sandbox = false sandbox-fallback = false substituters = https://cache.nixos.org/ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= trusted-substituters = trusted-users = @admin @root root extra-sandbox-paths = ``` Is there an issue with string concatenation in the creation of the filenames? I noticed there are extra single quotes within the file being `touch`ed.
Owner

@dustypomerleau (@)pennae tells me the root cause is that the Darwin detection creates this error, I will try to send a fix soon.

@dustypomerleau (@)pennae tells me the root cause is that the Darwin detection creates this error, I will try to send a fix soon.
Author

Fantastic—thank you for the quick reply @raito.

Fantastic—thank you for the quick reply @raito.
Author

@raito For what it's worth, it seems that the failure mode (the error during calls to touch) is consistently the same, but the failing test is variable. Today I am seeing:

20/135 lix:installcheck / functional-user-envs                                     FAIL            3.97s   exit status 1
>>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=4 MESON_TEST_ITERATION=1 MESON_BUILD_ROOT=/nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/source/build ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /nix/store/5p1afc63sf7fsmnsyj04dr2aryd154gl-python3-3.13.9-env/bin/python3 /nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/source/meson/run-test.py user-envs.sh
 ✀
stdout:
clearing store...
true
true
true
[FAIL]
stderr:
touch: cannot touch '/nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/tmp.wh3aPy1CTo/'$'\322''.txt': Illegal byte sequence
@raito For what it's worth, it seems that the failure mode (the error during calls to `touch`) is consistently the same, but the failing test is variable. Today I am seeing: ```sh 20/135 lix:installcheck / functional-user-envs FAIL 3.97s exit status 1 >>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=4 MESON_TEST_ITERATION=1 MESON_BUILD_ROOT=/nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/source/build ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /nix/store/5p1afc63sf7fsmnsyj04dr2aryd154gl-python3-3.13.9-env/bin/python3 /nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/source/meson/run-test.py user-envs.sh ✀ stdout: clearing store... true true true [FAIL] stderr: touch: cannot touch '/nix/var/nix/b/4ak2bckb9p74zds6iwc4mbvs96/tmp.wh3aPy1CTo/'$'\322''.txt': Illegal byte sequence ```
Owner

Hi, @dustypomerleau! I'm not able to reproduce this on other Darwin machines -- the touch error in the stdout is actually a red herring (see #1056); but there is a legtimiate test failure, and seeing what you are is a bit mystifying.

Actual failure: https://gist.github.com/dustypomerleau/16533b321de229132ac38ae95f5e69f2#file-lix-test-failure-functional-nix-shell-basic-txt-L1813

I'll follow up if I find out more. In the meantime, can you tell me if there's anything that might be unique about the machine (locale, any odd environment handling)?

Hi, @dustypomerleau! I'm not able to reproduce this on other Darwin machines -- the `touch` error in the stdout is actually a red herring (see #1056); but there is a legtimiate test failure, and seeing what you are is a bit mystifying. Actual failure: https://gist.github.com/dustypomerleau/16533b321de229132ac38ae95f5e69f2#file-lix-test-failure-functional-nix-shell-basic-txt-L1813 I'll follow up if I find out more. In the meantime, can you tell me if there's anything that might be unique about the machine (locale, any odd environment handling)?
Owner

Also: if you have other test cases failing, can you submit full logs from those ones?

Something odd is going on, and I'm not sure if it's a Lix-on-Darwin problem, a Lix problem, or something else in the environment. I'd also be happy to chat if this winds up being something you're wiling to try some interactive debugging on.

Thanks! ^^

Also: if you have other test cases failing, can you submit full logs from those ones? Something odd is going on, and I'm not sure if it's a Lix-on-Darwin problem, a Lix problem, or something else in the environment. I'd also be happy to chat if this winds up being something you're wiling to try some interactive debugging on. Thanks! ^^
Author

I don't think there is anything unusual about my system, but I'm happy to provide more debugging info if you can tell me what to run.

The system locale is Australia. My flake is here, if that's helpful.

Here is a gist of the latest failure. It looks quite similar to the original. Other than the one functional-user-envs failure above, I have almost exclusively been seeing failures of functional-nix-shell-basic.

Even though Lix install is currently failing, I should mention that I've successfully compiled/installed Lix main twice since the original post, so it's very inconsistent. Failure for a given rev of Lix main seems reproducible, but if you update the flake input to latest, it will sometimes succeed (also reproducible).

I appreciate the time you're taking to investigate this.

I don't think there is anything unusual about my system, but I'm happy to provide more debugging info if you can tell me what to run. The system locale is Australia. [My flake is here](https://github.com/dustypomerleau/config/blob/main/nix-darwin/flake.nix), if that's helpful. Here is a [gist of the latest failure](https://gist.github.com/dustypomerleau/974a65edbc684cc8a0f7b18da96787f4). It looks quite similar to the original. Other than the one `functional-user-envs` failure above, I have almost exclusively been seeing failures of `functional-nix-shell-basic`. Even though Lix install is currently failing, I should mention that I've successfully compiled/installed Lix main twice since the original post, so it's very inconsistent. Failure for a given rev of Lix main seems reproducible, but if you update the flake input to latest, it will sometimes succeed (also reproducible). I appreciate the time you're taking to investigate this.
Author

I have re-encountered the failure of functional-user-envs. Here is a gist of the log.

The error seems to point at this section of user-envs.sh:

# Query installed: should contain foo-1.0 now (which should be
# executable).
test "$(nix-env -q '*' | wc -l)" -eq 1
nix-env -q '*' | grepQuiet foo-1.0
test "$($profiles/test/bin/foo)" = "foo-1.0"
I have re-encountered the failure of `functional-user-envs`. Here is a [gist of the log](https://gist.github.com/dustypomerleau/29ebf75c92e001e58a5c3be1db383fca). The error seems to point at this section of `user-envs.sh`: ```sh # Query installed: should contain foo-1.0 now (which should be # executable). test "$(nix-env -q '*' | wc -l)" -eq 1 nix-env -q '*' | grepQuiet foo-1.0 test "$($profiles/test/bin/foo)" = "foo-1.0" ```
Author

Here is a log where both of the above tests fail in one run. The stack looks the same to me. It's pretty clear that it's specifically those 2 tests - I haven't had failures of any others since this began.

Here is [a log](https://gist.github.com/dustypomerleau/e17a39ee7ff83e6146099af4df1410dc) where both of the above tests fail in one run. The stack looks the same to me. It's pretty clear that it's specifically those 2 tests - I haven't had failures of any others since this began.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1042
No description provided.