Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006178OCamlOCamlbuild (the tool)public2013-09-14 00:192013-09-16 15:47
Reportertrefis 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006178: pack and bin_annot
DescriptionWhen calling ocamlbuild with "-cflags -bin-annot", no cmt files are produced for module packs.
Looking at the sources (which I'm not familiar with) I'd guess that's because the "compile" tag is not set when building the pack, neither is "link", so "-lflags" won't be anymore useful.
There doesn't seem to be any command line option related to packs however, not that it would be that useful (one should probably decide whether packing should be considered as a compilation or linking step).

However while looking at the sources I also discovered that the "bin_annot" tag translate itself into "-bin-annot" only when "compile" is set as well, but not when "pack" is set.
That can be fixed by adding the following line to ocaml_specific.ml (you didn't need me to know that, but it makes me feel smarter to say it):

    flag ["ocaml"; "bin_annot"; "pack"] (A "-bin-annot");;

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0010356)
gasche (developer)
2013-09-16 11:52

I think semantically pack is more of a linking step, but I'm not sure adding "link" to packing commands is safe: it may be the case that some -lflags are not well-supported by pack.

Considering "pack" a third step and using a pack-specific rule as you do is one way to fix the issue. You should highlight that users encountering your problem could add your "flag" line to their myocamlbuild.ml to solve it locally. But that means that other flags could possibly need to handle pack as well (eg. -thread; can you reproduce PR#6127 at the pack level?).

So I'd vote for investigating what breaks if we add "link" to pack, and if that's bad use your fix (generalized to other flags as well).
(0010357)
trefis (reporter)
2013-09-16 15:47

> I think semantically pack is more of a linking step, but I'm not sure adding "link" to packing commands is safe: it may be the case that some -lflags are not well-supported by pack.

Yes, that worries me too.

> Considering "pack" a third step and using a pack-specific rule as you do is one way to fix the issue.

Oh but I'm not doing anything : the "pack" tag already exists.
I merely pointed out the fact that even when you have these tag and the tag "bin_annot", the "-bin-annot" option is not added to the command line.

> You should highlight that users encountering your problem could add your "flag" line to their myocamlbuild.ml to solve it locally.

I'm not sure many users browse mantis for documentation.
But the manual you just started rewriting could mention it.

> other flags could possibly need to handle pack as well (eg. -thread; can you reproduce PR#6127 at the pack level?).

I didn't try it, but it's highly likely.

> So I'd vote for investigating what breaks if we add "link" to pack, and if that's bad use your fix (generalized to other flags as well).

Well, it might come from my lack of knowledge of ocamlbuild internals, but I'd say there are quite distinct issues. (I should maybe have created to issues then, oh well.)

- Issue History
Date Modified Username Field Change
2013-09-14 00:19 trefis New Issue
2013-09-16 11:52 gasche Note Added: 0010356
2013-09-16 11:52 gasche Status new => confirmed
2013-09-16 15:47 trefis Note Added: 0010357


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker