Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add proofs as package #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ jobs:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: nix build .#packages.x86_64-linux.guardonce --print-build-logs
x86_64-linux---packages---l4v:
name: x86_64-linux---packages---l4v
runs-on:
- ubuntu-latest
needs: []
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v14
with:
name: dlr-ft
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: nix build .#packages.x86_64-linux.l4v --print-build-logs
x86_64-linux---packages---microkit-sdk:
name: x86_64-linux---packages---microkit-sdk
runs-on:
Expand Down
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
camkes-deps = pkgs.python3Packages.camkes-deps;


#
### Proofs
#
l4v = pkgs.l4v;


#
### microkit(-sdk)
#
Expand Down
2 changes: 2 additions & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ final: prev: {
# https://android.googlesource.com/tools/repo
fetchGoogleRepoTool = prev.callPackage pkgs/fetch-google-repo-tool.nix { };

# L4.verified
l4v = prev.callPackage pkgs/l4v.nix { };

# microkit
microkit-sdk = prev.callPackage pkgs/microkit-sdk.nix { };
Expand Down
3 changes: 2 additions & 1 deletion pkgs/fetch-google-repo-tool.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lib.makeOverridable (
, rev
, name ? "source"
, hash
, manifest ? "default.xml"
# Problem
#
# `repo` allows for the manifest to just specify a branch, defaulting to the latest commit.
Expand Down Expand Up @@ -54,7 +55,7 @@ lib.makeOverridable (
mkdir -- "$out" home
export HOME="$PWD/home"
cd "$out"
repo init --manifest-url=${escapeShellArg url} --no-repo-verify
repo init --manifest-url=${escapeShellArg url} --manifest-name=${escapeShellArg manifest} --no-repo-verify

pushd .repo/manifests > /dev/null
git fetch --all --tags
Expand Down
76 changes: 76 additions & 0 deletions pkgs/l4v.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{ stdenvNoCC
, fetchGoogleRepoTool
, which
, isabelle
, cmake
, mlton
, ninja
, pkgsCross
, python3Packages
, openjdk_headless
}:

stdenvNoCC.mkDerivation (finalAttrs: {
pname = "L4.verified";
version = "1.11";

src = fetchGoogleRepoTool {
url = "https://github.com/seL4/verification-manifest";
rev = "2b434d1957eba420782f10f90e58f0b93ee3a4b7"; # 2024-10-11
manifest = "13.0.0.xml";
hash = "sha256-GTjofiun3TWlKdHRegWJNIitRzcZTGuSZQG1tmLpBg0=";
};
# src = fetchFromGitHub {
# owner = "seL4";
# repo = "l4v";
# rev = "autocorres-${finalAttrs.version}";
# hash = "sha256-Rv3lhx3CE7jW9P+nW3JiYZXnMmr+qFcAiK/TMziYxyE=";
# };

nativeBuildInputs = [
which
isabelle
mlton
openjdk_headless

cmake
ninja

# compilers
pkgsCross.aarch64-embedded.stdenv.cc.bintools.bintools
pkgsCross.aarch64-embedded.stdenv.cc.cc
pkgsCross.arm-embedded.stdenv.cc.bintools.bintools
pkgsCross.arm-embedded.stdenv.cc.cc
pkgsCross.riscv64-embedded.stdenv.cc.bintools.bintools
pkgsCross.riscv64-embedded.stdenv.cc.cc
];

preUnpack = ''
HOME="$PWD/home"
mkdir --parent -- "$HOME"
'';

dontUseCmakeConfigure = true;

# preConfigure = ''
# rm --force --recursive -- isabelle
# ln --force --symbolic -- ${isabelle} isabelle
# '';

prePatch = ''
patchShebangs .
'';

preBuild = ''
cd l4v/proof
'';

buildPhase = ''
runHook preBuild

file /build/source/l4v/isabelle/bin/isabelle
make all

runHook postBuild
'';
})