esy / esy

package.json workflow for native development with Reason/OCaml
http://esy.sh
Other
844 stars 93 forks source link

Add `opam-cross-*` to supported repositories #508

Open jaredly opened 6 years ago

jaredly commented 6 years ago

So I can do

{
  "dependencies": {
    "@opam-cross-windows/ocaml-windows": "*"
  }
}
rauanmayemir commented 6 years ago

I'm interested in working on this.

I think having general custom opam registries support would be better for several reasons.

  1. Custom @opam scope is already 'hacky' as it is (imo).
  2. Some packages will depend on e.g a 'conf' package residing in the same custom registry (or with patches only for a particular version)
  3. There are other registries I'd be interested in using (like janestreet's ecosystem, they heavily rely on custom repositories. For speed, I presume).

Until we have a clear cross-toolchain concept, I'd prefer we stayed away from doubling down on a workaround that was created to accommodate opam restrictions.

In my previous attempt, I introduced a concept of Toolchain within esy that was supposed to react on hard-coded ocaml, ocaml-windows, ocaml-android, ocaml-ios dependencies, and accordingly add appropriate findlib configs for packages depending on them. E.g if I had a dependency on lwt-windows that needed ocaml-windows, I'd add findlib configs for ocaml and ocaml-windows and somehow let packages know which one to use. Except esy had no concept of a target which we now do have in sandbox configs.

jaredly commented 6 years ago

@rauanmayemir the repo I'd like to cross-compile is reason-language-server. I'd love to be able to compile binaries for linux & windows from my mac