-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Agda rework #76653
Agda rework #76653
Conversation
Thanks for putting the work in here. Given that my usual way of using Agda libraries totally bypassed Nix, it was clear that something had to be done. Furthermore, the Agda community could really benefit from some way to make builds reproducible, because with the language and standard library changing quickly, reproducing builds is often hard. Before writing the documentation fully, could you give a quick overview of the intended workflow? In particular, I think it would be worth recommending something to deal with Emacs integration (I've never managed to do this with Haskell, for example). I'm slightly concerned with the “compile everything and put it in /nix/store/” approach which (IIUC) this proposal sticks to. Compiling the standard library all in one go takes several gigabytes of RAM, which on some machines is a serious inconvenience. Other libraries can be worse (I imagine agda-categories is). Also, it makes things much more difficult for those using master versions or working on a library. All caching is lost, even when only a tiny change to the library is made. Do you have recommendations for either of these situations? |
My workflow using this is to install say I haven't tested it a lot yet, but with this workflow emacs integration seems to work out the box. If you wanted to get a version of agda from nix-shell, I think
It does stick to this
This is why I have put
I think it could be hard to work round this issue. Some things I thought of:
|
317379e
to
1186903
Compare
1186903
to
a2581b1
Compare
Have rebased to fix merge conflict |
Is this PR considered ready? |
I think not quite yet, could do with someone else to look through/test it I think + resolve the problems in the discussion above |
a2581b1
to
43c5efe
Compare
Changed to using |
Having thought about it a bit more, it makes sense to work on libraries in a non-Nixified state, so it's not too unreasonable to assume that this is what one should do to work with master-branch versions too. Perhaps, though, it would be possible to do something cleverer. In cases where the Agda version stays the same, but the library changes, it should be the case that most .agdai files are still helpful. In particular, we may want to depend on an old, stable version of the library and copy its .agdai files over before building the new version. It feels like this could be done at a later time if it's really wanted, though, so I'll say that not doing it is fine.
I think this would be nice as an option in the generic builder, which we would hope to deprecate if/when Agda becomes better at building libraries. Do something like: build each file individually, so as to yield One more issue: how does this deal with compilation? If I remember correctly, compilation output can live in a different directory ( |
The only way I can see of doing incremental builds is by generating a nix expression for each file, as in https://github.com/nmattia/snack, though I am not sure this sort of thing lives in nixpkgs and as you have said, if you need to rebuild a library a lot it may make more sense for it to be in your home directory. I will try to add the building each file separately and seeing how it goes, the ways I can see of doing this are:
I'm not sure which of these is preferable I have actually never really tried to compile anything before, I'll give it a try. One final thing, I believe that agda does not accept having multiple library files, would it be worth adding an option in |
Compiling works, it seems to put all the files in your working directory by default. This also acts on the |
adding |
stdlib also has files like |
I'm sure the bash can be improved but
? |
perhaps this is better (though more cryptic) |
Just spotted another thing: I never got round to reviewing #76217, but agda-stdlib should be at version 1.2. We might as well make that change in this PR to avoid conflicts. |
is 1.2 for agda verson 2.6.0.1? |
Will add this in a sec, what else needs to be done? |
The old homepage URL, which was hosted inside the old SVN server, isn't publicly accessible anymore. Since the project has officially moved to github, it seems better to set the github repo as the homepage.
Have addressed discussions above |
I suggest we merge this as long as this evaluates/builds and take on further improvements in follow up PR's. @GrahamcOfBorg build agda agdaPackages.standard-library |
Seems to be fine on linux and for some reason tries to compile agda and times out on darwin and aarch64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nixpkgs-review on x86_64-darwin:
2 package marked as broken and skipped:
agdaPackages.agda-prelude agdaPackages.iowa-stdlib
1 package built:
agdaPackages.standard-library
Thank you @alexarice @chkno @laMudri @turion! |
I will ask on the Agda mailing list what typical libraries are that people use and try to bring them into this framework. My dream would be that |
One issue is most libraries don't seem to be publishing a release when a new agda version comes out though I was just planning on pinning some commits for each so that they at least work |
You mean pinning an agda commit or a library commit? Yeah, |
By that I mean that we can ping the library maintainers in a more systematic way, and point them to a reproducible failing build. |
Motivation for this change
Fixes #60271
Fixes #62546
Things done
agda
scopeagda-categories
(this can be split into a separate PR but I wanted to check that agda packages with agda dependencies worked)sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @jwiegley @laMudri
There should possibly be some documentation for this