1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
Commit graph

21395 commits

Author SHA1 Message Date
John Ericson
34bca9212a
Merge pull request #14156 from NixOS/fix-ub
treewide: Squash some user-after-free bugs
2025-10-05 16:49:22 -04:00
John Ericson
cd9c208baf
Merge pull request #14159 from NixOS/revert-resolution-goal
Revert #14097, #14022
2025-10-05 16:28:33 -04:00
Sergei Zimmerman
ce749454dc
Revert "Merge pull request #14022 from obsidiansystems/derivation-resolution-goal"
This reverts commit d02dca099f, reversing
changes made to 9bd09155ac.
2025-10-05 21:54:59 +03:00
Sergei Zimmerman
7e39ab4dc7
Revert "Merge pull request #14097 from obsidiansystems/light-realisation-improvements"
This reverts commit dc8c1461da, reversing
changes made to 28adcfda32.
2025-10-05 21:54:32 +03:00
Farid Zakaria
06a82da6f5 clang-tidy fix for src/libstore/build/derivation-check.cc 2025-10-05 11:18:30 -07:00
Sergei Zimmerman
be1ade7373
libexpr: Use use-after-move in SampleStack::saveProfile() 2025-10-05 16:57:13 +03:00
Sergei Zimmerman
452ec09fe0
libstore: Fix use-after-move in DerivationGoal::repairClosure 2025-10-05 16:55:41 +03:00
Jörg Thalheim
7ba3ef21a6
Merge pull request #14154 from NixOS/fix-segfault-toView
treewide: Remove toView() because it leads to segfaults when compiled…
2025-10-05 13:38:40 +02:00
Sergei Zimmerman
dce1a893d0
treewide: Remove toView() because it leads to segfaults when compiled with newer nixpkgs
Firstly, this is now available on darwin where the default in llvm 19.
Secondly, this leads to very weird segfaults when building with newer nixpkgs for some reason.
(It's UB after all).

This appears when building with the following:

mesonComponentOverrides = finalAttrs: prevAttrs: {
mesonBuildType = "debugoptimized";
dontStrip = true;
doCheck = false;
separateDebugInfo = false;
preConfigure = (prevAttrs.preConfigure or "") + ''
  case "$mesonBuildType" in
  release|minsize|debugoptimized) appendToVar mesonFlags "-Db_lto=true"  ;;
  *)                              appendToVar mesonFlags "-Db_lto=false" ;;
  esac
'';
};

And with the following nixpkgs input:

nix build ".#nix-cli" -L --override-input nixpkgs "https://releases.nixos.org/nixos/unstable/nixos-25.11pre870157.7df7ff7d8e00/nixexprs.tar.xz"

Stacktrace:

 #0  0x00000000006afdc0 in ?? ()
 #1  0x00007ffff71cebb6 in _Unwind_ForcedUnwind_Phase2 () from /nix/store/41ym1jm1b7j3rhglk82gwg9jml26z1km-gcc-14.3.0-lib/lib/libgcc_s.so.1
 #2  0x00007ffff71cf5b5 in _Unwind_Resume () from /nix/store/41ym1jm1b7j3rhglk82gwg9jml26z1km-gcc-14.3.0-lib/lib/libgcc_s.so.1
 #3  0x00007ffff7eac7d8 in std::basic_ios<char, std::char_traits<char> >::~basic_ios (this=<optimized out>, this=<optimized out>)
     at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/basic_ios.h:286
 #4  std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream (this=<optimized out>, this=<optimized out>)
     at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/sstream:806
 #5  nix::SimpleLogger::logEI (this=<optimized out>, ei=...) at ../logging.cc:121
 #6  0x00007ffff7515794 in nix::Logger::logEI (this=0x675450, lvl=nix::lvlError, ei=...) at /nix/store/bkshji3nnxmrmgwa4n2kaxadajkwvn65-nix-util-2.32.0pre-dev/include/nix/util/logging.hh:144
 #7  nix::handleExceptions (programName=..., fun=...) at ../shared.cc:336
 #8  0x000000000047b76b in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/82kmz7r96navanrc2fgckh2bamiqrgsw-gcc-14.3.0/include/c++/14.3.0/bits/new_allocator.h:88
2025-10-05 02:30:21 +03:00
Sergei Zimmerman
35d7719f46
Merge pull request #14149 from Radvendii/exprophasattr-alloc
libexpr: allocate ExprOpHasAttr's AttrPath in Exprs::alloc
2025-10-03 23:50:46 +03:00
Taeer Bar-Yam
39109c05be
libexpr: allocate ExprOpHasAttr's AttrPath in Exprs::alloc 2025-10-03 23:26:41 +03:00
Sergei Zimmerman
75826824d0
Merge pull request #14124 from Radvendii/exprselect-alloc
libexpr: allocate ExprSelect's AttrPath in Expr::alloc
2025-10-03 23:25:02 +03:00
Taeer Bar-Yam
76a92985d7
libexpr: allocate ExprSelect's AttrName vector in Expr::alloc 2025-10-03 22:51:23 +03:00
Sergei Zimmerman
862c816498
Merge pull request #14150 from cole-h/fixup-fakessh-check
libstore: fixup fakeSSH check
2025-10-03 22:46:40 +03:00
Cole Helbling
7ec1427fc3
libstore: fixup fakeSSH check
This broke invocations like:

    NIX_SSHOPTS='-p2222 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no' nix copy /nix/store/......-foo --to ssh-ng://root@localhost

In Nix 2.30.2, fakeSSH was enabled when the "thing I want to connect to"
was plain old "localhost". Previously, this check was written as:

         , fakeSSH(host == "localhost")

Given the above invocation, `host` would have been `root@localhost`, and
thus `fakeSSH` would be `false` because `root@localhost` != `localhost`.

However, since 49ba06175e, `authority.host`
returned _just_ the host (`localhost`, no user) and erroneously enabled
`fakeSSH` in this case, causing `NIX_SSHOPTS` to be ignored (since,
when `fakeSSH` is `true`, `SSHMaster::startCommand` doesn't call
`addCommonSSHOpts`).

`authority.to_string()` accurately returns the expected `root@localhost`
format (given the above invocation), fixing this.
2025-10-03 12:17:17 -07:00
Eelco Dolstra
73e4c40e64 Add test for external-builders 2025-10-03 16:32:32 +02:00
Eelco Dolstra
d5d7ca01b3
Merge pull request #14138 from lovesegfault/nix-fix-4313
fix(libfetchers): substitute fetchTarball and fetchurl
2025-10-03 15:13:06 +02:00
Eelco Dolstra
584ef0ffd3 Add external builders
These are helper programs that execute derivations for specified
system types (e.g. using QEMU to emulate another system type).

To use, set `external-builders`:

  external-builders = [{"systems": ["aarch64-linux"], "program": "/path/to/external-builder.py"}]

The external builder gets one command line argument, the path to a JSON file containing all necessary information about the derivation:

  {
    "args": [...],
    "builder": "/nix/store/kwcyvgdg98n98hqapaz8sw92pc2s78x6-bash-5.2p37/bin/bash",
    "env": {
      "HOME": "/homeless-shelter",
      ...
    },
    "realStoreDir": "/tmp/nix/nix/store",
    "storeDir": "/nix/store",
    "tmpDir": "/tmp/nix-shell.dzQ2hE/nix-build-patchelf-0.14.3.drv-46/build",
    "tmpDirInSandbox": "/build"
  }

Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2025-10-03 14:34:13 +02:00
Jörg Thalheim
76ac3758d7
Merge pull request #14144 from lovesegfault/curl-based-s3-pieces
build(libstore): add NIX_WITH_CURL_S3 build option
2025-10-03 09:25:22 +02:00
Bernardo Meurer Costa
27f6417128
build(libstore): add NIX_WITH_CURL_S3 build option
Introduce a new build option 'curl-s3-store' for the curl-based S3
implementation, separate from the existing AWS SDK-based 's3-store'.
The two options are mutually exclusive to avoid conflicts.

Users can enable the new implementation with:
  -Dcurl-s3-store=enabled -Ds3-store=disabled
2025-10-03 03:34:57 +00:00
Sergei Zimmerman
8a8a0c2a4b
Merge pull request #14135 from lovesegfault/curl-based-s3-pieces
feat(libstore): add AWS CRT-based credential infrastructure
2025-10-02 22:58:36 +00:00
Sergei Zimmerman
eb67b0df5a
Merge pull request #14142 from NixOS/move-settings-http-store
libstore: Move {narinfo,ls,log}-compression settings from BinaryCache…
2025-10-02 21:04:22 +00:00
Sergei Zimmerman
ea14933915
Merge pull request #14139 from osbm/master
docs: Update documentation regarding the flake outputs
2025-10-02 20:17:42 +00:00
Sergei Zimmerman
d2017e0e1a
libstore: Move {narinfo,ls,log}-compression settings from BinaryCacheStoreConfig to HttpBinaryCacheStoreConfig
These settings are only implemented for the http store and should not be
there for the file:// stores.
2025-10-02 23:11:16 +03:00
Bernardo Meurer Costa
1e92b61750
fix(libfetchers): substitute fetchTarball and fetchurl
Fixes #4313 by enabling builtins.fetchurl, builtins.fetchTarball to use
binary cache substituters before attempting to download from the
original URL.
2025-10-02 19:33:02 +00:00
7f3f0f2a0b docs: Update documentation regarding the flake outputs 2025-10-02 10:44:30 +03:00
Bernardo Meurer Costa
a4e792cba7
feat(libstore): add AWS CRT-based credential infrastructure
Add lightweight AWS credential resolution using AWS CRT (Common Runtime)
instead of the full AWS SDK. This provides credential management for the
upcoming curl-based S3 implementation.
2025-10-01 21:53:55 +00:00
John Ericson
dc8c1461da
Merge pull request #14097 from obsidiansystems/light-realisation-improvements
Realisation improvements, dummy store support, unit testing
2025-10-01 17:28:26 -04:00
John Ericson
5592bb717b Implement realisation operations on dummy store 2025-10-01 17:05:06 -04:00
John Ericson
e06968ec25 Split out UnkeyedRealisation from Realisation
Realisations are conceptually key-value pairs, mapping `DrvOutputs` (the
key) to information about that derivation output.

This separate the value type, which will be useful in maps, etc., where
we don't want to denormalize by including the key twice.

This matches similar changes for existing types:

| keyed              | unkeyed                |
|--------------------|------------------------|
| `ValidPathInfo`    | `UnkeyedValidPathInfo` |
| `KeyedBuildResult` | `BuildResult`          |
| `Realisation`      | `UnkeyedRealisation`   |
2025-10-01 17:01:26 -04:00
Sergei Zimmerman
28adcfda32
Merge pull request #14119 from NixOS/hide-derivation-internal
libexpr: Move derivation-internal.nix from corepkgsFS to internalFS
2025-10-01 20:58:17 +00:00
Jörg Thalheim
d02dca099f
Merge pull request #14022 from obsidiansystems/derivation-resolution-goal
Introduce `DerivationResolutionGoal`, fix substituting a single CA drv output
2025-10-01 22:53:58 +02:00
Jörg Thalheim
9bd09155ac
Merge pull request #14136 from Mic92/jitsi
link to jitsi meeting in the PR docs
2025-10-01 22:39:13 +02:00
Sergei Zimmerman
2774e67c60
Merge pull request #14128 from obsidiansystems/expose-dummy-store-for-tests-somewhat
Expose some core implementation details and write a basic unit test for the dummy store
2025-10-01 20:27:37 +00:00
Jörg Thalheim
85d6c8af4d link to jitsi meeting in the PR docs 2025-10-01 22:23:31 +02:00
Sergei Zimmerman
2a0fddc7d5
libexpr: Move derivation-internal.nix from corepkgsFS to internalFS
Best I can tell this was never supposed to be exposed to the user
and has been this way since 2.19.

2.18 did not expose this file to the user:

nix run nix/2.18-maintenance -- eval --expr "import <nix/derivation-internal.nix>"

error: getting status of '/__corepkgs__/derivation-internal.nix': No such file or directory
2025-10-01 23:13:11 +03:00
Sergei Zimmerman
d0c017def5
Merge pull request #14134 from JamiKettunen/fix-libc++-build
libstore: Include missing header to fix compile with libc++ 20
2025-10-01 20:07:03 +00:00
Sergei Zimmerman
30a6cbe90b
Merge pull request #14131 from lovesegfault/curl-based-s3-pieces
refactor(libstore): extract S3 URL parsing into separate files
2025-10-01 19:39:46 +00:00
Jami Kettunen
140b08ae3e libstore: Include missing header to fix compile with libc++ 20
https://en.cppreference.com/w/cpp/thread.html

src/libstore/gc.cc:121:39: error: no member named 'sleep_for' in namespace 'std::this_thread'
  121 |                     std::this_thread::sleep_for(std::chrono::milliseconds(100));
      |                     ~~~~~~~~~~~~~~~~~~^
2025-10-01 22:19:08 +03:00
Bernardo Meurer Costa
b72898b2aa
refactor(libstore): extract S3 URL parsing into separate files
Move ParsedS3URL from s3.cc/.hh into dedicated s3-url.cc/.hh files.
This separates URL parsing utilities (which are protocol-agnostic) from
the AWS SDK-specific S3Helper implementation, making the code cleaner
and enabling reuse by future curl-based S3 implementation.
2025-10-01 16:11:38 +00:00
John Ericson
251479bdda
Merge pull request #14127 from obsidiansystems/registerDrvOutput-no-blanket-unsupported
`Store::registerDrvOutput` make pure virtual
2025-10-01 08:51:18 -04:00
John Ericson
772a38069e
Merge pull request #14129 from fzakaria/fzakaria/shellcheck-multiple-6
Remove all shellcheck exclusions
2025-09-30 23:54:53 -04:00
Farid Zakaria
015b639cea shellcheck fix: tests/functional/why-depends.sh 2025-09-30 20:27:51 -07:00
Farid Zakaria
c8ef6dfa5a shellcheck fix: tests/functional/user-envs.sh 2025-09-30 20:27:50 -07:00
Farid Zakaria
13eac5295d shellcheck fix: tests/functional/user-envs.builder.sh 2025-09-30 20:23:02 -07:00
Farid Zakaria
049c4c7546 shellcheck fix: tests/functional/user-envs-test-case.sh 2025-09-30 20:22:11 -07:00
Farid Zakaria
359e73a6db shellcheck fix: tests/functional/user-envs-migration.sh 2025-09-30 20:20:13 -07:00
Farid Zakaria
799cd62ec8 shellcheck fix: tests/functional/toString-path.sh 2025-09-30 20:19:47 -07:00
Farid Zakaria
b349783830 shellcheck fix: tests/functional/supplementary-groups.sh 2025-09-30 20:19:27 -07:00
Farid Zakaria
8c9bfb6e12 shellcheck fix: tests/functional/simple.builder.sh 2025-09-30 20:18:48 -07:00