You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is a builder for Agda libraries. Unlike Haskell, there is no cabal or anything of the sort to tell us about the package. The common practice is for authors to expose a file to compile, commonly Everything.agda.
Simply, it does the following
Prepare -i flags to call agda with
Create a wrapped binary in front of PATH and make AGDA_PACKAGE_PATH. This is mostly for benefit of tooling: in nix-shell we now have to only call agda and all our dependencies are accounted for. buildTools don't get accounted for here.
Compile the files under specified directories and copy them under $out/share/agda. There is no canonical place to put it but if all packages put it there then we can always find the files that way. An alternative way would be to put a script at the top level at build time which can tell us where in the tree to find the files but benefit of this is dubious and I feel user-experience would suffer.
As proof of concept I converted the existing stdlib expression to use the new builder. I also packaged the categories library using it. It's not included because it the library happens to not compile with the recent update to Agda 2.4.2 but otherwise there is nothing wrong with it, I tested with previous version. You can see the expression here. As you can see it's nice and short.
This is a step up from how stdlib was packaged: abuse the cabal file inside of it and do everything manually in postInstall.
I think this could be made more resillent but I think most of all it just needs a bit of testing by others. cc @JohnW who's listed under Agda things.
@Fuuzetsu I think you may have CC'd the wrong johnw by mistake. This looks like an interesting project, but I haven't been involved with it as far as I can remember.
The ghcWithPackages is only there for the stdlib package: they use a Haskell program to generate Everything.agda and it requires filemanip as one of the dependencies so I achieve this with ghcWithPackages. In usual scenario such as in categories you don't need to do this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Below is a builder for Agda libraries. Unlike Haskell, there is no cabal or anything of the sort to tell us about the package. The common practice is for authors to expose a file to compile, commonly
Everything.agda.Simply, it does the following
-iflags to call agda withnix-shellwe now have to only callagdaand all our dependencies are accounted for.buildToolsdon't get accounted for here.$out/share/agda. There is no canonical place to put it but if all packages put it there then we can always find the files that way. An alternative way would be to put a script at the top level at build time which can tell us where in the tree to find the files but benefit of this is dubious and I feel user-experience would suffer.As proof of concept I converted the existing stdlib expression to use the new builder. I also packaged the
categorieslibrary using it. It's not included because it the library happens to not compile with the recent update to Agda 2.4.2 but otherwise there is nothing wrong with it, I tested with previous version. You can see the expression here. As you can see it's nice and short.This is a step up from how
stdlibwas packaged: abuse the cabal file inside of it and do everything manually inpostInstall.I think this could be made more resillent but I think most of all it just needs a bit of testing by others. cc @JohnW who's listed under Agda things.