Closed kentookura closed 9 months ago
It seems the main issue is the ocaml-system = "*"
constraint, combined with the fact that the ocaml compiler in your nixpkgs version is not recent enough. Updating opam-repository
(so that the compiler version in question is out of beta) and removing this constraint seems to make it build, although you will have to build the ocaml compiler yourself (shouldn't take too long, ~ 4 minutes on my hardware).
The complete diff that makes it work for me is this:
diff --git a/flake.lock b/flake.lock
index dc0ac51..813d188 100644
--- a/flake.lock
+++ b/flake.lock
@@ -140,11 +140,11 @@
"opam-repository_2": {
"flake": false,
"locked": {
- "lastModified": 1699845376,
- "narHash": "sha256-RZ+w6CI/K1PO33D5H7mTK0pT4jDh6DzwMT3zSUOsWTo=",
+ "lastModified": 1703856811,
+ "narHash": "sha256-dE+PZI0N8Hahs+D8GuvYktBGPhW9cyBZGxN6K+n2Y1g=",
"owner": "ocaml",
"repo": "opam-repository",
- "rev": "cd93eb224789c7c645f72575b685eec97b0ccbca",
+ "rev": "91155d8f7ba41238a91fbffd093e5bb7a532aa0a",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 35052b0..255c339 100644
--- a/flake.nix
+++ b/flake.nix
@@ -23,7 +23,7 @@
let inherit (opam-nix.lib.${system}) buildOpamProject;
scope = buildOpamProject
{ repos = [ "${opam-repository}" ]; } "forester" ./.
- { ocaml-system = "*"; };
+ { };
in
scope;
packages.default = self.legacyPackages.${system}."forester";
This is fine for now, thanks!
I maintain the flake for this project:
https://git.sr.ht/~jonsterling/ocaml-forester
It stopped working after some packages were updated, and I haven't been able to figure out how to fix it:
To Reproduce
nix run sourcehut:~jonsterling/ocaml-forester
for the original breakage. After cloning and updating the flake,nix build -L
results in the same errorExpected behavior It builds
Environment