chore(nix): make it faster to get melange#6347
Conversation
anmonteiro
commented
Oct 28, 2022
- nix-overlays enables flambda by default
- depending on the melange flake forces dune developers to build an extra flambda compiler to work on Dune
- this change uses the upstream OCaml from nixpkgs which should always be cached in cache.nixos.org
flake.nix
Outdated
| ocaml-ng = super.ocaml-ng // { | ||
| ocamlPackages_4_14 = | ||
| super.ocaml-ng.ocamlPackages_4_14.overrideScope' (oself: osuper: { | ||
| dune_3 = osuper.dune_3.overrideAttrs (o: { |
There was a problem hiding this comment.
should only be needed until NixOS/nixpkgs#196899 is merged.
dd365da to
0b19f46
Compare
|
@anmonteiro instead of waiting for upstream, could you add an overlay here? |
flake.nix
Outdated
| flake = false; | ||
| }; | ||
| melange.url = "github:melange-re/melange"; | ||
| melange.inputs.nixpkgs.follows = "nixpkgs"; |
There was a problem hiding this comment.
instead of reusing our own nixpkgs, would it be possible to just insert an overlay into melange's nixpkgs?
There was a problem hiding this comment.
If I understood you correctly, I don't think that's a good idea. Melange's nixpkgs are my nix overlays, which is what's causing the issue of having 2 OCaml compilers in the first place (clambda and flambda).
There was a problem hiding this comment.
Right but we can override your overlay? We don't need a fast melange since we only run it in trivial test projects.
There was a problem hiding this comment.
You're right, the line is not strictly necessary. It avoids pulling in one more tarball though. I'll defer to your decision.
There was a problem hiding this comment.
I guess if our goal is to speed up the build of melange this is ideal.
I'm just worried that if you decide to modify or overlay your nixpkgs somehow, melange won't build in our dev shell.
Anyway it's enough to keep an eye out for this for now.
There was a problem hiding this comment.
Alright, I removed the follows line. It doesn't impact the build: we just download an extra tarball of nixpkgs.
I like that suggestion. will do |
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
48c711c to
18ec685
Compare
|
Switched this to use a melange-provided overlay (added in melange-re/melange#430). |
flake.nix
Outdated
| pname = "melange-compiler-libs"; | ||
| version = "0.0.1-414"; | ||
| src = builtins.fetchurl { | ||
| url = "https://github.com/melange-re/melange-compiler-libs/releases/download/${version}/melange-compiler-libs-${version}.tbz"; |
There was a problem hiding this comment.
Would it be possible to add melange-compiler-libs as a flake input instead?
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
|
Diff looks a lot better with https://github.com/ocaml/dune/pull/6347/files?w=1 |
* main: test(melange): demonstrate error in melange compilation trying to build @ALL (ocaml#6485) chore(nix): make it faster to get melange (ocaml#6347) refactor: status db style tweaks (ocaml#6478) fix: improve error message for status db (ocaml#6479) refactor: remove unused [flags] parameter (ocaml#6480) refactor(ctypes): remove pesky aliases (ocaml#6482) chore: tweak `hacking.rst` following `dune.exe` move to _boot (ocaml#6484) feature(coq): automatic detection of native chore(coq): bump Coq lang to 0.7 test: disable formatting for a single dune file (ocaml#6465) refactor: clean up module compilation (ocaml#6461) doc: add button to copy code blocks in Dune manual (ocaml#6428) refactor: deforest a set conversion (ocaml#6473) refactor: remove temporary map used for sorting (ocaml#6472) fix(melange): handle include_subdirs unqualified (ocaml#6475)
* main: test(melange): demonstrate error in melange compilation trying to build @ALL (ocaml#6485) chore(nix): make it faster to get melange (ocaml#6347) refactor: status db style tweaks (ocaml#6478) fix: improve error message for status db (ocaml#6479) refactor: remove unused [flags] parameter (ocaml#6480) refactor(ctypes): remove pesky aliases (ocaml#6482) chore: tweak `hacking.rst` following `dune.exe` move to _boot (ocaml#6484) feature(coq): automatic detection of native chore(coq): bump Coq lang to 0.7 test: disable formatting for a single dune file (ocaml#6465) refactor: clean up module compilation (ocaml#6461) doc: add button to copy code blocks in Dune manual (ocaml#6428) refactor: deforest a set conversion (ocaml#6473) refactor: remove temporary map used for sorting (ocaml#6472) fix(melange): handle include_subdirs unqualified (ocaml#6475)