mirror of
https://github.com/NixOS/nix
synced 2025-07-10 08:53:55 +02:00
Coarse versions for constituent packages
As discussed in our meeting, we should use a simplified version for the libraries without the date or commit hash. This will make rebuilding a lot faster in many cases. Progress on #10379 Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
This commit is contained in:
parent
4956e7c44c
commit
93f58150c9
5 changed files with 47 additions and 22 deletions
|
@ -1,11 +1,34 @@
|
|||
{
|
||||
lib,
|
||||
src,
|
||||
officialRelease,
|
||||
}:
|
||||
|
||||
scope:
|
||||
|
||||
let
|
||||
inherit (scope) callPackage;
|
||||
|
||||
baseVersion = lib.fileContents ../.version;
|
||||
|
||||
versionSuffix = lib.optionalString (!officialRelease) "pre";
|
||||
|
||||
fineVersionSuffix = lib.optionalString
|
||||
(!officialRelease)
|
||||
"pre${builtins.substring 0 8 (src.lastModifiedDate or src.lastModified or "19700101")}_${src.shortRev or "dirty"}";
|
||||
|
||||
fineVersion = baseVersion + fineVersionSuffix;
|
||||
in
|
||||
|
||||
# This becomes the pkgs.nixComponents attribute set
|
||||
{
|
||||
nix = callPackage ../package.nix { };
|
||||
version = baseVersion + versionSuffix;
|
||||
inherit versionSuffix;
|
||||
|
||||
nix = callPackage ../package.nix {
|
||||
version = fineVersion;
|
||||
versionSuffix = fineVersionSuffix;
|
||||
};
|
||||
|
||||
nix-util = callPackage ../src/libutil/package.nix { };
|
||||
nix-util-c = callPackage ../src/libutil-c/package.nix { };
|
||||
|
@ -34,10 +57,10 @@ in
|
|||
nix-cmd = callPackage ../src/libcmd/package.nix { };
|
||||
|
||||
# Will replace `nix` once the old build system is gone.
|
||||
nix-ng = callPackage ../src/nix/package.nix { };
|
||||
nix-ng = callPackage ../src/nix/package.nix { version = fineVersion; };
|
||||
|
||||
nix-internal-api-docs = callPackage ../src/internal-api-docs/package.nix { };
|
||||
nix-external-api-docs = callPackage ../src/external-api-docs/package.nix { };
|
||||
nix-internal-api-docs = callPackage ../src/internal-api-docs/package.nix { version = fineVersion; };
|
||||
nix-external-api-docs = callPackage ../src/external-api-docs/package.nix { version = fineVersion; };
|
||||
|
||||
nix-perl-bindings = callPackage ../src/perl/package.nix { };
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
pkgs,
|
||||
|
||||
stdenv,
|
||||
versionSuffix,
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -73,11 +72,9 @@ let
|
|||
strictDeps = prevAttrs.strictDeps or true;
|
||||
enableParallelBuilding = true;
|
||||
};
|
||||
|
||||
in
|
||||
scope: {
|
||||
inherit stdenv versionSuffix;
|
||||
version = lib.fileContents ../.version + versionSuffix;
|
||||
inherit stdenv;
|
||||
|
||||
aws-sdk-cpp = (pkgs.aws-sdk-cpp.override {
|
||||
apis = [ "s3" "transfer" ];
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
, linux64BitSystems
|
||||
, nixpkgsFor
|
||||
, self
|
||||
, officialRelease
|
||||
}:
|
||||
let
|
||||
inherit (inputs) nixpkgs nixpkgs-regression;
|
||||
|
@ -16,7 +17,7 @@ let
|
|||
};
|
||||
|
||||
testNixVersions = pkgs: client: daemon:
|
||||
pkgs.callPackage ../package.nix {
|
||||
pkgs.nixComponents.callPackage ../package.nix {
|
||||
pname =
|
||||
"nix-tests"
|
||||
+ lib.optionalString
|
||||
|
@ -28,6 +29,12 @@ let
|
|||
test-daemon = daemon;
|
||||
|
||||
doBuild = false;
|
||||
|
||||
# This could be more accurate, but a shorter version will match the
|
||||
# fine version with rev. This functionality is already covered in
|
||||
# the normal test, so it's fine.
|
||||
version = pkgs.nixComponents.version;
|
||||
versionSuffix = pkgs.nixComponents.versionSuffix;
|
||||
};
|
||||
|
||||
# Technically we could just return `pkgs.nixComponents`, but for Hydra it's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue