-
Notifications
You must be signed in to change notification settings - Fork 23
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
Integrate the Haskell code generate from agda-spec
into the build system and CI
#1343
Comments
I would say that the right thing to do is to effectively integrate the code generation part into the top-level Cabal project since, as a workaround, I created an "empty" |
I've tried a couple of things today to integrate the the Agda spec and the generated code into the existing Nix build system. Much has already been done by Alex Esgen, i.e. we seem to actually build the pdfs in CI and thus implicitly also type-check the Agda development. So what remains to be done is the code generation. Nix
|
I've replicated the second component of the setup in the formal-ledger repo.
However, I'm still hitting a roadblock. Unfortunately trying to build the second derivation (from the top-level flake):
results in GHC panics, e.g.
I'm attaching the full log for reference. Unfortunately, I'll have to give up at that point. It is probably better to wait until Alex Esgen is back from holiday in January. |
Ended up looking a little further into this. I've noticed that It turns out the panic is in-fact a known issue in GHC encountered by @Soupstraw when generating Haskell from the ledger Agda spec. The issue only seems to manifest in a profiled build. Even though the issue seems to have been resolved in GHC 9.6.6, I still get it. Disabling the profiled build helps:
in the end, we get the generated code built and the tests by calling
and breaking the tests actually makes this build fail. |
I have also decided against integrating the generated code into the top-level |
Fixes #1343 Note that this PR targets the branch of #1315 and not `main`. This PR adds Nix derivations that: - generate Haskell code from the Agda spec using the `Makefile`-based build system in `./docs/agda-spec/` - wrap the generated code into Nix using `cabal2nix` In combination with the existing set-up in `flake.nix`, we can now build the generated code and run it's tests using the following flake output: ``` nix build .#hydraJobs.x86_64-linux.native.agda-spec.hsExe ``` which will also be done in CI, i.e. see the logs from testing this PR - the job [x86_64-linux.native.agda-spec.hsExe](https://ci.iog.io/build/6263029/log) builds and runs tests for the generated code some other jobs, e.g. the linting of the unit tests for the generated code, are failing, but we can fix those in #1315
The PR #1315 by @javierdiaz72 adds an executable specification of a part of the consensus layer in Agda.
We need to integrate the spec into the repo's build system and CI:
check the spec in CIthis is already done onmain
when building the PDF specThat probably involves integrating the generated code into the top-level Cabal project.generate the pdf from the spec (optionally in CI?), which means forwarding the relevant bits to ./nix/pdfs.nix.this is already done onmain
.The text was updated successfully, but these errors were encountered: