I finally got around to installing nix and I would like to use it to build my local git clone of some repository in an environment that corresponds to an existing PR (in order to create an overlay). Is this the right place to ask these questions? Can someone point me in the right direction?
Hi @Christian Doczkal, I can help / guide you through this process.
@Théo Zimmermann Sorry, I was called away. So where do I start?
No problem, I happen to be available again. The starting point should be https://github.com/coq-community/coq-nix-toolbox.
In particular, follow the Standalone instructions since you already have Nix.
Is this repository a new thing or some existing package?
I'm talking about a PR for mathcomp with an overlay for fourcolor
Oh OK, I misunderstood then :smile:
Let me reboot (figuratively).
Well, my initial messages was (purposefully) more generic than that, but possibly too generic nonetheless.
The most important missing point from your initial message is that you are trying to use Nix somewhere where the toolbox is already installed.
OK, I have an issue though, which is that @Cyril Cohen made this kind of workflow so simple in the latest version of the toolbox but apparently, he didn't yet update the version that is used on math-comp.
I currently have a local clone of math-comp and I'm on a branch that corresponds to the PR I want to create/update. Now I want to compile another package in the resulting environment. That is, the equivalent of creating a new switch and pinning mathcomp to the local version.
OK so first, in order to avoid rebuilding what CI has already built, it would help if you did the Cachix setup step described here: https://github.com/math-comp/math-comp/wiki/Nix-Example:-Instantenously-work-on-a-branch#setup-cachix-once-and-for-all--if-not-already-done
Yes, I did not install the latest toolbox for mathcomp yet... it's here: ready to merge once we release the toolbox: math-comp/math-comp#726
So I will defer to @Cyril Cohen to explain how you can do this in the version currently available on math-comp.
Well, I did the cachix use math-comp
, but the PR is currently not up to date anyway. So the cache won't have anything useful this time around.
I'm a bit lost: you want to build which project with which versions of what?
IIUC that's the same use case as https://github.com/coq-community/coq-nix-toolbox/issues/24 but for math-comp instead of Coq.
yes, but if one installs the toolbox in their own project, they can have the full support of the toolbox
That's why I'm asking
I am trying to build coq-fourcolor against a PR for mathcomp. ^^
Christian Doczkal said:
I am trying to build coq-fourcolor against a PR for mathcomp. ^^
for working in fourcolor or outside (e.g. the graph library) ?
In order to prepare the overlay for coq-fourcolor that this PR requires. Théo had it right, see above.
ok
I can make a PR in fourcolor to add the toolbox and you can take it from there?
OK, for this time, it works.
We're in a pre-release state. For July 1st I will tidy mathcomp as well and you will be able to use coq-community/coq-nix-toolbox#24
I will soon merge math-comp/fourcolor#33, but you could already use it
I wasn't aware that you also need to install the toolbox in the reverse dependencies.
Christian Doczkal said:
I wasn't aware that you also need to install the toolbox in the reverse dependencies.
you don't have to... but since the last version of the toolbox is not installed in mathcomp (and I do not want to do it right now), it's easier to just install the toolbox in the reverse deps
It's not necessary, but it's sufficient
Well, I can also do things manually for now and you install the toolbox in mathcomp and fourcolor once it's actually stable.
Now you only need to add the line
"8.13".coqPackages.mathcomp.override.version = "brancheName/#yourPR";
in .nix/config.nix
You're talking of the one on the four-color side, right?
Wait, so I should update the PR first, then let CI run (and fail)? Also, in which version of this file on which branch (of which repository) do I add the line?
No need.
I think Cyril was talking of the four-color repo.
But you can also do this on the command-line with nix-shell --arg override '{mathcomp = "#yourPR";}'
However, you will need first to checkout this version of the repo: https://github.com/math-comp/fourcolor/pull/33
I am also updating the toolbox of mathcomp, I think it runs under 1h and after that you can rebase the mathcomp PR as well, you'll have "l'embarras du choix"
So, I should update the PR (in the mathcomp repository), but I do not need to wait for CI to finish before I can do the override nix shell from the (patched) four-color clone?
You do not need to update the PR on the mathcomp side AFAICT.
and you do not need to wait for the CI to finish either
bit how does #yourPR
do the right thing, if the PR with that number does not ...
yes, the overloading instruction does not depend on the toolbox being installed in the dependencies
Ah! I got it. Then yes, if your local version is not the same as the one on the math-comp repo, you'll have to push.
(Although it is also supported to point to a local version.)
Well, I think I will wait for Cyril to merge the new toolbox (on mathcomp), then do the rebase/push and then bug you again tomorrow ;)
That's fine with me.
I'm lost
With respect to what?
as to why @Christian Doczkal could not use math-comp/fourcolor#33 right now
I can, but maybe I want to learn how to do the normal/regular way, and I used the time I budgeted for this today.
ok this was a mistake from me not to merge the experimental toolbox in mathcomp, I just detected two missing overlays (one in coqeal and one in abel) that we will have to fix before releasing the next mc release...
@Christian Doczkal FTR I merged math-comp/math-comp#726 yesterday so you can rebase your mathcomp PR, then type nix-shell --argstr job fourcolor
from the root of your workdir for the PR, then cd
to fourcolor and you can make -j8 -k
from there :)
Well, I saw the merge, and updated the PR, but I had forgotten the rebase. Consequently, CI failed terribly. Let's see what happens after the rebase. ^^
There also seems to be an issue with GitHub, because I don't get any progress or information on the CI run. Only a turning circle above the comment text field.
Yep, github looks fishy right now, maybe it's being hacked
That's not the only thing that looks down. cache.nixos.org too
oO
not on my side...
Théo Zimmermann said:
That's not the only thing that looks down. cache.nixos.org too
I also get an "Error 503 Service Unavailable"
@Christian Doczkal you do not need to rely on precompilation of anything... you can run the nix-shell on your computer right now... in worst case scenario you should be set in 7 min
Christian Doczkal said:
Théo Zimmermann said:
That's not the only thing that looks down. cache.nixos.org too
I also get an "Error 503 Service Unavailable"
I get HTTP 502 errors
I've also got a GitLab pipeline failing to reach deb.debian.org!
https://www.dailysabah.com/world/global-news-websites-down-amid-internet-outage/news
@Christian Doczkal did you have the opportunity to try?
@Cyril Cohen Yes, I did try the nix-shell --argstr job fourcolor
variant after locally rebasing (yet again) to the latest state of mathcomp. This works really well, although I am a bit bewildered by the huge amount of packages that are being copied from the cache, which even included systemd
? :grimacing:
Yes, that's the deal. Every dependency of a Nix package is pinned to a specific version and fetched to the store.
But once you have it there, you won't pull it again until its version changes, so not for a good while.
Just out of curiosity, what's up with time in Nix? This is what I get from Coq in a nix-shell (mathcomp default)
$ coqc --version
The Coq Proof Assistant, version 8.13.1 (January 1980)
compiled on Jan 1 1980 0:00:00 with OCaml 4.10.2
Nix is all about reproducible builds. Sticking the time at which a program was compiled in the binary makes the build non-reproducible. So Nix patches that.
But in future versions of Coq, this info is removed anyway.
Funny, why Jan 1 1980
and not Jan 1 1970
?
that would be the zero for unix
It used to be the latter. I don't know why it changed to the former.
Last updated: Oct 08 2024 at 15:02 UTC