Sfoglia il codice sorgente

Update dhall-haskell, enable tests for Hydra

tags/20.02
Emery Hemingway 1 anno fa
parent
commit
ae10abc7f2
8 ha cambiato i file con 107 aggiunte e 26 eliminazioni
  1. 0
    3
      .gitmodules
  2. 2
    4
      default.nix
  3. 0
    1
      dhall-haskell
  4. 2
    0
      dhall-haskell.nix
  5. 67
    0
      dhallPinnedNixpkgs.nix
  6. 19
    5
      release.nix
  7. 17
    9
      tests/default.nix
  8. 0
    4
      toolchain-overlay/default.nix

+ 0
- 3
.gitmodules Vedi File

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

+ 2
- 4
default.nix Vedi File

@@ -16,9 +16,7 @@ let
16 16
   toolchainOverlay = import ./toolchain-overlay;
17 17
   # Overlay of toolchain patches
18 18
 
19
-  nixpkgs' = import ./nixpkgs.nix;
20
-
21
-in { nixpkgs ? nixpkgs', dhall-haskell ? ./dhall-haskell.nix }:
19
+in { nixpkgs ? import ./nixpkgs.nix }:
22 20
 
23 21
 import nixpkgs {
24 22
   # Evaluate an overlayed Nixpkgs for a Genode target
@@ -28,5 +26,5 @@ import nixpkgs {
28 26
     isGenode = true;
29 27
     imports = [ ./platform.nix ];
30 28
   };
31
-  overlays = [ (toolchainOverlay dhall-haskell) pkgOverlay ];
29
+  overlays = [ toolchainOverlay pkgOverlay ];
32 30
 }

+ 0
- 1
dhall-haskell

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

+ 2
- 0
dhall-haskell.nix Vedi File

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

+ 67
- 0
dhallPinnedNixpkgs.nix Vedi File

@@ -0,0 +1,67 @@
1
+let
2
+  fetchNixpkgs =
3
+    { rev # The Git revision of nixpkgs to fetch
4
+    , owner ? "NixOS" # Owner of the Github repository
5
+    , sha256 # The SHA256 hash of the unpacked archive
6
+    , system ? builtins.currentSystem # This is overridable if necessary
7
+    }:
8
+
9
+    if (0 <= builtins.compareVersions builtins.nixVersion "1.12")
10
+
11
+    # In Nix 1.12, we can just give a `sha256` to `builtins.fetchTarball`.
12
+    then
13
+      (builtins.fetchTarball {
14
+        url = "https://github.com/${owner}/nixpkgs/archive/${rev}.tar.gz";
15
+        inherit sha256;
16
+      })
17
+
18
+      # This hack should at least work for Nix 1.11
19
+    else
20
+      ((rec {
21
+        tarball = import <nix/fetchurl.nix> {
22
+          url = "https://github.com/${owner}/nixpkgs/archive/${rev}.tar.gz";
23
+          sha256 = null;
24
+        };
25
+
26
+        builtin-paths = import <nix/config.nix>;
27
+
28
+        script = builtins.toFile "nixpkgs-unpacker" ''
29
+          "$coreutils/mkdir" "$out"
30
+          cd "$out"
31
+          "$gzip" --decompress < "$tarball" | "$tar" -x --strip-components=1
32
+        '';
33
+
34
+        nixpkgs = builtins.derivation ({
35
+          name = "nixpkgs-${builtins.substring 0 6 rev}";
36
+
37
+          builder = builtins.storePath builtin-paths.shell;
38
+
39
+          args = [ script ];
40
+
41
+          inherit tarball system;
42
+
43
+          tar = builtins.storePath builtin-paths.tar;
44
+          gzip = builtins.storePath builtin-paths.gzip;
45
+          coreutils = builtins.storePath builtin-paths.coreutils;
46
+        } // (if null == sha256 then
47
+          { }
48
+        else {
49
+          outputHashMode = "recursive";
50
+          outputHashAlgo = "sha256";
51
+          outputHash = sha256;
52
+        }));
53
+      }).nixpkgs);
54
+in {
55
+
56
+  nixpkgs = fetchNixpkgs {
57
+    rev = "1d4de0d552ae9aa66a5b8dee5fb0650a4372d148";
58
+    sha256 = "0xpqc1fhkvvv5dv1zmas2j1q27mi7j7dgyjcdh82mlgl1q63i660";
59
+  };
60
+
61
+  nixpkgsStaticLinux = fetchNixpkgs {
62
+    owner = "nh2";
63
+    rev = "925aac04f4ca58aceb83beef18cb7dae0715421b";
64
+    sha256 = "1zr8lscjl2a5cz61f0ibyx55a94v8yyp6sjzjl2gkqjrjbg99abx";
65
+  };
66
+
67
+}

+ 19
- 5
release.nix Vedi File

@@ -2,16 +2,30 @@
2 2
 #
3 3
 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
4 4
 
5
-{ genodepkgs ? builtins.fetchGit ./., nixpkgs ? <nixpkgs>
6
-, dhall-haskell ? ./dhall-haskell.nix }:
5
+let dhallPinned = import ./dhallPinnedNixpkgs.nix; in
7 6
 
8
-let pkgs = import ./default.nix { inherit nixpkgs; };
7
+{ genodepkgs ? ./default.nix
8
+, nixpkgs ? import ./nixpkgs.nix
9
+, dhall-haskell ? <dhall-haskell>
10
+, dhallNixpkgs ? dhallPinned.nixpkgs
11
+, dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux
12
+}:
13
+
14
+let
15
+  pkgs = import genodepkgs { inherit nixpkgs; };
16
+  dhall-haskell' = import (dhall-haskell + "/release.nix") {
17
+    nixpkgs = dhallNixpkgs;
18
+    nixpkgsStaticLinux = dhallNixpkgsStaticLinux;
19
+  };
9 20
 in {
10 21
   build.x86_64 = {
11 22
     inherit (pkgs) nova stdenv solo5;
12 23
     genode = removeAttrs pkgs.genode [ "override" "overrideDerivation" ];
13 24
   };
14 25
 
15
-  # tests.x86_64 = import ./tests { inherit pkgs; };
16
-    # Disable tests because of Dhall issues
26
+  tests = import ./tests {
27
+    inherit nixpkgs;
28
+    genodepkgs = pkgs;
29
+    dhall-haskell = dhall-haskell';
30
+  };
17 31
 }

+ 17
- 9
tests/default.nix Vedi File

@@ -11,18 +11,24 @@ let
11 11
     solo5 = call ./solo5.nix { };
12 12
     solo5-ping = call ./solo5-ping.nix { };
13 13
   };
14
-  nixpkgs' = import ./../nixpkgs.nix;
15
-in { nixpkgs ? nixpkgs' }:
14
+in
15
+
16
+{ genodepkgs ? import ./../default.nix { }
17
+, nixpkgs ? import ./../nixpkgs.nix
18
+, dhall-haskell
19
+}:
16 20
 
17 21
 let
18
-  hostPkgs = import nixpkgs { };
19
-  testPkgs = import ./.. { inherit nixpkgs; };
22
+  hostPkgs = import nixpkgs {
23
+    overlays = [ (self: super: { dhall = dhall-haskell.linux-dhall; }) ];
24
+  };
25
+  testPkgs = genodepkgs;
20 26
 
21 27
   lib = hostPkgs.lib // {
22 28
 
23 29
     renderDhallInit = path: args:
24 30
       hostPkgs.runCommand "init.xml" {
25
-        buildInputs = [ testPkgs.buildPackages.linux-dhall ];
31
+        buildInputs = [ hostPkgs.dhall ];
26 32
         initConfig = path;
27 33
         initArgs = args;
28 34
         DHALL_PRELUDE = "${testPkgs.dhallPackages.prelude}/package.dhall";
@@ -36,8 +42,10 @@ let
36 42
   };
37 43
 
38 44
 in {
39
-  linux = tests
40
-    (import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
41
-  nova = tests
42
-    (import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest;
45
+  x86_64 = {
46
+    linux = tests
47
+      (import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
48
+    nova = tests
49
+      (import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest;
50
+  };
43 51
 }

+ 0
- 4
toolchain-overlay/default.nix Vedi File

@@ -2,8 +2,6 @@
2 2
 #
3 3
 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
4 4
 
5
-dhall-haskell:
6
-
7 5
 self: super:
8 6
 
9 7
 let
@@ -35,8 +33,6 @@ in {
35 33
       null;
36 34
   });
37 35
 
38
-  inherit (import dhall-haskell) linux-dhall;
39
-
40 36
   genodeHeaders = self.callPackage ./headers { };
41 37
 
42 38
   inherit genodelibc;

Loading…
Annulla
Salva