aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-10-29StyleEelco Dolstra
2021-10-29Merge branch 'master' of https://github.com/alekswn/nixEelco Dolstra
2021-10-28Use nix::connect() to connect to the garbage collectorEelco Dolstra
2021-10-28Remove unused variableEelco Dolstra
2021-10-28Merge remote-tracking branch 'origin/master' into non-blocking-gcEelco Dolstra
2021-10-27Remove redundant 'warning:'Eelco Dolstra
2021-10-27build-remote: Implicitly add the 'builtin' system type to all machinesEelco Dolstra
This makes 'nix-env -i --max-jobs 0' work with remote builders.
2021-10-27If max-jobs == 0, do preferLocalBuild on remote buildersEelco Dolstra
2021-10-27daemon: Accept 'repeat' setting from untrusted usersEelco Dolstra
Fixes #5352.
2021-10-27StyleEelco Dolstra
2021-10-26parseExperimentalFeature(): Initialize atomicallyEelco Dolstra
2021-10-26Tweak fetchTree docsEelco Dolstra
2021-10-26Make experimental-features a proper typeregnat
Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it.
2021-10-17fetch: nicer infinite recursion errorsKevin Amado
- This change applies to builtins.fetchurl and builtins.fetchTarball - PoC: `let x = builtins.fetchurl x; in x` - Before: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered ``` - After: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered at /data/github/kamadorueda/nix/test.nix:1:9: 1| let x = builtins.fetchurl x; in x | ^ ``` Mentions: #3505
2021-10-17Add error reporting to machine spec paserAlexey Novikov
Currently machine specification (`/etc/nix/machine`) parser fails with a vague exception if the file had incorrect format. This commit adds verbose exceptions and unit-tests for the parser.
2021-10-17Fix error detection in 'base64Decode()'Alexey Novikov
Fixed a bug in initialization of 'base64DecodeChars' variable. Currently decoder do not fail on invalid Base64 strings. Added test-case to verify the fix. Also have made 'base64DecodeChars' to be computed at compile time. And added a test case to encode/decode string with non-printable charactes.
2021-10-15fetchTree: add pos to EvalState::forceValueKevin Amado
- This way we improve error messages on infinite recursion - Demo: ```nix let x = builtins.fetchTree { type = "git"; inherit x; }; in x ``` - Before: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered ``` - After: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered at /data/github/kamadorueda/nix/test.nix:3:10: 2| type = "git"; 3| inherit x; | ^ 4| }; ``` Mentions: #3505
2021-10-15fetchTree: add pos to EvalState::forceValueKevin Amado
- This way we improve error messages on infinite recursion - Demo: ```nix let x = builtins.fetchTree x; in x ``` - Before: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered ``` - After: ```bash $ nix-instantiate --extra-experimental-features flakes --strict error: infinite recursion encountered at /data/github/kamadorueda/nix/test.nix:1:9: 1| let x = builtins.fetchTree x; | ^ 2| in x ``` Mentions: #3505
2021-10-15Add a test for the non-blocking GCEelco Dolstra
2021-10-15Fix main GC thread exitingEelco Dolstra
2021-10-15Fix crash when a GC client disconnectsEelco Dolstra
The client thread can't just delete its own thread object from connections, it has to detach it.
2021-10-15Memoize queryReferrers()Eelco Dolstra
2021-10-15Merge pull request #5383 from kvtb/patch-7Eelco Dolstra
fix build with gcc11
2021-10-15Merge pull request #5388 from yvt/fix-oahd-pathEelco Dolstra
Add another path where a Rosetta 2 daemon plist file is possibly located
2021-10-14add pos to EvalState::forceValueKevin Amado
- This way we improve error messages on infinite recursion - Demo: ```nix let x = builtins.fetchMercurial x; in x ``` - Before: ```bash $ nix-instantiate --show-trace --strict error: infinite recursion encountered ``` - After: ```bash nix-instantiate --show-trace --strict error: infinite recursion encountered at /data/github/kamadorueda/test/default.nix:2:7: 1| let 2| x = builtins.fetchMercurial x; | ^ 3| in ``` Mentions: #3505
2021-10-15Add another path where a Rosetta 2 configuration file is possibly locatedyvt
2021-10-14Speed up GC by marking entire closures as liveEelco Dolstra
2021-10-14Remove GCStateEelco Dolstra
2021-10-14Move deleteFromStore()Eelco Dolstra
2021-10-14pathInfoCache: Use the entire base name as the cache keyEelco Dolstra
This fixes a bug in the garbage collector where if a path /nix/store/abcd-foo is valid, but we do a isValidPath("/nix/store/abcd-foo.lock") first, then a negative entry for /nix/store/abcd is added to pathInfoCache, so /nix/store/abcd-foo is subsequently considered invalid and deleted.
2021-10-14Make the canReachRoots() traversal non-recursiveEelco Dolstra
2021-10-14CleanupEelco Dolstra
2021-10-13fix build with gcc11kvtb
2021-10-13Fix GC when there are cycles in the referrers graphEelco Dolstra
(where "referrers" includes the reverse of derivation outputs and derivers). Now we do a full traversal to look if we can reach any root. If not, all paths reached can be deleted.
2021-10-13SimplifyEelco Dolstra
2021-10-13strcpy -> memcpyEelco Dolstra
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2021-10-13Use a thread per connectionEelco Dolstra
2021-10-13Fix auto-gcEelco Dolstra
2021-10-13Non-blocking garbage collectorEelco Dolstra
The garbage collector no longer blocks other processes from adding/building store paths or adding GC roots. To prevent the collector from deleting store paths just added by another process, processes need to connect to the garbage collector via a Unix domain socket to register new temporary roots.
2021-10-13Remove syncWithGC()Eelco Dolstra
2021-10-13Remove trash directoryEelco Dolstra
2021-10-13Merge pull request #5362 from Artturin/nixunpackEelco Dolstra
nix develop: add --unpack
2021-10-13Style tweaksEelco Dolstra
2021-10-13Merge branch 'feature/comp-level' of https://github.com/tomberek/nixEelco Dolstra
2021-10-12Merge pull request #5375 from edolstra/repl-ctrl-cEelco Dolstra
nix repl: Fix plugin-files warning
2021-10-12CleanupEelco Dolstra
2021-10-12Merge branch 'nix-repl-download-interruption' of https://github.com/Ma27/nixEelco Dolstra
2021-10-12nix repl: Don't write to std::cout directlyEelco Dolstra
Writing to std::cout doesn't play nice with ProgressBar.
2021-10-12nix repl: Don't build in a child processEelco Dolstra
Fixes #5356. This is a bit risky due to interrupts, but we have to deal with those anyway (#5353).
2021-10-12Add compression level for NARsTom Bereknyei
Based off on @dtzWill's #2276