-
Notifications
You must be signed in to change notification settings - Fork 10
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
Build Infrastructure #25
Conversation
This includes a shell for developing narya and a package definition for narya. The shell for developing narya uses regular old nixpkgs, but the package definition uses static nixpkgs, so the end build result can be copied to any linux machine and run with no dependencies.
Thanks for this! I appreciate it, but I need to think about it a bit and make sure I understand what it's doing, not just because I like to understand what's going on in my repository but because I'll need to know how it interacts with other things in the future.
|
|
Sorry for the delayed response, I didn't see you had responded. You raise some good points. In no particular order:
|
Thanks! Can you explain a bit more about the reproducibility benefit of version-controlling (Or point me to a good explanation of it elsewhere, if this is a standard best practice.) |
Keeping the flake lock in the repo is pretty standard, for instance see https://git.sr.ht/~jonsterling/ocaml-forester. A flake.nix file on its own doesn't guarantee reproducability because it doesn't specify how the inputs get resolved. Also see: https://www.tweag.io/blog/2020-05-25-flakes/. |
Thanks. Would it be correct to say that the lock file is not an output of compilation but rather part of the specification of a build, such as a makefile or a dune file, which we can morally think of as being created by hand rather than automatically -- it's just that it would be too tedious to actually write it by hand, and almost always when creating or updating it we want it to lock "the current version accessible to me right now", so there is an automated tool that does that for us? I guess this adds an extra burden on the developer, to know when the lock file has to be updated and run the appropriate command. When is that? |
Essentially, when we wish to update dependencies! That is, you will always get the same version of the ocaml compiler/same versions of dependencies until you update the lock file. So if you are happy with that, then you never need to update the lock file. But if you want a newer compiler/newer libraries when they come out, then one must update the lock file. |
Ok. I guess building the static binary in GitHub CI will help with that, by failing if the code changes to require a newer compiler or libraries but the lock file didn't get updated. |
This PR adds nix build infrastructure that:
nix develop
nix build
that can be distributed to any linux user (not just nix users)@mikeshulman, you might want to host tarballs of the statically-linked narya binaries on your website, that could make it a lot easier for people to run narya!