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

The type checker raises Not_found for missing cmis when checking external declarations #7325

Closed
vicuna opened this issue Aug 12, 2016 · 7 comments

Comments

@vicuna
Copy link

vicuna commented Aug 12, 2016

Original bug ID: 7325
Reporter: @yallop
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2016-08-22T02:05:49Z)
Resolution: fixed
Priority: high
Severity: major
Version: 4.04.0 +dev / +beta1 / +beta2
Target version: 4.04.0 +dev / +beta1 / +beta2
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Related to: #6998

Bug description

Here's a small test case that is compiled without complaint by 4.03 but fails with the 4.04 beta:

$ cat a.ml
type _ t = T
$ cat b.ml
type 'a t = 'a A.t
$ cat c.ml
external f : unit -> unit B.t = "%identity"
$ ocamlc -c a.ml b.ml && rm a.cmi && ocamlc -c c.ml
Fatal error: exception Not_found

The bug, which causes the build of the ocaml-memcpy package to fail, was first reported by Gabriel here

https://github.com/yallop/ocaml-memcpy/issues/3

where there's also a stack trace.

@vicuna
Copy link
Author

vicuna commented Aug 20, 2016

Comment author: @damiendoligez

It also breaks these packages: lz4, pci, unix-fcntl, unix-sys-stat.

This bug seems to be related to #6998.

@vicuna
Copy link
Author

vicuna commented Aug 22, 2016

Comment author: @garrigue

Fixed in 4.04 by commit 5bc5218.

This was a bug in the code added for the unboxed attribute.
It didn't protect about absent cmis.

Note that the behavior in the absence of cmis is still problematic in general: if the cmi is absent, the compiler just assumes that all types inside it are abstract. However, interfaces compiled against that cmi may assume a different definition, and very little care is taken of avoiding discrepancies...

@vicuna vicuna closed this as completed Aug 22, 2016
@vicuna
Copy link
Author

vicuna commented Aug 22, 2016

Comment author: @gasche

The test typing-multifile seems to fail when run from the testsuite/ directory (and not testsuite/tests/typing-multifile), I suppose because of the test result parsing machinery not agreeing with the hand-made success report.

@vicuna
Copy link
Author

vicuna commented Aug 22, 2016

Comment author: @garrigue

It works on OSX (make all-typing in testsuite).
I have no other architecture to test at hand.
Do you have a better solution for this kind of multifile test?

@vicuna
Copy link
Author

vicuna commented Aug 22, 2016

Comment author: @gasche

I tried to fix it by using (echo -e) instead of (echo), it fixes the issue on my Linux machine, hopefully that still works on OSX.

@vicuna
Copy link
Author

vicuna commented Aug 22, 2016

Comment author: @garrigue

It broke on OSX.
Looking at Makefile.toplevel, the solution seems to be to use printf.
This works on OSX, and I suppose on other architectures too.
People have eventually stopped using echo, due to too many incompatibilities...

@vicuna
Copy link
Author

vicuna commented Sep 9, 2016

Comment author: @damiendoligez

Fixed in beta2

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

2 participants