yawaramin / re-web

Experimental web framework for ReasonML & OCaml
https://yawaramin.github.io/re-web/re-web/index.html
MIT License
261 stars 8 forks source link

Conflict with compilerlibs Config.ml #14

Closed fakenickels closed 4 years ago

fakenickels commented 4 years ago

First of all thanks for the awesome lib!

I have this problem and I'm not sure if it has something to do with the configuration of https://github.com/yawaramin/fullstack-reason/. But when I try to use it with a dep that deps on compilerlibs I can't build the project because dune complains about:

$ esy b

info esy build 0.6.2 (using esy.json)
File "_none_", line 1:
Error: Files /Users/fakenickels/.esy/3_____________________________________________________________/i/ocaml-4.8.1000-426898cd/lib/ocaml/compiler-libs/ocamlcommon.cmxa
       and /Users/fakenickels/.esy/3_____________________________________________________________/i/opam__s__re_web-387ce658/lib/re-web/Z_internal_Config/Config.cmxa
       both define a module named Config
error: command failed: 'dune' 'build' '--only-packages' 'fullstack-reason' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1

esy: exiting due to errors above

The error can be reproduced with https://github.com/fakenickels/reweb-graphql-server/tree/feature/postgres

yawaramin commented 4 years ago

Hey thanks for the report. I am able to reproduce. Not sure what's going on to be honest! Will take a closer look tomorrow.

yawaramin commented 4 years ago

I was able to reproduce this with only opam and dune, ruling esy out as a factor. See https://github.com/ocaml/dune/issues/3102 . Let's see what the dune folks say!

yawaramin commented 4 years ago

OK now it looks like dune doesn't wrap 'library module' names. That's annoying but unlikely to change because it seems a change like that could break lots of things. Anyway I will switch to include_subdirs unqualified style and rename the modules like ReWeb__Config.ml, etc. to ensure no conflict. Should be no change from the perspective of consuming libraries. Will try to work on this later today.

[EDIT: actually decided to change just the library names which is a smaller change.]

fakenickels commented 4 years ago

Thanks a lot @yawaramin!