Skip to content

OpamParserTypes is now a module#37

Merged
dra27 merged 2 commits intoocaml:masterfrom
dra27:OpamParserTypes
Jan 7, 2021
Merged

OpamParserTypes is now a module#37
dra27 merged 2 commits intoocaml:masterfrom
dra27:OpamParserTypes

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Dec 17, 2020

2.1.1 added OpamParserTypes.FullPos. Unfortunately, this means that OpamParserTypes is no longer an mli-only module. The Makefile build system attests this:

ocamlopt -c  opamParser.ml
File "_none_", line 1:
Warning 58: no cmx file was found in path for module OpamParserTypes, and its interface was not compiled with -opaque

and indeed we get link errors like this:

File "test_parser.ml", line 1:
Error: No implementations provided for the following modules:
         OpamParserTypes referenced from opam-file-format.cmxa(OpamParser)

Dune avoids this problem because OpamParser is compiled with -no-alias-deps which removes the link dependency on an implementation for OpamParserTypes. #36 essentially replicates this in the Makefile, but this still doesn't fix the underlying problem:

module F = OpamParserTypes.FullPos

which with both #36 and with Dune leads to:

dra27@summer:~/opam-file-format/src$ ocamlopt opam-file-format.cmxa -o broken broken.ml
File "broken.ml", line 1:
Error: No implementations provided for the following modules:
         OpamParserTypes referenced from broken.cmx

unless broken.ml itself is compiled with -no-alias-deps. Note that these modules have no business being compiled with -no-alias-deps (they don't really in Dune either) and compiling everything with -opaque kills cross-module inlining.

So this PR converts OpamParserTypes.mli to OpamParserTypes.ml which should fix the problem in both build systems.

@dra27 dra27 added this to the 2.1.2 milestone Dec 17, 2020
@dra27 dra27 force-pushed the OpamParserTypes branch 2 times, most recently from 51a5715 to 1b77ccb Compare December 18, 2020 10:42
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Dec 18, 2020

The ocaml-ci failure is just ocurrent/opam-dune-lint#12

@dra27 dra27 merged commit a01ef6e into ocaml:master Jan 7, 2021
@dra27 dra27 deleted the OpamParserTypes branch January 7, 2021 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants