Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packaging/dev-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
)
Expand All @@ -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)
)
Expand Down
11 changes: 6 additions & 5 deletions src/libstore/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 4 additions & 2 deletions src/libstore/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
libseccomp,
nlohmann_json,
sqlite,
cmake, # for resolving aws-crt-cpp dep

busybox-sandbox-shell ? null,

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 8 additions & 15 deletions tests/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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, ... }:
{
Expand All @@ -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

{
Expand Down
4 changes: 2 additions & 2 deletions tests/nixos/fsync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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()

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")

Expand Down
Loading