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

Incremental builds broken in 4.07 #7821

Closed
vicuna opened this issue Jul 12, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Jul 12, 2018

Original bug ID: 7821
Reporter: @diml
Assigned to: @diml
Status: resolved (set by @diml on 2018-07-16T13:36:08Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.07.0
Category: typing
Monitored by: @nojb @gasche @yakobowski

Bug description

The "steps to reproduce" shows a case that fails with 4.07 but used to work with previous versions of the Compiler. The first build succeeds but the second fails.

What I don't understand is that the error mentions base.cmi when compiling info.ml. However Base depends on every other modules and no module depends on it, so the compiler shouldn't even try to read base.cmi when compiling info.ml.

I was thinking this could be due to the heuristic I added to print X__Y as X.Y, however there is no error message in the build so there is no type to print.

Steps to reproduce

$ git clone https://github.com/janestreet/base.git
$ cd base
$ git checkout v0.11
$ make
$ sed -i '1i(* *)' src/string0.ml
$ make
jbuilder build @install
ocamlc src/.base.objs/base__Info.{cmo,cmt} (exit 2)
(cd build/default && /usr/local/home/jdimino/opam-root/4.07.0/bin/ocamlc.opt -w -40 -safe-string -g -bin-annot -I src/.base.objs -I /usr/local/home/jdimino/opam-root/4.07.0/lib/sexplib0 -I compiler-stdlib/src/.caml.objs -I shadow-stdlib/src/.shadow_stdlib.objs -no-alias-deps -open Base_ -o src/.base.objs/base__Info.cmo -c -impl src/info.ml)
File "src/info.ml", line 1:
Error: The files src/.base.objs/base__Info_intf.cmi
and src/.base.objs/base.cmi make inconsistent assumptions
over interface Base__String0
ocamlopt src/.base.objs/base__Info.{cmx,o} (exit 2)
(cd build/default && /usr/local/home/jdimino/opam-root/4.07.0/bin/ocamlopt.opt -w -40 -safe-string -g -I src/.base.objs -I /usr/local/home/jdimino/opam-root/4.07.0/lib/sexplib0 -I compiler-stdlib/src/.caml.objs -I shadow-stdlib/src/.shadow_stdlib.objs -no-alias-deps -open Base_ -o src/.base.objs/base__Info.cmx -c -impl src/info.ml)
File "src/info.ml", line 1:
Error: The files src/.base.objs/base__Info_intf.cmi
and src/.base.objs/base.cmi make inconsistent assumptions
over interface Base__String0
make: *** [default] Error 1

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

Comment author: @alainfrisch

Can this be reproduced with a sequential build? If so, could you produce a log of build commands?

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Comment author: @diml

Yes, I attached the log for the first and second builds. The second one is the one that's failing.

I'll try to get a smaller reproduction case. One other thought: IIRC, the naming heuristic is also applied for extensible constructors, and maybe the call for this is not protected against extra cmi loading.

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Comment author: @diml

That seems to be the case indeed: in translcore.ml, line 51

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Comment author: @diml

I'm preparing a PR

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Comment author: @diml

And I confirm that it fixes the issue

@vicuna

This comment has been minimized.

Copy link
Author

commented Jul 16, 2018

Comment author: @diml

#1908

@vicuna vicuna closed this Jul 16, 2018

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.