Commit graph

10848 commits

Author SHA1 Message Date
Alexey Novikov e989c83b44 Add error reporting to machine spec paser
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-17 12:45:56 +04:00
Alexey Novikov 64a3b045c1 Fix error detection in 'base64Decode()'
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-17 12:45:26 +04:00
Eelco Dolstra 130284b850
Merge pull request #5390 from NixOS/fix-isnewerthan-check
Fix the `isDaemonNewer` guard in the testsuite
2021-10-15 15:50:20 +02:00
regnat 0b55c8767d Disable the eval-store test when using the daemon
Using the daemon will break most of the assumptions of this test, so
it’s as simple to just disable it
2021-10-15 14:15:43 +02:00
Eelco Dolstra c0951299b3
Merge pull request #5383 from kvtb/patch-7
fix build with gcc11
2021-10-15 09:03:12 +02:00
Eelco Dolstra c574ab3907
Merge pull request #5388 from yvt/fix-oahd-path
Add another path where a Rosetta 2 daemon plist file is possibly located
2021-10-15 09:02:16 +02:00
Domen Kožar 330650d294
Merge pull request #5389 from kamadorueda/master
add pos to EvalState::forceValue
2021-10-15 00:17:11 -05:00
Kevin Amado 1bdeef8395
add pos to EvalState::forceValue
- 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-14 23:23:05 -05:00
yvt a9d9e55551 Add another path where a Rosetta 2 configuration file is possibly located 2021-10-15 09:48:15 +09:00
regnat b598e5c47c Fix the min bound for the structured-attrs test
The min bound written corresponds to the date of the commit that
introduced the change, but it only got merged on master some weeks
later. Since the version is essentially the commit date, that means that
there’s a whole range of commits on master (including the current
`nixUnstable`) that have a higher version but don’t contain the required
change.
2021-10-14 16:00:59 +02:00
regnat 3a2fc9ce1d Fix the isDaemonNewer check
- Don’t hardcode the “newer” version
- Remove an ill-placed `return`
2021-10-14 16:00:45 +02:00
kvtb eae29b0385
fix build with gcc11 2021-10-13 18:03:33 +00:00
Eelco Dolstra 4c0cde95ad Update release notes 2021-10-13 11:39:54 +02:00
Eelco Dolstra 624dfde3df
Merge pull request #5362 from Artturin/nixunpack
nix develop: add --unpack
2021-10-13 11:39:08 +02:00
Eelco Dolstra 06fff5686c
Merge pull request #5379 from abathur/fix_volume_doc_fn
darwin-install: fix incorrect fn name
2021-10-13 11:12:00 +02:00
Eelco Dolstra 2f3c79c241 Mention compression-level in the release notes 2021-10-13 11:11:26 +02:00
Eelco Dolstra 0fac86fd6f Style tweaks 2021-10-13 11:00:10 +02:00
Eelco Dolstra abd685d373 Merge branch 'feature/comp-level' of https://github.com/tomberek/nix 2021-10-13 10:45:44 +02:00
Travis A. Everett 8a3b8d0b33 darwin-install: fix incorrect fn name 2021-10-12 18:17:27 -05:00
Eelco Dolstra 3e0c6aac9a
Merge pull request #5375 from edolstra/repl-ctrl-c
nix repl: Fix plugin-files warning
2021-10-12 17:11:39 +02:00
Eelco Dolstra 5176b072ed Cleanup 2021-10-12 16:43:00 +02:00
Eelco Dolstra 3a778ea8a0 Merge branch 'nix-repl-download-interruption' of https://github.com/Ma27/nix 2021-10-12 16:34:38 +02:00
Eelco Dolstra f6cdae5181 nix repl: Don't write to std::cout directly
Writing to std::cout doesn't play nice with ProgressBar.
2021-10-12 15:36:45 +02:00
Eelco Dolstra 9ebe02a81e nix repl: Don't build in a child process
Fixes #5356. This is a bit risky due to interrupts, but we have to
deal with those anyway (#5353).
2021-10-12 15:27:02 +02:00
Tom Bereknyei 03bb8f84e0 Add compression level for NARs
Based off on @dtzWill's #2276
2021-10-12 02:14:36 -04:00
Eelco Dolstra 102d3d71c0
Merge pull request #5361 from trofi/static-logging
mk/libraries.mk: fix trace-ld and trace-ar expansions
2021-10-11 12:58:35 +02:00
Eelco Dolstra 22b67a1b63
Merge pull request #5369 from NixOS/fix-invalid-rethrows
(partially) Revert "Don't copy in rethrow"
2021-10-11 12:53:59 +02:00
regnat 7466048d39 (partially) Revert "Don't copy in rethrow"
This reverts some parts of commit
8430a8f086 which was trying to rethrow
some exceptions while we weren’t in the context of a `catch` block,
causing some weird “terminate called without an active exception”
errors.

Fix #5368
2021-10-11 10:51:22 +02:00
Artturin e399c6ab7f nix develop: add --unpack 2021-10-09 01:19:50 +03:00
Sergei Trofimovich f147f42f46 mk/libraries.mk: fix trace-ld and trace-ar expansions
Noticed this minor logging deficiency when debugged --disable-shared
build:

  LD
  AR
  LD
  CXX    src/libstore/local-store.o

After the change build is logged as expected:

  LD     src/libmain/libnixmain.a
  LD     src/libfetchers/libnixfetchers.a
  AR     src/libmain/libnixmain.a
  CXX    src/libstore/local-store.o
2021-10-08 22:59:42 +01:00
Eelco Dolstra 01e9f046a8
Update release script 2021-10-08 15:01:03 +02:00
Eelco Dolstra 4c17ebebba
Merge pull request #5357 from NixOS/gitignore-libstore-tests
gitignore the `libstore-tests` executable
2021-10-08 11:35:38 +02:00
regnat 0351422662 gitignore the libstore-tests executable
So that running `make` still leaves a clean tree
2021-10-08 10:12:27 +02:00
Eelco Dolstra 6bd74a6bea
Merge pull request #5354 from trofi/fix-libstore-tests-underlink
libstore-tests: add libutil dependency (fix static link failure)
2021-10-08 08:41:27 +02:00
Sergei Trofimovich d7d6fe44d6 libstore-tests: add libutil dependency (fix static link failure)
In https://github.com/NixOS/nix/pull/5350 we noticed link failures
pkgsStatic.nixUnstable. Adding explicit dependency on libutil fixes
libstore-tests linking.
2021-10-08 07:16:12 +01:00
Maximilian Bosch 0872659002
nix repl: properly deal with interruptions
When I stop a download with Ctrl-C in a `nix repl` of a flake, the REPL
refuses to do any other downloads:

    nix-repl> builtins.getFlake "nix-serve"
    [0.0 MiB DL] downloading 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca41 error: download of 'e9828a9e01' was interrupted
    [0.0 MiB DL]
    nix-repl> builtins.getFlake "nix-serve"
    error: interrupted by the user
    [0.0 MiB DL]

To fix this issue, two changes were necessary:

* Reset the global `_isInterrupted` variable: only because a single
  operation was aborted, it should still be possible to continue the
  session.
* Recreate a `fileTransfer`-instance if the current one was shut down by
  an abort.
2021-10-07 23:58:02 +02:00
Eelco Dolstra 844dd901a7 Start 2.5 release notes 2021-10-07 20:09:03 +02:00
Eelco Dolstra 020f3ec914 Merge branch 'baloo/tests/nss-preload' of https://github.com/baloo/nix-1 2021-10-07 20:06:17 +02:00
Eelco Dolstra 7d74409ac8
Merge pull request #5350 from tomberek/master
Revert "mk: prefert inplace library paths to system ones"
2021-10-07 19:52:27 +02:00
Arthur Gautier e33f74495b Adds a test for nss preload mechanism
This tests for the fix implemented in #5224

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-07 17:25:41 +00:00
Tom Bereknyei b976b34a5b Revert "mk: prefert inplace library paths to system ones"
This reverts commit 4993174be5.

buildStatic.x86_64-linux and buildStatic.aarch64-linux were broken, see https://hydra.nixos.org/build/151755012
2021-10-07 12:36:23 -04:00
Eelco Dolstra 158fa6870f Bump version to 2.5 2021-10-07 17:39:30 +02:00
Eelco Dolstra 5a0c8c6712
Merge pull request #5348 from edolstra/chroot-addpath
Support chroot stores in builtins.{path,filterSource}
2021-10-07 14:53:47 +02:00
Eelco Dolstra d39692e6b3 Make builtins.{path,filterSource} work with chroot stores 2021-10-07 14:22:39 +02:00
Eelco Dolstra 7b5fc4a984
Merge pull request #5347 from edolstra/allow-context
Make addPath() work on paths with a context
2021-10-07 14:21:42 +02:00
Eelco Dolstra c4dcf3cf25 Add a trace to all errors in addPath() 2021-10-07 13:47:15 +02:00
Eelco Dolstra 4806f2f6b0 Allow builtins.{path,filterSource} on paths with a context
We now build the context (so this has the side-effect of making
builtins.{path,filterSource} work on derivations outputs, if IFD is
enabled) and then check that the path has no references (which is what
we really care about).
2021-10-07 13:43:17 +02:00
Eelco Dolstra 66c4b20d8b Typo 2021-10-07 13:34:04 +02:00
Eelco Dolstra 7c50568788 Remove unnecessary call to queryMissing()
Worker::run() already does this.
2021-10-07 13:15:01 +02:00
Eelco Dolstra 302c3a052a
Merge pull request #5346 from edolstra/allow-path
Allow access to path copied to the store
2021-10-07 12:53:21 +02:00