Commit Graph

13496 Commits

Author SHA1 Message Date
Robert Hensing
56eb179068
Merge pull request #9224 from hercules-ci/backport-9219-to-2.13-maintenance
[Backport 2.13-maintenance] StorePath: reject names starting with '.', Fix typo in error message of too long store path
2023-10-23 23:20:29 +02:00
edef
35c72f4425 StorePath: reject names starting with '.'
This has been the behaviour before Nix 2.4. It was dropped in a rewrite
in 759947bf72, allowing the creation of
store paths that aren't considered valid by older Nix versions or other
Nix tooling.

Nix 2.4 didn't ship in NixOS until 22.05, and stdenv.mkDerivation in
nixpkgs drops leading periods since April 2022, so it's unlikely anyone
is relying on the current lax behaviour.

Closes #9091.

Change-Id: I4a57bd9899e1b0dba56870ae5a1b680918a18ce9
(cherry picked from commit a06801de17)
(cherry picked from commit 33b54fc1f7)
2023-10-23 22:49:58 +02:00
oxalica
e22b261d82 Fix typo in error message of too long store path
(cherry picked from commit 303858afad)
(cherry picked from commit 8f74170e5e)
(cherry picked from commit 21d5e846c1)
2023-10-23 22:48:44 +02:00
Robert Hensing
c863accfd6
Merge pull request #9220 from hercules-ci/backport-9217-to-2.13-maintenance
[Backport 2.13-maintenance] CI Fixes #9217
2023-10-23 20:55:26 +02:00
Naïm Favier
1258cea068 ci: bump install-nix-action, don't fail fast
(cherry picked from commit b931d83550)
(cherry picked from commit ade3bffad3)
(cherry picked from commit cfc45b59de)
(cherry picked from commit 397de7bf24)
2023-10-23 19:44:06 +02:00
Silvan Mosberger
34d041d390 ci: Always run with sandbox, even on Darwin
And fix a test failure in the sandbox due to /home
existing on Darwin but not being accessible in the sandbox since it's a
symlink to /System/Volumes/Data/home, see
https://github.com/NixOS/nix/actions/runs/4205378453/jobs/7297384658#step:6:2127:

    C++ exception with description "error: getting status of /home/schnitzel/darmstadt/pommes: Operation not permitted" thrown in the test body.

On Linux this wasn't a problem because there /home doesn't exist in the sandbox

(cherry picked from commit be48907470)
(cherry picked from commit 75ec8e3130)
(cherry picked from commit 0ffb20a81d)
2023-10-23 19:43:21 +02:00
Eelco Dolstra
94d1b539a7 Bump version 2023-10-18 23:34:04 +02:00
Eelco Dolstra
2cf2bb45fc Fix C++17 build 2023-10-18 19:32:20 +02:00
Eelco Dolstra
70559cf89a Document that redirected tarball flakerefs can specify lastModified
(cherry picked from commit 56763ff918)
2023-10-18 17:08:00 +02:00
Eelco Dolstra
fb0b056d2f Tarball trees: Propagate lastModified
This makes them behave consistently with GitHub/GitLab flakes.

(cherry picked from commit 81045f243f)
(cherry picked from commit eb21904198)
2023-10-18 17:05:52 +02:00
Justin Restivo
38f4fe04e3 fix: build aarch64-darwin
(cherry picked from commit 220aa8e0ac)
2023-08-07 21:39:05 +02:00
Eelco Dolstra
d5f98aa91d Bump version 2023-08-07 21:38:53 +02:00
Eelco Dolstra
5bc21dccc9
Merge pull request #8763 from hercules-ci/backport-7447-to-2.13-maintenance
Backport 7447 to 2.13 maintenance
2023-08-07 19:30:27 +02:00
Eelco Dolstra
01401ffffd Merge remote-tracking branch 'origin/backport-8483-to-2.13-maintenance' into 2.13-maintenance 2023-08-07 16:43:57 +02:00
Eelco Dolstra
d971ce3ed4 Add docs
(cherry picked from commit cab03fb779)
2023-08-07 16:38:50 +02:00
Eelco Dolstra
dc718e28c9 Allow tarball URLs to redirect to a lockable immutable URL
Previously, for tarball flakes, we recorded the original URL of the
tarball flake, rather than the URL to which it ultimately
redirects. Thus, a flake URL like
http://example.org/patchelf-latest.tar that redirects to
http://example.org/patchelf-<revision>.tar was not really usable. We
couldn't record the redirected URL, because sites like GitHub redirect
to CDN URLs that we can't rely on to be stable.

So now we use the redirected URL only if the server returns the
`x-nix-is-immutable` or `x-amz-meta-nix-is-immutable` headers in its
response.

(cherry picked from commit 1ad3328c5e)
2023-08-07 16:38:30 +02:00
Eelco Dolstra
cb425af931 Add a generic check for rev attribute mismatches
(cherry picked from commit 3402b650cd)
2023-08-07 16:33:57 +02:00
Eelco Dolstra
3cc2ff77da GC server: Clear O_NONBLOCK on the right file descriptor
The bug fix in 6d30f9e6fe erroneously
cleared O_NONBLOCK on the server rather than client FD (leaving both
in an incorrect state).

Fixes #8551.

(cherry picked from commit a6a75ecad8)
2023-08-07 16:31:04 +02:00
Eelco Dolstra
0a0a4e2ea3 restoreMountNamespace(): Restore the original root directory
This is necessary when we're in a chroot environment, where the
process root is not the same as the root of the mount namespace
(e.g. in nixos-enter).

Fixes #7602.

(cherry picked from commit e54538c461)
2023-08-07 08:23:32 +00:00
Robert Hensing
995b658e72 Fixup release notes (#8393)
* Fixup release notes
2023-07-31 16:40:57 +02:00
Robert Hensing
1dfcf41645 rl-next.md: Minor improvement
(cherry picked from commit 37c533ed27)
2023-07-31 16:37:44 +02:00
Alex Ameen
1a6446b5eb primop: add readFileType, optimize readDir
Allows checking directory entry type of a single file/directory.

This was added to optimize the use of `builtins.readDir` on some
filesystems and operating systems which cannot detect this information
using POSIX's `readdir`.

Previously `builtins.readDir` would eagerly use system calls to lookup
these filetypes using other interfaces; this change makes these
operations lazy in the attribute values for each file with application
of `builtins.readFileType`.

(cherry picked from commit 153ee460c5)
2023-07-31 16:37:44 +02:00
Eelco Dolstra
25e1eb4dfd Bump version 2023-05-30 11:53:09 +02:00
Théophane Hufschmitt
43aa47cf8a
Merge pull request #8410 from tweag/backport-7957-to-2.13-maintenance
[Backport 2.13-maintenance] Switch to cachix/install-nix-action@v20
2023-05-28 17:24:13 +02:00
Théophane Hufschmitt
d17ecc5177 Switch to cachix/install-nix-action@v20
Fixes the installation issue with the latest Nix.

Also revert the pinning to nix-2.13 since it's not needed any more.

(cherry picked from commit c3b5499dff)
2023-05-28 17:23:37 +02:00
Théophane Hufschmitt
e0afeef10f
Merge pull request #8409 from NixOS/backport-7766-to-2.13-maintenance
[Backport 2.13-maintenance] Bump cachix/install-nix-action from 18 to 19
2023-05-28 17:18:25 +02:00
dependabot[bot]
478b015577 Bump cachix/install-nix-action from 18 to 19
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 19.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 6fdce7a9df)
2023-05-28 15:18:06 +00:00
Théophane Hufschmitt
691d1170e5
Merge pull request #8408 from NixOS/backport-8399-to-2.13-maintenance
[Backport 2.13-maintenance] Properly report build errors on chrooted stores
2023-05-28 17:11:48 +02:00
Théophane Hufschmitt
00811f98fb Properly report build errors on chrooted stores
When encountering a build error, Nix moves the output paths out of the
chroot into their final location (for “easier debugging of build
failures”). However this was broken for chroot stores as it was moving
it to the _logical_ location, not the _physical_ one.

Fix it by moving to the physical (_real_) location.

Fix https://github.com/NixOS/nix/issues/8395

(cherry picked from commit d16a1994fb)
2023-05-28 15:11:26 +00:00
Théophane Hufschmitt
8aa178f75b
Merge pull request #8181 from NixOS/backport-8179-to-2.13-maintenance
[Backport 2.13-maintenance] disable gc on coroutine
2023-04-08 13:44:15 +02:00
Yorick van Pelt
ad96bf9791 Add talkative msg for coro gc debug
(cherry picked from commit 62ddd8633c)
2023-04-07 16:21:30 +00:00
Yorick van Pelt
de7803e15f Always disable GC in a coroutine unless the patch is applied
(cherry picked from commit 58d24a4cb6)
2023-04-07 16:21:30 +00:00
Yorick van Pelt
cc90264a7d DisableGC: replace by CoroutineContext, std::shared_ptr<void>
(cherry picked from commit 00bc34430b)
2023-04-07 16:21:30 +00:00
Yorick van Pelt
325ea715b3 Disable GC inside coroutines on mac OS
(cherry picked from commit 2c53ef1bfe)
2023-04-07 16:21:30 +00:00
John Ericson
11f12253ce
Merge pull request #8054 from NixOS/backport-8053-to-2.13-maintenance
[Backport 2.13-maintenance] LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed builds
2023-03-16 18:24:51 -04:00
Linus Heckemann
e697c74269 LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed builds
(cherry picked from commit af4cbdafe7)
2023-03-16 15:04:52 +00:00
Eelco Dolstra
9bf0baa7f4 Bump version 2023-02-27 18:13:04 +01:00
Théophane Hufschmitt
4acc684ef7
Merge pull request #7878 from NixOS/backport-7856-to-2.13-maintenance
[Backport 2.13-maintenance] Wait with making /etc unwritable until after build env setup
2023-02-22 06:52:14 +01:00
Yorick van Pelt
11522a573d Wait with making /etc unwritable until after build env setup
This fixes /etc/nsswitch.conf

(cherry picked from commit bbba49b3e4)
2023-02-21 19:22:35 +00:00
Eelco Dolstra
1083ecbb2b
Merge pull request #7833 from hercules-ci/backport-7616-to-2.13-maintenance
Backport 7616 to 2.13 maintenance
2023-02-14 16:53:27 +01:00
Eelco Dolstra
911cd5b45a
Merge pull request #7837 from NixOS/backport-7830-to-2.13-maintenance
[Backport 2.13-maintenance] Don't allow writing to /etc
2023-02-14 16:52:50 +01:00
Yorick van Pelt
bca7075edc Make /etc writability conditional on uid-range feature
(cherry picked from commit 49fd72a903)
2023-02-14 15:50:29 +00:00
Yorick van Pelt
459832e5c2 container test: make /etc writable
(cherry picked from commit ad1f61c39b)
2023-02-14 15:50:29 +00:00
Yorick van Pelt
58210e5306 Don't allow writing to /etc
(cherry picked from commit db41f74af3)
2023-02-14 15:50:29 +00:00
Robert Hensing
4ca48e3c7f NarInfoDiskCache: Also test id consistency with updated fields
And clarify test

(cherry picked from commit 19b495a48a)
2023-02-14 14:54:51 +01:00
Robert Hensing
2e31c54ce5 NarInfoDiskCache: Keep BinaryCache.id stable and improve test
Fixes #3898

The entire `BinaryCaches` row used to get replaced after it became
stale according to the `timestamp` column. In a concurrent scenario,
this leads to foreign key conflicts as different instances of the
in-process `state.caches` cache now differ, with the consequence that
the older process still tries to use the `id` number of the old record.

Furthermore, this phenomenon appears to have caused the cache for
actual narinfos to be erased about every week, while the default
ttl for narinfos was supposed to be 30 days.

(cherry picked from commit fb94d5cabd)
2023-02-14 14:54:51 +01:00
Robert Hensing
e404ae5bb6 NarInfoDiskCache: Prepare reproducer for #3898
(cherry picked from commit 2ceece3ef3)
2023-02-14 14:54:51 +01:00
Robert Hensing
80498bd923 NarInfoDiskCacheImpl: Make dbPath a parameter
This allows testing with a clean database.

(cherry picked from commit 79f62d2dda)
2023-02-13 12:02:46 +00:00
Robert Hensing
7a67baf951 NarInfoDiskCache: Rename cacheExists -> upToDateCacheExists
This is slightly more accurate considering that an outdated record
may exist in the persistent cache. Possibly-outdated records are
quite relevant as they may be foreign keys to more recent information
that we want to keep, but we will not return them here.

(cherry picked from commit 29f0b196f4)
2023-02-13 12:02:46 +00:00
Robert Hensing
9f788403cf sqlite.cc: Add SQL tracing
Set environment variable NIX_DEBUG_SQLITE_TRACES=1 to log all sql statements.

(cherry picked from commit 8a0ef5d58e)
2023-02-13 12:02:46 +00:00