Commit graph

13032 commits

Author SHA1 Message Date
Eelco Dolstra
7317196807 Input::getAccessor(): Get the fingerprint from the final accessor
Fixes an issue reported by @erikarvstedt where
InputAccessor::fetchToStore() wouldn't cache the store path the first
time.
2022-10-10 17:50:21 +02:00
Eelco Dolstra
1483c56582 Patch libzip to return timestamps in the Unix epoch
We're not even using those timestamps, but doing the conversion to
local time takes a lot of time. For instance, this patch speeds up
'nix flake metadata nixpkgs` from 0.542s to 0.094s.
2022-10-10 17:23:24 +02:00
Eelco Dolstra
0286edb588 Format GitHub paths as URLs
As suggested by @aszlig in https://github.com/NixOS/nix/pull/6530#issuecomment-1273033129.
2022-10-10 15:25:27 +02:00
Eelco Dolstra
5c8d67d553 Merge remote-tracking branch 'origin/master' into lazy-trees 2022-10-10 14:51:22 +02:00
Valentin Gagarin
ac0fb38e8a
Merge pull request #6652 from abathur/doc_install_tests 2022-10-05 17:45:42 +02:00
Travis A. Everett
e1418430ac
Apply suggestions from code review
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-10-05 09:52:53 -05:00
Valentin Gagarin
927234cfb2
Merge pull request #6870 from amjoseph-nixpkgs/pr/doc/explain-local-remote-binary-substituter 2022-10-05 09:01:42 +02:00
Théophane Hufschmitt
3ae9467d57
Merge pull request #6969 from fricklerhandwerk/refactor-generate-manpage
refactor rendering command documentation to markdown
2022-10-03 15:50:17 +02:00
Eelco Dolstra
241dd5481e warnOnce(): Fix boost exception when the message contains a format character 2022-09-30 15:21:43 +02:00
Eelco Dolstra
89ca75c9f9
Merge pull request #7080 from squalus/nar-close-file
archive: check close errors when extracting nars
2022-09-30 12:58:28 +02:00
Eelco Dolstra
16e088c5db
Merge pull request #7108 from rapenne-s/wording
nix-copy-closure: improve wording
2022-09-30 12:54:25 +02:00
Valentin Gagarin
d8bef7358f bring back lost newline 2022-09-30 01:43:57 +02:00
Valentin Gagarin
70eea97742 use more self-explanatory names 2022-09-30 01:43:57 +02:00
Valentin Gagarin
61188cb820 move final template to the top
this allows readers to enter the code starting with what is visible from
the outside, instead of working themselves up from purely technical details.
2022-09-30 01:43:57 +02:00
Valentin Gagarin
0e0f1832de remove superfluous let-in pair 2022-09-30 01:43:57 +02:00
Valentin Gagarin
a85df04fcb refactor showOptions
it was quite a pain to manipulate strings just with `builtins`
2022-09-30 01:43:53 +02:00
Valentin Gagarin
4655563470 refactor rendering command documentation to markdown
idea:
- make document structure visible, like in a template
- order functions by descending abstraction
- avoid nested let bindings
2022-09-30 01:42:46 +02:00
Valentin Gagarin
6b56bb4a79 use indented strings where appropriate 2022-09-30 01:42:46 +02:00
Théophane Hufschmitt
82ef3c470b
Merge pull request #7114 from rapenne-s/reenable_test
tests/build-dry: re-enable some test
2022-09-29 16:33:12 +02:00
Eelco Dolstra
cbade16f9e Handle unlocked overriden inputs
This fixes the error

  in pure evaluation mode, 'fetchTree' requires a locked input

when using '--override-input X Y' where Y is an unlocked input (e.g. a
dirty Git tree).

Also, make LockFile use ref instead of std::shared_ptr.
2022-09-29 16:14:56 +02:00
Eelco Dolstra
c3c0682842 Don't show "from call site" when we don't know the call site
This gets rid of stack trace entries like

       … from call site

       at «stdin»:0: (source not available)
2022-09-28 17:01:16 +02:00
Solene Rapenne
62d53bc8a4 tests/build-dry: re-enable some test 2022-09-28 15:54:45 +02:00
Eelco Dolstra
a291e37b20 Improve error messages from call-flake.nix 2022-09-28 15:09:24 +02:00
Eelco Dolstra
28b62dd3e0 Merge remote-tracking branch 'origin/master' into lazy-trees 2022-09-28 14:13:44 +02:00
Solene Rapenne
847cd49909 nix-copy-closure: improve wording 2022-09-28 01:05:46 +02:00
Eelco Dolstra
050fcd391b
Merge pull request #7105 from SquidDev/hotfix/fish-return
Use exit instead of return in /etc/profile.d/nix-daemon.fish
2022-09-27 15:02:29 +02:00
Jonathan Coates
0259702219
Use exit instead of return in fish profile
Older versions of Fish (such as those bundled with Ubuntu LTS 22.04) do
not support return outside of functions. We need to use the equivalent
exit instead.
2022-09-27 12:59:37 +01:00
Eelco Dolstra
ace9f261da
Merge pull request #7103 from lheckemann/remove-add-root
nix-build: remove unused --add-root arg
2022-09-27 11:37:09 +02:00
Linus Heckemann
19f3ecd830 nix-build: remove unused --add-root arg
Fixes #1982
2022-09-27 00:07:42 +02:00
Eelco Dolstra
dfc3a9afc3
Merge pull request #7043 from edolstra/installer-test
Add an installer test
2022-09-26 17:34:23 +02:00
Eelco Dolstra
71e364c9c7
Quote URLs 2022-09-26 16:57:06 +02:00
Eelco Dolstra
eceaf1997c
Remove FIXME 2022-09-26 16:54:31 +02:00
Eelco Dolstra
6806f20157
Merge pull request #7089 from NixOS/mention-accept-flake-config-in-warning
Mention `--accept-flake-config` in the related warning
2022-09-26 11:13:02 +02:00
Eelco Dolstra
e25a36cdac
Merge pull request #7093 from amjoseph-nixpkgs/pr/intersectAttrs/values
src/libexpr/primops.cc: correct definition for intersectAttrs
2022-09-26 11:11:53 +02:00
Adam Joseph
dc205c75a2 src/libexpr/primops.cc: correct definition for intersectAttrs
The current definition of `intersectAttrs` is incorrect:

> Return a set consisting of the attributes in the set e2 that also exist in the
> set e1.

Recall that (Nix manual, section 5.1):

> An attribute set is a collection of name-value-pairs (called attributes)

According to the existing description of `intersectAttrs`, the following should
evaluate to the empty set, since no key-value *pair* (i.e. attribute) exists in
both sets:

```
builtins.intersectAttrs { x=3; } {x="foo";}
```

And yet:

```
nix-repl> builtins.intersectAttrs { x=3; } {x="foo";}
{ x = "foo"; }
```

Clearly the intent here was for the *names* of the resulting attribute set to be
the intersection of the *names* of the two arguments, and for the values of the
resulting attribute set to be the values from the second argument.

This commit corrects the definition, making it match the implementation and intent.
2022-09-24 23:51:09 -07:00
Théophane Hufschmitt
371013c08d
Merge pull request #7010 from edolstra/ignore-shell
nix develop: Ignore stdenv's $SHELL
2022-09-24 12:55:53 +02:00
Théophane Hufschmitt
3eb185d6d1
Merge pull request #7046 from mkenigs/fix-root-SHELL
dockerImage: fix root shell
2022-09-24 12:53:46 +02:00
Théophane Hufschmitt
db29ddd113
Merge pull request #7078 from obsidiansystems/trustworthy-signature
"valid signature" -> "signature by a trusted key"
2022-09-24 12:52:35 +02:00
Théophane Hufschmitt
74276cb354
Merge pull request #7079 from matthewbauer/allow-untrusted-settings
Allow pass max-silent-time and build-poll-interval to daemon untrusted
2022-09-24 12:47:49 +02:00
Théophane Hufschmitt
6a64820cb4
Merge pull request #7082 from rapenne-s/ccache
add ccacheStdenv
2022-09-24 12:45:27 +02:00
Théophane Hufschmitt
1a5d094be7
Mention --accept-flake-config in the related warning
Make sure that people who run Nix in non-interactive mode (and so don't have the possibility to interactively accept the individual flake configuration settings) are aware of this flag.

Fix #7086
2022-09-24 12:11:26 +02:00
Eelco Dolstra
cacfc32ee2
Merge pull request #7056 from hiroqn/fix-uname
Fix `uname -m` return value for armv6l/armv7l
2022-09-24 11:13:18 +02:00
Eelco Dolstra
c13007f012
Merge pull request #7059 from NixOS/remove-useless-ca-file-message
Remove a useless debug message in filetransfer.cc
2022-09-24 10:39:23 +02:00
John Ericson
60e23c8bae
Apply suggestions from code review
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Rune K. Svendsen <runesvend@gmail.com>
2022-09-23 13:57:57 -04:00
Solène Rapenne
e04b38f789 add ccacheStdenv
when using ccache, rebuild time has been measured
89% faster while not slowing the speed of cold builds
2022-09-23 11:21:19 +02:00
squalus
223f8dace0 archive: check close errors when extracting nars 2022-09-22 12:50:32 -07:00
Matthew Bauer
6e049ae607 Allow pass max-silent-time and build-poll-interval to daemon untrusted
These settings seem harmless, they control the same polling
functionality that timeout does, but with different behavior. Should
be safe for untrusted users to pass in.
2022-09-22 13:59:16 -05:00
John Ericson
a2a8cb10ac Dodge "trusted" vs "trustworthy" by being explicit
Hopefully this is best!
2022-09-22 14:37:52 -04:00
John Ericson
752f967c0f "valid signature" -> "trustworthy signature"
I just had a colleague get confused by the previous phrase for good
reason. "valid" sounds like an *objective* criterion, e.g. and *invalid
signature* would be one that would be trusted by no one, e.g. because it
misformatted or something.

What is actually going is that there might be a signature which is
perfectly valid to *someone else*, but not to the user, because they
don't trust the corresponding public key. This is a *subjective*
criterion, because it depends on the arbitrary and personal choice of
which public keys to trust.

I therefore think "trustworthy" is a better adjective to use. Whether
something is worthy of trust is clearly subjective, and then "trust"
within that word nicely evokes `trusted-public-keys` and friends.
2022-09-22 10:49:31 -04:00
Théophane Hufschmitt
f704c2720f
Merge pull request #7070 from alyssais/repl-history
nix repl: warn if creating dir for history fails
2022-09-21 13:50:49 +02:00