Update dhall-haskell, enable tests for Hydra

This commit is contained in:
Ehmry - 2019-10-09 16:51:06 +02:00
parent fbc11b0698
commit ae10abc7f2
8 changed files with 107 additions and 26 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "dhall-haskell"]
path = dhall-haskell
url = https://github.com/ehmry/dhall-haskell.git

View File

@ -16,9 +16,7 @@ let
toolchainOverlay = import ./toolchain-overlay; toolchainOverlay = import ./toolchain-overlay;
# Overlay of toolchain patches # Overlay of toolchain patches
nixpkgs' = import ./nixpkgs.nix; in { nixpkgs ? import ./nixpkgs.nix }:
in { nixpkgs ? nixpkgs', dhall-haskell ? ./dhall-haskell.nix }:
import nixpkgs { import nixpkgs {
# Evaluate an overlayed Nixpkgs for a Genode target # Evaluate an overlayed Nixpkgs for a Genode target
@ -28,5 +26,5 @@ import nixpkgs {
isGenode = true; isGenode = true;
imports = [ ./platform.nix ]; imports = [ ./platform.nix ];
}; };
overlays = [ (toolchainOverlay dhall-haskell) pkgOverlay ]; overlays = [ toolchainOverlay pkgOverlay ];
} }

@ -1 +0,0 @@
Subproject commit 7b36df7725a5ed40ef7bd803bb0d3eabbbbde74a

2
dhall-haskell.nix Normal file
View File

@ -0,0 +1,2 @@
let dhall-haskell = import <dhall-haskell>;
in { linux-dhall = dhall-haskell.dhall; }

67
dhallPinnedNixpkgs.nix Normal file
View File

@ -0,0 +1,67 @@
let
fetchNixpkgs =
{ rev # The Git revision of nixpkgs to fetch
, owner ? "NixOS" # Owner of the Github repository
, sha256 # The SHA256 hash of the unpacked archive
, system ? builtins.currentSystem # This is overridable if necessary
}:
if (0 <= builtins.compareVersions builtins.nixVersion "1.12")
# In Nix 1.12, we can just give a `sha256` to `builtins.fetchTarball`.
then
(builtins.fetchTarball {
url = "https://github.com/${owner}/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
})
# This hack should at least work for Nix 1.11
else
((rec {
tarball = import <nix/fetchurl.nix> {
url = "https://github.com/${owner}/nixpkgs/archive/${rev}.tar.gz";
sha256 = null;
};
builtin-paths = import <nix/config.nix>;
script = builtins.toFile "nixpkgs-unpacker" ''
"$coreutils/mkdir" "$out"
cd "$out"
"$gzip" --decompress < "$tarball" | "$tar" -x --strip-components=1
'';
nixpkgs = builtins.derivation ({
name = "nixpkgs-${builtins.substring 0 6 rev}";
builder = builtins.storePath builtin-paths.shell;
args = [ script ];
inherit tarball system;
tar = builtins.storePath builtin-paths.tar;
gzip = builtins.storePath builtin-paths.gzip;
coreutils = builtins.storePath builtin-paths.coreutils;
} // (if null == sha256 then
{ }
else {
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = sha256;
}));
}).nixpkgs);
in {
nixpkgs = fetchNixpkgs {
rev = "1d4de0d552ae9aa66a5b8dee5fb0650a4372d148";
sha256 = "0xpqc1fhkvvv5dv1zmas2j1q27mi7j7dgyjcdh82mlgl1q63i660";
};
nixpkgsStaticLinux = fetchNixpkgs {
owner = "nh2";
rev = "925aac04f4ca58aceb83beef18cb7dae0715421b";
sha256 = "1zr8lscjl2a5cz61f0ibyx55a94v8yyp6sjzjl2gkqjrjbg99abx";
};
}

View File

@ -2,16 +2,30 @@
# #
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ genodepkgs ? builtins.fetchGit ./., nixpkgs ? <nixpkgs> let dhallPinned = import ./dhallPinnedNixpkgs.nix; in
, dhall-haskell ? ./dhall-haskell.nix }:
let pkgs = import ./default.nix { inherit nixpkgs; }; { genodepkgs ? ./default.nix
, nixpkgs ? import ./nixpkgs.nix
, dhall-haskell ? <dhall-haskell>
, dhallNixpkgs ? dhallPinned.nixpkgs
, dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux
}:
let
pkgs = import genodepkgs { inherit nixpkgs; };
dhall-haskell' = import (dhall-haskell + "/release.nix") {
nixpkgs = dhallNixpkgs;
nixpkgsStaticLinux = dhallNixpkgsStaticLinux;
};
in { in {
build.x86_64 = { build.x86_64 = {
inherit (pkgs) nova stdenv solo5; inherit (pkgs) nova stdenv solo5;
genode = removeAttrs pkgs.genode [ "override" "overrideDerivation" ]; genode = removeAttrs pkgs.genode [ "override" "overrideDerivation" ];
}; };
# tests.x86_64 = import ./tests { inherit pkgs; }; tests = import ./tests {
# Disable tests because of Dhall issues inherit nixpkgs;
genodepkgs = pkgs;
dhall-haskell = dhall-haskell';
};
} }

View File

@ -11,18 +11,24 @@ let
solo5 = call ./solo5.nix { }; solo5 = call ./solo5.nix { };
solo5-ping = call ./solo5-ping.nix { }; solo5-ping = call ./solo5-ping.nix { };
}; };
nixpkgs' = import ./../nixpkgs.nix; in
in { nixpkgs ? nixpkgs' }:
{ genodepkgs ? import ./../default.nix { }
, nixpkgs ? import ./../nixpkgs.nix
, dhall-haskell
}:
let let
hostPkgs = import nixpkgs { }; hostPkgs = import nixpkgs {
testPkgs = import ./.. { inherit nixpkgs; }; overlays = [ (self: super: { dhall = dhall-haskell.linux-dhall; }) ];
};
testPkgs = genodepkgs;
lib = hostPkgs.lib // { lib = hostPkgs.lib // {
renderDhallInit = path: args: renderDhallInit = path: args:
hostPkgs.runCommand "init.xml" { hostPkgs.runCommand "init.xml" {
buildInputs = [ testPkgs.buildPackages.linux-dhall ]; buildInputs = [ hostPkgs.dhall ];
initConfig = path; initConfig = path;
initArgs = args; initArgs = args;
DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall"; DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
@ -36,8 +42,10 @@ let
}; };
in { in {
linux = tests x86_64 = {
(import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest; linux = tests
nova = tests (import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
(import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest; nova = tests
(import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest;
};
} }

View File

@ -2,8 +2,6 @@
# #
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
dhall-haskell:
self: super: self: super:
let let
@ -35,8 +33,6 @@ in {
null; null;
}); });
inherit (import dhall-haskell) linux-dhall;
genodeHeaders = self.callPackage ./headers { }; genodeHeaders = self.callPackage ./headers { };
inherit genodelibc; inherit genodelibc;