Commit graph

10848 commits

Author SHA1 Message Date
Michael Fellinger 5c99ec374c
fix git init race condition 2021-08-02 13:47:59 +02:00
Eelco Dolstra 94ec9e4703
Merge pull request #5077 from ldesgoui/nix-shell-args
nix-shell -p: pass `--arg`s as nixpkgs parameters
2021-08-01 21:57:14 +02:00
ldesgoui 6eeb6f9c84 nix-shell -p: pass --arg values as nixpkgs params 2021-07-31 17:25:10 +02:00
Andreas Rammhold b9c9c25766
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.
2021-07-30 21:07:32 +02:00
Pamplemousse d64cb33e90 Remove unused struct in libstore
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-07-30 10:34:28 -07:00
Eelco Dolstra 2b67cb7b8c
Merge pull request #5072 from NixOS/ca/queryRealisation-perl
Expose a perl method to query a derivation
2021-07-30 16:14:03 +02:00
regnat c15e121e32 Expose a perl method to query a derivation
Just doing a very stupid thing taking as argument a serialised drv
output and returning a serialised realisation.

This is needed for `nix-serve` to handle ca derivations
2021-07-30 11:55:14 +02:00
regnat d9ba3385a9 Don’t send the experimental-features to the daemon
The experimental features are, well, experimental, and shouldn’t be
carelessly and transparently enabled.
Besides, some (`ca-derivations` at least) need to be enabled at startup
in order to work properly.
So it’s better to just require that daemon be started with the right
`experimental-features` option.

Fix #5017
2021-07-30 10:34:50 +02:00
Viktor Kronvall 7cdaae6b9c Support SCP-like URLs in builtins.fetchGit attrs
This extends https://github.com/NixOS/nix/pull/4978 with
supporting the SCP-like urls in expressions like

```nix
builtins.fetchGit {
  url = "git@github.com:NixOS/nix.git";
  ref = "master";
}
```
2021-07-30 08:17:46 +09:00
Eelco Dolstra 48e35585a6
upload-release.pl: Fix deprecated 'nix' calls 2021-07-28 22:58:25 +02:00
Eelco Dolstra c5ade241f0 Merge remote-tracking branch 'origin/test-daemon-everywhere' 2021-07-28 21:57:50 +02:00
Eelco Dolstra 7816ef6c51
Merge pull request #5042 from alyssais/pthread
Enable pthreads for new libraries
2021-07-28 12:31:01 +02:00
Eelco Dolstra 64a07d3d18
Merge pull request #5057 from edolstra/nix-develop-chroot
nix develop: Support chroot stores
2021-07-28 12:30:38 +02:00
Pamplemousse 686ee74f09 Remove unecessary stuff in .gitignore
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-07-27 16:53:45 -07:00
regnat c2c0dba792 Remove the right socket before starting the daemon
For some reason, an old socket occasionally stays here on OSX, causing
the subsequent tests to fail
2021-07-27 17:06:11 +02:00
regnat addacfce4a Allow running all the tests with the daemon
When `NIX_DAEMON_PACKAGE` is set, make all the tests use the Nix daemon.
That way we can test every piece of Nix functionality both with and
without the daemon.

Tests for which using the daemon isn’t possible or doesn’t make sens can
selectively be disabled with `needLocalStore`
2021-07-27 17:06:11 +02:00
Eelco Dolstra 706777a4a8
Merge pull request #5055 from NixOS/fix-manpages-install
Fix the generation of nix3 manpages
2021-07-27 14:53:16 +02:00
regnat 441be5d59a Remove dead code in doc’s local.mk 2021-07-27 14:37:55 +02:00
Eelco Dolstra ed5ad59dc1 nix develop: Support chroot stores
Fixes #5024.
2021-07-27 14:24:03 +02:00
regnat cd6e9eb024 Fix the generation of nix3 manpages
- Separate the generation of the manpages from their installation
- Make sure that `make` generates the manpages
- Make sure that `make install` installs them

Fix #5051
2021-07-27 13:47:53 +02:00
Eelco Dolstra c000cec27f
Merge pull request #5048 from tweag/flox-eval-store
--eval-store and faster closure copying
2021-07-27 12:20:32 +02:00
Eelco Dolstra 29e4913f79 Add --eval-store test 2021-07-27 11:17:56 +02:00
Eelco Dolstra 47002108d1 nix-instantiate: Fix --eval-store 2021-07-27 11:16:47 +02:00
Eelco Dolstra f52fa47e16
Merge pull request #5046 from ncfavier/patch-1
Fix --no-gc-warning
2021-07-27 09:55:25 +02:00
Eelco Dolstra 9deeab6337
Merge pull request #5043 from alyssais/vexing
libutil: use uniform initialization in _deletePath
2021-07-27 09:54:24 +02:00
Eelco Dolstra da9b2cd74e
Merge pull request #5049 from Pamplemousse/less_globals
libexpr: Remove unused code
2021-07-27 09:53:12 +02:00
Pamplemousse c2d7c0cdb9 libexpr: Remove unused code
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-07-26 09:14:34 -07:00
Eelco Dolstra da55210403
Merge pull request #5037 from Pamplemousse/less_globals
Avoid global counters
2021-07-26 14:29:03 +02:00
Eelco Dolstra 72c5bac39d Revert no longer necessary change 2021-07-26 13:50:18 +02:00
Eelco Dolstra fe1f34fa60 Low-latency closure copy
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
2021-07-26 13:31:09 +02:00
Naïm Favier cefa8b673f
Fix --no-gc-warning
Broken by 8e758d402b
2021-07-25 16:06:55 +02:00
Alyssa Ross 369ed71858
libutil: use uniform initialization in _deletePath
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);
      |                 ^~~~~
2021-07-24 09:19:48 +00:00
Alyssa Ross ae0c026fe9
Enable pthreads for new libraries
Otherwise the lack of pthread causes linking to fail for NetBSD.
2021-07-24 09:15:01 +00:00
Domen Kožar 97be92569c
Merge pull request #5040 from SuperSandro2000/patch-1
installer: fix --no-modify-profile help text
2021-07-23 20:40:45 +02:00
Domen Kožar 7cd330bc46
Merge pull request #5041 from SuperSandro2000/patch-2
installer: update global nix.conf location
2021-07-23 20:40:03 +02:00
Sandro 5c4cc5e0d6
installer: update global nix.conf location 2021-07-23 19:56:30 +02:00
Sandro 142c966691
installer: fix --no-modify-profile help text 2021-07-23 19:51:37 +02:00
Eelco Dolstra 9957315ce0 RemoteStore::buildPaths(): Handle evalStore 2021-07-22 22:50:48 +02:00
Eelco Dolstra a7b7fcfb16 Remove redundant RealisedPath::closure() call 2021-07-22 22:43:18 +02:00
Eelco Dolstra 96c62fb66c Fix formatting error in 'nix store' manpage 2021-07-22 10:11:04 +02:00
Eelco Dolstra eb6db4fd38 buildPaths(): Add an evalStore argument
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.
2021-07-22 09:59:51 +02:00
Eelco Dolstra 668abd3e57 copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
Eelco Dolstra 8d9f7048cd Use eval-store in more places
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.
2021-07-22 09:59:51 +02:00
Eelco Dolstra 95e915a993 DummyStore: Remove redundant method 2021-07-22 09:59:51 +02:00
Eelco Dolstra 7321657746 nix-shell: Handle --eval-store correctly 2021-07-22 09:59:51 +02:00
Eelco Dolstra e9848beca7 nix-build: Copy drv closure between eval store and build store 2021-07-22 09:59:51 +02:00
Eelco Dolstra 2ff3035cf4 Support --eval-store in nix-instantiate and nix-build 2021-07-22 09:59:51 +02:00
Eelco Dolstra 3d9de41a5b Hacky fast closure copying mechanism 2021-07-22 09:59:51 +02:00
Eelco Dolstra bef40c2949 Add --eval-store option 2021-07-22 09:59:51 +02:00
Eelco Dolstra dfda499326 Downgrade warning message
If a store doesn't support GC, then we don't need to warn about the
inability to create roots.
2021-07-22 09:58:50 +02:00