Skip to content
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

esy: init at 0.6.2 WIP #85835

Draft
wants to merge 2 commits into
base: master
from
Draft

esy: init at 0.6.2 WIP #85835

wants to merge 2 commits into from

Conversation

@NickHu
Copy link
Contributor

NickHu commented Apr 23, 2020

Motivation for this change

A work-in-progress packaging of the esy package manager, by building on #65098 and esy/esy#994.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Issues to be solved

While the binary seems to work fine, there are some issues. The largest of which is that esy doesn't seem able to compile ocaml (under NixOS), which I think will be resolved when esy-ocaml/ocaml@1667562 hits the npm package registry (I tried really hard to just use local version of esy-ocaml/ocaml, switching to the latest 4.8.1000+esy branch, and editing the package.json of what I was trying to compile, but this just made the dependency resolver scream at me - I think it's very broken). As a result, I was unable to get this build of esy to build a single package (as it first needs to bootstrap the ocaml compiler), suggesting that more work is needed.

esy version 0.6.4 is out, but using this version causes complaints about esy.lock being corrupt on everything I tried - initially, I thought this was just that the format of esy.lock changed in a non-compatible way, but strangely when I tried version 0.6.4 on Arch Linux (by updating the PKGBUILD on the AUR) and it had no such issue. Fortunately, 0.6.2 doesn't seem to invalidate existing esy.lock directories. I wasn't able to package 0.6.3 easily because its package.json doesn't seem to be on the npm registry.

It might also be necessary to get some binaries (gnum4, coreutils, etc.) into the PATH used by esy when it builds too, but adding this to buildInputs/propagateBuildInputs doesn't seem to work (though strangely when I ran esy inside nix-shell -p gnum4 it was somehow able to find m4).

cc @Zimmi48 @kamilchm @anmonteiro

Zimmi48 and others added 2 commits Jul 19, 2019
Aborted attempt to add the esy package manager to nixpkgs.  I think I
was almost there to get its dependencies, but I have no idea if
building it like a dune package would have been enough to make it
work.  The last hurdle has been with cudf and dose3.  The first
problem when building dose3 was a string-byte problem, fixed by
importing patches from the opam repository.  I don't know how to fix the
next one: dose3 attempts to find a cudf.cmxa in a folder that contains
a cudf.cma but no cmxa.

This submission is in the hope that this PR can be partially salvaged
and my work was not totally useless.
Following on from PR #65098, this commit makes dose3 compile (all that
was missing was to compile the native version of cudf), and also esy.
Various packages have been updated too, and esy's node dependency
esy-solve-cudf has been packaged. A new overlay is added for
esyOcamlPackages, as mainline cmdliner doesn't successfully compile esy.
It's anticipated that more esy-specific deviations might occur.

Most of these changes were taken and adapted from
esy/esy#994.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.