Commit graph

13895 commits

Author SHA1 Message Date
regnat
2405bbbb5e Add some tests for the suggestions 2022-03-07 10:09:10 +01:00
regnat
c0792b1546 Implement a suggestions mechanism
Each `Error` class now includes a set of suggestions, and these are printed by
the top-level handler.
2022-03-07 10:09:09 +01:00
Théophane Hufschmitt
a2ace54fe4
Merge pull request #6029 from Ma27/nix-log-ssh-ng
ssh-ng: also store build logs to make them accessible by `nix log`
2022-03-07 09:51:40 +01:00
Théophane Hufschmitt
860016bcbf
Explain why the log tests are disabled for CA derivations 2022-03-07 09:15:34 +01:00
Théophane Hufschmitt
2051c0f409
Merge pull request #6208 from sielicki/fix-url-github-oauth
Point to new github oauth docs url
2022-03-07 08:54:50 +01:00
Nicholas Sielicki
314852a10e
Point to new github oauth docs url
Previous URL was 404'ing.
2022-03-06 17:01:14 -06:00
Guillaume Maudoux
1b5a8db148 change error location for genericClosure operator errors 2022-03-05 21:19:04 +01:00
Guillaume Maudoux
4078015927 DRY addPrimOp 2022-03-05 21:18:30 +01:00
Guillaume Maudoux
cbbbf36881 Use 'errorCtx' name everywhere 2022-03-04 22:55:14 +01:00
Guillaume Maudoux
57684d6247 fixup! s/forceValue/forceFunction/ where applicable 2022-03-04 22:51:56 +01:00
Guillaume Maudoux
ed02fa3c40 s/forceValue/forceFunction/ where applicable 2022-03-04 22:15:30 +01:00
Guillaume Maudoux
3a5855353e Add detailed error mesage for coerceTo{String,Path} 2022-03-04 21:47:58 +01:00
Maximilian Bosch
697d1dac01
tests: grep for string in nix log for remote-builds 2022-03-04 16:58:27 +01:00
Guillaume Maudoux
be1f069746 Add error context for most basic coercions 2022-03-04 05:04:47 +01:00
Guillaume Maudoux
00e242feed Add some context to coercion error strings 2022-03-03 21:46:20 +01:00
Eelco Dolstra
b09baf690b
Merge pull request #6188 from obsidiansystems/store-gc-subclass
Factor out a `GcStore` interface
2022-03-03 20:53:10 +01:00
John Ericson
6636202356 Factor out a GcStore interface
Starts progress on #5729.

The idea is that we should not have these default methods throwing
"unimplemented". This is a small step in that direction.

I kept `addTempRoot` because it is a no-op, rather than failure. Also,
as a practical matter, it is called all over the place, while doing
other tasks, so the downcasting would be annoying.

Maybe in the future I could move the "real" `addTempRoot` to `GcStore`,
and the existing usecases use a `tryAddTempRoot` wrapper to downcast or
do nothing, but I wasn't sure whether that was a good idea so with a
bias to less churn I didn't do it yet.
2022-03-03 19:01:25 +00:00
regnat
417aaf4ff7 Correctly hijack the file:// uri scheme with _NIX_FORCE_HTTP
Setting the `_NIX_FORCE_HTTP` environment variable is supposed to force `file://` store urls to use the `HttpBinaryCacheStore` implementation rather than the `LocalBinaryCacheStore` one (very useful for testing).
However because of a name mismatch, the `LocalBinaryCacheStore` was still registering the `file` scheme when this variable was set, meaning that the actual store implementation picked up on `file://` uris was dependent on the registration order of the stores (itself dependent on the link order of the object files).

Fix this by making the `LocalBinaryCacheStore` gracefully not register the `file` uri scheme when the variable is set.
2022-03-03 17:47:50 +01:00
pennae
2799fe4cdb enable LTO in optimized builds
gives 2-5% performance improvement across a board of tests.
LTO is broken when using clang; some libs link fine while others crash
the linker with a segfault in the llvm linker plugin. 🙁
2022-03-03 17:47:49 +01:00
Eelco Dolstra
391f4fcabe
Merge pull request #6201 from edolstra/print-value
printValue(): Don't show repeated values
2022-03-03 14:35:16 +01:00
Eelco Dolstra
e9c04c3351 Be more aggressive in hiding repeated values
We now memoize on Bindings / list element vectors rather than Values,
so that e.g. two Values that point to the same Bindings will be
printed only once.
2022-03-03 13:33:34 +01:00
Eelco Dolstra
ecff9d969a printValue(): Don't show repeated values
Fixes #6157.
2022-03-03 13:18:23 +01:00
Eelco Dolstra
6097790863 Fix segfault in headerCallback()
https://hydra.nixos.org/build/168594664
2022-03-03 11:11:16 +01:00
Eelco Dolstra
885d709393
Merge pull request #6198 from edolstra/coerce-store-path
Add EvalState::coerceToStorePath() helper
2022-03-03 10:02:51 +01:00
Eelco Dolstra
a7c835e9cb
Use C++11-style initializer
Co-authored-by: John Ericson <git@JohnEricson.me>
2022-03-03 10:02:11 +01:00
Eelco Dolstra
b55d79728c Add EvalState::coerceToStorePath() helper
This is useful whenever we want to evaluate something to a store path
(e.g. in get-drvs.cc).

Extracted from the lazy-trees branch (where we can require that a
store path must come from a store source tree accessor).
2022-03-02 23:58:58 +01:00
Eelco Dolstra
3e3d0711d4
Merge pull request #6197 from edolstra/nix-profile-ca
nix profile: Support CA derivations
2022-03-02 23:48:52 +01:00
Eelco Dolstra
d4538034b7 nix profile test: Restart daemon
Fixes

  nix-daemon: src/libstore/sqlite.cc:97: nix::SQLiteStmt::Use::Use(nix::SQLiteStmt&): Assertion `stmt.stmt' failed.

which happens because the daemon doesn't properly handle the case
where ca-derivations isn't enabled at daemon startup.
2022-03-02 23:08:49 +01:00
Eelco Dolstra
3a3821bcd7 Remove obsolete todo 2022-03-02 22:22:55 +01:00
Eelco Dolstra
b0d65b3d11 Silence kill output 2022-03-02 22:22:23 +01:00
Eelco Dolstra
d2586188fe tests/common.sh.in: Add enableFeatures helper 2022-03-02 21:48:25 +01:00
Eelco Dolstra
5d208cbe41 mk/run_test.sh: Add missing backslash 2022-03-02 21:36:46 +01:00
Eelco Dolstra
f9375778ae nix profile: Add a test for non-flake packages 2022-03-02 20:56:40 +01:00
Eelco Dolstra
161f798aa1 nix profile: Support CA derivations 2022-03-02 20:38:51 +01:00
Eelco Dolstra
54888b92de Move installables-related operations 2022-03-02 19:19:51 +01:00
Eelco Dolstra
b2da2a22c6
Merge pull request #6194 from edolstra/nix-profile
Add basic tests for 'nix profile'
2022-03-02 16:07:00 +01:00
Eelco Dolstra
5850fd17b4 Add basic tests for 'nix profile'
Fixes #6193.
2022-03-02 14:40:46 +01:00
Eelco Dolstra
1aca6b9f17
Merge pull request #4345 from bjornfor/installer-configurable-uid-gid
installer: allow overriding nix user GID and UIDs
2022-03-02 12:38:52 +01:00
Eelco Dolstra
b39ef07414 Style 2022-03-02 11:46:15 +01:00
Eelco Dolstra
c10865a46e tests: Rename nix-profile.sh -> bash-profile.sh 2022-03-02 11:21:00 +01:00
Eelco Dolstra
010ffc31f8 Remove stray debug line 2022-03-02 11:20:32 +01:00
Eelco Dolstra
03df331c3f
Merge pull request #6189 from obsidiansystems/build-result-header
Move `BuildResult` defintion to its own header
2022-03-02 08:47:51 +01:00
Eelco Dolstra
3c66839b9d
Merge pull request #6190 from andersk/bel
filterANSIEscapes: Ignore BEL character
2022-03-02 08:46:19 +01:00
Anders Kaseorg
b5cd3e2d5c filterANSIEscapes: Ignore BEL character
GCC is not as good at music as it seems to think it is.  Fixes #4546.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-03-01 15:35:42 -08:00
John Ericson
e862833ec6 Move BuildResult defintion to its own header
Just like we did for `ValidPathInfo` in
d92d4f85a5.
2022-03-01 19:43:07 +00:00
Bjørn Forsman
f4d57aa490 installer: allow overriding nix user GID and UIDs
Needed to resolve conflict in case the default GID and UIDs are in use.
2022-03-01 19:17:41 +01:00
Eelco Dolstra
9087fe0760
Merge pull request #6187 from thufschmitt/allow-the-darwin-tests-to-be-flaky
Acknowledge that the macOS tests are flaky
2022-03-01 19:11:36 +01:00
regnat
c511134a94 Acknowledge that the macOS tests are flaky
Restart the tests (at most once) on `unexpected EOF` errors.

This is truly ugly, but might prevent half of the CI runs to fail
because of https://github.com/NixOS/nix/issues/3605
2022-03-01 15:25:05 +01:00
Théophane Hufschmitt
47dec825c5
Merge pull request #6181 from obsidiansystems/auto-uid-allocation
Auto uid allocation -- update with latest master
2022-03-01 13:58:17 +01:00
Eelco Dolstra
0cb5af5000
Merge pull request #6185 from hercules-ci/fetchTree-reuse-local-paths
fetchTree: Use isValidPath, add comment
2022-03-01 13:15:42 +01:00