mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
Further changes
This commit is contained in:
parent
f55ee7cf77
commit
eff9b12bc2
4 changed files with 108 additions and 136 deletions
|
@ -1,8 +1,8 @@
|
|||
{ runCommand
|
||||
, version
|
||||
, system
|
||||
, nix
|
||||
, buildPackages
|
||||
, cacert
|
||||
, nix
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -11,6 +11,8 @@ let
|
|||
rootPaths = [ nix cacert ];
|
||||
};
|
||||
|
||||
inherit (nix) version;
|
||||
|
||||
env = {
|
||||
meta.description = "Distribution-independent Nix bootstrap binaries for ${system}";
|
||||
};
|
||||
|
|
35
coverage.nix
Normal file
35
coverage.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ lib
|
||||
, releaseTools
|
||||
, nix
|
||||
, stdenv
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (nix) version;
|
||||
|
||||
in
|
||||
|
||||
releaseTools.coverageAnalysis {
|
||||
name = "nix-coverage-${version}";
|
||||
|
||||
inherit (nix)
|
||||
src
|
||||
configureFlags
|
||||
nativeBuildInputs
|
||||
buildInputs
|
||||
#checkInputs
|
||||
;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
dontInstall = false;
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckTarget = "installcheck"; # work around buggy detection in stdenv
|
||||
|
||||
lcovFilter = [ "*/boost/*" "*-tab.*" ];
|
||||
|
||||
hardeningDisable = ["fortify"];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-DCOVERAGE=1";
|
||||
}
|
87
flake.nix
87
flake.nix
|
@ -479,52 +479,17 @@
|
|||
dockerImage = lib.genAttrs linux64BitSystems (system: self.packages.${system}.dockerImage);
|
||||
|
||||
# Line coverage analysis.
|
||||
coverage =
|
||||
with nixpkgsFor.x86_64-linux.native;
|
||||
with commonDeps { inherit pkgs; };
|
||||
|
||||
releaseTools.coverageAnalysis {
|
||||
name = "nix-coverage-${version}";
|
||||
|
||||
src = nixSrc;
|
||||
|
||||
configureFlags = testConfigureFlags;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeBuildInputs = nativeBuildDeps;
|
||||
buildInputs = buildDeps ++ propagatedDeps ++ awsDeps ++ checkDeps;
|
||||
|
||||
dontInstall = false;
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckTarget = "installcheck"; # work around buggy detection in stdenv
|
||||
|
||||
lcovFilter = [ "*/boost/*" "*-tab.*" ];
|
||||
|
||||
hardeningDisable = ["fortify"];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-DCOVERAGE=1";
|
||||
};
|
||||
coverage = nixpkgsFor.x86_64-linux.native.callPackage ./coverage.nix {};
|
||||
|
||||
# API docs for Nix's unstable internal C++ interfaces.
|
||||
internal-api-docs =
|
||||
with nixpkgsFor.x86_64-linux.native;
|
||||
with commonDeps { inherit pkgs; };
|
||||
|
||||
stdenv.mkDerivation {
|
||||
internal-api-docs = nixpkgsFor.x86_64-linux.native.nix.overrideAttrs (old: {
|
||||
pname = "nix-internal-api-docs";
|
||||
inherit version;
|
||||
|
||||
src = nixSrc;
|
||||
|
||||
configureFlags = testConfigureFlags ++ internalApiDocsConfigureFlags;
|
||||
|
||||
nativeBuildInputs = nativeBuildDeps;
|
||||
buildInputs = buildDeps ++ propagatedDeps
|
||||
++ awsDeps ++ checkDeps ++ internalApiDocsDeps;
|
||||
configureFlags = old.configureFlags ++ [ "--enable-internal-api-docs" ];
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ nixpkgsFor.x86_64-linux.native.doxygen ];
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
|
||||
installTargets = [ "internal-api-html" ];
|
||||
|
||||
|
@ -532,7 +497,7 @@
|
|||
mkdir -p $out/nix-support
|
||||
echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
# System tests.
|
||||
tests = import ./tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
||||
|
@ -540,7 +505,9 @@
|
|||
# Make sure that nix-env still produces the exact same result
|
||||
# on a particular version of Nixpkgs.
|
||||
evalNixpkgs =
|
||||
with nixpkgsFor.x86_64-linux.native;
|
||||
let
|
||||
inherit (nixpkgsFor.x86_64-linux.native) runCommand nix nixpkgs-regression;
|
||||
in
|
||||
runCommand "eval-nixos" { buildInputs = [ nix ]; }
|
||||
''
|
||||
type -p nix-env
|
||||
|
@ -627,39 +594,9 @@
|
|||
stdenvs)));
|
||||
|
||||
devShells = let
|
||||
makeShell = pkgs: stdenv:
|
||||
let
|
||||
canRunInstalled = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
in
|
||||
with commonDeps { inherit pkgs; };
|
||||
stdenv.mkDerivation {
|
||||
name = "nix";
|
||||
|
||||
outputs = [ "out" "dev" "doc" ]
|
||||
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "check";
|
||||
|
||||
nativeBuildInputs = nativeBuildDeps
|
||||
++ lib.optional stdenv.cc.isClang pkgs.buildPackages.bear
|
||||
++ lib.optional
|
||||
(stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform)
|
||||
pkgs.buildPackages.clang-tools
|
||||
# We want changelog-d in the shell even if the current build doesn't need it
|
||||
++ lib.optional (officialRelease || ! buildUnreleasedNotes) changelog-d
|
||||
;
|
||||
|
||||
buildInputs = buildDeps ++ propagatedDeps
|
||||
++ awsDeps ++ checkDeps ++ internalApiDocsDeps;
|
||||
|
||||
configureFlags = configureFlags
|
||||
++ testConfigureFlags ++ internalApiDocsConfigureFlags
|
||||
++ lib.optional (!canRunInstalled) "--disable-doc-gen";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
makeShell = pkgs: stdenv: (pkgs.nix.override { inherit stdenv; }).overrideAttrs (_: {
|
||||
installFlags = "sysconfdir=$(out)/etc";
|
||||
|
||||
shellHook =
|
||||
''
|
||||
shellHook = ''
|
||||
PATH=$prefix/bin:$PATH
|
||||
unset PYTHONPATH
|
||||
export MANPATH=$out/share/man:$MANPATH
|
||||
|
@ -667,7 +604,7 @@
|
|||
# Make bash completion work.
|
||||
XDG_DATA_DIRS+=:$out/share
|
||||
'';
|
||||
};
|
||||
});
|
||||
in
|
||||
forAllSystems (system:
|
||||
let
|
||||
|
|
42
package.nix
42
package.nix
|
@ -41,16 +41,12 @@
|
|||
}:
|
||||
|
||||
let
|
||||
|
||||
version = lib.fileContents ./.version + versionSuffix;
|
||||
|
||||
inherit (stdenv.hostPlatform) isStatic;
|
||||
|
||||
canRunInstalled = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "nix-${version}";
|
||||
pname = "nix";
|
||||
inherit version;
|
||||
|
||||
src =
|
||||
|
@ -103,17 +99,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
bison
|
||||
flex
|
||||
(lib.getBin lowdown)
|
||||
jq # Also for custom mdBook preprocessor.
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
autoconf-archive
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
|
||||
# Tests
|
||||
git
|
||||
mercurial # FIXME: remove? only needed for tests
|
||||
jq # Also for custom mdBook preprocessor.
|
||||
openssh # only needed for tests (ssh-keygen)
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
||||
# Official releases don't have rl-next, so we don't need to compile a changelog
|
||||
|
@ -133,19 +124,29 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
sqlite
|
||||
xz
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [libseccomp]
|
||||
++ lib.optional stdenv.isLinux libseccomp
|
||||
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
|
||||
# There have been issues building these dependencies
|
||||
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) (lib.optional (stdenv.isLinux || stdenv.isDarwin)
|
||||
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))
|
||||
(aws-sdk-cpp.override {
|
||||
apis = ["s3" "transfer"];
|
||||
customMemoryManagement = false;
|
||||
}))
|
||||
++ lib.optionals finalAttrs.doCheck [
|
||||
})
|
||||
;
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkInputs = [
|
||||
gtest
|
||||
rapidcheck
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
git
|
||||
mercurial # FIXME: remove? only needed for tests
|
||||
openssh # only needed for tests (ssh-keygen)
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
boehmgc
|
||||
nlohmann_json
|
||||
|
@ -153,8 +154,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
disallowedReferences = [ boost ];
|
||||
|
||||
preConfigure = lib.optionalString (! stdenv.hostPlatform.isStatic)
|
||||
''
|
||||
preConfigure = lib.optionalString (! stdenv.hostPlatform.isStatic) ''
|
||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
||||
mkdir -p $out/lib
|
||||
|
@ -179,13 +179,13 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"--with-boost=${boost}/lib"
|
||||
"--with-sandbox-shell=${sh}/bin/busybox"
|
||||
]
|
||||
++ lib.optionals (stdenv.isLinux && !(isStatic && stdenv.system == "aarch64-linux")) [
|
||||
++ lib.optional (stdenv.isLinux && !(stdenv.hostPlatform.isStatic && stdenv.system == "aarch64-linux"))
|
||||
"LDFLAGS=-fuse-ld=gold"
|
||||
]
|
||||
++ [ "--sysconfdir=/etc" ]
|
||||
++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell"
|
||||
++ [ (lib.enableFeature finalAttrs.doCheck "tests") ]
|
||||
++ lib.optionals finalAttrs.doCheck ([ "RAPIDCHECK_HEADERS=${lib.getDev rapidcheck}/extras/gtest/include" ]
|
||||
++ lib.optionals finalAttrs.doCheck (
|
||||
[ "RAPIDCHECK_HEADERS=${lib.getDev rapidcheck}/extras/gtest/include" ]
|
||||
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
"--enable-install-unit-tests"
|
||||
"--with-check-bin-dir=${builtins.placeholder "check"}/bin"
|
||||
|
@ -197,8 +197,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
installFlags = "sysconfdir=$(out)/etc";
|
||||
|
||||
postInstall = ''
|
||||
|
|
Loading…
Reference in a new issue