yoriyuki / Camomile

A Unicode library for OCaml
Other
125 stars 26 forks source link

1.0.0 doesn't compile on macOS (OCaml 4.04.0) #68

Closed wokalski closed 6 years ago

wokalski commented 6 years ago

Output from opam install camomile:

#=== ERROR while installing camomile.1.0.0 ====================================#
# opam-version 1.2.2
# os           darwin
# command      jbuilder build -p camomile -j 4
# path         /Users/wczekalski/.opam/4.04.0_ios/build/camomile.1.0.0
# compiler     4.04.0
# exit-code    1
# env-file     /Users/wczekalski/.opam/4.04.0_ios/build/camomile.1.0.0/camomile-4894-d2c37b.env
# stdout-file  /Users/wczekalski/.opam/4.04.0_ios/build/camomile.1.0.0/camomile-4894-d2c37b.out
# stderr-file  /Users/wczekalski/.opam/4.04.0_ios/build/camomile.1.0.0/camomile-4894-d2c37b.err
### stderr ###
# usage:  ar -d [-TLsv] archive file ...
# [...]
#   ar -q [-cTLsv] archive file ...
#   ar -r [-cuTLsv] archive file ...
#   ar -r [-abciuTLsv] position archive file ...
#   ar -t [-TLsv] archive [file ...]
#   ar -x [-ouTLsv] archive [file ...]
# File "_none_", line 1:
# Error: Error while creating the library Camomile/camomile_yuge.a
#    ocamlyacc Camomile/internal/uReStrParser.{ml,mli}
# 4 shift/reduce conflicts.
yoriyuki commented 6 years ago

Thank you for the report. It is reproduced on my machine. I suspect it is caused by camomile_yuge, which is empty.

@rgrinberg I'm not sure the intention of this library. What is this?

rgrinberg commented 6 years ago

The intention is as follows: we'd like to use module aliases (for reasons I described elsewhere), but jbuilder only allows one top level alias module per library. This is a sensible restriction, but it complicates our lives with making Camomile backwards compatible. Since Camomile does indeed export multiple toplevel module names. The workaround is to move each toplevel module into its own library (remembering that only 1 toplevel module is allowed per lib with (wrapped true)), and then compose them again with a dummy lib like I did (camomile_yuge in this case).

The empty module I think I should have caught - sorry about that. The issue is the annoying behavior of ar not to accept empty archives. Later versions of OCaml do workaround this. The solution for us is to simply add an empty dummy module to camomile_yuge. I will make a PR shortly.

yoriyuki commented 6 years ago

New release 1.0.1 should fix this problem https://github.com/yoriyuki/Camomile/releases/tag/1.0.1. New opam package is submitted.

yoriyuki commented 6 years ago

an opam package is merged

https://github.com/ocaml/opam-repository/pull/11753