2
0
Fork 0

Convert flake to a attrset of systems

20.02
Emery Hemingway 3 years ago
parent 7eda0b9f55
commit 4aba5a4e85
  1. 36
      flake.nix
  2. 53
      packages.nix
  3. 27
      tests/default.nix
  4. 11
      tests/driver-linux.nix
  5. 5
      tests/driver-nova.nix
  6. 12
      tests/fs_report.nix
  7. 4
      tests/libc.nix
  8. 4
      tests/log.nix
  9. 2
      tests/pci.nix
  10. 4
      tests/signal.nix

@ -1,7 +1,7 @@
{
edition = 201909;
description = "Genode package overlay";
description = "Genode packages";
inputs = {
nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git";
@ -10,28 +10,24 @@
};
outputs = { self, nixpkgs, dhall-haskell }:
let fullPkgs = import ./packages.nix { nixpkgs = import nixpkgs; };
in {
let
nixpkgs' = import nixpkgs;
systems = [ "x86_64-genode" ];
packages = with fullPkgs; {
inherit stdenv nova genode-os genode-base genode-base-nova
genode-base-linux solo5;
};
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
defaultPackage = self.packages.genode-os;
in {
hydraJobs = {
build.x86_64 = {
inherit (self.packages)
nova stdenv solo5 genode-base-linux genode-base-nova genode-os;
};
tests = import ./tests {
inherit nixpkgs dhall-haskell;
genodepkgs = fullPkgs;
};
};
packages = forAllSystems (system:
import ./packages.nix {
inherit system;
nixpkgs = nixpkgs';
});
checks = { inherit (self.hydraJobs.tests.x86_64.nova) pci; };
checks = forAllSystems (system:
import ./tests {
inherit nixpkgs dhall-haskell;
genodepkgs = builtins.getAttr system self.packages;
});
};
}

@ -2,36 +2,35 @@
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
let
nativeOverlay = self: super:
# Overlay of locally defined packages
with self;
let
genode = (callPackage ./upstream { } // {
libc = callPackage ./pkgs/libc { };
nic_bus = callPackage ./pkgs/nic_bus { };
});
dhallPackages = super.dhallPackages // (callPackage ./dhall { });
in {
genode-base = genode.base;
genode-base-linux = genode.base-linux;
genode-base-nova = genode.base-nova;
genode-os = genode.os;
depot = callPackage ./depot { };
dhallGenode = dhallPackages.genode;
dhallPrelude = dhallPackages.prelude;
nova = callPackage ./NOVA { };
solo5 = callPackage ./pkgs/solo5 { };
};
{ system ? "x86_64-genode", nixpkgs ? import <nixpkgs>, extraOverlays ? [ ] }:
let
toolchainOverlay = import ./toolchain-overlay;
# Overlay of toolchain patches
in { nixpkgs ? import <nixpkgs>, extraOverlays ? [ ] }:
super = nixpkgs {
# Evaluate an overlayed Nixpkgs for a Genode target
localSystem = "x86_64-linux";
crossSystem = "x86_64-genode";
overlays = [ toolchainOverlay ] ++ extraOverlays;
};
inherit (super) callPackage;
genode = (callPackage ./upstream { } // {
libc = callPackage ./pkgs/libc { };
nic_bus = callPackage ./pkgs/nic_bus { };
});
dhallPackages = super.dhallPackages // (callPackage ./dhall { });
in rec {
inherit (super) stdenv;
genode-base = genode.base;
genode-base-linux = genode.base-linux;
genode-base-nova = genode.base-nova;
genode-os = genode.os;
nixpkgs {
# Evaluate an overlayed Nixpkgs for a Genode target
localSystem = "x86_64-linux";
crossSystem = "x86_64-genode";
overlays = [ toolchainOverlay nativeOverlay ] ++ extraOverlays;
dhallGenode = dhallPackages.genode;
dhallPrelude = dhallPackages.prelude;
nova = callPackage ./NOVA { };
solo5 = callPackage ./pkgs/solo5 { inherit genode-base genode-os; };
}

@ -8,7 +8,7 @@ let
libc = call ./libc.nix { };
log = call ./log.nix { };
signal = call ./signal.nix { };
solo5 = call ./solo5 { };
# solo5 = call ./solo5 { };
};
in { genodepkgs, nixpkgs, dhall-haskell }:
@ -18,6 +18,7 @@ let
system = "x86_64-linux";
overlays = [ (self: super: { inherit (dhall-haskell.packages) dhall; }) ];
};
depot = hostPkgs.callPackage ../depot { };
testPkgs = genodepkgs;
lib = hostPkgs.lib // {
@ -50,11 +51,19 @@ let
'';
};
in {
x86_64 = {
linux = tests
(import ./driver-linux.nix { inherit testPkgs hostPkgs lib; }).callTest;
nova = (call: ((tests call) // { pci = call ./pci.nix { }; }))
(import ./driver-nova.nix { inherit testPkgs hostPkgs lib; }).callTest;
};
}
linux = tests (import ./driver-linux.nix {
inherit testPkgs hostPkgs lib depot;
}).callTest;
nova = (call: ((tests call) // { pci = call ./pci.nix { }; }))
(import ./driver-nova.nix {
inherit testPkgs hostPkgs lib depot;
}).callTest;
testsToList = tests:
map (test: {
inherit (test) name;
value = test;
}) (builtins.attrValues tests);
in with builtins; listToAttrs (concatLists (map (testsToList) [ linux nova ]))

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ testPkgs, hostPkgs, lib }:
{ testPkgs, hostPkgs, lib, depot }:
let
testDriver = with hostPkgs;
@ -23,7 +23,7 @@ let
runTests = driver:
hostPkgs.stdenv.mkDerivation {
name = "test-run-${driver.testName}";
name = "linux-"+driver.testName;
preferLocalBuild = true;
buildCommand = ''
@ -42,10 +42,10 @@ let
bootModules' = {
inherit testConfig;
config = ./driver-config.xml;
core = "${genode.base-linux}/bin/core-linux";
init = "${genode.os}/bin/init";
core = "${genode-base-linux}/bin/core-linux";
init = "${genode-os}/bin/init";
"ld.lib.so" = "${depot.base-linux}/lib/ld.lib.so";
timer = "${genode.base-linux}/bin/linux_timer_drv";
timer = "${genode-base-linux}/bin/linux_timer_drv";
} // bootModules;
baseSetup = with builtins;
@ -92,5 +92,6 @@ in {
isNova = false;
};
pkgs = testPkgs;
inherit depot;
} // args));
}

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ testPkgs, hostPkgs, lib }:
{ testPkgs, hostPkgs, lib, depot }:
let
testDriver = with hostPkgs;
@ -23,7 +23,7 @@ let
runTests = driver:
hostPkgs.stdenv.mkDerivation {
name = "test-run-${driver.testName}";
name = "nova-"+driver.testName;
preferLocalBuild = true;
buildCommand = ''
@ -147,5 +147,6 @@ in {
isNova = true;
};
pkgs = testPkgs;
inherit depot;
} // args));
}

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, ... }:
with pkgs;
testEnv.mkTest {
@ -8,11 +8,11 @@ testEnv.mkTest {
testConfig = ./fs_report.xml;
bootModules = {
fs_report = "${genode.os}/bin/fs_report";
fs_rom = "${genode.os}/bin/fs_rom";
ram_fs = "${genode.os}/bin/ram_fs";
test-fs_report = "${genode.os}/bin/test-fs_report";
"vfs.lib.so" = "${genode.os}/lib/vfs.lib.so";
fs_report = "${genode-os}/bin/fs_report";
fs_rom = "${genode-os}/bin/fs_rom";
ram_fs = "${genode-os}/bin/ram_fs";
test-fs_report = "${genode-os}/bin/test-fs_report";
"vfs.lib.so" = "${genode-os}/lib/vfs.lib.so";
};
testScript = ''

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, depot }:
with pkgs;
testEnv.mkTest rec {
@ -12,7 +12,7 @@ testEnv.mkTest rec {
"libm.lib.so" = "${depot.libc}/lib/libm.lib.so";
"posix.lib.so" = "${depot.posix}/lib/posix.lib.so";
"test-libc" = "${depot.test-libc}/bin/test-libc";
"vfs.lib.so" = "${genode.os}/lib/vfs.lib.so";
"vfs.lib.so" = "${genode-os}/lib/vfs.lib.so";
};
qemuMem = 384;

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, ... }:
with pkgs;
testEnv.mkTest rec {
@ -7,7 +7,7 @@ testEnv.mkTest rec {
testConfig = testEnv.lib.renderDhallInit ./log.dhall "{=}";
bootModules.test-log = "${genode.base}/bin/test-log";
bootModules.test-log = "${genode-base}/bin/test-log";
testScript = "run_genode_until {Test done.} 10";
}

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, ... }:
with pkgs;
testEnv.mkTest {

@ -1,4 +1,4 @@
{ testEnv, pkgs }:
{ testEnv, pkgs, ... }:
with pkgs;
testEnv.mkTest rec {
@ -7,7 +7,7 @@ testEnv.mkTest rec {
testConfig = testEnv.lib.renderDhallInit ./signal.dhall "{=}";
bootModules.test-signal = "${genode.os}/bin/test-signal";
bootModules.test-signal = "${genode-os}/bin/test-signal";
testScript = "run_genode_until {--- Signalling test finished ---} 120";
}

Loading…
Cancel
Save