From e3e5528569fe829a5b57888c6ffe3842ec639626 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sun, 31 May 2020 11:53:25 +0530 Subject: [PATCH] Update flake attributes, README, cleanup Thanks to Dan Connolly for noticing deprecated formating in the flake. --- README.md | 99 +++++++++++++++++++++++---------------------- flake.nix | 4 +- tool/setup-hooks.sh | 7 ---- 3 files changed, 52 insertions(+), 58 deletions(-) delete mode 100644 tool/setup-hooks.sh diff --git a/README.md b/README.md index f931174..1373b18 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,16 @@ **SoTest:** https://opensource.sotest.io/userName%3Demery/1 +## Repository layout + + - Native packages are at [packages](./packages/default.nix) + + - Existing Nixpkgs packages are patched at [overlay](./overlay/default.nix) + + - Tests are at [tests](./tests/default.nix) (messy) + # Contributing -At the moment every user needs to also act as distro developer, designing how -packaging works needs to be done before packages can be submitted in bulk. Patches can be submitted and issues reported via the [mailing list](https://lists.sr.ht/~ehmry/genodepkgs). The mailing list is the minimum viable mechanism for community development, and may be replaced later. @@ -31,37 +37,24 @@ The worksites at the moment are: - Documentation - - Port tests to the NixOS test harness. + - ARM, i686 - - Patching standard Nixpkgs packages via an overlay. Workflow and tooling - needs to be explored for building emulated UNIX environments. + - Write a proper test framework, or better, reuse the NixOS one. + + - Patching standard Nixpkgs packages by overlay. Explore Workflow and tooling + for building emulated UNIX environments. - LLVM testing and upstreaming patches. - Formalizing Dhall configuration types. + - NixOS modules for constructing a reasonably usable Genode system. Reusing the + module system from NixOS is advantagous because a dual boot system can + share a `/nix/store` and be updated simultaneously. Work-in-progress on a + topic branch. + - Configuration validation via a service routing prover. - -# Packaging - -Packaging is done using standard Nixpkgs methods, a `stdenv` is available for -cross-compilation. See [Solo5](./packages/solo5/default.nix) as an example. - - -# System description format - -The high-level interface to system building are boot descriptions. These Dhall -documents describe the configuration of an [Init](https://genode.org/documentation/genode-foundations/19.05/system_configuration/The_init_component.html) -instance and a store of ROM (Read-Only Memory) modules. These description can be -used to build firmware-like binary images or merged and nested within other -descriptions. In theory these descriptions can arrange file-systems, but those -functions are missing. - -The description schema is documented as code: -https://git.sr.ht/~ehmry/dhall-genode/tree/master/Boot/package.dhall - - # Nix Flakes This repository is structured as a Nix flake, which is an experimental extension @@ -70,21 +63,34 @@ introduction and tutorial. ## Build Caching +The builds produced by Hydra are available as a binary cache, using the cache is +strongly recommended. + +The global (IPv6 only) address for the cache can be tested by fetching the +following: http://cache.server7.hq.c3d2.de/nix-cache-info. + +If that fails the cache is also available within the +[Yggdrasil](https://yggdrasil-network.github.io/) network: +http://nix-serve.y.c3d2.de/nix-cache-info. + Those with IPv6 will want to the following to their */etc/nix/nix.conf* file: ``` -substituters = https://cache.nixos.org/ https://cache.server7.hq.c3d2.de/ +substituters = https://cache.nixos.org https://cache.server7.hq.c3d2.de trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.server7.hq.c3d2.de:x8JLRG26zRZ8ysYZLEkPxuAYuK1VSJi/aMAEIs2Lv+U= ``` - NixOS users may alternatively using the following configuration: ```nix { pkgs, ... }: { # The following enables the use of a binary cache (IPv6 only) - nix.binaryCaches = [ "https://cache.server7.hq.c3d2.de" ]; + nix.binaryCaches = [ + "https://cache.nixos.org" + "https://cache.server7.hq.c3d2.de" + # or "http://nix-serve.y.c3d2.de" + ]; nix.binaryCachePublicKeys = [ "cache.server7.hq.c3d2.de:x8JLRG26zRZ8ysYZLEkPxuAYuK1VSJi/aMAEIs2Lv+U=" ]; @@ -102,6 +108,11 @@ $ nix build .#checks.x86_64-linux.nova-x86 $ nix log .#checks.x86_64-linux.nova-x86 ``` +# Packaging + +Packaging is done using standard Nixpkgs methods, a `stdenv` is available for +cross-compilation. See [Solo5](./packages/solo5/default.nix) as an example. + # Toolchain The Genode Labs toolchain is available here only for Linux and in binary form. @@ -116,14 +127,6 @@ nix run .#legacyPackages.x86_64-linux-x86_64-genode.stdenv.cc x86_64-unknown-genode-clang++ -v ``` -# Building - -Bootstrapping the build tooling can take several hours on a laptop, therefore it -is recommended enable the binary caches and to farm massive rebuilds to large -multicore machines. The Nix flake is prepared for continuous builds with a -[Hydra](https://nixos.org/hydra/), but only the experimental flakes capable -Hydra. - # Testing Tests are performed using QEMU, the test artifacts are built as follows: @@ -142,6 +145,18 @@ nix build .#checks.x86_64-linux.nova-x86.store nix build .#checks.x86_64-linux.nova-x86.config ``` +# System description format + +The high-level interface to system building are boot descriptions. These Dhall +documents describe the configuration of an [Init](https://genode.org/documentation/genode-foundations/19.05/system_configuration/The_init_component.html) +instance and a store of ROM (Read-Only Memory) modules. These description can be +used to build firmware-like binary images or merged and nested within other +descriptions. In theory these descriptions can arrange file-systems, but those +functions are missing. + +The description schema is documented as code: +https://git.sr.ht/~ehmry/dhall-genode/tree/master/Boot/package.dhall + # Tips and tricks ## How to build a Genode make target? @@ -203,18 +218,6 @@ within the Genode source tree is an *explicit input hash* and the output of the port preparation is non-deterministic. -## Render a Dhall Init configuration to XML - -```shell -echo ./config.dhall | nix app genodepkgs#render-init > config.xml -``` - -## Build a Genode Labs Make target - -```shell -nix app genodepkgs#genode-make "test/bomb" -``` - ## Enter an environment compatible with the Genode Labs build scripts ```shell diff --git a/flake.nix b/flake.nix index d895817..261bcd8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,9 @@ # SPDX-License-Identifier: CC0-1.0 { - edition = 201909; - description = "Genode packages"; - inputs.nixpkgs.uri = "github:ehmry/nixpkgs?ref=genode"; + inputs.nixpkgs.url = "github:ehmry/nixpkgs?ref=genode"; outputs = { self, nixpkgs }: let diff --git a/tool/setup-hooks.sh b/tool/setup-hooks.sh deleted file mode 100644 index b4d96c5..0000000 --- a/tool/setup-hooks.sh +++ /dev/null @@ -1,7 +0,0 @@ -addGenodePkgConfigPath () { - if test -e "$1/.genode" && test -d "$1/lib/pkgconfig"; then - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$1/lib/pkgconfig" - fi -} - -addEnvHooks "$targetOffset" addGenodePkgConfigPath