1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00
Commit graph

2755 commits

Author SHA1 Message Date
Eelco Dolstra
4aba8ad022
Delete unused test 2025-02-12 20:05:02 +01:00
Eelco Dolstra
d856328ab5
Fix build 2025-02-12 20:04:48 +01:00
Eelco Dolstra
7bfd71e10d copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.

(cherry picked from commit 26b87e78b5)
2025-02-11 21:51:38 +00:00
Robert Hensing
c69579114b test: Fix shifted source positions after formatting 2025-01-24 22:09:21 +01:00
Robert Hensing
24c78e06cf Format .nix files
This does not include any automation for the release branch, but
is based on the configuration of https://github.com/NixOS/nix/pull/12349

    pre-commit run -a nixfmt-rfc-style
2025-01-24 20:37:38 +01:00
Eelco Dolstra
e64fcf62f9 GitRepo::fetch(): Ignore $GIT_DIR
Fixes #12325.

(cherry picked from commit 41983dba8f)
2025-01-22 20:30:25 +00:00
Robert Hensing
0284eef493 tests: Wait for network *online* targets
More prevalent than I thought in 15073e86a

See also https://github.com/NixOS/nix/actions/runs/12872412321/job/35887830320?pr=12310
which is a failed github-flakes test without "Network is Online"

(cherry picked from commit 6f0bdd9ae7)

# Conflicts:
#	tests/nixos/nix-docker.nix
2025-01-20 18:16:43 +00:00
Robert Hensing
8b205302f3 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.

(cherry picked from commit 15073e86a8)
2025-01-20 16:40:04 +00:00
Eelco Dolstra
938f0f4fd9 Don't absolutize 'git+file:' in parseURLFlakeRef()
https://github.com/NixOS/nix/issues/12273#issuecomment-2596069519
2025-01-16 19:17:08 +01:00
Eelco Dolstra
40bb5ec675
Merge pull request #12269 from NixOS/mergify/bp/2.25-maintenance/pr-12254
Fix relative 'path:' flakerefs in the CLI (backport #12254)
2025-01-15 21:54:43 +01:00
Eelco Dolstra
0b57e7daf5 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.

(cherry picked from commit ff8e2fe84e)
2025-01-15 20:20:45 +00:00
Robert Hensing
dcfd80610b Clarify cd call in tests/functional/flakes/flakes.sh
(cherry picked from commit d9a50c0af2)
2025-01-15 19:56:17 +00:00
Bryan Lai
4fea745fe0 tests/flake-in-submodule: git+file:./* input
(cherry picked from commit 37ac18d1d9)
2025-01-15 19:56:17 +00:00
Bryan Lai
335e0d9508 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.

(cherry picked from commit 9d088fa502)
2025-01-15 19:56:16 +00:00
mergify[bot]
08cd0acf65
Merge pull request #12210 from NixOS/mergify/bp/2.25-maintenance/pr-11294
parser-state: fix attribute merging (backport #11294)
2025-01-10 20:39:33 +00:00
mergify[bot]
1521a82077
Merge pull request #12184 from NixOS/mergify/bp/2.25-maintenance/pr-12051
Skip tests on systems with restricted usernamespaces (backport #12051)
2025-01-10 18:55:14 +00:00
Eelco Dolstra
c902a299a8
Merge pull request #12164 from NixOS/mergify/bp/2.25-maintenance/pr-12157
parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment (backport #12157)
2025-01-10 18:11:30 +01:00
Eelco Dolstra
31d6afb476
Merge pull request #12181 from NixOS/mergify/bp/2.25-maintenance/pr-12091
libstore: fixup unformatted uri when S3 getObject fails (backport #12091)
2025-01-10 15:17:50 +01:00
Eelco Dolstra
faecb6e306 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.

(cherry picked from commit 28caa35a97)
2025-01-10 13:37:23 +01:00
Ryan Hendrickson
5575a2f1c3 parser-state: fix attribute merging
(cherry picked from commit 8034589d7e)
2025-01-10 10:40:07 +00:00
Jörg Thalheim
4e990b0bcb functional-tests: skip tests if the kernel restricts unprivileged user namespaces
Update tests/functional/common/functions.sh

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
(cherry picked from commit da7f7ba810)
2025-01-10 09:52:32 +00:00
Cole Helbling
f8999cd4ee 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).

(cherry picked from commit f0c1262d23)
2025-01-10 09:48:23 +00:00
Cole Helbling
6aaf623058 tests/nixos/s3-binary-cache-store: test that "object does not exist" error message is properly formatted
(cherry picked from commit 535724fd79)
2025-01-10 09:48:22 +00:00
Philipp Otterbein
4bf020de50 toJSON: re-throw serialization exception
(cherry picked from commit 4a2310a3a0)
2025-01-10 09:42:14 +00:00
Robert Hensing
336fdaa119 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.

(cherry picked from commit 4c74d679b6)
2025-01-07 06:03:58 +00:00
Robert Hensing
7c4e2fdfd7 test: Add hydraJobs.tests.functional_symlinked-home
(cherry picked from commit 628c11d237)
2025-01-07 06:03:57 +00:00
Robert Hensing
3fbcd8d7ba fix: Resolve CLI parent symlinks before adding to store
Fixes https://github.com/NixOS/nix/issues/11941

(cherry picked from commit ddbbf53767)
2025-01-07 06:03:57 +00:00
Robert Hensing
255379daf1 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

(cherry picked from commit 36563c69a4)
2025-01-07 06:03:56 +00:00
Robert Hensing
9f2df5899c tests: Make unusual logging test conditional on fixed daemon version
(cherry picked from commit c783cd22ac)
2024-12-10 00:16:09 +01:00
Robert Hensing
a867747c05 test: Move unusual-logging to run only in logging test case
(cherry picked from commit 1421420e86)
2024-12-09 21:40:37 +00:00
Robert Hensing
b1058ee0d2 tests/functional/dependencies.nix: Check that we tolerate syntax and type errors
(cherry picked from commit 1485937b89)
2024-12-09 21:40:27 +00:00
Linus Heckemann
7c98167eab libutil: handle json builder log messages with unexpected format
Before this change, expressions like:

with import <nixpkgs> {};
runCommand "foo" {} ''
  echo '@nix {}' >&$NIX_LOG_FD
''

would result in Lix crashing, because accessing nonexistent fields of
a JSON object throws an exception.

Rather than handling each field individually, we just catch JSON
exceptions wholesale. Since these log messages are an unusual
circumstance, log a warning when this happens.

Fixes #544.

Change-Id: Idc2d8acf6e37046b3ec212f42e29269163dca893
(cherry picked from commit e55cd3beea710db727fd966f265a1b715b7285f3)
(cherry picked from commit ee03fd478e)
2024-12-09 21:40:23 +00:00
Robert Hensing
c797848b88 tests/functional/dependencies.nix: Refactor, replace arcane let
(cherry picked from commit e82ff51726)
2024-12-09 21:40:19 +00:00
Eelco Dolstra
97f0c68389 nix hash convert: Don't fail on uppercase base-16 hashes
(cherry picked from commit 33b645cedf)
2024-12-05 22:30:32 +00:00
Eelco Dolstra
26741bcfda nix hash convert: Support SRI hashes that lack trailing '=' characters
Fixes #11996.

(cherry picked from commit 52f1cd0595)
2024-12-05 22:30:32 +00:00
Eelco Dolstra
c381199e97
Merge pull request #11964 from NixOS/mergify/bp/2.25-maintenance/pr-11901
tests/functional/flakes/develop.sh: Don't hang (backport #11901)
2024-11-26 13:35:14 +01:00
Eelco Dolstra
1dbe60e073 tests/functional/flakes/develop.sh: Don't hang
The bash shell started by `nix develop` waited forever for stdin
input.

Fixes #11827.

(cherry picked from commit 428af8c66f)
2024-11-26 11:19:33 +00:00
Robert Hensing
3bc3e55736 Fix issue 11892
It seems that I copied the expression for baseDir thoughtlessly and
did not come back to it.

- `baseDir` was only used in the `fromArgs` branch.
- `fromArgs` is true when `packages` is true.

(cherry picked from commit c4b95dbdd1)
2024-11-26 11:19:29 +00:00
Jörg Thalheim
aeffdeffc8
Merge pull request #11826 from DeterminateSystems/revert-11804
Revert "Merge pull request #11804 from obsidiansystems/remove-old-make"
2024-11-08 12:04:55 +01:00
Eelco Dolstra
723fdeb4f1
Merge pull request #11832 from DeterminateSystems/fix-remote-build-test
Fix tests.remoteBuilds_local_nix_2_18
2024-11-07 22:56:28 +01:00
Eelco Dolstra
5471d2a454 Fix tests.remoteBuilds_local_nix_2_18
This was broken since a03bb4455c because
Nix 2.18 does not support broken $SHELL settings. So don't try a
broken $SHELL on old Nix versions. (It's a mystery though why
tests.remoteBuilds_local_nix_2_13 and tests.remoteBuilds_local_nix_2_3
didn't fail...)

https://hydra.nixos.org/build/277366807
2024-11-07 20:48:11 +01:00
Eelco Dolstra
0ed5af164f
Merge pull request #11831 from DeterminateSystems/fix-nix-copy-test
Fix 'nix copy' VM test
2024-11-07 20:43:01 +01:00
Eelco Dolstra
ea6dc8ebf1 Fix 'nix copy' VM test
This was broken because the root password wasn't getting set correctly.

https://hydra.nixos.org/build/277366631
2024-11-07 20:10:57 +01:00
Eelco Dolstra
47bffe20e4 Revert "Merge pull request #10980 from kjeremy/flake-show-description"
This reverts commit 1c5ad159d6, reversing
changes made to 67de193277.

This reverts commit ce4e4a158e, reversing
changes made to 43e82c9446.
2024-11-07 18:12:04 +01:00
Eelco Dolstra
67d231c046 Revert "Merge pull request #11804 from obsidiansystems/remove-old-make"
This reverts commit 619eeb658a, reversing
changes made to 1af94bf471.
2024-11-07 13:46:37 +01:00
John Ericson
f7591bc6ed Make config.nix shims
As requested in https://github.com/NixOS/nix/pull/11792#discussion_r1827034428
2024-11-06 16:09:18 -05:00
John Ericson
e70c9bb06a Remove old build system 2024-11-06 16:09:18 -05:00
Robert Hensing
c6c8d2af65 refact: Remove unused arguments 2024-11-06 19:45:19 +01:00
Robert Hensing
3112e59734 ProgressBar::ask: Accept EOF as a no
This may occur when stderr is a tty but stdin is empty.
E.g.

    $ nix build </dev/null
    error: unexpected EOF reading a line

These stdio handles are how some non-interactive sandboxes behave,
including the Nix build sandbox and Hercules CI Effects.
2024-11-06 19:45:19 +01:00
Brian McKenna
a9c417dbab msys2: use ls.exe instead of coreutils.exe for coreutils directory 2024-11-06 00:18:59 +11:00