Installation fails with nix-env ('__noChroot' set, but that's not allowed when 'sandbox' is 'true')
Pacomito opened this issue · 7 comments
Hello Gregory,
Thank you for this very nice package.
I encounter this error when trying to install TooManyCells from nix:
nix-env -f default.nix -i too-many-cells
...
error: derivation '/nix/store/jizcclxhhmqaxm9cy1wcmmy5nz1h0mwp-homer-4.11.drv' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'
I managed to pass this error by changing the deps/homer.nix file line 21 by setting noChroot to false: __noChroot = false;
So then the homer installation is fine but the first test of the installation fails. I don't know if it is linked to the modification above.
[1 of 1] Compiling Main ( tests/test-qq.hs, dist/build/test-qq/test-qq-tmp/Main.o, dist/build/test-qq/test-qq-tmp/Main.dyn_o )
Linking dist/build/test-qq/test-qq ...
Preprocessing test suite 'tests' for inline-r-0.10.4..
Building test suite 'tests' for inline-r-0.10.4..
[1 of 8] Compiling Test.Constraints ( tests/Test/Constraints.hs, dist/build/tests/tests-tmp/Test/Constraints.o, dist/build/tests/tests-tmp/Test/Constraints.dyn_o )
[2 of 8] Compiling Test.Event ( tests/Test/Event.hs, dist/build/tests/tests-tmp/Test/Event.o, dist/build/tests/tests-tmp/Test/Event.dyn_o )
[3 of 8] Compiling Test.FunPtr ( tests/Test/FunPtr.hs, dist/build/tests/tests-tmp/Test/FunPtr.o, dist/build/tests/tests-tmp/Test/FunPtr.dyn_o )
[4 of 8] Compiling Test.GC ( tests/Test/GC.hs, dist/build/tests/tests-tmp/Test/GC.o, dist/build/tests/tests-tmp/Test/GC.dyn_o )
[5 of 8] Compiling Test.Matcher ( tests/Test/Matcher.hs, dist/build/tests/tests-tmp/Test/Matcher.o, dist/build/tests/tests-tmp/Test/Matcher.dyn_o )
[6 of 8] Compiling Test.Regions ( tests/Test/Regions.hs, dist/build/tests/tests-tmp/Test/Regions.o, dist/build/tests/tests-tmp/Test/Regions.dyn_o )
[7 of 8] Compiling Test.Vector ( tests/Test/Vector.hs, dist/build/tests/tests-tmp/Test/Vector.o, dist/build/tests/tests-tmp/Test/Vector.dyn_o )
[8 of 8] Compiling Main ( tests/tests.hs, dist/build/tests/tests-tmp/Main.o, dist/build/tests/tests-tmp/Main.dyn_o )
Linking dist/build/tests/tests ...
Preprocessing test suite 'test-shootout' for inline-r-0.10.4..
Building test suite 'test-shootout' for inline-r-0.10.4..
[1 of 2] Compiling Test.Scripts ( tests/Test/Scripts.hs, dist/build/test-shootout/test-shootout-tmp/Test/Scripts.o, dist/build/test-shootout/test-shootout-tmp/Test/Scripts.dyn_o )
[2 of 2] Compiling Main ( tests/test-shootout.hs, dist/build/test-shootout/test-shootout-tmp/Main.o, dist/build/test-shootout/test-shootout-tmp/Main.dyn_o )
Linking dist/build/test-shootout/test-shootout ...
running tests
Running 3 test suites...
Test suite test-qq: RUNNING...
Test suite test-qq: FAIL
Test suite logged to: dist/test/inline-r-0.10.4-test-qq.log
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to: dist/test/inline-r-0.10.4-tests.log
Test suite test-shootout: RUNNING...
Test suite test-shootout: PASS
Test suite logged to: dist/test/inline-r-0.10.4-test-shootout.log
2 of 3 test suites (2 of 3 test cases) passed.
error: builder for '/nix/store/x2wcyjx5hwfn2b28qmbrb6qfr410yy97-inline-r-0.10.4.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/m4i3lm899cid0m9jqqs0bhd2vsirsag9-too-many-cells-3.0.1.0.drv' failed to build
Thanks in advance,
Pacôme
Thank you for your interest and kind words!
Unfortunately, homer
requires an impure network access to install which is contrary to the reproducible nature of nix, so it does not allow the program to be installed unless sandboxing is turned off. You can do that for this install only or for all nix installations. Or you can remove homer
as a dependency in the default.nix
file or just have it probably not install everything as you have changed (this would only affect too-many-peaks
if you use homer
instead of meme
.
However, I am more concerned about the next error you found. What is your OS?
Also, if they are linked, try removing homer
from default.nix
and see if that changes anything.
Thank you for your prompt reply.
I am on Ubuntu 20.04.4 LTS (11th Gen Intel® Core™ i9-11950H @ 2.60GHz × 16 ) with nix (Nix) 2.11.1.
I erased homer from the default.nix and re-ran the installation, but got the same error in the first test of the test-qq suite.
Unfortunately I am not able to access the logs of the path "dist/test/inline-r-0.10.4-test-qq.log"
Cheers,
Pacôme
Uh oh, this is one of those cases where it works for me so I cannot reproduce the issue. You might be able to find the error log in your /nix/store/*-inline-r-0.10.4/dist/test
folder.
Could you run nix-shell
in the directory, then try cabal build
and send me everything that is outputted?
Hello Gregory,
Amazingly, running nix-shell
built the derivations and passed the test-qq unlike before !
Then I ran cabal build
which worked and finally I opened a new terminal to run nix-env -f default.nix -i too-many-cells
and TooManyCells is installed and works fine !
I have no idea why, but thank you,
Pacôme
That is weird. It is unrelated to nix-shell
and cabal build
, I just wanted to see what the error would be. Maybe something about the system changed, maybe it lost internet connection while building or something along those lines? Either way, glad to hear it!