Can't build on mac os anymore #1118

Closed
opened 2026-02-03 19:38:31 +00:00 by imran-iq · 19 comments

Describe the bug

I've started getting the following error whenever I try to build/switch

error:
       … while waiting for the build environment for '/nix/store/sv6rx54skrk207d5y4whmjnhqd9laqg4-darwin-version.json.drv' to initialize (failed with exit code 1, previous messages: sandbox initialization failed: no version specified||failed to configure sandbox)

       error: unexpected EOF reading a line

I am not sure whether this is a lix or a nix issue, searching for the strings in either project give no results except for:

github.com/NixOS/nix@6d6cbf78cc/src/libstore/unix/build/darwin-derivation-builder.cc (L199)

and

https://git.lix.systems/lix-project/lix/src/branch/main/lix/libexec/launch-builder-darwin.cc#L49

Steps To Reproduce

I have a make file that runs the following:

nix flake update
sudo darwin-rebuild switch --flake ~/.config/nix-darwin

and then commits the result

this has stopped working few days ago, my last commit has me bumping the version to 2e0cc67ec829754184dcbebff8078726debd13f7 but looks like I am running f09ed729b5dcacbbff5e1ae6f85bc93933ecf2f1

Expected behavior

A clear and concise description of what you expected to happen.

nix --version output

nix (Lix, like Nix) 2.95.0-pre20260202-dev_f09ed72
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/imran/.config/nix/nix.conf:/Users/imran/.nix-profile/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/v3v84m7h498iik3qmg99zhvwzlavzny8-lix-2.95.0-pre20260202-dev_f09ed72/share

Additional context

nix.conf

# 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
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 = root
extra-sandbox-paths = 
## Describe the bug I've started getting the following error whenever I try to build/switch ``` error: … while waiting for the build environment for '/nix/store/sv6rx54skrk207d5y4whmjnhqd9laqg4-darwin-version.json.drv' to initialize (failed with exit code 1, previous messages: sandbox initialization failed: no version specified||failed to configure sandbox) error: unexpected EOF reading a line ``` I am not sure whether this is a lix or a nix issue, searching for the strings in either project give no results except for: https://github.com/NixOS/nix/blob/6d6cbf78ccaa89c9b39b71616f2ace527040e6f5/src/libstore/unix/build/darwin-derivation-builder.cc#L199 and https://git.lix.systems/lix-project/lix/src/branch/main/lix/libexec/launch-builder-darwin.cc#L49 ## Steps To Reproduce I have a make file that runs the following: ``` nix flake update sudo darwin-rebuild switch --flake ~/.config/nix-darwin ``` and then commits the result this has stopped working few days ago, my last commit has me bumping the version to `2e0cc67ec829754184dcbebff8078726debd13f7` but looks like I am running `f09ed729b5dcacbbff5e1ae6f85bc93933ecf2f1` ## Expected behavior A clear and concise description of what you expected to happen. ## `nix --version` output ``` nix (Lix, like Nix) 2.95.0-pre20260202-dev_f09ed72 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/imran/.config/nix/nix.conf:/Users/imran/.nix-profile/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/v3v84m7h498iik3qmg99zhvwzlavzny8-lix-2.95.0-pre20260202-dev_f09ed72/share ``` ## Additional context nix.conf ``` # 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 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 = root extra-sandbox-paths = ```
Owner

can you run the build with -j1 --debug and check for Generated sandbox profile lines? those should not be empty.

@lix-project/macos we can't find anything obviously wrong with the code since the same kind of string conveyance to the launcher works fine on linux, can y'all have a look?

can you run the build with `-j1 --debug` and check for `Generated sandbox profile` lines? those should not be empty. @lix-project/macos we can't find anything obviously wrong with the code since the same kind of string conveyance to the launcher works fine on linux, can y'all have a look?
Owner

actually, on a wild guess: can you rebuild your system from git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1 and see if that helps?

actually, on a wild guess: can you rebuild your system from `git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1` and see if that helps?
Author

can you run the build with -j1 --debug

there is no --debug for darwin-rebuild, but none of the verbose log options caused anything with Generated sandbox profile to be printed.

here are the available options

❯ darwin-rebuild --help
darwin-rebuild [--help] {edit | switch | activate | build | check | changelog}
               [--list-generations] [{--profile-name | -p} name] [--rollback]
               [{--switch-generation | -G} generation] [--verbose...] [-v...]
               [-Q] [{--max-jobs | -j} number] [--cores number] [--dry-run]
               [--keep-going | -k] [--keep-failed | -K] [--fallback] [--show-trace]
               [--print-build-logs | -L] [--impure] [-I path]
               [--option name value] [--arg name value] [--argstr name value]
               [--no-flake | [--flake flake]
                             [--commit-lock-file] [--recreate-lock-file]
                             [--no-update-lock-file] [--no-write-lock-file]
                             [--override-input input flake] [--update-input input]
                             [--no-registries] [--offline] [--refresh]]
               [--substituters substituters-list] ...

can you rebuild your system from git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1 and see if that helps?

I first had to rollback to 2.95.0-pre20260130-dev_2e0cc67

I could then build and switch to 2.95.0-pre20260203-dev_8b73cbb which then resulted in the following error:

darwin-rebuild build --flake .
building the system configuration...
warning: Git tree '/Users/imran/.config/nix-darwin' is dirty
home-manager-applications> created 1 symlinks in user environment
home-manager-fonts> created 0 symlinks in user environment
man-paths> created 506 symlinks in user environment
home-manager-path> created 988 symlinks in user environment
man-cache> Processing manual pages under /nix/store/jjxyxqxn0y10canngravhpg025ifz26y-man-paths/share/man...
system-applications> created 0 symlinks in user environment
system-path> created 569 symlinks in user environment
man-cache> Updating index cache for path `/nix/store/jjxyxqxn0y10canngravhpg025ifz26y-man-paths/share/man/man7'. Wait...done.
man-cache> 4 man subdirectories contained newer manual pages.
man-cache> 506 manual pages were added.
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1

and seems to keep happening

darwin-rebuild build --flake .
building the system configuration...
warning: Git tree '/Users/imran/.config/nix-darwin' is dirty
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1
> can you run the build with -j1 --debug there is no `--debug` for darwin-rebuild, but none of the verbose log options caused anything with `Generated sandbox profile` to be printed. here are the available options ``` ❯ darwin-rebuild --help darwin-rebuild [--help] {edit | switch | activate | build | check | changelog} [--list-generations] [{--profile-name | -p} name] [--rollback] [{--switch-generation | -G} generation] [--verbose...] [-v...] [-Q] [{--max-jobs | -j} number] [--cores number] [--dry-run] [--keep-going | -k] [--keep-failed | -K] [--fallback] [--show-trace] [--print-build-logs | -L] [--impure] [-I path] [--option name value] [--arg name value] [--argstr name value] [--no-flake | [--flake flake] [--commit-lock-file] [--recreate-lock-file] [--no-update-lock-file] [--no-write-lock-file] [--override-input input flake] [--update-input input] [--no-registries] [--offline] [--refresh]] [--substituters substituters-list] ... ``` > can you rebuild your system from git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1 and see if that helps? I first had to rollback to `2.95.0-pre20260130-dev_2e0cc67` I could then build and switch to `2.95.0-pre20260203-dev_8b73cbb` which then resulted in the following error: ``` darwin-rebuild build --flake . building the system configuration... warning: Git tree '/Users/imran/.config/nix-darwin' is dirty home-manager-applications> created 1 symlinks in user environment home-manager-fonts> created 0 symlinks in user environment man-paths> created 506 symlinks in user environment home-manager-path> created 988 symlinks in user environment man-cache> Processing manual pages under /nix/store/jjxyxqxn0y10canngravhpg025ifz26y-man-paths/share/man... system-applications> created 0 symlinks in user environment system-path> created 569 symlinks in user environment man-cache> Updating index cache for path `/nix/store/jjxyxqxn0y10canngravhpg025ifz26y-man-paths/share/man/man7'. Wait...done. man-cache> 4 man subdirectories contained newer manual pages. man-cache> 506 manual pages were added. error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1 ``` and seems to keep happening ``` darwin-rebuild build --flake . building the system configuration... warning: Git tree '/Users/imran/.config/nix-darwin' is dirty error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1 ```
Owner

darwin-rebuild build --flake . is equivalent to nix build .#darwinConfigurations.$HOSTNAME.config.system.build.toplevel, so you can pass --debug to that

`darwin-rebuild build --flake .` is equivalent to `nix build .#darwinConfigurations.$HOSTNAME.config.system.build.toplevel`, so you can pass `--debug` to that
Owner

@imran-iq https://gerrit.lix.systems/c/lix/+/5076 has changes to ensure that we always report stderr of the build child if setup fails for any reason, is it does in your case. the iovTotal number suggests that the sandbox profile is transmitted correctly, at least

@imran-iq https://gerrit.lix.systems/c/lix/+/5076 has changes to ensure that we always report stderr of the build child if setup fails for any reason, is it does in your case. the `iovTotal` number suggests that the sandbox profile is transmitted correctly, at least
Author

So using version 2.95.0-pre20260202-dev_f09ed72

with -j1 --debug all i get pertaining to the sandbox is

rying user '_nixbld1'
killing all processes running under uid '351'
running command: '17' '351'
executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
sandbox setup: sandbox initialization failed: no version specified
sandbox setup:
sandbox setup: failed to configure sandbox
lock released on '/nix/store/3g08pg498cg0vzmwmkbzq9sw6c220zx4-darwin-system-26.05.0fc4e7a.lock'
building of '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv^out' from .drv file: goal destroyed
error:
       … while waiting for the build environment for '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv' to initialize (failed with exit code 1, previous messages: sandbox initialization failed: no version specified||failed to configure sandbox)

       error: unexpected EOF reading a line

using version 2.95.0-pre20260203-dev_8b73cbb

trying user '_nixbld1'
killing all processes running under uid '351'
running command: '17' '351'
executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
Generated sandbox profile: (version 1)


(allow default)

; Disallow creating setuid/setgid binaries, since that
; would allow breaking build user isolation.
(deny file-write-setugid)


running command:
killing process group 12480
killing all processes running under uid '351'
running command: '20' '351'
lock released on '/nix/store/3g08pg498cg0vzmwmkbzq9sw6c220zx4-darwin-system-26.05.0fc4e7a.lock'
building of '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv^out' from .drv file: goal destroyed
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1
So using version `2.95.0-pre20260202-dev_f09ed72` with -j1 --debug all i get pertaining to the sandbox is ``` rying user '_nixbld1' killing all processes running under uid '351' running command: '17' '351' executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' sandbox setup: sandbox initialization failed: no version specified sandbox setup: sandbox setup: failed to configure sandbox lock released on '/nix/store/3g08pg498cg0vzmwmkbzq9sw6c220zx4-darwin-system-26.05.0fc4e7a.lock' building of '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv^out' from .drv file: goal destroyed error: … while waiting for the build environment for '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv' to initialize (failed with exit code 1, previous messages: sandbox initialization failed: no version specified||failed to configure sandbox) error: unexpected EOF reading a line ``` --- using version `2.95.0-pre20260203-dev_8b73cbb` ``` trying user '_nixbld1' killing all processes running under uid '351' running command: '17' '351' executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' Generated sandbox profile: (version 1) (allow default) ; Disallow creating setuid/setgid binaries, since that ; would allow breaking build user isolation. (deny file-write-setugid) running command: killing process group 12480 killing all processes running under uid '351' running command: '20' '351' lock released on '/nix/store/3g08pg498cg0vzmwmkbzq9sw6c220zx4-darwin-system-26.05.0fc4e7a.lock' building of '/nix/store/5zlpr221yiy9bp42nzpkm7jml715bvw2-darwin-system-26.05.0fc4e7a.drv^out' from .drv file: goal destroyed error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1 ```
Author

I went ahead and switched to the latest on main: 2.95.0-pre20260204-dev_ba4f4f9 and can build now (switched to a smaller package to build)

trying user '_nixbld1'
killing all processes running under uid '351'
running command: '17' '351'
executing builder '/nix/store/k385hp16fsc8llfacr3phmmwnlfymdrz-bash-5.3p3/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
Generated sandbox profile: (version 1)


(allow default)

; Disallow creating setuid/setgid binaries, since that
; would allow breaking build user isolation.
(deny file-write-setugid)


running command:
checking outputs of '/nix/store/wdbphvx3b2d4xa6n6xqaxks3f0djp0nr-rubcopgen-0.0.1.drv'...

If y'all are interested I could try bisecting to figure out which commit had the issue, but for now am good

I went ahead and switched to the latest on main: `2.95.0-pre20260204-dev_ba4f4f9` and can build now (switched to a smaller package to build) ``` trying user '_nixbld1' killing all processes running under uid '351' running command: '17' '351' executing builder '/nix/store/k385hp16fsc8llfacr3phmmwnlfymdrz-bash-5.3p3/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' Generated sandbox profile: (version 1) (allow default) ; Disallow creating setuid/setgid binaries, since that ; would allow breaking build user isolation. (deny file-write-setugid) running command: checking outputs of '/nix/store/wdbphvx3b2d4xa6n6xqaxks3f0djp0nr-rubcopgen-0.0.1.drv'... ``` If y'all are interested I could try bisecting to figure out which commit had the issue, but for now am good
Owner

great that it works again! bisecting probably won't be necessary, but we'd really like to get to the bottom of the writev error since we think it's related. can you retry building the derivation that reproduced that error to begin with? which derivation was it, do you know?

great that it works again! bisecting probably won't be necessary, but we'd really like to get to the bottom of the writev error since we think it's related. can you retry building the derivation that reproduced that error to begin with? which derivation was it, do you know?

I'm also getting the writev error when building my nix-darwin configuration (although I also get that when using cppnix so I don't know if it's a Lix issue). This is the output it gives me when using the latest commit (2.95.0-pre20260204-dev_ba4f4f9):

trying user '_nixbld1'
killing all processes running under uid '351'
running command: '17' '351'
executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
Generated sandbox profile: (version 1)


(allow default)

; Disallow creating setuid/setgid binaries, since that
; would allow breaking build user isolation.
(deny file-write-setugid)


running command: 
killing process group 66901
killing all processes running under uid '351'
running command: '20' '351'
lock released on '/nix/store/kcfz2wwhf1l36q2fkxjyg0sdhlpdl13p-darwin-system-26.05.0d7874e.lock'
building of '/nix/store/cqvi7ysrcjhysvafkcxn9aiz20ppb9bd-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 83056; iov.size() = 1
I'm also getting the `writev` error when building my nix-darwin configuration (although I also get that when using cppnix so I don't know if it's a Lix issue). This is the output it gives me when using the latest commit (2.95.0-pre20260204-dev_ba4f4f9): ``` trying user '_nixbld1' killing all processes running under uid '351' running command: '17' '351' executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' Generated sandbox profile: (version 1) (allow default) ; Disallow creating setuid/setgid binaries, since that ; would allow breaking build user isolation. (deny file-write-setugid) running command: killing process group 66901 killing all processes running under uid '351' running command: '20' '351' lock released on '/nix/store/kcfz2wwhf1l36q2fkxjyg0sdhlpdl13p-darwin-system-26.05.0d7874e.lock' building of '/nix/store/cqvi7ysrcjhysvafkcxn9aiz20ppb9bd-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 83056; iov.size() = 1 ```
Owner

https://gerrit.lix.systems/c/lix/+/5080 has improved the error messages further. we really wish to get to the bottom of this, because quite frankly we can't imagine why things are breaking like this

https://gerrit.lix.systems/c/lix/+/5080 has improved the error messages further. we really wish to get to the bottom of this, because quite frankly we can't imagine why things are breaking like *this*
Author

can you retry building the derivation that reproduced that error to begin with? which derivation was it, do you know?

So my timeline of events was:

I started on this version (i'll call this version 1) 2e0cc67ec8
I then built and switched to this (I'll call this version 2): f09ed729b5

when switching to version 2 I ended up getting those sandbox error messages when trying to build anything

I then opened this ticket

I built (version 3) from this comment and that git url: git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1

version 3 is what gives me that error: ::writev stuff

I am now back on the main branch at ba4f4f917a
and (for me) have stopped seeing the error ::writev stuff

I will try building and switching to the new commit and see what happens


I may have spoken too soon, I getting this now building the new change with ba4f4f917a5989205443b581917e046b5da2ba12

darwin-option> patching script interpreter paths in /nix/store/94lifj7s31rkipq46894a4z76psr4qf9-darwin-option
system-applications> created 0 symlinks in user environment
system-path> created 569 symlinks in user environment
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1
make: *** [Makefile:9: build] Error 1
> can you retry building the derivation that reproduced that error to begin with? which derivation was it, do you know? So my timeline of events was: I started on this version (i'll call this version 1) https://git.lix.systems/lix-project/lix/commit/2e0cc67ec829754184dcbebff8078726debd13f7 I then built and switched to this (I'll call this version 2): https://git.lix.systems/lix-project/lix/commit/f09ed729b5dcacbbff5e1ae6f85bc93933ecf2f1 when switching to version 2 I ended up getting those sandbox error messages when trying to build anything I then opened this ticket I built (version 3) from [this](https://git.lix.systems/lix-project/lix/issues/1118#issuecomment-17416) comment and that git url: git+https://gerrit.lix.systems/lix?ref=refs/changes/75/5075/1 version 3 is what gives me that `error: ::writev` stuff I am now back on the main branch at https://git.lix.systems/lix-project/lix/commit/ba4f4f917a5989205443b581917e046b5da2ba12 and (for me) have stopped seeing the `error ::writev` stuff I will try building and switching to the new commit and see what happens ---- I may have spoken too soon, I getting this now building the new change with `ba4f4f917a5989205443b581917e046b5da2ba12` ``` darwin-option> patching script interpreter paths in /nix/store/94lifj7s31rkipq46894a4z76psr4qf9-darwin-option system-applications> created 0 symlinks in user environment system-path> created 569 symlinks in user environment error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1 make: *** [Makefile:9: build] Error 1 ```
Owner

@imran-iq can you try with 684aba046a ? We missed the actual error reporting. This time, this should be good.

@imran-iq can you try with 684aba046a2e7f7af28c39c523c20210afd399e7 ? We missed the actual error reporting. This time, this should be good.
Author

using 684aba046a with nix build .#darwinConfigurations.HOST.config.system.build.toplevel -j1 --debug --rebuild

trying user '_nixbld1'
killing all processes running under uid '351'
running command: '16' '351'
executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
Generated sandbox profile: (version 1)


(allow default)

; Disallow creating setuid/setgid binaries, since that
; would allow breaking build user isolation.
(deny file-write-setugid)


running command:
error:
       … while setting up the build environment for /nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv

       error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1
killing process group 86408
checking outputs of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv'...
building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: build done
builder process for '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv' finished
killing all processes running under uid '351'
running command: '17' '351'
lock released on '/nix/store/3sq4zy68y90hhgkx2q31i3icnac4rzz0-darwin-system-26.05.0d7874e.lock'
building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: done
building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed
error: builder for '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv' failed due to signal 9 (Killed: 9)
using https://git.lix.systems/lix-project/lix/commit/684aba046a2e7f7af28c39c523c20210afd399e7 with `nix build .#darwinConfigurations.HOST.config.system.build.toplevel -j1 --debug --rebuild` ``` trying user '_nixbld1' killing all processes running under uid '351' running command: '16' '351' executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' Generated sandbox profile: (version 1) (allow default) ; Disallow creating setuid/setgid binaries, since that ; would allow breaking build user isolation. (deny file-write-setugid) running command: error: … while setting up the build environment for /nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 84680; iov.size() = 1 killing process group 86408 checking outputs of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv'... building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: build done builder process for '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv' finished killing all processes running under uid '351' running command: '17' '351' lock released on '/nix/store/3sq4zy68y90hhgkx2q31i3icnac4rzz0-darwin-system-26.05.0d7874e.lock' building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: done building of '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed error: builder for '/nix/store/a3fk59ibx1xmwaa2hx25rx9llyb6s18v-darwin-system-26.05.0d7874e.drv' failed due to signal 9 (Killed: 9) ```
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5148 ("libexec: unlazify launch-builder capnp message reading")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5148", "number": 5148, "kind": "commit message"}], "cl_meta": {"5148": {"change_title": "libexec: unlazify launch-builder capnp message reading"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5148](https://gerrit.lix.systems/c/lix/+/5148) ("libexec: unlazify launch-builder capnp message reading")

This is still broken for me unfortunately. I updated to the latest commit (2.95.0-pre20260209-dev_95ac829) and using the command nix build .#darwinConfigurations.<hostname>.config.system.build.toplevel -j1 --debug in my system configuration flake still gives me the following output:

trying user '_nixbld1'
killing all processes running under uid '351'
running command: '17' '351'
executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash'
using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh'
Generated sandbox profile: (version 1)


(allow default)

; Disallow creating setuid/setgid binaries, since that
; would allow breaking build user isolation.
(deny file-write-setugid)


running command:
killing process group 59452
killing all processes running under uid '351'
running command: '20' '351'
lock released on '/nix/store/fhgxnpbccns4pq8ya241iapx5x5v0maz-darwin-system-26.05.0d7874e.lock'
building of '/nix/store/8jbmzb2a2vd9vl9dysib2nh2y0ljcjp3-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed
error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 83256; iov.size() = 1
This is still broken for me unfortunately. I updated to the latest commit (2.95.0-pre20260209-dev_95ac829) and using the command `nix build .#darwinConfigurations.<hostname>.config.system.build.toplevel -j1 --debug` in my system configuration flake still gives me the following output: ``` trying user '_nixbld1' killing all processes running under uid '351' running command: '17' '351' executing builder '/nix/store/vlfjhc9730i65q1xhzf51kzh58s9kxnp-bash-5.3p9/bin/bash' using builder args '-e /nix/store/l622p70vy8k5sh7y5wizi5f2mic6ynpg-source-stdenv.sh /nix/store/shkw4qm9qcw5sc5n1k5jznc83ny02r39-default-builder.sh' Generated sandbox profile: (version 1) (allow default) ; Disallow creating setuid/setgid binaries, since that ; would allow breaking build user isolation. (deny file-write-setugid) running command: killing process group 59452 killing all processes running under uid '351' running command: '20' '351' lock released on '/nix/store/fhgxnpbccns4pq8ya241iapx5x5v0maz-darwin-system-26.05.0d7874e.lock' building of '/nix/store/8jbmzb2a2vd9vl9dysib2nh2y0ljcjp3-darwin-system-26.05.0d7874e.drv^out' from .drv file: goal destroyed error: ::writev(fd, iov.begin(), iov.size()): Broken pipe; iovTotal = 83256; iov.size() = 1 ```
pennae reopened this issue 2026-02-09 18:43:22 +00:00
Owner

@toodeluna Can you confirm that the daemon you are using is using the latest Lix version with the patch? (using launchd to examine the paths and verify it's the right one, etc.)

@toodeluna Can you confirm that the daemon you are using is using the latest Lix version with the patch? (using launchd to examine the paths and verify it's the right one, etc.)
Member

specifically: nix-darwin rewrites the launchd service on each rebuild to make sure you're always running the daemon version associated with the whole darwin profile, so if you're not taking steps to run the right daemon yourself, it's likely you'll need to launchctl bootout org.nixos.nix-daemon to stop the previous daemon, and then run the daemon from your up-to-date build tree (e.g. with sudo nix run --daemon in the build tree) and then run darwin-rebuild

specifically: nix-darwin rewrites the launchd service on each rebuild to make sure you're always running the daemon version associated with the whole darwin profile, so if you're not taking steps to run the right daemon yourself, it's likely you'll need to `launchctl bootout org.nixos.nix-daemon` to stop the previous daemon, and then run the daemon from your up-to-date build tree (e.g. with `sudo nix run --daemon` in the build tree) and _then_ run darwin-rebuild

@raito @ktemkin Seems like this was the issue indeed! Had to manually kill the nix-daemon and re-run it since I was unable to rebuild. Didn't work for me with launchctl bootout org.nixos.nix-daemon though so I did ps aux | grep nix-daemon to find the PID of the nix-daemon and then killed that and ran sudo nix daemon after which I was able to rebuild again. Thanks for suggesting this, I would've probably been stuck for a long time otherwise!

@raito @ktemkin Seems like this was the issue indeed! Had to manually kill the nix-daemon and re-run it since I was unable to rebuild. Didn't work for me with `launchctl bootout org.nixos.nix-daemon` though so I did `ps aux | grep nix-daemon` to find the PID of the nix-daemon and then killed that and ran `sudo nix daemon` after which I was able to rebuild again. Thanks for suggesting this, I would've probably been stuck for a long time otherwise!
Member

Closing this as it seems fixed; but feel free to poke if anything else goes wrong. ^^

Closing this as it seems fixed; but feel free to poke if anything else goes wrong. ^^
Sign in to join this conversation.
No milestone
No project
No assignees
7 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#1118
No description provided.