Comments (8)
cf182a8 is known to be bad. But on latest commit, nix
is already listed as a build input.
Line 27 in 3fa46cc
Could you paste the build log on latest commit?
Also you can also try running manually this command, which is used to get all Nix builtins.
nix eval --experimental-features nix-command --store dummy:// --json --expr 'builtins.attrNames builtins'
from nil.
I checked again, and newer versions do have indeed a different error message, and I have to admit, I haven't looked carefully. I actually thought I were pasting the error message that I now attach here:
nil-unstable> Compiling builtin v0.0.0 (/private/tmp/nix-build-nil-unstable-2022-11-14.drv-0/source/crates/builtin)
nil-unstable> error: failed to run custom build command for `builtin v0.0.0 (/private/tmp/nix-build-nil-unstable-2022-11-14.drv-0/source/crates/builtin)`
nil-unstable> Caused by:
nil-unstable> process didn't exit successfully: `/private/tmp/nix-build-nil-unstable-2022-11-14.drv-0/source/target/release/build/builtin-85c15f4d0ed9324b/build-script-build` (exit status: 101)
nil-unstable> --- stdout
nil-unstable> cargo:rerun-if-changed=build.rs
nil-unstable> --- stderr
nil-unstable> thread 'main' panicked at 'Failed to get builtins. Is `nix` accessible?: "Command \"nix\" \"eval\" \"--experimental-features\" \"nix-command\" \"--store\" \"dummy://\" \"--json\" \"--expr\" \"builtins.attrNames builtins\" failed: Output { status: ExitStatus(unix_wait_status(6)), stdout: \"\", stderr: \"libc++abi: terminating with uncaught exception of type nix::SysError: \\u{1b}[31;1merror:\\u{1b}[0m getting status of \\u{1b}[35;1m/nix/var/nix/profiles/per-user/root/channels/nixpkgs\\u{1b}[0m: \\u{1b}[35;1mOperation not permitted\\u{1b}[0m\\n\" }"', crates/builtin/build.rs:23:10
nil-unstable> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
nil-unstable> warning: build failed, waiting for other jobs to finish...
The error is the same independently of enabling or disabling the sandbox.
The commit I used for build right now was 3fa46cc. Which seems to be HEAD
after a git pull origin
.
The command you gave me ran directly gives this:
$ nix eval --experimental-features nix-command --store dummy:// --json --expr 'builtins.attrNames builtins'
["abort","add","addErrorContext","all","any","appendContext","attrNames","attrValues","baseNameOf","bitAnd","bitOr","bitXor","break","builtins","catAttrs","ceil","compareVersions","concatLists","concatMap","concatStringsSep","deepSeq","derivation","derivationStrict","dirOf","div","elem","elemAt","false","fetchGit","fetchMercurial","fetchTarball","fetchTree","fetchurl","filter","filterSource","findFile","floor","foldl'","fromJSON","fromTOML","functionArgs","genList","genericClosure","getAttr","getContext","getEnv","groupBy","hasAttr","hasContext","hashFile","hashString","head","import","intersectAttrs","isAttrs","isBool","isFloat","isFunction","isInt","isList","isNull","isPath","isString","langVersion","length","lessThan","listToAttrs","map","mapAttrs","match","mul","nixPath","nixVersion","null","parseDrvName","partition","path","pathExists","placeholder","readDir","readFile","removeAttrs","replaceStrings","scopedImport","seq","sort","split","splitVersion","storeDir","storePath","stringLength","sub","substring","tail","throw","toFile","toJSON","toPath","toString","toXML","trace","traceVerbose","true","tryEval","typeOf","unsafeDiscardOutputDependency","unsafeDiscardStringContext","unsafeGetAttrPos","zipAttrsWith"]
from nil.
Having read the error with more detail now, it seems as if my first analyzis has been plain wrong.
It is not that nix wasn't found, it seems as if there is a permission error accessing channels outside of the build.
The error is the same, regardless of building with or without a sandbox.
Using --option extra-sandbox-paths /nix/var/nix/profiles/per-user/root/channels/nixpkgs
doesn't seem to help either.
Adding or removing channels to make that folder (dis)appear in an act of desperation didn't change anything.
from nil.
nil-unstable> thread 'main' panicked at 'Failed to get builtins. Is `nix` accessible?: "Command \"nix\" \"eval\" \"--experimental-features\" \"nix-command\" \"--store\" \"dummy://\" \"--json\" \"--expr\" \"builtins.attrNames builtins\" failed: Output { status: ExitStatus(unix_wait_status(6)), stdout: \"\", stderr: \"libc++abi: terminating with uncaught exception of type nix::SysError: \\u{1b}[31;1merror:\\u{1b}[0m getting status of \\u{1b}[35;1m/nix/var/nix/profiles/per-user/root/channels/nixpkgs\\u{1b}[0m: \\u{1b}[35;1mOperation not permitted\\u{1b}[0m\\n\" }"', crates/builtin/build.rs:23:10
The error is the same independently of enabling or disabling the sandbox.
The command you gave me ran directly gives this:
$ nix eval --experimental-features nix-command --store dummy:// --json --expr 'builtins.attrNames builtins' ["abort","add","addErrorContext","all","any",...
🤔 This is strange. They are the same command and are not supposed to read any filesystem path.
For my NixOS on x86_64-linux, I can run that command in an empty bwrap
sandbox with no /var
.
$ nix run nixpkgs#bubblewrap -- --ro-bind /nix /nix --ro-bind /run /run --dev /dev --proc /proc -- nix eval --experimental-features nix-command --store dummy:// --json --expr 'builtins.attrNames builtins'
Do you have any related changes in /etc/nix/nix.conf
or any overlays in ~/.config/nix/
?
from nil.
I do not have any problems on my x86_64-linux either, its just the aarch64-darwin that is affected.
I am not aware of any overlays, nor would I expect them to be picked up at all as I am running the flake build. Anyway, I will doublecheck again tomorrow when I have access again to the workstation.
from nil.
There is no folder in ~/.config
whichs name would contain nix
. So there is also no overlay. I will try to extend this discussion into the matrix space later today.
I get the feeling that this is not related to nil
but instead my nix
installation is broken. In the meantime I will use nil
from nixpkgs
on the darwin host.
Also, as other members of the community have not been able to reproduce my problem I will close this issue. I consider it proven that it is something in my installation, nothing with nil.
from nil.
Just FYI if someone will come to this issue in the future: pretty sure that I broke my Nix installation in a same way by doing sudo nix-channel --update
instead of sudo -i nix-channel --update
. Nix reinstall did fix my problem.
from nil.
I do not use channels, though thanks for the tip, I will check if there are some stray channels from installation.
I will also try to re-install nix again, though it feels as if that actually introduced the problem for me.
from nil.
Related Issues (20)
- Setting formatter via initializationOptions doesn't work HOT 4
- Option-completion in inlined modules? HOT 1
- Option-completion with `mk*`-functions in NixOS modules? HOT 2
- type of attrset from function application in let-binding is not propagated to usage in the let body HOT 1
- thread 'main' panicked ... vfs.rs:194:30 HOT 1
- When an attribute is reused (nested syntax), the header line breadcrumb path is only correct for the first occurrence HOT 1
- nil vs nixd HOT 1
- toolchain requires `1.70` HOT 1
- Always fails to fetch non-flake file inputs HOT 1
- Merging recursive and non-recursive attrsets panics
- "I" being capitalised in the README HOT 2
- Do you use HM type inference? HOT 1
- Completion in Doom Emacs doesn't work HOT 2
- Typo in the "about" section HOT 1
- `nix profile install --override-inputs` fails with "Git changes are not committed" HOT 1
- Manix Support HOT 1
- Nil not updating UI or stuck on loading HOT 1
- Fail silently (or silenter) HOT 3
- Formatting (with alejandra) not working anymore HOT 1
- Diagnostics for multiple files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nil.