1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
Commit graph

2987 commits

Author SHA1 Message Date
Robert Hensing
96e550efc5 Format .nix files
... with nixfmt (rfc style)
2025-01-24 17:04:02 +01:00
Eelco Dolstra
d48d464c8b Add a test for #12339 2025-01-24 15:25:10 +01:00
Eelco Dolstra
00d9e7e1f4 EvalState::resolveLookupPathPath(): Call resolveSymlinks() before pathExists()
Fixes #12339.
2025-01-24 12:15:07 +01:00
Eelco Dolstra
261b213272
Merge pull request #11900 from DeterminateSystems/fix-help-test
Fix help test in dev shell
2025-01-23 15:20:34 +01:00
Eelco Dolstra
5b43163c6d Disable 'man' tests 2025-01-23 14:54:05 +01:00
Eelco Dolstra
2dae5acf86 Run the 'nix --help' tests early
These don't depend on 'man' so we don't need to skip them.
2025-01-23 14:28:48 +01:00
Robert Hensing
06123f6284
Merge pull request #12335 from obsidiansystems/fix-12295
Fix #12295
2025-01-22 23:13:02 +01:00
John Ericson
7f7ca3810b Fix #12295
We were simply passing in the wrong path. This went uncaught because the
TODO about deduplication hasn't happened yet.
2025-01-22 16:53:05 -05:00
Robert Hensing
f168a6e739
Merge pull request #11799 from obsidiansystems/flake-nixpkgs-cleanup
Clean up packaging a bit
2025-01-22 22:40:24 +01:00
Eelco Dolstra
e0c6ed1c83 Fix help test in dev shell
Not sure what the intent was expecting help.sh to fail in the main suite, but it caused `meson test` to fail inside a `nix develop` shell:

  $ meson test help --print-errorlogs
  ninja: Entering directory `/home/eelco/Dev/nix-master/build'
  1/1 nix-functional-tests:main / help        UNEXPECTEDPASS   4.02s
2025-01-22 21:07:50 +01:00
Eelco Dolstra
41983dba8f GitRepo::fetch(): Ignore $GIT_DIR
Fixes #12325.
2025-01-22 17:54:19 +01:00
Leandro Reina
83576d86dd Oops, did not mean to commit that 2025-01-21 14:40:40 +01:00
Leandro Reina
40a3007b7c Merge remote-tracking branch 'upstream/master' into lfs 2025-01-21 14:16:42 +01:00
Eelco Dolstra
9e324df383 Fix fetchurl test
https://hydra.nixos.org/build/286311974
2025-01-21 14:09:17 +01:00
Eelco Dolstra
27c9f7ef78 Fix name 2025-01-21 14:07:20 +01:00
Robert Hensing
6f0bdd9ae7 tests: Wait for network *online* targets
More prevalent than I thought in 15073e86a

See also 3588783032
which is a failed github-flakes test without "Network is Online"
2025-01-20 18:24:22 +01:00
Robert Hensing
15073e86a8 tests: Wait for network *online* and multi-user targets
This should help prevent some test stalls.

By default, multi-user.target does not imply that the network is fully up.
2025-01-20 15:47:10 +01:00
John Ericson
69fde530a6 Clean up packaging a bit
- Multiple choices of stdenv are handled more consistently, especially for the dev
  shells which were previously not done correctly.

- Some stray nix code was moving into the `packaging` directory
2025-01-17 15:09:43 -05:00
Eelco Dolstra
17b6557c03
Merge pull request #12275 from andrewhamon/ah/set-priority-nix-env-install
nix-env: add a --priority flag to --install
2025-01-16 22:04:35 +01:00
Andy Hamon
3716ded8df nix-env: add a --priority flag to --install
nix-env can read priorities from a derivations meta attributes, but this
only works when installing a nix expression.

nix-env can also install bare store paths, however meta attributes are
not readable in that case. This means that a store path can not be
installed with a specific priority.

Some cases where it is advantageous to install a store path: a remote
host following a `nix copy`, or any time you want to save some
evaluation time and happen to already know the store path.

This PR addresses this shortcoming by adding a --priority flag to
nix-env --install.
2025-01-16 11:46:25 -08:00
Eelco Dolstra
521667eb89 Fix follow-paths test
Since ff8e2fe84e, 'path:' URLs on the
CLI are interpreted as relative to the current directory of the user,
not the path of the flake we're overriding.
2025-01-16 11:19:20 +01:00
Eelco Dolstra
550fe889ee Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-16 11:05:10 +01:00
John Ericson
e02026adae
Merge pull request #12254 from DeterminateSystems/fix-relative-path-on-cli
Fix relative 'path:' flakerefs in the CLI
2025-01-15 15:19:56 -05:00
mergify[bot]
c45dfeeef3
Merge pull request #12220 from DeterminateSystems/allow-dirty-locks
Add setting 'allow-dirty-locks'
2025-01-15 20:18:28 +00:00
Eelco Dolstra
ff8e2fe84e Fix relative 'path:' flakerefs in the CLI
And handle relative 'git+file:' flakerefs while we're at it (these
crashed with an assertion failure).

Fixes #12248.
2025-01-14 17:30:13 +01:00
Eelco Dolstra
cd0127f957 Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-13 14:13:56 +01:00
Leandro Reina
b08b7bee4e Merge remote-tracking branch 'upstream/master' into lfs 2025-01-10 18:33:03 +01:00
Leandro Reina
2a2518b408 LFS code review 2025-01-10 18:32:09 +01:00
Eelco Dolstra
e161393299 Add setting 'allow-dirty-locks'
This allows writing lock files with dirty inputs, so long as they have
a NAR hash. (Currently they always have a NAR hash, but with lazy
trees that may not always be the case.)

Generally dirty locks are bad for reproducibility (we can detect if
the dirty input has changed, but we have no way to fetch it except
substitution). Hence we don't allow them by default.

Fixes #11181.
2025-01-10 17:55:30 +01:00
Robert Hensing
d9a50c0af2
Clarify cd call in tests/functional/flakes/flakes.sh 2025-01-10 09:57:54 +01:00
Bryan Lai
37ac18d1d9 tests/flake-in-submodule: git+file:./* input 2025-01-10 11:44:55 +08:00
Bryan Lai
9d088fa502 tests/flakes: check git+file:./${submodule} protocol
Relative, local git repo used to work (for submodules), but it
fails after 3e0129ce3b.

This commit adds a test to prevent such failure in the future.
2025-01-10 11:37:29 +08:00
Eelco Dolstra
28caa35a97 parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
Commands like `nix flake metadata '.?submodules=1'` ignored the query
part of the URL, while `nix build '.?submodules=1#foo'` did work
correctly because of the presence of the fragment part.
2025-01-08 18:38:53 +01:00
Robert Hensing
4c74d679b6 test: Avoid regressing accidental use of weakly_canonical instead of makeParentCanonical
I'd messed up a rebase in my previous iteration, causing `weakly_canonical` to reappear,
but not trigger a test failure.

These two functions behave similarly when the argument is a path that points to a broken
symlink. `weakly_canonical` would not resolve it because the target doesn't exist, and
`makeParentCanonical` would not resolve it, because it never resolves the final path
element.
This new test case now also tests a valid symlink, "differentiating" the two.
2025-01-07 05:42:04 +00:00
Robert Hensing
628c11d237 test: Add hydraJobs.tests.functional_symlinked-home 2025-01-07 05:42:04 +00:00
Robert Hensing
ddbbf53767 fix: Resolve CLI parent symlinks before adding to store
Fixes https://github.com/NixOS/nix/issues/11941
2025-01-07 05:42:03 +00:00
Robert Hensing
36563c69a4 fix: Handle symlinks and FIFOs in nix hash where possible
Fixes https://github.com/NixOS/nix/issues/11756
Fixes https://github.com/NixOS/nix/issues/11681
2025-01-07 05:42:03 +00:00
Philipp Otterbein
a44e9dd1ea correctly parse strings with null bytes and throw error 2025-01-04 16:14:06 +01:00
Connor Baker
359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Robert Hensing
4f3960ea26
Merge pull request #12127 from NaN-git/json-ser
toJSON: re-throw serialization exception
2024-12-31 21:41:38 +01:00
Philipp Otterbein
4a2310a3a0 toJSON: re-throw serialization exception 2024-12-31 20:33:28 +01:00
mergify[bot]
18f077035a
Merge pull request #12119 from not-my-profile/nix-instantiate-raw
Implement --raw for nix-instantiate --eval
2024-12-31 16:55:15 +00:00
Martin Fischer
7a8a28629c feat(nix-instantiate): add --raw flag
The experimental `nix eval` command already supports a `--raw` flag.
This commit implements the same flag for the stable nix-instantiate command.

Until now instructions and scripts that didn't want to rely on experimental
features had to use workarounds such as:

    nix-instantiate --eval <something> | tr -d \"

(which also undesirably also removes double quotation marks within the string), or

    nix-instantiate --eval <something> | jq -j

(which undesirably depends on another package).

Co-authored-by: Silvan Mosberger <silvan.mosberger@tweag.io>
2024-12-31 16:36:49 +01:00
Robert Hensing
3859b3b9e1
Merge pull request #11566 from Mic92/nixpkgs-upgrade
Nixpkgs upgrade to NixOS 24.11
2024-12-31 15:37:44 +01:00
Martin Fischer
1a402e0c53 test: test eval of newlines with raw output 2024-12-31 14:24:06 +01:00
Cole Helbling
f0c1262d23 tests/nixos/s3-binary-cache-store: disable default substituter so it runs faster
Since networking is disabled in these VMs, trying to talk to the default
cache.nixos.org slows the test down (since it can't resolve it).
2024-12-19 11:16:34 -08:00
Cole Helbling
535724fd79 tests/nixos/s3-binary-cache-store: test that "object does not exist" error message is properly formatted 2024-12-19 11:16:30 -08:00
Eelco Dolstra
8534c4222c Merge remote-tracking branch 'origin/master' into relative-flakes 2024-12-18 21:09:27 +01:00
Leandro Reina
7756b2286d Merge remote-tracking branch 'upstream/master' into lfs 2024-12-18 18:18:45 +01:00
Leandro Reina
726f8fd61f Rework tests 2024-12-18 18:01:51 +01:00