Conversation
1b5b637 to
1676cdb
Compare
|
Most things appear to be building, thank you it's a bit annoying to have to manually modify
#!/bin/sh
set -e
if [ "$(awk -F': ' '/tag/ {print $2}' cabal.project)" != "$(jq -r '.rev' support/nix/dep/Agda/github.json)" ]; then
echo "Mismatching revs" > /dev/stderr
exit 1;
fi
|
|
I don't think 1 works: if I add cabal.project to .gitignore and make a change to cabal.project, git still tracks it. I think .gitignore only dictates which files become tracked in the first place, but once a file is tracked it's tracked. 2 doesn't play nicely with the third use case above: running For 3, I don't think cabal2nix can do this but we could write a script using cabal-install-parsers and call it from Nix. It's a bit weird to have the information go from cabal.project to Nix though, since Nix also requires a hash that's not present in the cabal.project file. I'm also not sure this is worth the extra complexity. |
|
We definitely want to keep |
TOTBWF
left a comment
There was a problem hiding this comment.
We can deal with synchronizing the revs in the cabal file in later work, as it looks pretty non-trivial.
This ensures that `cabal build shake` succeeds without warnings, as a first step towards making it possible to build the 1Lab without Nix.
Replace the bespoke `mkDerivation` with an equivalent `callCabal2nix` so that dependencies and other build options are only tracked in one place. These changes are made with *four* use cases in mind: - `nix-build` for building the 1Lab; - `nix-shell --run '1lab-shake all'` for working on the 1Lab interactively; - `nix-shell -A shakefile --run 'cabal run 1lab-shake -- all'` for working on the 1Lab *and the build script* interactively; - `cabal run 1lab-shake -- all` outside of a Nix shell, after following the instructions in the README for setting up dependencies.
Since 9.10 is the default version in nixpkgs, Haskell dependencies are now available from cache.nixos.org.
`all-pages.agda` is already generated by the shakefile. To build the 1Lab as an Agda library, one can use `agda --build-library`.
Both available mechanisms for determining whether we are in a nix-shell invocation are currently broken: - the `inNixShell` argument is not set by nix-direnv; - the `IN_NIX_SHELL` environment variable is an environment variable, so it affects nix-build calls inside nix shells. So we keep the shells separate instead.
Warning: boring PR.
This makes
cabal build 1lab-shakesucceed (without warnings), so that one can build the 1Lab outside of the provided Nix shell by following the instructions in the (updated) README, should one choose to inflict this upon oneself. To prevent further bitrot in1lab-shake.cabal, I also replaced the bespokemkDerivationfor building the shakefile with an equivalentcallCabal2nix; this means that dependencies and other build options are only tracked in one place.These changes are made with four use cases in mind:
nix-buildfor building the 1Lab;nix-shell --run '1lab-shake all'for working on the 1Lab interactively;nix-shell -A shakefile --run 'cabal run 1lab-shake -- all'for working on the 1Lab and the build system interactively;cabal run 1lab-shake -- alloutside of a Nix shell, after following the instructions in the README for setting up dependencies.Also removes
support/check.shas discussed in #587, since the same thing can be achieved withagda --build-library.Also bumps GHC to 9.10 to get dependencies from cache.nixos.org.
Also contains other trivial changes. The only breaking changes should be:
shakeCabal target is renamed to1lab-shake.nix-shell -A shakefileno longer exposesghcide(possibly other stuff as well). If needed, this can be added inshell.nix. HLS is still included.Let me know if you find anything else.
@4e554c4c Does this work for your use cases?