Age | Commit message (Collapse) | Author |
|
Minor maintenance cleaning
|
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
nix-shell --pure: Let it work for any derivation
|
|
Fix potential race-condition in reference scanning code
|
|
libstore: use set instead of list for waiter list
|
|
This replaces the O(n) search complexity in our insert code with a
lookup of O(log n). It also makes removing waitees easier as we can use
the extract method provided by the set class.
|
|
Previously the code ensures that the isBase32 array would only be
initialised once in a single-threaded context. If two threads happen to
call the function before the initialisation was completed both of them
would have completed the initialization step. This allowed for a
race-condition where one thread might be done with the initialization
but the other thread sets all the fields to false again. For a brief
moment the base32 detection would then produce false-negatives.
|
|
flake-registry should be safe to set to an aribtrary value, since it
is identical to just setting `inputs`.
|
|
`nix-shell --pure` when applied to a non stdenv derivation doesn't seem
to clear the PATH. It expects the stdenv/setup file to do so.
This adds an explicit `unset PATH` by nix-build.cc (nix-shell) itself so
that it's not reliant on stdenv/setup anymore.
This does not break impure nix-shell since the PATH is persisted as the
variable `p` prior in the bash rcfile
fixes #5092
|
|
libutil: initialize the base64 decode array only once
|
|
|
|
|
|
Previously, despite having a boolean that tracked initialization, the
decode characters have been "calculated" every single time a base64
string was being decoded.
With this change we only initialize the decode array once in a
thread-safe manner.
|
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
Enable pthreads for new libraries
|
|
Fixes #5024.
|
|
--eval-store and faster closure copying
|
|
|
|
Fix --no-gc-warning
|
|
libutil: use uniform initialization in _deletePath
|
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
Avoid global counters
|
|
|
|
This adds a new store operation 'addMultipleToStore' that reads a
number of NARs and ValidPathInfos from a Source, allowing any number
of store paths to be copied in a single call. This is much faster on
high-latency links when copying a lot of small files, like .drv
closures.
For example, on a connection with an 50 ms delay:
Before:
$ nix copy --to 'unix:///tmp/proxy-socket?root=/tmp/dest-chroot' \
/nix/store/90jjw94xiyg5drj70whm9yll6xjj0ca9-hello-2.10.drv \
--derivation --no-check-sigs
real 0m57.868s
user 0m0.103s
sys 0m0.056s
After:
real 0m0.690s
user 0m0.017s
sys 0m0.011s
|
|
Broken by 8e758d402ba1045c7b8273f8cb1d6d8d917ca52b
|
|
Otherwise I get a compiler error when building for NetBSD:
src/libutil/util.cc: In function 'void nix::_deletePath(const Path&, uint64_t&)':
src/libutil/util.cc:438:17: error: base operand of '->' is not a pointer
438 | AutoCloseFD dirfd(open(dir.c_str(), O_RDONLY));
| ^~~~~
src/libutil/util.cc:439:10: error: 'dirfd' was not declared in this scope
439 | if (!dirfd) {
| ^~~~~
src/libutil/util.cc:444:17: error: 'dirfd' was not declared in this scope
444 | _deletePath(dirfd.get(), path, bytesFreed);
| ^~~~~
|
|
Otherwise the lack of pthread causes linking to fail for NetBSD.
|
|
|
|
|
|
|
|
With this, we don't have to copy the entire .drv closure to the
destination store ahead of time (or at all). Instead, buildPaths()
reads .drv files from the eval store and copies inputSrcs to the
destination store if it needs to build a derivation.
Issue #5025.
|
|
|
|
In particular, this now works:
$ nix path-info --eval-store auto --store https://cache.nixos.org nixpkgs#hello
Previously this would fail as it would try to upload the hello .drv to
cache.nixos.org. Now the .drv is instantiated in the local store, and
then we check for the existence of the outputs in cache.nixos.org.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If a store doesn't support GC, then we don't need to warn about the
inability to create roots.
|
|
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
|
|
|
|
|
|
Also remove an erroneous comment.
|
|
|
|
Make sure that we can’t build the same derivation twice at the same
time.
Fix https://github.com/NixOS/nix/issues/5029
|
|
It supports functions as well. Also change `package` to
`derivation` because it operates at the language level and does
not open the derivation (which would be useful but not nearly
as much).
|
|
It does not operate on a derivation and does not return a
derivation path. Instead it works at the language level,
where a distinct term "package" is more appropriate to
distinguish the parent object of `meta.position`; an
attribute which doesn't even make it into the derivation.
|
|
`:lf ref` does essentially the same thing as
`:a (builtins.getFlake "ref")` (but cannonicalising `ref` if needs be,
so that `:lf .` works)
Fix #3803
|
|
Forward the whole Nix config to the repl subprocesses
|