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

Dependency between generated dune-build-info file and clients #3277

Closed
jberdine opened this issue Mar 18, 2020 · 9 comments
Closed

Dependency between generated dune-build-info file and clients #3277

jberdine opened this issue Mar 18, 2020 · 9 comments

Comments

@jberdine
Copy link
Contributor

I'm trying to hunt down why I am getting a

File "_none_", line 1:
Warning 58: no cmx file was found in path for module Build_info__Build_info_data, and its interface was not compiled with -opaque

warning, which has led me to what looks like a missing dependency from a client of Build_info to the generated module.

Expected Behavior

For a module e.g. in cli.ml that uses Build_info, build_info_data.ml-gen is always compiled before cli.ml, so that build_info__Build_info_data.cmx is available when compiling cli.ml

Actual Behavior

I see build logs where sometimes e.g.

$ (cd _build/default && /Users/jjb/.opam/sledge/bin/ocamlopt.opt -I .cli.eobjs/byte -I .cli.eobjs/native -I /Users/jjb/.opam/sledge/lib/dune-build-info -intf-suffix .ml-gen -no-alias-deps -opaque -o .cli.eobjs/native/build_info__Build_info_data.cmx -c -impl .cli.eobjs/build_info_data.ml-gen)

appears after the compilation line for the user.

Reproduction

This seems to be sensitive to parallelism, and I have not managed to create an isolated test that reproduces the warning. Attached is a tarball of a small project that I think is representative of the larger case where this occurs, but the small project does not appear to trigger the warning. The _build/log file is included in the archive as build_log for reference.

The larger repro is running dune build _build/dbg/bin/sledge.exe from infer/sledge. I mention this in case browsing the dune files there is helpful, but actually setting up the deps for that build is tough (fork of llvm and whatnot).

Specifications

  • Version of dune (output of dune --version): 2.3.1
  • Version of ocaml (output of ocamlc --version): 4.08.1
  • Operating system (distribution and version): macos 10.14.6
@jberdine
Copy link
Contributor Author

@ghost
Copy link

ghost commented Mar 19, 2020

Hmm, so I was pretty sure that build_info_data.mli was compiled with -opaque to avoid this issue. I'm having a look.

@jberdine
Copy link
Contributor Author

If it helps, in my _build/log files, there is no mention of an mli for build_info_data.

facebook-github-bot pushed a commit to facebook/infer that referenced this issue Mar 23, 2020
Summary:
Previously building would spew:
```
Warning 58: no cmx file was found in path for module Build_info__Build_info_data, and its interface was not compiled with -opaque
```
This is from compilation of the generated `build_info_data.ml-gen`. It
does not have an interface, so I don't how to resolve this other than
disabling the warning.

See also ocaml/dune#3277 .

Reviewed By: jvillard

Differential Revision: D20589879

fbshipit-source-id: fcd86fb3b
@ghost
Copy link

ghost commented Mar 24, 2020

Indeed, it is because the mli is part of dune-build-info directly. I haven't been able to reproduce the issue so far.

@jberdine
Copy link
Contributor Author

jberdine commented May 9, 2020

In case it is useful, it seems that in watch mode, this leads to IO errors such as:

Error: I/O error: bin/.sledge_cli.eobjs/native/build_info__Build_info_data.cmx: No such file or directory

I don't know that this is the same underlying issue, just a guess.

@ghost
Copy link

ghost commented May 12, 2020

Ah, I just observed a similar error in watch mode recently. More precisely, if I modify a file while dune is building, I'm seeing such errors. If I modify a file while dune is not running, everything is fine.

There might a cleanup that we don't do when we interrupt a build because of file changes.

@jberdine
Copy link
Contributor Author

I'm not sure, but ocaml/ocaml#9790 (comment) notes a potential difference in flambda mode which might be related to this issue.

@ghost
Copy link

ghost commented Jul 27, 2020

Given what we discovered in #3599, this might be due to a bug in the compiler :/

@rgrinberg
Copy link
Member

There's not much more we can do, as we already compile the mli only module with -opaque.

@rgrinberg rgrinberg closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2022
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

No branches or pull requests

2 participants