forked from lix-project/lix
More fixes
This commit is contained in:
parent
c71d987553
commit
7b51086d73
29
coverage.nix
29
coverage.nix
|
@ -1,29 +0,0 @@
|
||||||
{ lib
|
|
||||||
, releaseTools
|
|
||||||
, nix
|
|
||||||
, stdenv
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (nix) version;
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
releaseTools.coverageAnalysis {
|
|
||||||
name = "nix-coverage-${version}";
|
|
||||||
|
|
||||||
inherit (nix)
|
|
||||||
src
|
|
||||||
buildInputs
|
|
||||||
nativeBuildInputs
|
|
||||||
propagatedBuildInputs
|
|
||||||
configureFlags
|
|
||||||
makeFlags
|
|
||||||
installFlags
|
|
||||||
doInstallCheck
|
|
||||||
installCheckFlags
|
|
||||||
installCheckTarget
|
|
||||||
;
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
}
|
|
97
flake.nix
97
flake.nix
|
@ -123,8 +123,20 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
testNixVersions = pkgs: client: daemon:
|
testNixVersions = pkgs: client: daemon:
|
||||||
pkgs.callPackage ./test-nix-versions.nix {
|
pkgs.callPackage ./package.nix {
|
||||||
inherit client daemon fileset;
|
pname =
|
||||||
|
"nix-tests"
|
||||||
|
+ lib.optionalString
|
||||||
|
(lib.versionAtLeast daemon.version "2.4pre20211005" &&
|
||||||
|
lib.versionAtLeast client.version "2.4pre20211005")
|
||||||
|
"-${client.version}-against-${daemon.version}";
|
||||||
|
|
||||||
|
inherit fileset;
|
||||||
|
|
||||||
|
test-client = client;
|
||||||
|
test-daemon = daemon;
|
||||||
|
|
||||||
|
doBuild = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
binaryTarball = nix: pkgs: pkgs.callPackage ./binary-tarball.nix {
|
binaryTarball = nix: pkgs: pkgs.callPackage ./binary-tarball.nix {
|
||||||
|
@ -134,10 +146,6 @@
|
||||||
overlayFor = getStdenv: final: prev:
|
overlayFor = getStdenv: final: prev:
|
||||||
let
|
let
|
||||||
stdenv = getStdenv final;
|
stdenv = getStdenv final;
|
||||||
|
|
||||||
lowdown-nix = final.callPackage ./lowdown.nix {
|
|
||||||
inherit lowdown-src stdenv;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixStable = prev.nix;
|
nixStable = prev.nix;
|
||||||
|
@ -145,6 +153,41 @@
|
||||||
# Forward from the previous stage as we don’t want it to pick the lowdown override
|
# Forward from the previous stage as we don’t want it to pick the lowdown override
|
||||||
inherit (prev) nixUnstable;
|
inherit (prev) nixUnstable;
|
||||||
|
|
||||||
|
default-busybox-sandbox-shell = final.busybox.override {
|
||||||
|
useMusl = true;
|
||||||
|
enableStatic = true;
|
||||||
|
enableMinimal = true;
|
||||||
|
extraConfig = ''
|
||||||
|
CONFIG_FEATURE_FANCY_ECHO y
|
||||||
|
CONFIG_FEATURE_SH_MATH y
|
||||||
|
CONFIG_FEATURE_SH_MATH_64 y
|
||||||
|
|
||||||
|
CONFIG_ASH y
|
||||||
|
CONFIG_ASH_OPTIMIZE_FOR_SIZE y
|
||||||
|
|
||||||
|
CONFIG_ASH_ALIAS y
|
||||||
|
CONFIG_ASH_BASH_COMPAT y
|
||||||
|
CONFIG_ASH_CMDCMD y
|
||||||
|
CONFIG_ASH_ECHO y
|
||||||
|
CONFIG_ASH_GETOPTS y
|
||||||
|
CONFIG_ASH_INTERNAL_GLOB y
|
||||||
|
CONFIG_ASH_JOB_CONTROL y
|
||||||
|
CONFIG_ASH_PRINTF y
|
||||||
|
CONFIG_ASH_TEST y
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
lowdown-nix = final.callPackage ./lowdown.nix {
|
||||||
|
inherit lowdown-src stdenv;
|
||||||
|
};
|
||||||
|
|
||||||
|
libgit2-nix = final.libgit2.overrideAttrs (attrs: {
|
||||||
|
src = libgit2;
|
||||||
|
version = libgit2.lastModifiedDate;
|
||||||
|
cmakeFlags = attrs.cmakeFlags or []
|
||||||
|
++ [ "-DUSE_SSH=exec" ];
|
||||||
|
});
|
||||||
|
|
||||||
nix =
|
nix =
|
||||||
let
|
let
|
||||||
officialRelease = false;
|
officialRelease = false;
|
||||||
|
@ -153,30 +196,6 @@
|
||||||
then ""
|
then ""
|
||||||
else "pre${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}_${self.shortRev or "dirty"}";
|
else "pre${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}_${self.shortRev or "dirty"}";
|
||||||
|
|
||||||
default-busybox-sandbox-shell = final.busybox.override {
|
|
||||||
useMusl = true;
|
|
||||||
enableStatic = true;
|
|
||||||
enableMinimal = true;
|
|
||||||
extraConfig = ''
|
|
||||||
CONFIG_FEATURE_FANCY_ECHO y
|
|
||||||
CONFIG_FEATURE_SH_MATH y
|
|
||||||
CONFIG_FEATURE_SH_MATH_64 y
|
|
||||||
|
|
||||||
CONFIG_ASH y
|
|
||||||
CONFIG_ASH_OPTIMIZE_FOR_SIZE y
|
|
||||||
|
|
||||||
CONFIG_ASH_ALIAS y
|
|
||||||
CONFIG_ASH_BASH_COMPAT y
|
|
||||||
CONFIG_ASH_CMDCMD y
|
|
||||||
CONFIG_ASH_ECHO y
|
|
||||||
CONFIG_ASH_GETOPTS y
|
|
||||||
CONFIG_ASH_INTERNAL_GLOB y
|
|
||||||
CONFIG_ASH_JOB_CONTROL y
|
|
||||||
CONFIG_ASH_PRINTF y
|
|
||||||
CONFIG_ASH_TEST y
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
boehmgc = (final.boehmgc.override {
|
boehmgc = (final.boehmgc.override {
|
||||||
enableLargeConfig = true;
|
enableLargeConfig = true;
|
||||||
}).overrideAttrs(o: {
|
}).overrideAttrs(o: {
|
||||||
|
@ -195,18 +214,11 @@
|
||||||
stdenv
|
stdenv
|
||||||
versionSuffix
|
versionSuffix
|
||||||
;
|
;
|
||||||
busybox-sandbox-shell = final.busybox-sandbox-shell or default-busybox-sandbox-shell;
|
|
||||||
libgit2 = final.libgit2.overrideAttrs (attrs: {
|
|
||||||
src = libgit2;
|
|
||||||
version = libgit2.lastModifiedDate;
|
|
||||||
cmakeFlags = attrs.cmakeFlags or []
|
|
||||||
++ [ "-DUSE_SSH=exec" ];
|
|
||||||
});
|
|
||||||
lowdown = lowdown-nix;
|
|
||||||
officialRelease = false;
|
officialRelease = false;
|
||||||
|
libgit2 = final.libgit2-nix;
|
||||||
|
lowdown = final.lowdown-nix;
|
||||||
|
busybox-sandbox-shell = final.busybox-sandbox-shell or final.default-busybox-sandbox-shell;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit lowdown-nix;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -272,7 +284,10 @@
|
||||||
dockerImage = lib.genAttrs linux64BitSystems (system: self.packages.${system}.dockerImage);
|
dockerImage = lib.genAttrs linux64BitSystems (system: self.packages.${system}.dockerImage);
|
||||||
|
|
||||||
# Line coverage analysis.
|
# Line coverage analysis.
|
||||||
coverage = nixpkgsFor.x86_64-linux.native.callPackage ./coverage.nix {};
|
coverage = nixpkgsFor.x86_64-linux.native.nix.override {
|
||||||
|
pname = "nix-coverage";
|
||||||
|
withCoverageChecks = true;
|
||||||
|
};
|
||||||
|
|
||||||
# API docs for Nix's unstable internal C++ interfaces.
|
# API docs for Nix's unstable internal C++ interfaces.
|
||||||
internal-api-docs = nixpkgsFor.x86_64-linux.native.callPackage ./package.nix {
|
internal-api-docs = nixpkgsFor.x86_64-linux.native.callPackage ./package.nix {
|
||||||
|
|
61
package.nix
61
package.nix
|
@ -2,9 +2,6 @@
|
||||||
, callPackage
|
, callPackage
|
||||||
, stdenv
|
, stdenv
|
||||||
, releaseTools
|
, releaseTools
|
||||||
, versionSuffix ? ""
|
|
||||||
, officialRelease ? false
|
|
||||||
, buildUnreleasedNotes ? false
|
|
||||||
, autoconf-archive
|
, autoconf-archive
|
||||||
, autoreconfHook
|
, autoreconfHook
|
||||||
, aws-sdk-cpp
|
, aws-sdk-cpp
|
||||||
|
@ -43,21 +40,25 @@
|
||||||
, busybox-sandbox-shell ? null
|
, busybox-sandbox-shell ? null
|
||||||
|
|
||||||
# Configuration Options
|
# Configuration Options
|
||||||
#
|
#:
|
||||||
# This probably seems like too many degrees of freedom, but it
|
# This probably seems like too many degrees of freedom, but it
|
||||||
# faithfully reflects how the underlying configure + make build system
|
# faithfully reflects how the underlying configure + make build system
|
||||||
# work. The top-level flake.nix will choose useful combinations.
|
# work. The top-level flake.nix will choose useful combinations.
|
||||||
|
|
||||||
, pname ? "nix"
|
, pname ? "nix"
|
||||||
|
|
||||||
|
, versionSuffix ? ""
|
||||||
|
, officialRelease ? false
|
||||||
|
|
||||||
, doBuild ? true
|
, doBuild ? true
|
||||||
, doCheck ? __forDefaults.canRunInstalled
|
, doCheck ? __forDefaults.canRunInstalled
|
||||||
, doInstallCheck ? __forDefaults.canRunInstalled
|
, doInstallCheck ? test-client != null || __forDefaults.canRunInstalled
|
||||||
|
|
||||||
, withCoverageChecks ? false
|
, withCoverageChecks ? false
|
||||||
|
|
||||||
# Whether to build the regular manual
|
# Whether to build the regular manual
|
||||||
, enableManual ? __forDefaults.canRunInstalled
|
, enableManual ? __forDefaults.canRunInstalled
|
||||||
|
, buildUnreleasedNotes ? false
|
||||||
# Whether to build the internal API docs, can be done separately from
|
# Whether to build the internal API docs, can be done separately from
|
||||||
# everything else.
|
# everything else.
|
||||||
, enableInternalAPIDocs ? false
|
, enableInternalAPIDocs ? false
|
||||||
|
@ -115,7 +116,11 @@ let
|
||||||
|
|
||||||
mkDerivation =
|
mkDerivation =
|
||||||
if withCoverageChecks
|
if withCoverageChecks
|
||||||
then releaseTools.coverageAnalysis
|
then
|
||||||
|
# TODO support `finalAttrs` args function in
|
||||||
|
# `releaseTools.coverageAnalysis`.
|
||||||
|
argsFun:
|
||||||
|
releaseTools.coverageAnalysis (let args = argsFun args; in args)
|
||||||
else stdenv.mkDerivation;
|
else stdenv.mkDerivation;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -146,6 +151,7 @@ in {
|
||||||
fileset = fileset.intersect filesets.baseFiles (fileset.unions ([
|
fileset = fileset.intersect filesets.baseFiles (fileset.unions ([
|
||||||
filesets.configureFiles
|
filesets.configureFiles
|
||||||
filesets.topLevelBuildFiles
|
filesets.topLevelBuildFiles
|
||||||
|
./doc/internal-api
|
||||||
] ++ lib.optionals doBuild [
|
] ++ lib.optionals doBuild [
|
||||||
./boehmgc-coroutine-sp-fallback.diff
|
./boehmgc-coroutine-sp-fallback.diff
|
||||||
./doc
|
./doc
|
||||||
|
@ -170,20 +176,24 @@ in {
|
||||||
++ lib.optional installUnitTests "check";
|
++ lib.optional installUnitTests "check";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
bison
|
|
||||||
flex
|
|
||||||
(lib.getBin lowdown)
|
|
||||||
jq # Also for custom mdBook preprocessor.
|
|
||||||
mdbook
|
|
||||||
mdbook-linkcheck
|
|
||||||
autoconf-archive
|
autoconf-archive
|
||||||
autoreconfHook
|
autoreconfHook
|
||||||
pkg-config
|
pkg-config
|
||||||
]
|
] ++ lib.optionals doBuild [
|
||||||
++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
bison
|
||||||
# Official releases don't have rl-next, so we don't need to compile a
|
flex
|
||||||
# changelog
|
] ++ lib.optionals enableManual [
|
||||||
++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d;
|
(lib.getBin lowdown)
|
||||||
|
mdbook
|
||||||
|
mdbook-linkcheck
|
||||||
|
] ++ lib.optionals (doInstallCheck || enableManual) [
|
||||||
|
jq # Also for custom mdBook preprocessor.
|
||||||
|
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
||||||
|
# Official releases don't have rl-next, so we don't need to compile a
|
||||||
|
# changelog
|
||||||
|
++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d
|
||||||
|
++ lib.optional enableInternalAPIDocs doxygen
|
||||||
|
;
|
||||||
|
|
||||||
buildInputs = lib.optionals doBuild [
|
buildInputs = lib.optionals doBuild [
|
||||||
boost
|
boost
|
||||||
|
@ -225,13 +235,11 @@ in {
|
||||||
git
|
git
|
||||||
mercurial
|
mercurial
|
||||||
openssh
|
openssh
|
||||||
] ++ lib.optionals enableInternalAPIDocs [
|
|
||||||
doxygen
|
|
||||||
];
|
];
|
||||||
|
|
||||||
disallowedReferences = [ boost ];
|
disallowedReferences = [ boost ];
|
||||||
|
|
||||||
preConfigure = lib.optionalString (! stdenv.hostPlatform.isStatic) ''
|
preConfigure = lib.optionalString (doBuild && ! stdenv.hostPlatform.isStatic) ''
|
||||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
# Copy libboost_context so we don't get all of Boost in our closure.
|
||||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
# https://github.com/NixOS/nixpkgs/issues/45462
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
|
@ -307,7 +315,14 @@ in {
|
||||||
doInstallCheck = attrs.doInstallCheck;
|
doInstallCheck = attrs.doInstallCheck;
|
||||||
|
|
||||||
installCheckFlags = "sysconfdir=$(out)/etc";
|
installCheckFlags = "sysconfdir=$(out)/etc";
|
||||||
installCheckTarget = "installcheck"; # work around buggy detection in stdenv
|
# work around buggy detection in stdenv
|
||||||
|
installCheckTarget = "installcheck";
|
||||||
|
|
||||||
|
# work around weird bug where it doesn't want to do anything
|
||||||
|
installCheckPhase = if (!doBuild && doInstallCheck) then ''
|
||||||
|
mkdir -p src/nix-channel
|
||||||
|
make installcheck -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
|
||||||
|
'' else null;
|
||||||
|
|
||||||
# Needed for tests if we are not doing a build, but testing existing
|
# Needed for tests if we are not doing a build, but testing existing
|
||||||
# built Nix.
|
# built Nix.
|
||||||
|
@ -317,7 +332,9 @@ in {
|
||||||
|
|
||||||
separateDebugInfo = !stdenv.hostPlatform.isStatic;
|
separateDebugInfo = !stdenv.hostPlatform.isStatic;
|
||||||
|
|
||||||
strictDeps = true;
|
# TODO `releaseTools.coverageAnalysis` in Nixpkgs needs to be updated
|
||||||
|
# to work with `strictDeps`.
|
||||||
|
strictDeps = !withCoverageChecks;
|
||||||
|
|
||||||
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
|
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue