esy-issues icon indicating copy to clipboard operation
esy-issues copied to clipboard

[MED PRI] Constraint solver that generates shrinkwrap.

Open jordwalke opened this issue 7 years ago • 1 comments

  • Constraint solver that generates shrinkwrap.json.
  • Constraint solver that generates yarn lockfile (stretch goal, maybe not needed).

jordwalke avatar Mar 15 '17 10:03 jordwalke

Description thanks to @andreypopp:

yarn/npm use a super naive dependency solver. This is somewhat acceptable for JS code but doesn't scale with OCaml ecosystem.

The problem is that with OCaml we have multiple compiler versions available (4.02, 4.03, 4.04, ...), npm will fail trying to solve dependency on a compiler (remember they get rid of enforcing "engine" field in package.json?).

Another problem is that sometimes we need more expressive dependency declarations, for example opam allows boolean formulas there — https://opam.ocaml.org/doc/Packaging.html#Moreonopamfiles — but we yet need to analyze how we should deal with that. Probably boolean formulas are to powerful and confusing for users.

Thea idea is to use CUDF based solver so that we don't need to write one and (hopefully) worry about their perf (as they are written in C and highly optimized). http://www.mancoosi.org/cudf/ Such tool would generate npm-shrinkwrap.json or yarn.lock so that installers could use them.

Bonus point fot this task: write OCaml, not JS

wokalski avatar May 08 '17 16:05 wokalski