LnL7 / nix-darwin

nix modules for darwin
MIT License
2.76k stars 428 forks source link

Builder for hatch (needed for system-applications, thus for darwin-system-24.05) failure #1005

Open soli opened 2 months ago

soli commented 2 months ago

I recently tried to upgrade to 24.05 on my intel Sonoma mac, but I'm faced with the following error when trying darwin-rebuild switch --flake .

error: builder for '/nix/store/k1ln9m245ccxvkm6yrs7ya2yl76dy44k-hatch-1.9.7.drv' failed with exit code 1;
       last 10 log lines:
       > FAILED tests/cli/python/test_install.py::test_already_installed_update_disabled - shellingham.posix.ps.PsNotAvailable: ps not found
       > FAILED tests/cli/python/test_install.py::test_already_in_path[in_current_path] - shellingham.posix.ps.PsNotAvailable: ps not found
       > FAILED tests/cli/run/test_run.py::test_sync_project_dependencies - AssertionError: assert 'Checking dependencies\n' == 'Checking dep...ependen...
       > FAILED tests/cli/run/test_run.py::test_sync_project_features - AssertionError: assert 'Checking dependencies\n' == 'Checking dep...ependen...
       > FAILED tests/cli/run/test_run.py::test_dependency_hash_checking - AssertionError: assert 'Checking dependencies\n' == 'Checking dep...ependen...
       > FAILED tests/cli/env/test_create.py::test_sync_dependencies - AssertionError: assert 'Creating env...ependencies\n' == 'Creating env...ep...
       > FAILED tests/cli/env/test_create.py::test_features - AssertionError: assert 1 == 2
       > FAILED tests/cli/env/test_create.py::test_sync_dynamic_dependencies - AssertionError: assert 3 == 4
       > =========== 21 failed, 1378 passed, 56 skipped in 761.80s (0:12:41) ============
       > /nix/store/hhd9b62c8lka7z38filvph6zg5ckbsx1-stdenv-darwin/setup: line 1588: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/k1ln9m245ccxvkm6yrs7ya2yl76dy44k-hatch-1.9.7.drv'.
error: 1 dependencies of derivation '/nix/store/gh06nbgz8aq3s3zz0fw8nz20g3nw44aw-system-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/06p8fbyaz05hk41y726gaf01jfgdjsrn-darwin-system-24.05.20240704.835cf2d+darwin4.ec12b88.drv' failed to build

I'm very inexperienced using nix/nix-darwin so I'm not sure how to start debugging this…

Looking at the log generated by the above command yields a huge file, but the first error seems to be: E FileNotFoundError: [Errno 2] No such file or directory: 'ps'

which, to be honest, I don't really understand… (I have the basic Darwin /bin/ps though indeed no ps in /run/current-system/sw/bin for instance…).

Any help would be welcome.

cpossinger commented 2 months ago

I think it's working in unstable you could also install using pip

soli commented 2 months ago

Ok, thanks, I'll try unstable then. For the pip part I'm not sure what you mean… I don't really need/want hatch installed (I actually have it installed in some venv's where I need it) it's just that it seems a requirement to build darwin-system.

soli commented 2 months ago

Well… unstable doesn't seem to solve my issue unfortunately.

error: builder for '/nix/store/5mbmm3gly032nqjpry8py78dck40w84n-hatch-1.12.0.drv' failed with exit code 1;
       last 10 log lines:
       > ERROR tests/cli/python/test_install.py::test_already_installed_update_flag - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_show.py::test_specific_location - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_install.py::test_already_in_path[in_current_path] - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_show.py::test_outdated - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_update.py::test_not_installed - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_update.py::test_basic - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_update.py::test_specific_location - shellingham.posix.ps.PsNotAvailable: ps not found
       > ERROR tests/cli/python/test_update.py::test_all - shellingham.posix.ps.PsNotAvailable: ps not found
       > ====== 62 failed, 1490 passed, 58 skipped, 29 errors in 579.77s (0:09:39) ======
       > /nix/store/x4lrdlck6skb3z9cwaz8mzga781yl90s-stdenv-darwin/setup: line 1650: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/5mbmm3gly032nqjpry8py78dck40w84n-hatch-1.12.0.drv'.
Samasaur1 commented 2 months ago

At least part of this appears to be due to an issue with the Nix sandbox on macOS that was recently fixed. Can you check nix --version and let us know what version you're on?

Also, are you managing your Nix version as part of nix-darwin (i.e., with nix.package) or not?

soli commented 2 months ago
> nix --version
nix (Nix) 2.18.1

No I don't use nix.package, should I?

soli commented 1 month ago

Well, I managed to upgrade to nix 2.18.4 by going back to 23.11 (which builds nicely) and using nix.package, but then it still fails with the same error if I try to update to 24.05…

Samasaur1 commented 1 month ago

sorry, this is beyond me now. looks like it's not a Nix issue, though

soli commented 1 month ago

Thanks for trying, I might try a full desinstall-reinstall and we'll see…

soli commented 1 month ago

Didn't help 😭 same error, same place (hatch testing, ps not found…)