1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00
Commit graph

18767 commits

Author SHA1 Message Date
Cole Helbling
8f5ea8b8ca libstore: fixup unformatted uri when S3 getObject fails
(cherry picked from commit b978fa8450)
2025-01-10 09:48:23 +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
mergify[bot]
85a4f62400
Merge pull request #12151 from NixOS/mergify/bp/2.25-maintenance/pr-12143
mergify: fix installer test name (backport #12143)
2025-01-07 19:42:57 +00:00
Jörg Thalheim
f9fc7fea5c mergify: fix installer test name
(cherry picked from commit 438a20427f)
2025-01-07 19:18:11 +00:00
Jörg Thalheim
e67cf5f306
Merge pull request #12145 from NixOS/mergify/bp/2.25-maintenance/pr-12046
CLI symlink fixes (backport #12046)
2025-01-07 07:54:59 +01: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
Jörg Thalheim
b0784dd69b makeParentCanonical: test case where parent is empty
(cherry picked from commit 5a5a86949a)
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
fdd61cf529 refactor: Don't re-construct SourcePath unnecessarily
(cherry picked from commit c0b64f3377)
2025-01-07 06:03:57 +00:00
Robert Hensing
6d7ef8f29d doc: Document nix-store --add-fixed symlink behavior
Tested with

    nix run nix/2.3-maintenance#nix-store -- --add some_symlink
    nix run nix/2.3-maintenance#nix-store -- --add-fixed sha256 --recursive some_symlink

(cherry picked from commit 91e91f62fa)
2025-01-07 06:03:56 +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
0213f22650 Add makeParentCanonical()
(cherry picked from commit 69853c067c)
2025-01-07 06:03:55 +00:00
Jörg Thalheim
8abff3cf05
Merge pull request #12075 from NixOS/mergify/bp/2.25-maintenance/pr-12059
installer: make sure we can always test the installer in ci and locally (backport #12059)
2025-01-07 00:32:01 +01:00
Robert Hensing
d910cab254 .github/ci: Use fixed names
This lets us update "runs-on" without creating a mismatch with the
required checks that are configured for the repo in the github ui.
2025-01-07 00:05:23 +01:00
NAHO
a3522b4696 ci: lock macOS runner to macos-14 2025-01-07 00:05:23 +01:00
NAHO
29a8ad18ff ci: update Ubuntu runner to ubuntu-24.04
Link: https://github.com/actions/runner-images/issues/10636
2025-01-07 00:05:23 +01:00
NAHO
2d63629ed0 ci: lock Ubuntu runner to ubuntu-22.04
Lock the Ubuntu runner to ubuntu-22.04 to avoid accidental updates [1]
and increase reproducibility.

[1]: https://github.com/actions/runner-images/issues/10636
2025-01-07 00:05:23 +01:00
Jörg Thalheim
92b14e072f mergify: updated required tests
(cherry picked from commit df3eb4f3f6)
2025-01-07 00:05:23 +01:00
Jörg Thalheim
9a2cf3468c installer: make sure we can always test the installer in ci and locally
Just now there is a dependency on cachix, which means we cannot test
the installer in CI if forks do not have the necessary secrets set up.
We replace this with a simple http server that serves the installer and
can be both used in CI and locally.

(cherry picked from commit 6162e1220e)
2025-01-07 00:05:18 +01:00
Eelco Dolstra
c396e24c3a
Merge pull request #12081 from NixOS/mergify/bp/2.25-maintenance/pr-12080
Fix `flake.lock`/`flake.nix` mix-up (backport #12080)
2024-12-16 23:26:35 +01:00
Jason Yundt
f1a4544886 Fix flake.lock/flake.nix mix-up
src/nix/flake.md describes the format of flake.lock files. Before this
change, it said that the original field was “The original input
specification from `flake.lock`[…]” The original input specification is
in flake.nix, not flake.lock.

(cherry picked from commit 51463d2280)
2024-12-16 22:03:50 +00:00
mergify[bot]
bb08cc7cc2
Merge pull request #12065 from NixOS/mergify/bp/2.25-maintenance/pr-12048
Fix `nix upgrade-nix` profile search (backport #12048)
2024-12-15 21:24:09 +00:00
Jörg Thalheim
51166bb388 upgrade-nix: don't double quote path on error
the format error already adds quotes.

(cherry picked from commit ccaa4c259a)
2024-12-15 20:52:06 +00:00
Greg Curtis
e467269a44 Fix nix upgrade-nix profile search
Commit cfe66dbec updated `nix upgrade-nix` to use
`ExecutablePath::load().find`, which broke the logic for finding the
profile associated with the nix executable. The error looks something
like:

```
$ sudo -i nix upgrade-nix --debug
found Nix in '"/nix/store/46p1z0w9ad605kky62dr53z4h24k2a5r-nix-2.25.2/bin/nix"'
found profile '/nix/store/46p1z0w9ad605kky62dr53z4h24k2a5r-nix-2.25.2/bin'
error: directory '"/nix/store/46p1z0w9ad605kky62dr53z4h24k2a5r-nix-2.25.2/bin/nix"' does not appear to be part of a Nix profile
```

This seems to happen for two reasons:

1. The original PATH search resulted in a directory, but `find` returns
   the path to the executable. Fixed by getting the path's parent.
2. The profile symlink cannot be found because
   `ExecutablePath::load().find` canonicalizes the executable path. I
   updated find to normalize the path instead, which seems more in line
   with how other programs resolve paths. I'm not sure if this affects
   other callers though.

I manually tested this on macOS and Linux, and it seemed to fix
upgrading from 2.25.2 to 2.25.3.

(cherry picked from commit 4f831e2be5)
2024-12-15 20:52:05 +00:00
mergify[bot]
fd087ceec6
Merge pull request #12055 from NixOS/mergify/bp/2.25-maintenance/pr-12050
speed up ci by splitting off eval and build + fix ci with restricted namespaces (backport #12050)
2024-12-14 15:51:12 +00:00
Jörg Thalheim
75b657cf7c ci: disable apparmor restrictions
For our tests we need to map the root user for some tests.
However ubuntu no longer allows this by default:
https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces

(cherry picked from commit 9f2b9256b6)
2024-12-14 15:24:51 +00:00
Jörg Thalheim
cdd3e3015d binary-tarball: create tarball without listing files
This is producing quite a bit of log output in CI.

(cherry picked from commit 31b3a34e5b)
2024-12-14 15:24:51 +00:00
Jörg Thalheim
79a52afe82 speed up ci by splitting off eval and build
- This speeds up macOS builds from 30 minutes to 11 minutes (3x faster).
- Also improve error reporting e.g. printing out what actually failed to build.
- As a result we also no longer need swap.

(cherry picked from commit 691b1ea237)
2024-12-14 15:24:50 +00:00
Jörg Thalheim
fe3c94d5c2
Merge pull request #12035 from NixOS/mergify/bp/2.25-maintenance/pr-11921
Make @nix json structured build log parsing warn instead of fail (backport #11921)
2024-12-10 05:37:59 +01: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
2eb816226e Remove redundant warning: prefix from structured build log warning
(cherry picked from commit f3c722cab2)
2024-12-09 21:40:41 +00: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
c709ca6e36 Push log source description out of libutil and report build hook @nix warning correctly
(cherry picked from commit 03d4bfd852)
2024-12-09 21:40:32 +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
8a81c2428a
Merge pull request #12018 from NixOS/mergify/bp/2.25-maintenance/pr-12013
nix hash convert: Support SRI hashes that lack trailing '=' characters (backport #12013)
2024-12-09 13:14:29 +01:00
Eelco Dolstra
a5ee9a3e99
Resolve conflicts 2024-12-06 12:13:51 +01:00
Eelco Dolstra
0a2545b23a nix hash: Don't print 'nix hash' deprecation message
Fixes #11997.

(cherry picked from commit 408c2faf93)

# Conflicts:
#	src/nix/hash.cc
2024-12-05 22:30:33 +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
218cd6c16c
Merge pull request #11981 from h0nIg/patch-2
docker: Fix command "nix profile install", Don't require --impure (fix for 2.25)
2024-11-29 12:53:47 +01:00
h0nIg
61950c3375
docker: Fix command "nix profile install", Don't require --impure 2024-11-27 13:35:18 +01:00
Jörg Thalheim
282bfbdacb
Merge pull request #11973 from NixOS/mergify/bp/2.25-maintenance/pr-11959
more readable errors if symlinks cannot be created (backport #11959)
2024-11-27 08:04:06 +01:00
Jörg Thalheim
14432ea4a2
Merge pull request #11962 from NixOS/mergify/bp/2.25-maintenance/pr-11915
Bump fetcher cache version (backport #11915)
2024-11-27 07:23:52 +01:00
Jörg Thalheim
8d51c90872 more readable errors if symlinks cannot be created
Before:

filesystem error: cannot create symlink: Permission denied [/nix/store/1s2p3a4rs172336hj2l8n20nz74hf71j-nix-eval-jobs-2.24.1.drv] [/1s2p3a4rs172336hj2l8n20nz74hf71j-nix-eval-jobs-2.24.1.drv.tmp-2772352-1316231068]

Now:

creating symlink '/wfxz2q489c811n08cdqj7ywxm3n4z6m5-nix-eval-jobs-2.24.1.drv.tmp-2971297-324653080' -> '/nix/store/wfxz2q489c811n08cdqj7ywxm3n4z6m5-nix-eval-jobs-2.24.1.drv': Permission denied

(cherry picked from commit 5b8728d393)

# Conflicts:
#	src/nix/flake.cc
2024-11-27 07:21:10 +01:00
Eelco Dolstra
118d50992c
Merge pull request #11968 from NixOS/mergify/bp/2.25-maintenance/pr-11878
Remove warning that interpretation of .drv has changed (backport #11878)
2024-11-26 14:51:50 +01:00
Eelco Dolstra
9f9b2ed48c
Merge pull request #11966 from NixOS/mergify/bp/2.25-maintenance/pr-11876
Filter OSC 8 correctly (backport #11876)
2024-11-26 14:10:16 +01:00