Browse Source

Update Genode Dhall library

Freeze the library when committing to the Nix store. The Init.toStart
function now lowers an only-child automatically, so adjust the Timer
service routes in tests accordingly.
20.02
Emery Hemingway 2 years ago
parent
commit
36f682ccd4
  1. 1
      flake.nix
  2. 4
      packages/default.nix
  3. 4
      packages/dhall/default.nix
  4. 22
      packages/dhall/genode.nix
  5. 27
      tests/driver-hw-config.dhall
  6. 2
      tests/driver-linux-config.dhall
  7. 27
      tests/driver-nova-config.dhall
  8. 1
      tests/signal.dhall
  9. 1
      tests/solo5/simple.dhall

1
flake.nix

@ -31,6 +31,7 @@
inherit system legacyPackages;
depot = thisSystem genode-depot.packages;
apps = self.apps.${localSystem};
dhallApps = dhall-haskell.apps.${localSystem};
};
defaultPackage = packages.genode.base-linux;

4
packages/default.nix

@ -1,11 +1,11 @@
# SPDX-License-Identifier: CC0-1.0
{ system, legacyPackages, depot, apps }:
{ system, legacyPackages, depot, apps, dhallApps }:
let
inherit (legacyPackages) callPackage;
dhallPackages = legacyPackages.dhallPackages // (callPackage ./dhall { });
dhallPackages = legacyPackages.dhallPackages // (callPackage ./dhall { inherit dhallApps; });
mkDhallManifest = drv:
legacyPackages.runCommand "${drv.name}.dhall" { inherit drv; }

4
packages/dhall/default.nix

@ -1,10 +1,10 @@
# SPDX-License-Identifier: CC0-1.0
{ callPackage }:
{ callPackage, dhallApps }:
rec {
prelude = prelude_11_0_0;
prelude_11_0_0 = callPackage ./prelude-11.0.0.nix { };
prelude_9_0_0 = callPackage ./prelude-9.0.0.nix { };
genode = callPackage ./genode.nix { };
genode = callPackage ./genode.nix { inherit dhallApps prelude; };
}

22
packages/dhall/genode.nix

@ -1,9 +1,21 @@
# SPDX-License-Identifier: CC0-1.0
{ fetchgit }:
{ stdenv, fetchgit, dhallApps, prelude }:
fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "07e16f711038cae1167a8aba22db6f12cc1215c5";
sha256 = "1r6sz729bzwmp5vcwcf9vx1ppyqx2zhgy4zxxqv8bvn3nm8z82dz";
stdenv.mkDerivation {
name = "dhall-genode";
src = fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "472a300141766e58a68b605568eb881e0a944eca";
sha256 = "03lxxrzyfkgf9c31ds93ndr1bl3a4rlynj377n9rhniz9xzl11y3";
};
DHALL_PRELUDE = prelude + "/package.dhall";
buildCommand = ''
export XDG_CACHE_HOME=$TMPDIR
cp -r $src $out
chmod +w -R $out
echo $DHALL_PRELUDE > $out/Prelude.dhall
find $out -type f -exec \
${dhallApps.dhall.program} freeze --all --inplace {} \;
'';
}

27
tests/driver-hw-config.dhall

@ -4,32 +4,9 @@ let Genode = env:DHALL_GENODE
let Prelude = Genode.Prelude
let ChildEntry = Prelude.Map.Entry Text Genode.Init.Start.Type
let toChildEntry =
λ(init : Genode.Init.Type)
→ let childCount = Prelude.List.length ChildEntry init.children
let onlyChild = Prelude.Natural.lessThan childCount 2
let child =
if onlyChild
then Prelude.Optional.fold
ChildEntry
(Prelude.List.head ChildEntry init.children)
ChildEntry
(λ(child : ChildEntry) → child)
{ mapKey = ""
, mapValue = Genode.Init.Start::{ binary = "" }
}
else { mapKey = "init", mapValue = Genode.Init.toStart init }
in child
in λ(boot : Genode.Boot.Type)
→ let child = toChildEntry boot.config
→ let child =
{ mapKey = "test", mapValue = Genode.Init.toStart boot.config }
in { config =
Genode.Init::{

2
tests/driver-linux-config.dhall

@ -23,7 +23,7 @@ in λ(args : Args)
, provides = [ "Timer" ]
}
}
, { mapKey = "init", mapValue = Genode.Init.toStart args.config }
, { mapKey = "test", mapValue = Genode.Init.toStart args.config }
]
}
, rom =

27
tests/driver-nova-config.dhall

@ -4,32 +4,9 @@ let Genode = env:DHALL_GENODE
let Prelude = Genode.Prelude
let ChildEntry = Prelude.Map.Entry Text Genode.Init.Start.Type
let toChildEntry =
λ(init : Genode.Init.Type)
→ let childCount = Prelude.List.length ChildEntry init.children
let onlyChild = Prelude.Natural.lessThan childCount 2
let child =
if onlyChild
then Prelude.Optional.fold
ChildEntry
(Prelude.List.head ChildEntry init.children)
ChildEntry
(λ(child : ChildEntry) → child)
{ mapKey = ""
, mapValue = Genode.Init.Start::{ binary = "" }
}
else { mapKey = "init", mapValue = Genode.Init.toStart init }
in child
in λ(boot : Genode.Boot.Type)
→ let child = toChildEntry boot.config
→ let child =
{ mapKey = "test", mapValue = Genode.Init.toStart boot.config }
in { config =
Genode.Init::{

1
tests/signal.dhall

@ -12,7 +12,6 @@ in { config =
, binary = "test-signal"
, exitPropagate = True
, resources = { caps = 500, ram = Genode.units.MiB 10 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
}
}
}

1
tests/solo5/simple.dhall

@ -12,7 +12,6 @@ in λ(testBinary : Genode.Prelude.Map.Entry Text Text)
, binary = testBinary.mapKey
, exitPropagate = True
, resources = { caps = 256, ram = Genode.units.MiB 3 }
, routes = [ Genode.ServiceRoute.parent "Timer" ]
, config =
Some
( Genode.Prelude.XML.element

Loading…
Cancel
Save