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

ci: fix kyber build #243

Merged
merged 1 commit into from
Jun 11, 2024
Merged
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
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ jobs:
path: eurydice
- name: setup
run: |
nix build github:aeneasverif/charon/${{ github.sha }} -o charon
nix build ./eurydice -o eurydice/result --override-input charon github:aeneasverif/charon/${{ github.sha }}
ln -s $(pwd)/eurydice/result/bin/eurydice $(pwd)/eurydice/eurydice
nix build github:hacl-star/hacl-nix#fstar -o fstar
nix build github:hacl-star/hacl-nix#karamel.home -o karamel
echo CHARON_HOME=$(pwd)/charon >> $GITHUB_ENV
echo EURYDICE_HOME=$(pwd)/eurydice >> $GITHUB_ENV
echo FSTAR_HOME=$(pwd)/fstar >> $GITHUB_ENV
echo KRML_HOME=$(pwd)/karamel >> $GITHUB_ENV
- name: build kyber
run: |
cd libcrux-ml-kem
nix develop 'github:aeneasverif/charon/${{ github.sha }}#kyber-ci' --command ./c.sh
nix develop 'github:aeneasverif/charon/${{ github.sha }}#kyber-ci' --command build-kyber
30 changes: 24 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,30 @@
];
};
# The dev-shell we need to run kyber in CI. This doesn't really belong here but it's easier here.
devShells.kyber-ci = pkgs.mkShell {
packages = [
rustToolchain
pkgs.clang-tools # For clang-format
];
};
devShells.kyber-ci =
let
build-kyber = pkgs.writeShellScriptBin "build-kyber" ''
export RUSTFLAGS="--cfg eurydice"
echo "Running charon (sha3) ..."
(cd libcrux-sha3 && charon)
echo "Running charon (ml-kem) ..."
cd libcrux-ml-kem
charon

mkdir -p c
cd c
echo "Running eurydice ..."
$EURYDICE_HOME/eurydice --config ../c.yaml ../../libcrux_ml_kem.llbc ../../libcrux_sha3.llbc
'';
in
pkgs.mkShell {
packages = [
charon
build-kyber
rustToolchain
pkgs.clang-tools # For clang-format
];
};
checks = { inherit charon-ml-tests charon-check-fmt charon-ml-check-fmt; };

# Export this function so that users of charon can use it in nix. This
Expand Down