Open philipp-baumann opened 3 weeks ago
Where and why is the official nix installer setting the host name?
The error stack in your output is from Nix itself, so I'm fairly sure the answer is that the installer itself isn't directly doing this.
It looks like the error comes from here: https://github.com/NixOS/nix/blob/dfd0033afbbb12e6578ab3f1f026d15ff9dec132/src/libstore/unix/build/local-derivation-goal.cc#L1840-L1843
Where and why is the official nix installer setting the host name?
The error stack in your output is from Nix itself, so I'm fairly sure the answer is that the installer itself isn't directly doing this.
It looks like the error comes from here:
Thanks a lot for this hint. When I omit the nix-shell
runtime command, It still fails with the same message. I tested again on macOS in the same default.nix
nix-shell
(but with vfkit and podman), there it installs and i can build my derivations in default.nix
in the container. On WSL2 Ubuntu 22.04, virtualized on Win10, and with podman and qemu combo, it fails.
If it would be nix-daemon
launched as openRC service complaining, it would not be the installer message, or I am missing something obvious or very internal?:
"installing 'nix-2.24.10'
error:
… while setting up the build environment
error: cannot set host name: Operation not permitted
---- oh no! --------------------------------------------------------------------
Oh no, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.
:(
We'd love to help if you need it.
You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md
Or get in touch with the community: https://nixos.org/community
Error: building at STEP "RUN sh <(curl -L https://nixos.org/nix/install) --daemon --yes": while running runtime: exit status 1"
For some more context and a repo with reproducible example, https://github.com/rstats-on-nix/r-minimal-alpine
Platform
Additional information
While trying to build a minimal alpine container with multiuser and nix-daemon setup via podman, the official installer fails when I try to build this image on WSL2 Ubuntu via QEMU, but not on aarch64-darwin via vfkit, where it perfectly builds until the installer step (only nix-shell currently doesn't run because of permissions issue, but that is not relevant here).
I have this
nix-shell
env:Part of this build script.
build_container.sh
This is the image I'm trying to build:
entrypoint.sh
nix-daemon.sh
Output
Output
```log installing 'nix-2.24.10' error: … while setting up the build environment error: cannot set host name: Operation not permitted ```Linux HYBDk5ilQDH1in3 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux Windows 10 Enterprise Version 10.0.19045 Build 19045
Guesses
Priorities
Add :+1: to issues you find important.