From 1e371c4a4904bda11cd8c6cd78839252cc188e77 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 16 May 2025 10:27:29 +0200 Subject: [PATCH 01/17] docs: fix duplicate anchor `#deriving-path-encoding` is defined in two places, I _think_ this is the correct one to change. (cherry picked from commit 4c50cf798e05341ef6b0b08cd227a525234173d1) --- doc/manual/source/store/derivation/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/store/derivation/index.md b/doc/manual/source/store/derivation/index.md index 911c28485a7..16ffc0923d9 100644 --- a/doc/manual/source/store/derivation/index.md +++ b/doc/manual/source/store/derivation/index.md @@ -282,7 +282,7 @@ type DerivingPath = ConstantPath | OutputPath; Under this extended model, `DerivingPath`s are thus inductively built up from a root `ConstantPath`, wrapped with zero or more outer `OutputPath`s. -### Encoding {#deriving-path-encoding} +### Encoding {#deriving-path-encoding-higher-order} The encoding is adjusted in the natural way, encoding the `drv` field recursively using the same deriving path encoding. The result of this is that it is possible to have a chain of `^` at the end of the final string, as opposed to just a single one. From 354d4c4a32d0764c4a5344d2874c180edae6fc5e Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Fri, 23 May 2025 12:06:59 +0000 Subject: [PATCH 02/17] export/meson: Don't require `-std=c++2a` for -c libraries in `.pc` files (cherry picked from commit d8da8f0cd6eafeee975e775d1fb74fa37d7012af) --- nix-meson-build-support/export/meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nix-meson-build-support/export/meson.build b/nix-meson-build-support/export/meson.build index b2409de8571..950bd954434 100644 --- a/nix-meson-build-support/export/meson.build +++ b/nix-meson-build-support/export/meson.build @@ -11,12 +11,18 @@ endforeach requires_public += deps_public extra_pkg_config_variables = get_variable('extra_pkg_config_variables', {}) + +extra_cflags = [] +if not meson.project_name().endswith('-c') + extra_cflags += ['-std=c++2a'] +endif + import('pkgconfig').generate( this_library, filebase : meson.project_name(), name : 'Nix', description : 'Nix Package Manager', - extra_cflags : ['-std=c++2a'], + extra_cflags : extra_cflags, requires : requires_public, requires_private : requires_private, libraries_private : libraries_private, From e04004ebc2c78c89dd104eae674a97cb5571a087 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 27 May 2025 11:56:45 +0200 Subject: [PATCH 03/17] nix flake archive: add --no-check-sigs option Allows to copy the archive to a remote host and not get error: cannot add path '/nix/store/01x2k4nlxcpyd85nnr0b9gm89rm8ff4x-source' because it lacks a signature by a trusted key (cherry picked from commit 80a429348637b5b2f76a93caa9e5a31936f1e834) --- src/nix/flake.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index c739c3686e2..bb1edb6ad4f 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -1019,6 +1019,10 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun { std::string dstUri; + CheckSigsFlag checkSigs = CheckSigs; + + SubstituteFlag substitute = NoSubstitute; + CmdFlakeArchive() { addFlag({ @@ -1027,6 +1031,11 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun .labels = {"store-uri"}, .handler = {&dstUri}, }); + addFlag({ + .longName = "no-check-sigs", + .description = "Do not require that paths are signed by trusted keys.", + .handler = {&checkSigs, NoCheckSigs}, + }); } std::string description() override @@ -1087,7 +1096,8 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun if (!dryRun && !dstUri.empty()) { ref dstStore = dstUri.empty() ? openStore() : openStore(dstUri); - copyPaths(*store, *dstStore, sources); + + copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute); } } }; From 8f5e9b38f17cc428bc8ab50b72fc99cf62a2c2d6 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Tue, 27 May 2025 22:28:13 +0000 Subject: [PATCH 04/17] tests/functional: Add more language tests for builtins.match These tests have been collected from nixpkgs f870c6ccc8951fc48aeb293cf3e98ade6ac42668 usage of builtins.match for x86_64-linux eval system. At most 2 matching and non-matching cases are included for each encountered regex. This should hopefully add more confidence when possibly trying to switch the regex implementation in the future. (cherry picked from commit d555d6b404124dbc95bfced3dc85cb321a3baae4) --- .../lang/eval-okay-regex-match2.exp | 1 + .../lang/eval-okay-regex-match2.nix | 938 ++++++++++++++++++ 2 files changed, 939 insertions(+) create mode 100644 tests/functional/lang/eval-okay-regex-match2.exp create mode 100644 tests/functional/lang/eval-okay-regex-match2.nix diff --git a/tests/functional/lang/eval-okay-regex-match2.exp b/tests/functional/lang/eval-okay-regex-match2.exp new file mode 100644 index 00000000000..b7fb4e05e16 --- /dev/null +++ b/tests/functional/lang/eval-okay-regex-match2.exp @@ -0,0 +1 @@ +[ null null null null null null null null null null [ ] [ ] null null null null [ "gnu" "m4/m4-1.4.19.tar.bz2" ] null [ "cpan" "src/5.0/perl-5.40.0.tar.gz" ] null null null [ "10" "" ] [ "11" "" ] [ "36" ] null [ "exec" ] [ ] null [ "26" ] null [ "26" ] null [ ] null null null null null [ "meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307" ] null null [ "xmlto" ] null null [ "exec" ] null null [ ] [ ] null null [ "coconutbattery-4.0.2,152" ] [ "12" "0" ] [ "12" "8" ] [ "8" "9" "5" "30" ] [ "9" "7" "1" "26" ] null null [ ] [ ] null [ ] null [ ] null null [ null null "draupnir" ] [ ] [ ] null null [ null null "renderer" ] [ ] [ ] [ null ] null [ null ] null null null [ ] [ ] [ "p" ] [ "p" ] [ "systemtap" ] null [ ] null null [ ] null [ "20220722-71c783507536-b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] [ ] [ "0.3.2308" ] null null null [ "17.0.14+" "7" ] null [ null ] [ null ] null null [ "21.0.7+" "6" ] null null [ ] [ ] [ "8u442" "06" ] [ ] [ "jna" "5.6.0" null null ] [ "jna" "5.6.0" null null ] [ ] [ ] null [ "2" ] null [ ] [ ] null null [ ] [ ] null null [ ] null [ ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] null [ ] null [ "rejeep" "ansi.el" ] null [ "rejeep" "commander.el" ] null [ "2.2.4" "20231021.200112" "6" ] [ "2.2.4" "20231021.200112" "6" ] [ ] [ ] null null [ "" ] [ "" ".git" ] [ "" "\\.git" ] null null null [ "" "__pycache__" ] [ "" "__pycache__" ] null null null [ "" ] null null [ ] [ ] [ ] [ "8u442" "06" ] [ ] [ ] [ "simulator" ] null null null null null null [ "notify-send" ] [ "playlistmanager" ] [ ] [ ] null null null null [ "name" ] [ "name" ] null null null null [ "pypy" "27" ] [ "pypy" "310" ] [ "refs/heads/master" ] null [ "refs/heads/master" ] null null [ ] null null null null [ ] [ ] [ ] [ ] [ "b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] null null [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ "" ] [ ] ] diff --git a/tests/functional/lang/eval-okay-regex-match2.nix b/tests/functional/lang/eval-okay-regex-match2.nix new file mode 100644 index 00000000000..31a94423d86 --- /dev/null +++ b/tests/functional/lang/eval-okay-regex-match2.nix @@ -0,0 +1,938 @@ +# Derived from nixpkgs f870c6ccc8951fc48aeb293cf3e98ade6ac42668 by instrumenting +# builtins.match to collect at most 2 non-matching and 2 matching cases of every +# regex used when running: +# `nix-env --query --available --out-path --eval-system x86_64-linux`. + +builtins.map + ( + list: + let + re = builtins.head list; + str = builtins.elemAt list 1; + in + builtins.match re str + ) + [ + [ + ''(.*)e?abi.*'' + ''linux'' + ] + [ + ''(.*)e?abi.*'' + ''linux'' + ] + [ + ''.*-none.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*nvptx.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*switch.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*-uefi.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*-none.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*nvptx.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*switch.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''.*-uefi.*'' + ''x86_64-unknown-linux-gnu'' + ] + [ + ''[[:alnum:]+_?=-][[:alnum:]+._?=-]*'' + ''bootstrap-stage0-glibc-bootstrapFiles'' + ] + [ + ''[[:alnum:]+_?=-][[:alnum:]+._?=-]*'' + ''glibc-2.40-66'' + ] + [ + ''mirror://([a-z]+)/(.*)'' + ''https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz'' + ] + [ + ''mirror://([a-z]+)/(.*)'' + ''https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=948ae97ca5703224bd3eada06b7a69f40dd15a02'' + ] + [ + ''.*/.*'' + ''mktemp'' + ] + [ + ''.*/.*'' + ''rm'' + ] + [ + ''mirror://([a-z]+)/(.*)'' + ''mirror://gnu/m4/m4-1.4.19.tar.bz2'' + ] + [ + ''5\.[0-9]*[13579]\..+'' + ''5.40.0'' + ] + [ + ''mirror://([a-z]+)/(.*)'' + ''mirror://cpan/src/5.0/perl-5.40.0.tar.gz'' + ] + [ + ''5\.[0-9]*[13579]\..+'' + ''5.40.0'' + ] + [ + ''^([0-9][0-9\.]*)(.*)$'' + ''addons'' + ] + [ + ''^([0-9][0-9\.]*)(.*)$'' + ''extras'' + ] + [ + ''^([0-9][0-9\.]*)(.*)$'' + ''10'' + ] + [ + ''^([0-9][0-9\.]*)(.*)$'' + ''11'' + ] + [ + ''[[:space:]]*0*(-?[[:digit:]]+)[[:space:]]*'' + ''36'' + ] + [ + ''0+'' + ''36'' + ] + [ + ''/bin/([^/]+)'' + ''/bin/exec'' + ] + [ + ''[[:alnum:],._+:@%/-]+'' + ''/bin/exec'' + ] + [ + ''[[:alnum:],._+:@%/-]+'' + '''' + ] + [ + ''[[:space:]]*(-?[[:digit:]]+)[[:space:]]*'' + ''26'' + ] + [ + ''0[[:digit:]]+'' + ''26'' + ] + [ + ''[[:space:]]*(-?[[:digit:]]+)[[:space:]]*'' + ''26'' + ] + [ + ''0[[:digit:]]+'' + ''26'' + ] + [ + ''[[:alnum:],._+:@%/-]+'' + ''@tcl@'' + ] + [ + ''[[:alnum:],._+:@%/-]+'' + ''@[a-zA-Z_][0-9A-Za-z_'-]*@'' + ] + [ + ''.*pypy.*'' + ''/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12'' + ] + [ + ''(.*/)?\.\.(/.*)?'' + ''package.nix'' + ] + [ + ''/bin/([^/]+)'' + '''' + ] + [ + ''[[:alnum:]+_?=-][[:alnum:]+._?=-]*'' + ''meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307'' + ] + [ + ''\.*(.*)'' + ''meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307'' + ] + [ + ''/bin/([^/]+)'' + '''' + ] + [ + ''.*-rc.*'' + ''2.49.0'' + ] + [ + ''(.*)\.git'' + ''xmlto.git'' + ] + [ + ''[a-f0-9]*'' + ''0.0.29'' + ] + [ + ''.*-rc.*'' + ''2.49.0'' + ] + [ + ''/bin/([^/]+)'' + ''/bin/exec'' + ] + [ + ''.*-polly.*'' + ''/nix/store/0yxfdnfxbzczjxhgdpac81jnas194wfj-gnu-install-dirs.patch'' + ] + [ + ''.*-polly.*'' + ''/nix/store/jh2pda7psaasq85b2rrigmkjdbl8d0a1-llvm-lit-cfg-add-libs-to-dylib-path.patch'' + ] + [ + ''.*-polly.*'' + ''/nix/store/x868j4ih7wqiivf6wr9m4g424jav0hpq-gnu-install-dirs-polly.patch'' + ] + [ + ''.*-polly.*'' + ''/nix/store/gr73nf6sca9nyzl88x58y3qxrav04yhd-polly-lit-cfg-add-libs-to-dylib-path.patch'' + ] + [ + ''(.*/)?\.\.(/.*)?'' + ''package.nix'' + ] + [ + ''[[:alnum:]+_?=-][[:alnum:]+._?=-]*'' + ''coconutbattery-4.0.2,152'' + ] + [ + ''\.*(.*)'' + ''coconutbattery-4.0.2,152'' + ] + [ + ''^([[:digit:]]+)\.([[:digit:]]+)$'' + ''12.0'' + ] + [ + ''^([[:digit:]]+)\.([[:digit:]]+)$'' + ''12.8'' + ] + [ + ''^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$'' + ''8.9.5.30'' + ] + [ + ''^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$'' + ''9.7.1.26'' + ] + [ + ''^/.*'' + ''8.20'' + ] + [ + ''^/.*'' + ''8.20'' + ] + [ + ''^github.*'' + ''github.com'' + ] + [ + ''^github.*'' + ''github.com'' + ] + [ + ''^github.*'' + ''gitlab.inria.fr'' + ] + [ + ''^gitlab.*'' + ''gitlab.inria.fr'' + ] + [ + ''^github.*'' + ''gitlab.inria.fr'' + ] + [ + ''^gitlab.*'' + ''gitlab.inria.fr'' + ] + [ + ''^gitlab.*'' + ''sf.snu.ac.kr'' + ] + [ + ''^gitlab.*'' + ''sf.snu.ac.kr'' + ] + [ + ''^(@([^/]+)/)?([^/]+)$'' + ''draupnir'' + ] + [ + ''^[[:digit:]].*'' + ''0xproto'' + ] + [ + ''^[[:digit:]].*'' + ''3270'' + ] + [ + ''^[[:digit:]].*'' + ''adwaita-mono'' + ] + [ + ''^[[:digit:]].*'' + ''agave'' + ] + [ + ''^(@([^/]+)/)?([^/]+)$'' + ''renderer'' + ] + [ + ''[^[:space:]]*'' + ''900,906,908,1010,1012,1030'' + ] + [ + ''[^[:space:]]*'' + '''' + ] + [ + ''.*[0-9]_LIN(UX)?.sh'' + ''Wolfram_14.2.1_LIN.sh'' + ] + [ + ''.*[0-9]_LIN(UX)?.sh'' + ''Wolfram_14.2.1_LIN_Bndl.sh'' + ] + [ + ''.*[0-9]_LIN(UX)?.sh'' + ''Wolfram_14.2.0_LIN.sh'' + ] + [ + ''.*[0-9]_LIN(UX)?.sh'' + ''Wolfram_14.2.0_LIN_Bndl.sh'' + ] + [ + ''[A-Z]'' + ''b'' + ] + [ + ''[A-Z]'' + ''l'' + ] + [ + ''[A-Z]'' + ''E'' + ] + [ + ''[A-Z]'' + ''T'' + ] + [ + ''([0-9A-Za-z._])[0-9A-Za-z._-]*'' + ''pythoncheck.sh'' + ] + [ + ''([0-9A-Za-z._])[0-9A-Za-z._-]*'' + ''pythoncheck.sh'' + ] + [ + ''(.*)\.git'' + ''systemtap.git'' + ] + [ + ''[a-f0-9]*'' + ''release-5.2'' + ] + [ + ''[a-f0-9]*'' + ''b7a857659f8485ee3c6769c27a3e74b0af910746'' + ] + [ + ''.*pypy.*'' + ''/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12'' + ] + [ + ''(.*)\.git'' + ''gn'' + ] + [ + ''[a-f0-9]*'' + ''df98b86690c83b81aedc909ded18857296406159'' + ] + [ + ''.*-rc\..*'' + ''22.14.0'' + ] + [ + ''.*/linux-gecko-(.*).tar.bz2'' + ''https://static.replay.io/downloads/linux-gecko-20220722-71c783507536-b7eae18423ef.tar.bz2'' + ] + [ + ''.*/linux-node-(.*)'' + ''https://static.replay.io/downloads/linux-node-20220726-bac6d66b5ca1-5b966f2f136c'' + ] + [ + ''.*-DSQLITE_ENABLE_FTS3.*'' + ''-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SOUNDEX -DSQLITE_SECURE_DELETE -DSQLITE_MAX_VARIABLE_NUMBER=250000 -DSQLITE_MAX_EXPR_DEPTH=10000'' + ] + [ + '' + [ + ]*(.*[^ + ])[ + ]*'' + '' + 0.3.2308 + '' + ] + [ + ''(.*)\.git'' + ''rtmpdump'' + ] + [ + ''.*;.*'' + ''Game'' + ] + [ + ''.*;.*'' + ''Game'' + ] + [ + ''(.+)+(.+)'' + ''17.0.14+7'' + ] + [ + ''^#(.*)$'' + ''20240715'' + ] + [ + ''[[:alpha:]_][[:alnum:]_]*(\.[[:alpha:]_][[:alnum:]_]*)*'' + ''external_deps_dirs'' + ] + [ + ''[[:alpha:]_][[:alnum:]_]*(\.[[:alpha:]_][[:alnum:]_]*)*'' + ''local_cache'' + ] + [ + ''^#(.*)$'' + ''20240715'' + ] + [ + ''.*-rc\..*'' + ''20.19.2'' + ] + [ + ''(.+)+(.+)'' + ''21.0.7+6'' + ] + [ + ''.*llvm-tblgen.*'' + ''-DLLVM_INSTALL_PACKAGE_DIR:STRING=/02qcpld1y6xhs5gz9bchpxaw0xdhmsp5dv88lh25r2ss44kh8dxz/lib/cmake/llvm'' + ] + [ + ''.*llvm-tblgen.*'' + ''-DLLVM_ENABLE_RTTI:BOOL=TRUE'' + ] + [ + ''.*llvm-tblgen.*'' + ''-DLLVM_TABLEGEN:STRING=/nix/store/xp9hkw8nsw9p81d69yvcg1yr6f7vh71c-llvm-tblgen-18.1.8/bin/llvm-tblgen'' + ] + [ + ''.*llvm-tblgen.*'' + ''-DLLVM_TABLEGEN_EXE:STRING=/nix/store/xp9hkw8nsw9p81d69yvcg1yr6f7vh71c-llvm-tblgen-18.1.8/bin/llvm-tblgen'' + ] + [ + ''(.+)-b(.+)'' + ''8u442-b06'' + ] + [ + ''.*-DSQLITE_ENABLE_FTS3.*'' + ''-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SOUNDEX -DSQLITE_SECURE_DELETE -DSQLITE_MAX_VARIABLE_NUMBER=250000 -DSQLITE_MAX_EXPR_DEPTH=10000'' + ] + [ + ''([^/]*)/([^/]*)(/SNAPSHOT)?(/.*)?'' + ''jna/5.6.0'' + ] + [ + ''([^/]*)/([^/]*)(/SNAPSHOT)?(/.*)?'' + ''jna/5.6.0'' + ] + [ + ''[0-9]+'' + ''2'' + ] + [ + ''[0-9]+'' + ''3'' + ] + [ + ''[0-9]+'' + ''unstable'' + ] + [ + ''[[:space:]]*0*(-?[[:digit:]]+)[[:space:]]*'' + ''2'' + ] + [ + ''0+'' + ''2'' + ] + [ + ''0+'' + ''0'' + ] + [ + ''.*org/eclipse/jdt/ecj.*'' + ''https://repo.maven.apache.org/maven2/org/eclipse/jdt/ecj/maven-metadata.xml'' + ] + [ + ''.*[<>"'&].*'' + ''org.eclipse.jdt'' + ] + [ + ''.*[<>"'&].*'' + ''20241203050026'' + ] + [ + ''[a-zA-Z_][a-zA-Z0-9_'-]*'' + ''cpu'' + ] + [ + ''[a-zA-Z_][a-zA-Z0-9_'-]*'' + ''bits'' + ] + [ + ''armv[67]l-linux'' + ''x86_64-linux'' + ] + [ + ''armv[67]l-linux'' + ''x86_64-linux'' + ] + [ + ''0+'' + ''0'' + ] + [ + ''[0-9]+'' + ''rc'' + ] + [ + ''.*tensorflow_cpu.*'' + ''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow_cpu-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'' + ] + [ + ''git\+([^?]+)(\?(rev|tag|branch)=(.*))?#(.*)'' + ''git+https://github.com/GRA0007/google-cloud-rs.git#4a2db92efd57a896e14d18877458c6ae43418aec'' + ] + [ + ''git\+([^?]+)(\?(rev|tag|branch)=(.*))?#(.*)'' + ''git+https://github.com/GRA0007/google-cloud-rs.git#4a2db92efd57a896e14d18877458c6ae43418aec'' + ] + [ + ''mpv[-_](.*)'' + ''detect-image'' + ] + [ + ''.*org/bouncycastle/bcutil-lts8on.*'' + ''https://plugins.gradle.org/m2/org/bouncycastle/bcutil-lts8on/maven-metadata.xml'' + ] + [ + ''^.*-unstable-([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})$'' + ''0.9.0'' + ] + [ + ''(.+)/(.+)'' + ''rejeep/ansi.el'' + ] + [ + ''^.*-unstable-([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})$'' + ''20230306.1823'' + ] + [ + ''(.+)/(.+)'' + ''rejeep/commander.el'' + ] + [ + ''mpv[-_](.*)'' + ''equalizer'' + ] + [ + ''(.*)-([^-]*)-([^-]*)'' + ''2.2.4-20231021.200112-6'' + ] + [ + ''(.*)-([^-]*)-([^-]*)'' + ''2.2.4-20231021.200112-6'' + ] + [ + ''.*com/badlogicgames/gdx-controllers/gdx-controllers-core.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-core/2.2.4-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*com/badlogicgames/gdx-controllers/gdx-controllers-desktop.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-desktop/2.2.4-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''^(#.*|$)'' + ''.git'' + ] + [ + ''^(#.*|$)'' + ''__pycache__'' + ] + [ + ''^(#.*|$)'' + '''' + ] + [ + ''^(!?)(.*)'' + ''.git'' + ] + [ + ''^(/?)(.*)'' + ''\.git'' + ] + [ + ''.+/.+'' + ''\.git'' + ] + [ + ''^(.*)/$'' + ''(^|.*/)\.git'' + ] + [ + ''(^|.*/)\.git'' + ''.flake8'' + ] + [ + ''^(!?)(.*)'' + ''__pycache__'' + ] + [ + ''^(/?)(.*)'' + ''__pycache__'' + ] + [ + ''.+/.+'' + ''__pycache__'' + ] + [ + ''^(.*)/$'' + ''(^|.*/)__pycache__'' + ] + [ + ''(^|.*/)__pycache__'' + ''.flake8'' + ] + [ + ''^(#.*|$)'' + '''' + ] + [ + ''(^|.*/)\.git'' + ''.gitignore'' + ] + [ + ''(^|.*/)__pycache__'' + ''.gitignore'' + ] + [ + ''^[a-fA-F0-9]{40}$'' + ''3a667bdb3d7f0955a5a51c8468eac83210c1439e'' + ] + [ + ''.*com/android/tools/build/gradle.*'' + ''https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'' + ] + [ + ''^[a-fA-F0-9]{40}$'' + ''dc0a228a5544988d4a920cfb40be9cd28db41423'' + ] + [ + ''(.+)-b(.+)'' + ''8u442-b06'' + ] + [ + ''.*com/tobiasdiez/easybind.*'' + ''https://oss.sonatype.org/content/groups/public/com/tobiasdiez/easybind/2.2.1-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*org/hamcrest/hamcrest.*'' + ''https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest/maven-metadata.xml'' + ] + [ + ''^.*CONFIG_BOARD_DIRECTORY="([a-zA-Z0-9_]+)".*$'' + '' + # CONFIG_LOW_LEVEL_OPTIONS is not set + # CONFIG_MACH_AVR is not set + # CONFIG_MACH_ATSAM is not set + # CONFIG_MACH_ATSAMD is not set + # CONFIG_MACH_LPC176X is not set + # CONFIG_MACH_STM32 is not set + # CONFIG_MACH_HC32F460 is not set + # CONFIG_MACH_RPXXXX is not set + # CONFIG_MACH_PRU is not set + # CONFIG_MACH_AR100 is not set + # CONFIG_MACH_LINUX is not set + CONFIG_MACH_SIMU=y + CONFIG_BOARD_DIRECTORY="simulator" + CONFIG_CLOCK_FREQ=20000000 + CONFIG_SERIAL=y + CONFIG_SIMULATOR_SELECT=y + CONFIG_SERIAL_BAUD=250000 + CONFIG_USB_VENDOR_ID=0x1d50 + CONFIG_USB_DEVICE_ID=0x614e + CONFIG_USB_SERIAL_NUMBER="12345" + CONFIG_WANT_ADC=y + CONFIG_WANT_SPI=y + CONFIG_WANT_SOFTWARE_SPI=y + CONFIG_WANT_HARD_PWM=y + CONFIG_WANT_BUTTONS=y + CONFIG_WANT_TMCUART=y + CONFIG_WANT_NEOPIXEL=y + CONFIG_WANT_PULSE_COUNTER=y + CONFIG_WANT_ST7920=y + CONFIG_WANT_HD44780=y + CONFIG_WANT_ADXL345=y + CONFIG_WANT_LIS2DW=y + CONFIG_WANT_THERMOCOUPLE=y + CONFIG_WANT_HX71X=y + CONFIG_WANT_ADS1220=y + CONFIG_WANT_SENSOR_ANGLE=y + CONFIG_NEED_SENSOR_BULK=y + CONFIG_CANBUS_FREQUENCY=1000000 + CONFIG_INLINE_STEPPER_HACK=y + CONFIG_HAVE_GPIO=y + CONFIG_HAVE_GPIO_ADC=y + CONFIG_HAVE_GPIO_SPI=y + CONFIG_HAVE_GPIO_HARD_PWM=y + '' + ] + [ + ''[^.]*[.][^.]*-.*'' + ''5.15.183-rt85'' + ] + [ + ''[^.]*[.][^.]*-.*'' + ''6.1.134-rt51'' + ] + [ + ''^\.sw[a-z]$'' + ''package.nix'' + ] + [ + ''^\..*\.sw[a-z]$'' + ''package.nix'' + ] + [ + ''^\.sw[a-z]$'' + ''pyproject.toml'' + ] + [ + ''^\..*\.sw[a-z]$'' + ''pyproject.toml'' + ] + [ + ''mpv[-_](.*)'' + ''mpv-notify-send'' + ] + [ + ''mpv[-_](.*)'' + ''mpv-playlistmanager'' + ] + [ + ''.*ch/qos/logback/logback-core.*'' + ''https://repo.maven.apache.org/maven2/ch/qos/logback/logback-core/maven-metadata.xml'' + ] + [ + ''.*commons-codec/commons-codec.*'' + ''https://repo.maven.apache.org/maven2/commons-codec/commons-codec/maven-metadata.xml'' + ] + [ + ''/[0-9a-z]{52}'' + ''/run/opengl-driver'' + ] + [ + ''/[0-9a-z]{52}'' + ''/dev/dri'' + ] + [ + ''<(.*)>'' + ''_module'' + ] + [ + ''<(.*)>'' + ''args'' + ] + [ + ''<(.*)>'' + '''' + ] + [ + ''<(.*)>'' + '''' + ] + [ + ''[a-zA-Z_][a-zA-Z0-9_'-]*'' + ''2bwm'' + ] + [ + ''[a-zA-Z_][a-zA-Z0-9_'-]*'' + ''pm.max_children'' + ] + [ + ''(pypy|python)([[:digit:]]*)'' + ''override'' + ] + [ + ''(pypy|python)([[:digit:]]*)'' + ''overrideDerivation'' + ] + [ + ''(pypy|python)([[:digit:]]*)'' + ''pypy27'' + ] + [ + ''(pypy|python)([[:digit:]]*)'' + ''pypy310'' + ] + [ + ''^ref: (.*)$'' + ''ref: refs/heads/master'' + ] + [ + ''^ref: (.*)$'' + ''f870c6ccc8951fc48aeb293cf3e98ade6ac42668'' + ] + [ + ''^ref: (.*)$'' + ''ref: refs/heads/master'' + ] + [ + ''^ref: (.*)$'' + ''f870c6ccc8951fc48aeb293cf3e98ade6ac42668'' + ] + [ + ''.*\.post[0-9]+'' + ''1.7.2'' + ] + [ + ''.*tensorflow_cpu.*'' + ''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow_cpu-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'' + ] + [ + ''.*tensorflow_cpu.*'' + ''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'' + ] + [ + ''.*\.post[0-9]+'' + ''1.7.2'' + ] + [ + ''.*darwin.*'' + ''i686-cygwin'' + ] + [ + ''.*darwin.*'' + ''x86_64-cygwin'' + ] + [ + ''.*darwin.*'' + ''x86_64-darwin'' + ] + [ + ''.*darwin.*'' + ''aarch64-darwin'' + ] + [ + ''.*com/badlogicgames/gdx-controllers/gdx-controllers-core.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-core/2.2.4-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*com/badlogicgames/gdx-controllers/gdx-controllers-desktop.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-desktop/2.2.4-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*/linux-recordreplay-(.*).tgz'' + ''https://static.replay.io/downloads/linux-recordreplay-b7eae18423ef.tgz'' + ] + [ + ''.*/linux-node-(.*)'' + ''https://static.replay.io/downloads/linux-node-20220726-bac6d66b5ca1-5b966f2f136c'' + ] + [ + ''.*-large-wordlist.*'' + ''hunspell-dict-cs-cz-libreoffice-6.3.0.4'' + ] + [ + ''.*-large-wordlist.*'' + ''hunspell-dict-da-dk-2.5.189'' + ] + [ + ''.*-large-wordlist.*'' + ''hunspell-dict-en-au-large-wordlist-2018.04.16'' + ] + [ + ''.*-large-wordlist.*'' + ''hunspell-dict-en-ca-large-wordlist-2018.04.16'' + ] + [ + ''.*com/fazecast/jSerialComm.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/com/fazecast/jSerialComm/2.11.1-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*net/java/dev/jna/jna-platform.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna-platform/5.1.1-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*net/java/dev/jna/jna-platform.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna-platform/maven-metadata.xml'' + ] + [ + ''.*net/java/dev/jna/jna.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/5.1.1-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*net/java/dev/jna/jna.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/maven-metadata.xml'' + ] + [ + ''.*org/java-websocket/Java-WebSocket.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/org/java-websocket/Java-WebSocket/1.3.10-SNAPSHOT/maven-metadata.xml'' + ] + [ + ''.*org/java-websocket/Java-WebSocket.*'' + ''https://oss.sonatype.org/content/repositories/snapshots/org/java-websocket/Java-WebSocket/maven-metadata.xml'' + ] + [ + ''.*com/melloware/jintellitype.*'' + ''https://repo.maven.apache.org/maven2/com/melloware/jintellitype/maven-metadata.xml'' + ] + [ + ''[0-9.]*([a-z]*)'' + ''2025.1.1'' + ] + [ + ''.*com/velocitypowered/velocity-brigadier.*'' + ''https://repo.papermc.io/repository/maven-public/com/velocitypowered/velocity-brigadier/1.0.0-SNAPSHOT/maven-metadata.xml'' + ] + ] From 59da02def586140257b353772ded65a039eea3ba Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Sat, 31 May 2025 07:41:27 -0700 Subject: [PATCH 05/17] Overriding gtest with gmock How did this work before... * Added .direnv/ to gitignore (cherry picked from commit 58e34a2d27a5264cc0eb36fceccc009e0ec205d0) --- .gitignore | 3 +++ src/libexpr-tests/meson.build | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9c46912406f..4782bfbafd2 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ result-* .DS_Store flake-regressions + +# direnv +.direnv/ diff --git a/src/libexpr-tests/meson.build b/src/libexpr-tests/meson.build index f7822edfd9f..35ae8a9d068 100644 --- a/src/libexpr-tests/meson.build +++ b/src/libexpr-tests/meson.build @@ -32,8 +32,8 @@ deps_private += rapidcheck gtest = dependency('gtest') deps_private += gtest -gtest = dependency('gmock') -deps_private += gtest +gmock = dependency('gmock') +deps_private += gmock configdata = configuration_data() configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) From b320aa50feb9544a44bf7f81e9cff69636c7d764 Mon Sep 17 00:00:00 2001 From: Jade Lynn Masker Date: Sat, 31 May 2025 17:50:46 -0400 Subject: [PATCH 06/17] add documentation of tarball-ttl to nix-channel (cherry picked from commit 6badd21b6a22c6037a5152463343491e770a581d) --- doc/manual/source/command-ref/nix-channel.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/manual/source/command-ref/nix-channel.md b/doc/manual/source/command-ref/nix-channel.md index 8b58392b7b5..4a7555c9058 100644 --- a/doc/manual/source/command-ref/nix-channel.md +++ b/doc/manual/source/command-ref/nix-channel.md @@ -53,6 +53,11 @@ This command has the following operations: Download the Nix expressions of subscribed channels and create a new generation. Update all channels if none is specified, and only those included in *names* otherwise. + > **Note** + > + > `--update` uses [fetchTarball](@docroot@/language/builtins.md#builtins-fetchTarball) under the hood, so it will cache channels. + > Use `--tarball-ttl` or the nix configuration option `tarball-ttl` to change this behavior. + - `--list-generations` Prints a list of all the current existing generations for the From ab3ad122dbe02dd477f5b1f3ece50d01f9e6a6ce Mon Sep 17 00:00:00 2001 From: Jade Masker Date: Sun, 1 Jun 2025 15:55:49 -0400 Subject: [PATCH 07/17] remove overly verbose mention of fetchTarball Co-authored-by: Valentin Gagarin (cherry picked from commit 633d39109b292e88bdc98ff622f13153e866eab2) --- doc/manual/source/command-ref/nix-channel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/command-ref/nix-channel.md b/doc/manual/source/command-ref/nix-channel.md index 4a7555c9058..b1b2812d2ee 100644 --- a/doc/manual/source/command-ref/nix-channel.md +++ b/doc/manual/source/command-ref/nix-channel.md @@ -55,7 +55,7 @@ This command has the following operations: > **Note** > - > `--update` uses [fetchTarball](@docroot@/language/builtins.md#builtins-fetchTarball) under the hood, so it will cache channels. + > Downloaded channel contents are cached. > Use `--tarball-ttl` or the nix configuration option `tarball-ttl` to change this behavior. - `--list-generations` From aace3d91ac51103265964c1ef88f66ef061295a5 Mon Sep 17 00:00:00 2001 From: Jade Masker Date: Sun, 1 Jun 2025 15:56:46 -0400 Subject: [PATCH 08/17] add reference to the tarball-ttl documentation Co-authored-by: Valentin Gagarin (cherry picked from commit c0ceaa2d5db4a2ad96c4b7ee475dc53834d6a502) --- doc/manual/source/command-ref/nix-channel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/command-ref/nix-channel.md b/doc/manual/source/command-ref/nix-channel.md index b1b2812d2ee..ed9cbb41fbf 100644 --- a/doc/manual/source/command-ref/nix-channel.md +++ b/doc/manual/source/command-ref/nix-channel.md @@ -56,7 +56,7 @@ This command has the following operations: > **Note** > > Downloaded channel contents are cached. - > Use `--tarball-ttl` or the nix configuration option `tarball-ttl` to change this behavior. + > Use `--tarball-ttl` or the [`tarball-ttl` configuration option](@docroot@/command-ref/conf-file.md#conf-tarball-ttl) to change the validity period of cached downloads. - `--list-generations` From 556b71d6c082374ad929720e52a2f8427aa42207 Mon Sep 17 00:00:00 2001 From: PopeRigby Date: Tue, 3 Jun 2025 13:26:09 -0700 Subject: [PATCH 09/17] Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten The latter alias is deprecated in favor of the former, and produces a warning. (cherry picked from commit cfc15d6921fbbea98df0ea1b5ddf139221da4ef7) --- docker.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker.nix b/docker.nix index d52c317d6b1..9e680653342 100644 --- a/docker.nix +++ b/docker.nix @@ -155,7 +155,7 @@ let nixConfContents = (lib.concatStringsSep "\n" ( - lib.mapAttrsFlatten ( + lib.mapAttrsToList ( n: v: let vStr = if builtins.isList v then lib.concatStringsSep " " v else v; From f97ff25aecd8cd68903e9b307aeaaf7d52599a75 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 11 Jun 2025 08:52:04 -0700 Subject: [PATCH 10/17] Fix broken link in configuration description (cherry picked from commit 525078c59d8391b866f723338db1ee525a4a88cb) --- src/libstore/include/nix/store/globals.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/include/nix/store/globals.hh b/src/libstore/include/nix/store/globals.hh index 6cf93f2f7a4..8b0650faa24 100644 --- a/src/libstore/include/nix/store/globals.hh +++ b/src/libstore/include/nix/store/globals.hh @@ -389,7 +389,7 @@ public: To build only on remote machines and disable local builds, set [`max-jobs`](#conf-max-jobs) to 0. - If you want the remote machines to use substituters, set [`builders-use-substitutes`](#conf-builders-use-substituters) to `true`. + If you want the remote machines to use substituters, set [`builders-use-substitutes`](#conf-builders-use-substitutes) to `true`. )", {}, false}; From ffe384b21e8220b93575483a8aee8b6b9858691e Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 12 Jun 2025 09:41:37 +0200 Subject: [PATCH 11/17] docker: make sure `nix config check` works (cherry picked from commit 57c72dee9b27b50b2a3b7a738cf33329acfb7236) --- docker.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker.nix b/docker.nix index d52c317d6b1..16d66d23aa6 100644 --- a/docker.nix +++ b/docker.nix @@ -275,7 +275,6 @@ let ln -s ${profile} $out/nix/var/nix/profiles/default-1-link ln -s /nix/var/nix/profiles/default-1-link $out/nix/var/nix/profiles/default - ln -s /nix/var/nix/profiles/default $out${userHome}/.nix-profile ln -s ${channel} $out/nix/var/nix/profiles/per-user/${uname}/channels-1-link ln -s /nix/var/nix/profiles/per-user/${uname}/channels-1-link $out/nix/var/nix/profiles/per-user/${uname}/channels @@ -327,7 +326,7 @@ pkgs.dockerTools.buildLayeredImageWithNixDb { ''; config = { - Cmd = [ "${userHome}/.nix-profile/bin/bash" ]; + Cmd = [ (lib.getExe pkgs.bashInteractive) ]; User = "${toString uid}:${toString gid}"; Env = [ "USER=${uname}" From 4f105e7c7dc73da05abf636e172d159197a10668 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Thu, 12 Jun 2025 22:29:05 +0000 Subject: [PATCH 12/17] libexpr: Remove non-const overload of `listElems` This overload isn't actually necessary anywhere and doesn't make much sense. The pointers to `Value`s are themselves const, but the `Value`s are mutable. A non-const member function implies that the object itself can be modified but this doesn't make much sense considering the return type: `Value * const * `, which is a pointer to a constant array of pointers to mutable values. (cherry picked from commit 7b46eb9958e7681958020b68d9ea30a52be7cf09) --- src/libexpr/include/nix/expr/value.hh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/libexpr/include/nix/expr/value.hh b/src/libexpr/include/nix/expr/value.hh index d7b7a07105e..11811e548df 100644 --- a/src/libexpr/include/nix/expr/value.hh +++ b/src/libexpr/include/nix/expr/value.hh @@ -451,11 +451,6 @@ public: return internalType == tList1 || internalType == tList2 || internalType == tListN; } - Value * const * listElems() - { - return internalType == tList1 || internalType == tList2 ? payload.smallList : payload.bigList.elems; - } - std::span listItems() const { assert(isList()); From cac6cfe51e6a6faf59c8a1b2b2dc2833e93e32e7 Mon Sep 17 00:00:00 2001 From: jayeshv Date: Fri, 13 Jun 2025 12:28:27 +0200 Subject: [PATCH 13/17] Fix a minor typo (cherry picked from commit 699db04df3e755b9c3411567ca332709c39ba07d) --- doc/manual/source/installation/installing-binary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/installation/installing-binary.md b/doc/manual/source/installation/installing-binary.md index 6a1a5ddcaff..21c15637437 100644 --- a/doc/manual/source/installation/installing-binary.md +++ b/doc/manual/source/installation/installing-binary.md @@ -25,7 +25,7 @@ This performs the default type of installation for your platform: We recommend the multi-user installation if it supports your platform and you can authenticate with `sudo`. -The installer can configured with various command line arguments and environment variables. +The installer can be configured with various command line arguments and environment variables. To show available command line flags: ```console From e52fe2cab4061058980f2b0ef9b3ac66f14bfbff Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 17 Jun 2025 08:45:29 +0200 Subject: [PATCH 14/17] libstore: fix race condition when creating state directories Running parallel nix in nix can lead to multiple instances trying to create the state directories and failing on the `createSymlink` step, because the link already exists. `replaceSymlink` is already idempotent, so let's use that. Resolves #2706 (cherry picked from commit d64c92216409b08ca40f43e601fbdae59114e812) --- src/libstore/local-store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 339d3c926b0..63108fab4e0 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -126,7 +126,7 @@ LocalStore::LocalStore(std::string_view scheme, PathView path, const Params & pa Path gcRootsDir = stateDir + "/gcroots"; if (!pathExists(gcRootsDir)) { createDirs(gcRootsDir); - createSymlink(profilesDir, gcRootsDir + "/profiles"); + replaceSymlink(profilesDir, gcRootsDir + "/profiles"); } for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) { From 66a5d4c31bfa30fc889c6699965d237b29479986 Mon Sep 17 00:00:00 2001 From: Nikita Krasnov Date: Fri, 20 Jun 2025 21:19:13 +0300 Subject: [PATCH 15/17] Update docs (cherry picked from commit 785f3867fd6c4f0dfa0863b215a30ae262187472) --- doc/manual/source/store/derivation/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/store/derivation/index.md b/doc/manual/source/store/derivation/index.md index 911c28485a7..c89ce07a50b 100644 --- a/doc/manual/source/store/derivation/index.md +++ b/doc/manual/source/store/derivation/index.md @@ -189,7 +189,7 @@ This ensures that there is a canonical [store path] used to refer to the derivat > **Note** > > Currently, the canonical encoding for every derivation is the "ATerm" format, -> but this is subject to change for types derivations which are not yet stable. +> but this is subject to change for the types of derivations which are not yet stable. Regardless of the format used, when serializing a derivation to a store object, that store object will be content-addressed. From 01963be827ebf7a268c2ba39d0b54c966e012b8d Mon Sep 17 00:00:00 2001 From: Egor Konovalov <73017521+egorkonovalov@users.noreply.github.com> Date: Mon, 23 Jun 2025 11:26:59 +0200 Subject: [PATCH 16/17] Fix link Remove extra `realise` (cherry picked from commit df21f249877cead560782f5ccdd1796bc5682349) --- doc/manual/source/store/derivation/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/source/store/derivation/index.md b/doc/manual/source/store/derivation/index.md index 911c28485a7..4516d5f3788 100644 --- a/doc/manual/source/store/derivation/index.md +++ b/doc/manual/source/store/derivation/index.md @@ -162,7 +162,7 @@ There are two types of placeholder, corresponding to the two cases where this pr > **Explanation** > -> In general, we need to realise [realise] a [store object] in order to be sure to have a store object for it. +> In general, we need to [realise] a [store object] in order to be sure to have a store object for it. > But for these two cases this is either impossible or impractical: > > - In the output case this is impossible: From 9af1782bdf31d9359eaa597950a0fb7cbe953316 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Wed, 25 Jun 2025 00:07:58 +0300 Subject: [PATCH 17/17] libstore-tests: Don't leak memory in tests We shouldn't leak memory in unit tests in order to make enabling ASAN easier. (cherry picked from commit 55d12dfc5db53f7b2f90fef235e7115c9c17e8b2) --- .../include/nix/store/tests/nix_api_store.hh | 8 ++++++-- src/libstore-tests/nix_api_store.cc | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh b/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh index 9d173cc68ee..7beb8c77434 100644 --- a/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh +++ b/src/libstore-test-support/include/nix/store/tests/nix_api_store.hh @@ -38,6 +38,8 @@ public: Store * store; std::string nixDir; std::string nixStoreDir; + std::string nixStateDir; + std::string nixLogDir; protected: void init_local_store() @@ -58,11 +60,13 @@ protected: #endif nixStoreDir = nixDir + "/my_nix_store"; + nixStateDir = nixDir + "/my_state"; + nixLogDir = nixDir + "/my_log"; // Options documented in `nix help-stores` const char * p1[] = {"store", nixStoreDir.c_str()}; - const char * p2[] = {"state", (new std::string(nixDir + "/my_state"))->c_str()}; - const char * p3[] = {"log", (new std::string(nixDir + "/my_log"))->c_str()}; + const char * p2[] = {"state", nixStateDir.c_str()}; + const char * p3[] = {"log", nixLogDir.c_str()}; const char ** params[] = {p1, p2, p3, nullptr}; diff --git a/src/libstore-tests/nix_api_store.cc b/src/libstore-tests/nix_api_store.cc index 4eb95360a6a..3d9f7908b3f 100644 --- a/src/libstore-tests/nix_api_store.cc +++ b/src/libstore-tests/nix_api_store.cc @@ -71,17 +71,21 @@ TEST_F(nix_api_store_test, ReturnsValidStorePath) ASSERT_NE(result, nullptr); ASSERT_STREQ("name", result->path.name().data()); ASSERT_STREQ(PATH_SUFFIX.substr(1).c_str(), result->path.to_string().data()); + nix_store_path_free(result); } TEST_F(nix_api_store_test, SetsLastErrCodeToNixOk) { - nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str()); + StorePath * path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str()); ASSERT_EQ(ctx->last_err_code, NIX_OK); + nix_store_path_free(path); } TEST_F(nix_api_store_test, DoesNotCrashWhenContextIsNull) { - ASSERT_NO_THROW(nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str())); + StorePath * path = nullptr; + ASSERT_NO_THROW(path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str())); + nix_store_path_free(path); } TEST_F(nix_api_store_test, get_version) @@ -119,6 +123,7 @@ TEST_F(nix_api_store_test, nix_store_is_valid_path_not_in_store) { StorePath * path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str()); ASSERT_EQ(false, nix_store_is_valid_path(ctx, store, path)); + nix_store_path_free(path); } TEST_F(nix_api_store_test, nix_store_real_path)