Remove generation of goblint.ml with all opens#455
Conversation
|
It's great to simplify these things, but what would you do about the tracing? Do you think we could get rid of the if-statements if one had a properly lazy approach, like this, or do we still need the conditional crap? I think our current framework also does not create the docs, but it still invokes the printf pseudo-printer, even when the tracing subsystem is disabled. |
This is particularly confusing, even from purely build system point of view. I thought it would be good to use dune's promotion such that these generated files show up in the One idea I had would be to use dune profiles such that one has to create (but not commit) a
I wonder how that approach actually compares to ours, it's not so obvious. That one still always calls some external library function, not sure how much that gets optimized. Ours on the other hand has an explicit
That's probably true, but it might not have notable overhead since by ignoring everything it doesn't really do much other than iterating through the format string once. Generalizing to Another thought I've had at some point is maybe using a ppx rewriter to have a special extension point for our tracing, which would avoid having to write the |
This assumes particular layout of locally checked out CIL. Moreover, it assumes that is actually pinned.
|
I went all in now and completely replaced these generation things with dune rules, including the entirety of |
Accidentally left 2 from local experimentation on Linux.
michael-schwarz
left a comment
There was a problem hiding this comment.
LGTM! Nice to see things becoming more clean!
|
We should update the docs as well. I think they explicitly refer to these trace scripts. |
|
Also, I get build errors when trying this. Interesting that the CI has no problems. Would be nice to have something like [So in this case it would also have to remove an existing pin... maybe not so easy for a script to cover all such things.] |
The scripts are still there and still work though, right? Or did I misunderstand? |
|
Yes. They work, but it's not ideal to recommend stuff that immediately print out "hey, we're deprecated" :) |
Yeah, I decided to adapt them for now, so the previous workflow for switching to trace mode still works. Although you could just create the |
This nonsense has driven me mad forever, especially because no other OCaml project as far as I have seen needs to do this.
It has been especially annoying if you delete, rename or move modules and want to switch between branches, because the
(source_tree .)cannot possibly know about deletions, so it will not regenerate goblint.ml and compilation fails due to the missing module. The solution has been tomake cleanto force it to be regenerated, but that wastes so much time unnecessarily.Apparently this has been completely unnecessary under dune all along because the
-linkalloption already guarantees that all modules are linked. Theat_exitis still necessary to ensure that Goblint's entry point runs after all the toplevel code in all the linked modules.To be honest, I'm also tempted to get rid of
scripts/set_version.shand especially thetrace_on/offcounterparts. The version script also does some MacOS hackery at configure time, but finding the correctcppto use could easily be done at runtime, which would also be more portable.