cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.56k stars 259 forks source link

poetry2nix failure with "failed with without exit code" non-descriptive error #1184

Open vetsin opened 2 weeks ago

vetsin commented 2 weeks ago

Describe the bug In some cases when using a poetry2nix flake we get the error failed with without exit code

To reproduce

Using https://github.com/vetsin/devenv-poetry-bug

Note that running devenv test in the passes folder passes, while devenv test in the fails folder fails. (See README.md for full log)

$ devenv -v test
• Overriding .devenv to .devenv.A7h8VeYG0nnR
• Building tests ...
• Using Cachix: devenv
• Running command: nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --keep-going --max-jobs 6 build .#devenv.test --no-link --print-out-paths --option extra-substituters https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
evaluating derivation 'path:/Users/vetsin/projects/devenv-poetry/fails#devenv.test'
✖ Command produced the following output:

✔ Building tests in 28.8s.
Error:   × Command `/nix/store/8csgh07r3jivsb0qg9jxv4fzv90r7bmn-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-
  │ features flakes --option warn-dirty false --option eval-cache false --keep-going --max-jobs 6 build .#devenv.test --no-link --print-out-paths --option
  │ extra-substituters https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=` failed
  │ with without exit code

The only material difference is:

diff --color -r passes/example/flake.nix fails/example/flake.nix
22c22
<           myapp = mkPoetryApplication { projectDir = self; };
---
>           myapp = mkPoetryApplication { projectDir = ./.; };

Which is seemingly one problem. The other problem is that there's no error message i can seemingly ferret out of devenv. I can go into both passes/example and fails/example and do a nix build just fine.

Version

devenv 1.0.5 (aarch64-darwin)

sandydoo commented 1 week ago

It's throwing terminated by signal SIGBUS (Misaligned address error). 🤷

devenv-poetry-bug on  main [!+]
➜ /nix/store/3m507qgy4fc6ap04pfwgpxf3cmra2wsk-nix-devenv-2.21.0pre20240412_b24a931/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --keep-going --max-jobs 5 print-dev-env --profile /Users/sander/code/scratch/de-1184/devenv-poetry-bug/.devenv/gc/shell --option extra-substituters https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
evaluating derivation 'git+file:///Users/sander/code/scratch/de-1184/devenv-poetry-bug#devShells.aarch64-darwin.default'fish: Job 1, '/nix/store/3m507qgy4fc6ap04pfwg…' terminated by signal SIGBUS (Misaligned address error)
sandydoo commented 1 week ago

Bumped the nix used by devenv and the shell now builds. Exact cause unclear, but this looks suspicious: https://github.com/domenkozar/nix/commit/fca6ddf106768416487d21ef892a9f8f73ae95dc