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

RFC: Agda builder #3915

Merged
merged 2 commits into from
Sep 4, 2014
Merged

RFC: Agda builder #3915

merged 2 commits into from
Sep 4, 2014

Conversation

Fuuzetsu
Copy link
Member

@Fuuzetsu Fuuzetsu commented Sep 1, 2014

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.

@stillyetanothergithubuser

@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.

@pSub
Copy link
Member

pSub commented Sep 2, 2014

CC @jwiegley

@Fuuzetsu
Copy link
Member Author

Fuuzetsu commented Sep 2, 2014

oops, sorry @JohnW , my mistake!

Yes, cc @jwiegley who seems to be currently missing.

@jwiegley
Copy link
Contributor

jwiegley commented Sep 3, 2014

@Fuuzetsu It looks pretty nice to me. Why do you have to do the somewhat magical things with ghcWithPackages? I didn't quite follow that part.

@Fuuzetsu
Copy link
Member Author

Fuuzetsu commented Sep 3, 2014

@jwiegley Nice to see you around again!

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.

@jwiegley
Copy link
Contributor

jwiegley commented Sep 3, 2014

@Fuuzetsu I'm at the ICFP conference this week, so I won't be around much until Monday, but this patch is fine by me as it is.

peti added a commit that referenced this pull request Sep 4, 2014
@peti peti merged commit ca931e0 into NixOS:master Sep 4, 2014
@Fuuzetsu Fuuzetsu deleted the agda-builder branch September 4, 2014 17:52
@nbp nbp mentioned this pull request Feb 26, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 9.needs: reporter feedback This issue needs the person who filed it to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants