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

Please make Dune aware of -inlining-report #1401

Open
ejgallego opened this issue Oct 4, 2018 · 10 comments
Open

Please make Dune aware of -inlining-report #1401

ejgallego opened this issue Oct 4, 2018 · 10 comments

Comments

@ejgallego
Copy link
Collaborator

ejgallego commented Oct 4, 2018

Dear Dune devs,

some OCaml flags such as -inlining-report will generate extra development files, however, as noted in coq/coq#8651 , Dune is not aware of the extra targets thus some problems may occur, in particular, deleting the reports on a rebuild.

Please make Dune aware of this option and similar ones.

@rgrinberg
Copy link
Member

I wonder if it's just simpler to turn off dune's automatic cleaning. There's quite a few of these options, and it doesn't seem all that practical to keep track of all of them.

@ejgallego
Copy link
Collaborator Author

That indeed would also work I think.

@ghost
Copy link

ghost commented Oct 5, 2018

we do need to clean stale cmi files to avoid problems. However, we could limit cleaning to things that used to be targets but no longer are

@ejgallego
Copy link
Collaborator Author

I guess that the solution with the less implementation overhead should do the trick. This is after all a very specific developer-only need, to inspect the debug info of the compiler.

@cpitclaudel
Copy link
Contributor

@ejgallego Although as you pointed in a recent discussion, this corresponds to the case of extraction from Coq modules, too: compiling a .v to .vo can create extracted OCaml files, and Dune will then delete them between runs.

I wonder if a general solution for this would be to add a stanza to register additional outputs of a rule, so that I could say "compiling x.v also produces x_extraction.ml" and "compiling xyz.ml also produces xyz.0.inlining.org, xyz.1.inlining.org, xyz.2.inlining.org, etc.".

@rgrinberg
Copy link
Member

rgrinberg commented Nov 1, 2019 via email

@cpitclaudel
Copy link
Contributor

The difficulty here is to have a way to select the rule for which the targets need to be adjusted. If possible, I think it would be simpler if normal coq libraries did no extraction and all the extraction was done through a separate stanza.

I doubt that's possible, since there's such a broad variety of extraction commands — especially given how stateful the whole thing is (you'd have to attach the extraction commands to a particular file, since each coq file can set stateful options that affect extraction)

@rgrinberg
Copy link
Member

rgrinberg commented Nov 1, 2019 via email

@cpitclaudel
Copy link
Contributor

I see. Although I think that commands that modify how extraction works shouldn’t pose a problem.

That could be true :) Being able to say something like "run this extraction command after processing this specific file" would work, but at that point it might be just as simple to embed the command inside of the Coq file (and it makes dune's job easier, since it doesn't have to learn about the various forms of extraction that Coq supports).

@ejgallego
Copy link
Collaborator Author

This could maybe be an use case for the instrumentation framework #3526 ?

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

3 participants