remote-store=
store URI option does not act on build-dir
#876
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#876
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
This is more a surprise than an actual bug report. The Lix core team who mitigated the issue intended to make this a system setting and not a store setting.
In situations where you are using
remote-store=
to separate stores when remote building, you may find yourself writing to/nix/var/nix/builds
and you may get new EPERM errors because you do not have such permissions to create directories and builds there.Indeed,
remote-store
is notbuild-dir
and there's noremote-build-dir
option. This could be seen as an oversight or intended. This issue serves as discussion for this topic.Steps To Workaround
Set
NIX_STATE_DIR=
in the environment ofnix-daemon --stdio
.Multiple ways exist to perform this: PAM session variables, SSH
ForceCommand
, etc.Expected behavior
A clear answer to "should
build-dir
be a store option?"nix --version
outputAffecting Lix 2.91.2, 2.92.2, Lix 2.93.1 and HEAD.
Additional context
Came up in a Hydra deployment.
I'd argue that the responsibility here lies with the chroot store implementation, and
remote-store
itself is mostly irrelevant. Won't you have the same problem if you try tonix-build '<nixpkgs>' -A hello --store /mnt
without the SSH stuff being involved? I think that should work as before, but it sounds like it won't currently.@lheckemann wrote in #876 (comment):
It should, no? Your command goes via the daemon which has permissions to write in
/nix/var/nix/builds
.The problem arise when you do
NIX_REMOTE=local nix-build '<nixpkgs>' -A hello --store /mnt
.No,
--store /mnt
is equivalent to--store local?root=/mnt
(not 100% sure on the name of theroot=
parameter) -- it has nothing to do with the daemon anymore.(sorry for double-posting)
--store
is the same setting asNIX_REMOTE
Can confirm that the security fix breaks building in chroot stores with no SSH involvement:
chroot stores should presumably use their own prefix, or (if possible, not sure about this) perform the chroot early enough that
/nix
is already the store that's being built in when setting up the build dir.In any case, I'm strongly of the opinion that this shouldn't require any extra steps when invoking the build.
OK, this is serious and we will probably need to release new minors.
In the meantime, we probably need to be very forthcoming about workarounds to survive.
if we're going to have a built-in workaround that moves build dirs for chroot store it should probably happen somewhere around here
This issue was mentioned on Gerrit on the following CLs:
buildDir
aLocalStore
config")