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

pack and bin_annot #6178

Closed
vicuna opened this issue Sep 13, 2013 · 3 comments
Closed

pack and bin_annot #6178

vicuna opened this issue Sep 13, 2013 · 3 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 13, 2013

Original bug ID: 6178
Reporter: @trefis
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:36:49Z)
Resolution: fixed
Priority: low
Severity: minor
Target version: 4.02.2+dev / +rc1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues

Bug description

When 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");;
@vicuna
Copy link
Author

vicuna commented Sep 16, 2013

Comment author: @gasche

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 #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).

@vicuna
Copy link
Author

vicuna commented Sep 16, 2013

Comment author: @trefis

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 #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.)

@vicuna
Copy link
Author

vicuna commented Oct 14, 2014

Comment author: @gasche

Closed after I forgot about the issue and independently closed #6599 with the change Thomas suggested in the first place... Apologies, and rejoice!

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added this to the 4.02.2 milestone 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
Projects
None yet
Development

No branches or pull requests

2 participants