Mysterious guessOrInventPath.sockets unit test failure on macOS after libexec changes #1113

Open
opened 2026-01-31 17:41:40 +00:00 by lunaphied · 6 comments
Owner

Describe the bug

I can't build Lix as a derivation (with or without sandboxing) due to an odd test failure that seem to only occur on my machine at the moment. The log is attached but essentially it seems to be looking into the wrong path for unix-bind-connect while doing specifically guessOrInventPath.sockets unit test.

If I try to build the same revision in a development environment a seemingly related issue occurs when running the tests but in the form a timeout instead in one of the functional(2?) tests, while the unit test that was failing inside the derivation build passes fine.

The core error is

error: executing '/nix/store/zdn53j69arskzp548z046xvjp19p64k8-lix-2.95.0pre20260128-dev_56988d8/libexec/lix/unix-bind-connect': No such file or directory

Steps To Reproduce

  1. Checkout revision 56988d8605 or later of Lix.
  2. Try to build on my Darwin machine
  3. ProfitFailure.

Expected behavior

Not this.

nix --version output

nix (Lix, like Nix) 2.94.0-pre20251112-dev_78bdc60
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/lunaphied/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/40pgpdvr4gfvhx0pyc127yd5g83frca9-lix-2.94.0-pre20251112-dev_78bdc60/share

Additional context

I'm going to start bisecting this more specifically to confirm which revision introduced this more specifically but probably tomorrow.

## Describe the bug I can't build Lix as a derivation (with or without sandboxing) due to an odd test failure that seem to only occur on my machine at the moment. The log is attached but essentially it seems to be looking into the wrong path for `unix-bind-connect` while doing specifically `guessOrInventPath.sockets` unit test. If I try to build the same revision in a development environment a seemingly related issue occurs when running the tests but in the form a timeout instead in one of the functional(2?) tests, while the unit test that was failing inside the derivation build passes fine. The core error is ``` error: executing '/nix/store/zdn53j69arskzp548z046xvjp19p64k8-lix-2.95.0pre20260128-dev_56988d8/libexec/lix/unix-bind-connect': No such file or directory ``` ## Steps To Reproduce 1. Checkout revision 56988d860593a5fd8153d02a0ca5469508378626 or later of Lix. 2. Try to build on my Darwin machine 3. ~~Profit~~Failure. ## Expected behavior Not this. ## `nix --version` output ``` nix (Lix, like Nix) 2.94.0-pre20251112-dev_78bdc60 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/lunaphied/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/40pgpdvr4gfvhx0pyc127yd5g83frca9-lix-2.94.0-pre20251112-dev_78bdc60/share ``` ## Additional context I'm going to start bisecting this more specifically to confirm which revision introduced this more specifically but probably tomorrow.
Owner

oh dear, unix sockets again 🫠 the ENOENT is likely due to the packaging not running the install phase before the check phase, so the helper isn't available yet. do you have a non-default tmpdir setting on your system? iwrc the default setting should not lead to socket paths that are long enough to require the connect helper to use

oh dear, unix sockets again 🫠 the ENOENT is likely due to the packaging not running the install phase before the check phase, so the helper isn't available yet. do you have a non-default tmpdir setting on your system? iwrc the default setting should not lead to socket paths that are long enough to require the connect helper to use
Author
Owner

I shouldn't have a non-standard tmpdir temp-dir = this is just based off the default install from https://lix.systems/install followed by updating the profile to the shown revision

I shouldn't have a non-standard tmpdir `temp-dir =` this is just based off the default install from https://lix.systems/install followed by updating the profile to the shown revision
Owner

that is super strange then. can you add a print of the generated socket path to the guessOrInventPath sockets test in lix/tests/unit/libutil/tests.cc? if it fails on your machine tht path must be longer than it is in ci, and figuring out where that difference comes from sounds pretty important right now

worst case we can disable that specific test on macos, or shuffle phases?

that is super strange then. can you add a print of the generated socket path to the guessOrInventPath sockets test in `lix/tests/unit/libutil/tests.cc`? if it fails on your machine tht path *must* be longer than it is in ci, and figuring out where that difference comes from sounds pretty important right now worst case we can disable that specific test on macos, or shuffle phases?
Author
Owner
socketPath: /nix/var/nix/builds/nix-build-lix-2.95.0pre20260222-dev_dirty.drv-0/b/source/tests/unit/libutil/data/guess-or-invent/socket
unknown file: Failure
C++ exception with description "error: failed to run /nix/store/875xwix2qk8n9s07m54syy98yv1k3nqq-lix-2.95.0pre20260222-dev_dirty/libexec/lix/unix-bind-connect: error: executing '/nix/store/875xwix2qk8n9s07m54syy98yv1k3nqq-lix-2.95.0pre20260222-dev_dirty/libexec/lix/unix-bind-connect': No such file or directory" thrown in the test body.
``` socketPath: /nix/var/nix/builds/nix-build-lix-2.95.0pre20260222-dev_dirty.drv-0/b/source/tests/unit/libutil/data/guess-or-invent/socket unknown file: Failure C++ exception with description "error: failed to run /nix/store/875xwix2qk8n9s07m54syy98yv1k3nqq-lix-2.95.0pre20260222-dev_dirty/libexec/lix/unix-bind-connect: error: executing '/nix/store/875xwix2qk8n9s07m54syy98yv1k3nqq-lix-2.95.0pre20260222-dev_dirty/libexec/lix/unix-bind-connect': No such file or directory" thrown in the test body. ```
Author
Owner

The other error I was seeing in functional-gc-non-blocking was also due to using unix-bind-connect because because TMPDIR and TEMPDIR were set based on entering the nix develop environment which put it connecting to a test path like /private/var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/nix-shell.FLuJAy/nix-test/gc-non-blocking/var/nix/gc-socket which is of course too long for a direct connection.

The reason the unit test passes in the dev environment because that uses a path like /Users/lunaphied/code/lix/tests/unit/libutil/data/guess-or-invent/socket

It looks like I have $TMPDIR getting set to /var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/nix-shell.CKSaGA when I enter a shell, which makes the path just slightly too long. I cannot find so far where it's getting set but TMPDIR starts out as /var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/ or similar on my machine.

@qyriad when you get a chance can you give me the equivalent information from one or both of your Darwin systems because I don't know why this isn't affecting you currently. I suspect that you might not see the error during derivation build because of having a less recent system Lix that doesn't yet use the temp directory fix.

The other error I was seeing in `functional-gc-non-blocking` was also due to using `unix-bind-connect` because because `TMPDIR` and `TEMPDIR` were set based on entering the `nix develop` environment which put it connecting to a test path like `/private/var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/nix-shell.FLuJAy/nix-test/gc-non-blocking/var/nix/gc-socket` which is of course too long for a direct connection. The reason the unit test passes in the dev environment because that uses a path like `/Users/lunaphied/code/lix/tests/unit/libutil/data/guess-or-invent/socket` It looks like I have `$TMPDIR` getting set to `/var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/nix-shell.CKSaGA` when I enter a shell, which makes the path just slightly too long. I cannot find so far where it's getting set but `TMPDIR` starts out as `/var/folders/hn/z5j50y9x46vffv4zsbcq6vw40000gn/T/` or similar on my machine. @qyriad when you get a chance can you give me the equivalent information from one or both of your Darwin systems because I don't know why this isn't affecting you currently. I suspect that you might not see the error during derivation build because of having a less recent system Lix that doesn't yet use the temp directory fix.
Owner

perhaps we should just drop this unit test. the test suite quite obviously exercises that functionality already, and it relying on other binaries really makes it not a unit test anyway

perhaps we should just drop this unit test. the test suite quite obviously exercises that functionality already, and it relying on other binaries really makes it not a *unit* test anyway
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#1113
No description provided.