From 0f22d60c7e94956d6570d9c6e7905bbbe97ec174 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Fri, 23 Jan 2026 02:47:13 +0300 Subject: [PATCH 1/4] tests/nixos: Specify -f argument to mount Otherwise we barf on btrfs: machine # [ 17.027621] EXT4-fs error (device vdb): ext4_lookup:1819: inode #2476: comm nix: iget: checksum invalid machine # error: getting status of '/mnt/nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3': Bad message machine # checking '/nix/store/m3954qff15v7z1l6lpyqf8v2h47c7hv2-mailcap-2.1.54'... machine # checking '/nix/store/xh1ff9c9c0yv1wxrwa5gnfp092yagh7v-tzdata-2025b'... machine # [ 17.172793] EXT4-fs error (device vdb): ext4_lookup:1819: inode #1777: comm nix: iget: checksum invalid machine # error: getting status of '/mnt/nix/store/xh1ff9c9c0yv1wxrwa5gnfp092yagh7v-tzdata-2025b/share/zoneinfo/leap-seconds.list': Bad message --- tests/nixos/fsync.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nixos/fsync.nix b/tests/nixos/fsync.nix index e215e5b3c25..2af9773336d 100644 --- a/tests/nixos/fsync.nix +++ b/tests/nixos/fsync.nix @@ -40,7 +40,7 @@ in for fs in ("ext4", "btrfs", "xfs"): machine.succeed("mkfs.{} {} /dev/vdb".format(fs, "-F" if fs == "ext4" else "-f")) machine.succeed("mkdir -p /mnt") - machine.succeed("mount /dev/vdb /mnt") + machine.succeed("mount -t {} /dev/vdb /mnt".format(fs)) machine.succeed("sync") machine.succeed("nix copy --offline ${pkg1} --to /mnt") machine.crash() @@ -48,7 +48,7 @@ in machine.start() machine.wait_for_unit("multi-user.target") machine.succeed("mkdir -p /mnt") - machine.succeed("mount /dev/vdb /mnt") + machine.succeed("mount -t {} /dev/vdb /mnt".format(fs)) machine.succeed("nix path-info --offline --store /mnt ${pkg1}") machine.succeed("nix store verify --all --store /mnt --no-trust") From c4c0aee4f1bdc4c2ef3b2cd0d86ce988b8e1a07b Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Fri, 23 Jan 2026 01:39:58 +0300 Subject: [PATCH 2/4] tests/nixos: Drop otherNixes.nix_2_3, replace with 2_18 Since [1] there's no way to run 2.3 anymore and overrides wouldn't be very helpful. Let's instead use 2.18, which is the baseline for nixpkgs. --- tests/nixos/default.nix | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/nixos/default.nix b/tests/nixos/default.nix index fd7ea61e30f..c30e872bc1d 100644 --- a/tests/nixos/default.nix +++ b/tests/nixos/default.nix @@ -75,21 +75,6 @@ let ]; }; - otherNixes.nix_2_3.setNixPackage = - { lib, pkgs, ... }: - { - imports = [ checkOverrideNixVersion ]; - nix.package = lib.mkForce ( - pkgs.nixVersions.nix_2_3.overrideAttrs (o: { - meta = o.meta // { - # This version shouldn't be used by end-users, but we run tests against - # it to ensure we don't break protocol compatibility. - knownVulnerabilities = [ ]; - }; - }) - ); - }; - otherNixes.nix_2_13.setNixPackage = { lib, pkgs, ... }: { @@ -106,6 +91,14 @@ let ); }; + otherNixes.nix_2_18.setNixPackage = + { lib, pkgs, ... }: + { + imports = [ checkOverrideNixVersion ]; + nix.package = lib.mkForce ( + nixpkgs-23-11.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nixVersions.nix_2_18 + ); + }; in { From dcaaf2c65f103786d2afdb18a6c2380e85566510 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Fri, 23 Jan 2026 22:06:55 +0300 Subject: [PATCH 3/4] dev-shell: Use stdenv.hostPlatform instead of hostPlatform This is now a warning in 25.11: > evaluation warning: 'hostPlatform' has been renamed to/replaced by 'stdenv.hostPlatform' --- packaging/dev-shell.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/dev-shell.nix b/packaging/dev-shell.nix index 7b2638f4e21..72d517d876a 100644 --- a/packaging/dev-shell.nix +++ b/packaging/dev-shell.nix @@ -131,7 +131,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs ( ignoreCrossFile = flags: builtins.filter (flag: !(lib.strings.hasInfix "cross-file" flag)) flags; availableComponents = lib.filterAttrs ( - k: v: lib.meta.availableOn pkgs.hostPlatform v + k: v: lib.meta.availableOn pkgs.stdenv.hostPlatform v ) allComponents; activeComponents = buildInputsClosureCond isInternal ( @@ -323,7 +323,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs ( pkgs.buildPackages.shellcheck pkgs.buildPackages.include-what-you-use ] - ++ lib.optional pkgs.hostPlatform.isUnix pkgs.buildPackages.gdb + ++ lib.optional stdenv.hostPlatform.isUnix pkgs.buildPackages.gdb ++ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) ( lib.hiPrio pkgs.buildPackages.clang-tools ) @@ -341,7 +341,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs ( buildInputs = # TODO change Nixpkgs to mark gbenchmark as building on Windows - lib.optional pkgs.hostPlatform.isUnix pkgs.gbenchmark + lib.optional stdenv.hostPlatform.isUnix pkgs.gbenchmark ++ dedupByString (v: "${v}") ( lib.filter (x: !isInternal x) (lib.lists.concatMap (c: c.buildInputs) activeComponents) ) From 64458acde2a88bfda21e61d67aefe080af9a57b1 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sun, 25 Jan 2026 01:26:23 +0300 Subject: [PATCH 4/4] packaging: Fix static builds with S3 support, enable by default aws-crt-cpp doesn't provide pkg-config files and has a bunch of transitive deps, so switch to cmake for resolving the dependency. --- src/libstore/meson.build | 11 ++++++----- src/libstore/package.nix | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 2dc70a0b0c5..a01aa903ae2 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -158,14 +158,15 @@ sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19') deps_private += sqlite s3_aws_auth = get_option('s3-aws-auth') -aws_crt_cpp = cxx.find_library('aws-crt-cpp', required : s3_aws_auth) +aws_crt_cpp = dependency( + 'aws-crt-cpp', + required : s3_aws_auth, + method : 'cmake', + modules : [ 'AWS::aws-crt-cpp' ], +) if s3_aws_auth.enabled() deps_other += aws_crt_cpp - aws_c_common = cxx.find_library('aws-c-common', required : true) - deps_other += aws_c_common - aws_c_auth = cxx.find_library('aws-c-auth', required : true) - deps_other += aws_c_auth endif configdata_pub.set('NIX_WITH_AWS_AUTH', s3_aws_auth.enabled().to_int()) diff --git a/src/libstore/package.nix b/src/libstore/package.nix index 968c4e3eb91..1f7b56f2238 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -14,6 +14,7 @@ libseccomp, nlohmann_json, sqlite, + cmake, # for resolving aws-crt-cpp dep busybox-sandbox-shell ? null, @@ -25,7 +26,7 @@ withAWS ? # Default is this way because there have been issues building this dependency - lib.meta.availableOn stdenv.hostPlatform aws-c-common, + (lib.meta.availableOn stdenv.hostPlatform aws-c-common), }: let @@ -57,7 +58,8 @@ mkMesonLibrary (finalAttrs: { (fileset.fileFilter (file: file.hasExt "sql") ./.) ]; - nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump; + nativeBuildInputs = + lib.optional withAWS cmake ++ lib.optional embeddedSandboxShell unixtools.hexdump; buildInputs = [ boost