zhaofengli/colmena

--nix-option is not taken into account

datafoo opened this issue · 3 comments

I tried to build a machine with Colmena but I could not because I did not manage to set 'sandbox' to 'relaxed' despite using --nix-option.

In fact --nix-option seems to have no effect at all:

[me@mymachine:~/dev/test-colmena/deployment1]$ colmena --version
Colmena 0.4.0

[me@mymachine:~/dev/test-colmena/deployment1]$ colmena build
warning: Git tree '/home/me/dev/test-colmena' is dirty
[INFO ] Using flake: git+file:///home/me/dev/test-colmena?dir=deployment1
[INFO ] Enumerating nodes...
[INFO ] Selected all 1 nodes.
      ❌ 11s Failed: Child process exited with error code: 1
  tst ✅ 11s Evaluated tst
  tst ❌ 1s Build failed: Child process exited with error code: 1                                                                                                                                                                                                                                                           
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to build tst - Last 20 lines of logs:
[ERROR]   stderr)   /nix/store/qkjgvdmji4j813hl54h615scyzw89brh-unit-zpool-trim.timer.drv
[ERROR]   stderr)   /nix/store/ql2m8kgzsrciw3iyi9v29469xampc1qm-unit-zfs-zed.service.drv
[ERROR]   stderr)   /nix/store/l6fk7vfln2kqya4dfn4vcvhy4bi3n5i2-unit-script-myapplication-pre-start.drv
[ERROR]   stderr)   /nix/store/rh0i641ix6arb13bk9whzhqjpyir2m85-unit-myapplication.service.drv
[ERROR]   stderr)   /nix/store/mnh546x3k4cilz8n7pxd8zb33mg7cjc0-unit-script-post-resume-start.drv
[ERROR]   stderr)   /nix/store/s7z86rcafs1lgk3kd8yrfgj1s1rbj5pj-unit-post-resume.service.drv
[ERROR]   stderr)   /nix/store/cznp3lvcbf4gfrzi273m3j83fwpyxrr4-unit-script-zfs-sync-rpool-start.drv
[ERROR]   stderr)   /nix/store/vvp9gb56di13nila2gvqbp59h36k0w9y-unit-zfs-sync-rpool.service.drv
[ERROR]   stderr)   /nix/store/2dx5kpsc3fmp2awlgsyi48hapcwnzlkz-system-units.drv
[ERROR]   stderr)   /nix/store/d9gi42532cq553qwpz78gxq4d8wm4rf7-unit-dbus.service.drv
[ERROR]   stderr)   /nix/store/r5lkpx5sslgrp3irra0x8bq6k8q0ghy8-user-units.drv
[ERROR]   stderr)   /nix/store/r0vscvqvlmpgvvwy8alrf3j2ypnignrw-etc.drv
[ERROR]   stderr)   /nix/store/0a0v7hjs0lmi2fmb6qkrcsjbzj622ghw-nixos-system-tst-23.05pre-git.drv
[ERROR]   stderr) building '/nix/store/ql2m8kgzsrciw3iyi9v29469xampc1qm-unit-zfs-zed.service.drv'...
[ERROR]   stderr) building '/nix/store/pvrlrl9hr7cvb07amy4nanclkvniyqrp-unit-zfs.target.drv'...
[ERROR]   stderr) building '/nix/store/h3fjdj0k7ybzd128mnz1qb3f8j15scr6-unit-zpool-trim.service.drv'...
[ERROR]   stderr) building '/nix/store/qkjgvdmji4j813hl54h615scyzw89brh-unit-zpool-trim.timer.drv'...
[ERROR]   stderr) building '/nix/store/drbf0ypaq3bz3b1sfwnh96qa5cnj6zx1-X-Restart-Triggers.drv'...
[ERROR]   stderr) error: derivation '/nix/store/3rkv8gqdmqlix58vf8zwsz0sb01lp21s-myapplication-unstable-2023-07-21.drv' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace

[me@mymachine:~/dev/test-colmena/deployment1]$ colmena build --nix-option sandbox relaxed 
warning: Git tree '/home/me/dev/test-colmena' is dirty
[INFO ] Using flake: git+file:///home/me/dev/test-colmena?dir=deployment1
[INFO ] Enumerating nodes...
[INFO ] Selected all 1 nodes.
      ❌ 9s Failed: Child process exited with error code: 1
  tst ✅ 8s Evaluated tst
  tst ❌ 1s Build failed: Child process exited with error code: 1                                                                                                                                                                                                                                                           
[ERROR] Failed to build tst - Last 20 lines of logs:
[ERROR]   stderr)   /nix/store/qkjgvdmji4j813hl54h615scyzw89brh-unit-zpool-trim.timer.drv
[ERROR]   stderr)   /nix/store/ql2m8kgzsrciw3iyi9v29469xampc1qm-unit-zfs-zed.service.drv
[ERROR]   stderr)   /nix/store/l6fk7vfln2kqya4dfn4vcvhy4bi3n5i2-unit-script-myapplication-pre-start.drv
[ERROR]   stderr)   /nix/store/rh0i641ix6arb13bk9whzhqjpyir2m85-unit-myapplication.service.drv
[ERROR]   stderr)   /nix/store/mnh546x3k4cilz8n7pxd8zb33mg7cjc0-unit-script-post-resume-start.drv
[ERROR]   stderr)   /nix/store/s7z86rcafs1lgk3kd8yrfgj1s1rbj5pj-unit-post-resume.service.drv
[ERROR]   stderr)   /nix/store/cznp3lvcbf4gfrzi273m3j83fwpyxrr4-unit-script-zfs-sync-rpool-start.drv
[ERROR]   stderr)   /nix/store/vvp9gb56di13nila2gvqbp59h36k0w9y-unit-zfs-sync-rpool.service.drv
[ERROR]   stderr)   /nix/store/2dx5kpsc3fmp2awlgsyi48hapcwnzlkz-system-units.drv
[ERROR]   stderr)   /nix/store/d9gi42532cq553qwpz78gxq4d8wm4rf7-unit-dbus.service.drv
[ERROR]   stderr)   /nix/store/r5lkpx5sslgrp3irra0x8bq6k8q0ghy8-user-units.drv
[ERROR]   stderr)   /nix/store/r0vscvqvlmpgvvwy8alrf3j2ypnignrw-etc.drv
[ERROR]   stderr)   /nix/store/0a0v7hjs0lmi2fmb6qkrcsjbzj622ghw-nixos-system-tst-23.05pre-git.drv
[ERROR]   stderr) building '/nix/store/ql2m8kgzsrciw3iyi9v29469xampc1qm-unit-zfs-zed.service.drv'...
[ERROR]   stderr) building '/nix/store/pvrlrl9hr7cvb07amy4nanclkvniyqrp-unit-zfs.target.drv'...
[ERROR]   stderr) building '/nix/store/h3fjdj0k7ybzd128mnz1qb3f8j15scr6-unit-zpool-trim.service.drv'...
[ERROR]   stderr) building '/nix/store/qkjgvdmji4j813hl54h615scyzw89brh-unit-zpool-trim.timer.drv'...
[ERROR]   stderr) building '/nix/store/drbf0ypaq3bz3b1sfwnh96qa5cnj6zx1-X-Restart-Triggers.drv'...
[ERROR]   stderr) error: derivation '/nix/store/3rkv8gqdmqlix58vf8zwsz0sb01lp21s-myapplication-unstable-2023-07-21.drv' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Hint: Backtrace available - Use `RUST_BACKTRACE=1` environment variable to display a backtrace

How can I build my machine with Colmena?

Per #126 , could you try the following?

colmena build --verbose -- --option sandbox relaxed

$ colmena build --verbose -- --option sandbox relaxed
error: unexpected argument 'sandbox' found

Usage: colmena build [OPTIONS]

For more information, try '--help'.

I cannot reproduce. My updated colmena test now allows me to run colmena build and colmena build --nix-option sandbox relaxed successfully.

I do not know why I assumed the compilation error was due to the sandbox.