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

Wish: -dsource/-dparsetree for ocamldep #6730

Closed
vicuna opened this issue Dec 22, 2014 · 12 comments
Closed

Wish: -dsource/-dparsetree for ocamldep #6730

vicuna opened this issue Dec 22, 2014 · 12 comments

Comments

@vicuna
Copy link

vicuna commented Dec 22, 2014

Original bug ID: 6730
Reporter: @whitequark
Status: acknowledged (set by @damiendoligez on 2015-01-09T17:10:58Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.02.1
Target version: undecided
Category: tools (ocaml{lex,yacc,dep,debug,...})

Bug description

I currently have a mysterious failure of ocamldep when it does not output any dependencies with a certain set of -ppx. However the file itself compiles fine. I'll not be able to debug that without a -dparsetree or equivalent.

@vicuna
Copy link
Author

vicuna commented Dec 23, 2014

Comment author: @gasche

This looks like an ocamldep bug. I'm not opposed to adding -dsource for debuggability, but if you're going to have to change the ocamldep sources to fix the issue anyway, why not directly dive in and debug it by temporarily instrumenting it with an extra print-ast call?

@vicuna
Copy link
Author

vicuna commented Dec 23, 2014

Comment author: @whitequark

I've changed my code since then, and I did not have time to debug ocamldep at the moment. So I filed the bug to at least simplify debugging for whoever encounters this next.

@vicuna
Copy link
Author

vicuna commented Jan 9, 2015

Comment author: @damiendoligez

I don't think this is pressing enough that it should go into 4.02.2. Speak up if you disagree.

@vicuna
Copy link
Author

vicuna commented Feb 22, 2017

Comment author: @alainfrisch

GitHub PR welcome!

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 11, 2020
@whitequark
Copy link
Member

Still an issue.

@Octachron
Copy link
Member

Does ocamldep really need to have a duplicate -dsource/-dparsetree options? Using ocaml{c,opt} to get the post-processed AST should work fine, isn'it?

@whitequark
Copy link
Member

Yes. The problem is that some ppx extensions (ones that read generated files, like .cmi or .cmt) have to return different parsetrees depending on whether they run as a part of ocamldep or ocamlc, since the generated files may not have been generated yet. Admittedly an obscure use case.

@Octachron
Copy link
Member

If your ppx have two modes, couldn't you just run the ppx in an ocamldep-debug mode with ocamlc -dsource and debug from that point? This certainly more convoluted than a -dsource option in ocamldep, but the issue seems quite specific. How common is it for a ppx to run into this constraint and related issue?

@whitequark
Copy link
Member

Probably not common at all. @gasche thought this is an issue; if you'd like to close this as something upstream isn't interested in, I'm not strongly opposed.

@Octachron
Copy link
Member

I think it is best to close the issue for now as a too specialized issue for adding a generic flag to ocamldep. If the issue rears it head again, we will reopen it with more data points proving that the issue is not that uncommon.

@whitequark
Copy link
Member

I think ocamldep should, morally speaking, have had that flag in first place (like any other tool that processes OCaml source and runs ppx extensions!) but no objection to closing.

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

4 participants