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
sub-sub-module building fails for native code compilation #5084
Comments
Comment author: mww This is still the case with 3.12.0+rc1 |
Comment author: mww This is still the case with 3.12.0 (release) |
Comment author: @xclerc My understanding of this report is that it is not an ocamlbuild-specific problem. |
Comment author: mww It didn't occur to me that this could be the native compilers fault -- why would this feature get removed in 3.12.0? |
Comment author: abdallah This is still the case with 3.12.1 (release) |
Comment author: @protz GOOD: commit 71ba631c28d7398cb78a5fcfcb1c1b00b8472722
BAD: commit ee5f671c834da0eee1b28412313628556f9ddc10
These two revisions are approximately 7 commits apart. It's hard to bisect in that range because someone (I'm looking at you xclerc ;-)) forgot to add files for ocamlbuild parameterized tags, so I basically can't compile in that range. I'm going to try right before and right after the parameterized tags stuff, just to confirm. |
Comment author: @protz GOOD: commit d71b23f614d913a84ab75f6d83feb499a787b4d9
BAD:
with the files from commit 87cd319c69653b747ea3ae40c527c145049517d0
So the problem is in one of the two commits above. |
Comment author: @protz Mantis erased my comment by accident. How I hate you Mantis! This is definitely a bug in OCamlbuild that was introduced when we committed parameterized flags. Here's the output of ocamlbuild on 3.11 /usr/local/bin/ocamldep.opt -modules main.ml > main.ml.depends Here is the output on trunk: usr/local/bin/ocamldep.opt -modules main.ml > main.ml.depends
Please note that in the latter case, the -for-pack argument is missing, on the line that starts with "touch". Here's what happens (beware, this is just a theory). The code that is responsible for adding the -for-pack flag to the command line is in ocaml_specific.ml:454 let () = However, protzenk@sauternes:/tmp/exemple $ ocamlbuild -show-tags sub1/sub2.cmx That is to say, when ocamlbuild builds the sub2.cmx file, there should be a -for-pack flag, but since sub2.cmx does not have a "compile" tag, the -for-pack flag is not added. Xclerc, do you have any idea how we could add an extra line in ocaml_specific.ml that triggers the -for-pack flag when building a .cmx? Adding another rule that matches on "extension:cmx" instead of "compile" doesn't work (the -for-pack flag gets passed as an argument to -pp when building ocamlbuild itself...). In this case, the -for-pack tag is present, so I think the least we could do is honor the user's instructions and actually pass the -for-pack flag to the compiler. How do we write this in ocamlbuild? Thanks, jonathan |
Comment author: @protz r12437 and r12438, on 4.00 and trunk respectively. |
… phase and fix ocaml#5084 git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12437 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Original bug ID: 5084
Reporter: mww
Assigned to: @protz
Status: closed (set by @xavierleroy on 2015-12-11T18:04:33Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0+beta1 or 3.12.0+rc1
Fixed in version: 4.00.0+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: abdallah mehdi @ygrek
Bug description
when building a sub-sub-module with the for-pack option, compilation fails ("was not compiled with the for-pack subXX option)
This works on 3.11.2 -- for 3.12.0+beta1 only when building bytecode..
Additional information
this is Mac OS X 10.6.4/amd64;
the attached tarball has a sub-sub module and demonstrates the error:
ocamlbuild main.native
compiles and works with 3.11.2 but fails on 3.12.0+beta with:
File "sub1.cmx", line 1, characters 0-1:
Error: File sub1/sub2.cmx
was not compiled with the `-for-pack Sub1' option
Command exited with code 1.
Compilation unsuccessful after building 9 targets (0 cached) in 00:00:00.
File attachments
The text was updated successfully, but these errors were encountered: