Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Map.disjoint_union when compiling #7349

Closed
vicuna opened this issue Sep 9, 2016 · 8 comments
Closed

Fatal error: Map.disjoint_union when compiling #7349

vicuna opened this issue Sep 9, 2016 · 8 comments

Comments

@vicuna
Copy link

vicuna commented Sep 9, 2016

Original bug ID: 7349
Reporter: zozozo
Status: closed (set by @mshinwell on 2017-03-07T13:22:52Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.03.0
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: middle end (typedtree to clambda)
Duplicate of: #3922
Related to: #7645
Monitored by: @gasche @hcarty

Bug description

A fatal error appears when trying to build a binary in the msat project (https://github.com/Gbury/mSAT). The fatal error only appears with the flambda switch.

Steps to reproduce

Clone the repo and checkout the relevant commit

git clone https://github.com/Gbury/mSAT.git
git checkout 954892ac4aa9130e77915429e7f5e492c9697a4b

Switch to 4.03.0+Flambda and install dependencies

opam switch 4.03.0+flambda
opam install ocamlfind ocamlbuild dolmen

Try and build the project

make bin

Additional information

Even without the fatal error, the build produces some warnings, and does not finish, but the fatal error is not very informative about what the problem is and how to fix it.

@vicuna
Copy link
Author

vicuna commented Sep 9, 2016

Comment author: zozozo

I forgot to add the 'eval $(opam config env)' to the steps to reproduce.

@vicuna
Copy link
Author

vicuna commented Sep 11, 2016

Comment author: @mshinwell

I will look at this

@vicuna
Copy link
Author

vicuna commented Sep 12, 2016

Comment author: @mshinwell

The problem appears to be that there are references to the same module (e.g. Log) both through the Msat pack (written as "Msat.Log") and not through the pack (written as just "Log").

We are going to clarify what the compiler's behaviour should be in this situation.

In the meantime you should be able to fix your code by either:

  • including more modules in the pack that should perhaps be there anyway, for example Expr and Type (you will need to change the references e.g. in Expr to remove any "Msat." prefixes); or

  • for the modules outside the pack (e.g. Expr) ensure that all references to modules included in the pack (e.g. Log) are written with the pack-qualified name (e.g. Msat.Log) rather than just (e.g.) "Log".

@vicuna
Copy link
Author

vicuna commented Sep 12, 2016

Comment author: zozozo

Thanks a lot ! I thought something like this might be happening, and had already fixed that in the following commit.

Maybe that situation could deserve a proper compiler error, with the location of the two references that causes the problem ?

@vicuna
Copy link
Author

vicuna commented Dec 8, 2016

Comment author: @mshinwell

This probably does require a proper error.

@vicuna
Copy link
Author

vicuna commented Mar 7, 2017

Comment author: @mshinwell

The error is covered in #7086

@vicuna
Copy link
Author

vicuna commented Mar 7, 2017

Comment author: @mshinwell

As Alain points out, #7086 is actually slightly different.

@vicuna
Copy link
Author

vicuna commented Mar 7, 2017

Comment author: @mshinwell

This is a duplicate of #3922, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant