Commit graph

18295 commits

Author SHA1 Message Date
Rebecca Turner
4910d74086
Print derivation paths in nix eval
`nix eval` forces values and prints derivations as attribute sets, so
commands that print derivations (e.g. `nix eval nixpkgs#bash`) will
infinitely loop and segfault.

Printing derivations as `.drv` paths makes `nix eval` complete as
expected. Further work is needed, but this is better than a segfault.
2024-03-08 21:43:54 -08:00
tomberek
3120fef01b
Merge pull request #10184 from iFreilicht/patch-2
docs: Explain how to add release notes
2024-03-08 19:49:44 -05:00
Felix Uhl
35f2b07668 docs: Fix link to release note documentation 2024-03-08 20:04:55 +01:00
tomberek
a200ee6bf7
Merge pull request #9874 from pennae/error-reports
improve error reports somewhat
2024-03-08 10:51:14 -05:00
Eelco Dolstra
ae2bd460a8
Merge pull request #10166 from bobvanderlinden/profile-regex-all
profile: introduce --regex and --all
2024-03-08 15:59:24 +01:00
Jonathan Dickinson
1ffcbddf62
docs: add inherit to language overview (#10194)
* docs: add inherit to language overview

Adds a short summary about `inherit` to the language overview.
2024-03-08 14:24:44 +00:00
Théophane Hufschmitt
ef5cb44608
Merge pull request #10197 from edolstra/github-treehash
GitHub fetcher: Don't emit treeHash yet
2024-03-08 14:14:51 +01:00
Eelco Dolstra
6d245182e8 GitHub fetcher: Don't emit treeHash yet
But do accept it if it's there, so we don't choke on future lock files
that do have the treeHash attribute.
2024-03-08 12:40:14 +01:00
Bob van der Linden
3d628d1704
profile: convert Matcher to abstract class 2024-03-08 10:47:51 +01:00
Eelco Dolstra
61b006ddf6
Merge pull request #10174 from tweag/disable-failing-hydra-jobs
flake: Remove the cross-compilation to freebsd13
2024-03-08 09:46:38 +01:00
Eelco Dolstra
4fda08d867
Merge pull request #10195 from tweag/fix-nix-env-qap
Update the golden hash of the evalNixpkgs test
2024-03-08 09:44:16 +01:00
Eelco Dolstra
a7b3249d68
Merge pull request #10179 from edolstra/upload-release
maintainers/upload-release.pl: Handle 2.3 and 2.18 branches
2024-03-08 09:38:15 +01:00
Eelco Dolstra
cb7ee1af89
Merge pull request #10175 from tweag/disable-i686-perl-bindings
flake: Disable the perl bindings on i686-linux
2024-03-08 09:21:00 +01:00
Théophane Hufschmitt
ff74c081e9 flake: Remove the cross-compilation to freebsd13
`libc` is broken there: https://hydra.nixos.org/build/252347598.

We can reintroduce it once the base system is working
2024-03-08 08:58:37 +01:00
Théophane Hufschmitt
520a1df208 flake: Disable the perl bindings on i686-linux
Some perl dependencies are failing: https://hydra.nixos.org/build/252347639/nixlog/1

Since the support is only best-effort there, disable the perl bindings
2024-03-08 08:58:10 +01:00
Théophane Hufschmitt
201369dceb tests.evalNixpkgs: Update the golden hash
`nix-env -qaP`'s output has changed a bit because of https://github.com/NixOS/nix/issues/10132.

Although that's a bit annoying, it isn't nearly as problematic as the
evaluation changes that this test is supposed to catch. So it's find to
just update the hash for the time being and fix the issue later
(properly fixing the issue will very likely change the hash any way).
2024-03-08 08:50:27 +01:00
Théophane Hufschmitt
4354b37fc4 Add more logs to the evalNixpkgs test
Make it possible to understand a mimimum what's going on in case of a
failure
2024-03-08 08:48:53 +01:00
Bob van der Linden
4741d3e308
add release note 2024-03-07 21:07:03 +01:00
Bob van der Linden
91f068c193
profile: make --all exclusive 2024-03-07 21:07:03 +01:00
Bob van der Linden
7a4d5e89d3
profile: add --all option to match any package 2024-03-07 21:07:03 +01:00
Bob van der Linden
fb391ebc77
profile: add tests for not matching any packages 2024-03-07 21:07:03 +01:00
Bob van der Linden
9fac62435c
tests/functional: add assertStderr function
Currently there isn't a convenient way to check for multiline output. In
addition, these outputs will easily change and having a diff between the
expected an the actual output upon failures is convenient.
2024-03-07 21:07:03 +01:00
Bob van der Linden
87741dbd21
profile: add --regex option to match packages 2024-03-07 21:07:03 +01:00
Bob van der Linden
d6f5da51d3
profile: match on package name instead of regex 2024-03-07 21:07:03 +01:00
Bob van der Linden
741a6bfad5
profile: allow different types of matchers 2024-03-07 21:07:03 +01:00
Eelco Dolstra
b3b312827c
Merge pull request #10180 from 9999years/rebeccat/flake-check-log
Restore "checking Hydra job" message in `nix flake check`
2024-03-07 17:48:37 +01:00
Rebecca Turner
4b4c71e239 Restore "checking Hydra job" message in nix flake check
Mistakenly removed in #8893, thanks @lf- for catching this!

9404ce36e4 (r139485316)
2024-03-07 08:15:53 -08:00
Eelco Dolstra
091f232896 maintainers/upload-release.pl: Handle 2.3 and 2.18 branches 2024-03-07 16:53:34 +01:00
Eelco Dolstra
751cb7cf51
Merge pull request #10178 from tweag/copy-built-outputs
Fix the outputs moving on macOS
2024-03-07 15:40:54 +01:00
Théophane Hufschmitt
a3163b9eab Fix the outputs moving on macOS 2024-03-07 14:52:40 +01:00
Eelco Dolstra
fb37e184a5
Merge pull request #10176 from NixOS/relative-path-fingerprint
PathInputScheme::getFingerprint(): Don't barf on relative paths
2024-03-07 14:23:57 +01:00
Eelco Dolstra
0282499e18 PathInputScheme::getFingerprint(): Don't barf on relative paths
This wasn't caught by CI because #10149 and #10152 pass
individually... It doesn't happen on lazy-trees either because we
never try to fetch relative path flakes (#10089).
2024-03-07 13:28:52 +01:00
Eelco Dolstra
da62528487
Merge pull request from GHSA-2ffj-w4mj-pg37
Copy built outputs
2024-03-07 11:56:24 +01:00
Eelco Dolstra
454456209f
Merge pull request #10165 from link2xt/patch-1
Make search.nixos.org link in quick start clickable
2024-03-07 11:05:48 +01:00
Eelco Dolstra
7d76bc8a39
Merge pull request #10152 from edolstra/fetcher-cleanups
Fetcher cleanups
2024-03-07 10:21:11 +01:00
Eelco Dolstra
bd828b1937
Merge pull request #10150 from edolstra/always-upgrade-unlocked-flakerefs
nix profile upgrade: Always upgrade unlocked flakerefs
2024-03-07 10:20:37 +01:00
Eelco Dolstra
38b79da100
Merge pull request #10149 from edolstra/use-flake-fingerprint
LockedFlake::getFingerprint(): Use Input::getFingerprint()
2024-03-07 10:18:19 +01:00
Théophane Hufschmitt
f175b3a4b7 Revert "install-multi-user.sh: _sudo: add proxy variables to sudo"
This reverts commit 24fd7e2755.
2024-03-07 10:06:33 +01:00
Théophane Hufschmitt
739f53aca4 Revert "Fix sudo in the darwin installer (#10128)"
This reverts commit 686405ef41.
2024-03-07 10:06:33 +01:00
Robert Hensing
73cf23275e
Merge pull request #10107 from tweag/repl-file-argument
Properly fail on flakerefs that don't point to a directory
2024-03-07 10:04:35 +01:00
tomberek
0a11080c58
Merge pull request #10172 from lf-/jade/fix-9725
fix: bounds check result in getMaxCPU
2024-03-07 00:58:44 -05:00
Théophane Hufschmitt
c4cfa18a33
Merge pull request #10164 from hercules-ci/objc-workaround
package.nix: Apply OBJC_DISABLE_INITIALIZE_FORK_SAFETY workaround
2024-03-07 06:26:15 +01:00
Jade Lovelace
9c64a09c70 fix: bounds check result in getMaxCPU
Fixes https://github.com/NixOS/nix/issues/9725
2024-03-06 20:57:31 -08:00
Robert Hensing
16fa5aa305
Merge pull request #10168 from hercules-ci/doc-glossary-file-system-object-anchor
doc/glossary: Fix file system object anchor
2024-03-07 00:40:36 +01:00
Robert Hensing
e4500e539e doc/glossary: Fix file system object anchor
It was stealing the store object id. Browsers pick the first one.
It was confusing.
2024-03-07 00:04:30 +01:00
pennae
5d9fdab3de use byte indexed locations for PosIdx
we now keep not a table of all positions, but a table of all origins and
their sizes. position indices are now direct pointers into the virtual
concatenation of all parsed contents. this slightly reduces memory usage
and time spent in the parser, at the cost of not being able to report
positions if the total input size exceeds 4GiB. this limit is not unique
to nix though, rustc and clang also limit their input to 4GiB (although
at least clang refuses to process inputs that are larger, we will not).

this new 4GiB limit probably will not cause any problems for quite a
while, all of nixpkgs together is less than 100MiB in size and already
needs over 700MiB of memory and multiple seconds just to parse. 4GiB
worth of input will easily take multiple minutes and over 30GiB of
memory without even evaluating anything. if problems *do* arise we can
probably recover the old table-based system by adding some tracking to
Pos::Origin (or increasing the size of PosIdx outright), but for time
being this looks like more complexity than it's worth.

since we now need to read the entire input again to determine the
line/column of a position we'll make unsafeGetAttrPos slightly lazy:
mostly the set it returns is only used to determine the file of origin
of an attribute, not its exact location. the thunks do not add
measurable runtime overhead.

notably this change is necessary to allow changing the parser since
apparently nothing supports nix's very idiosyncratic line ending choice
of "anything goes", making it very hard to calculate line/column
positions in the parser (while byte offsets are very easy).
2024-03-06 23:48:42 +01:00
pennae
855fd5a1bb diagnose "unexpected EOF" at EOF
this needs a string comparison because there seems to be no other way to
get that information out of bison. usually the location info is going to
be correct (pointing at a bad token), but since EOF isn't a token as
such it'll be wrong in that this case.

this hasn't shown up much so far because a single line ending *is* a
token, so any file formatted in the usual manner (ie, ending in a line
ending) would have its EOF position reported correctly.
2024-03-06 23:11:12 +01:00
pennae
2be6b14328 match line endings used by parser and error reports
the parser treats a plain \r as a newline, error reports do not. this
can lead to interesting divergences if anything makes use of this
feature, with error reports pointing to wrong locations in the input (or
even outside the input altogether).
2024-03-06 23:11:12 +01:00
pennae
1edd6fada5 report inherit attr errors at the duplicate name
previously we reported the error at the beginning of the binding
block (for plain inherits) or the beginning of the attr list (for
inherit-from), effectively hiding where exactly the error happened.

this also carries over to runtime positions of attributes in sets as
reported by unsafeGetAttrPos. we're not worried about this changing
observable eval behavior because it *is* marked unsafe, and the new
behavior is much more useful.
2024-03-06 23:11:12 +01:00
pennae
4147ecfb1c normalize formal order on ExprLambda::show
we already normalize attr order to lexicographic, doing the same for
formals makes sense. doubly so because the order of formals would
otherwise depend on the context of the expression, which is not quite as
useful as one might expect.
2024-03-06 23:11:12 +01:00