Include original source dirs in dune describe#3834
Include original source dirs in dune describe#3834sigwinch28 wants to merge 2 commits intoocaml:mainfrom
Conversation
Whenever possible, drop the build context from source paths returned for ml and mli files when describing the current workspace. Additionally, introduce a new top-level variant "workspace" which provides the root of the current workspace as an absolute path, and information about libraries required in the current context.
|
It seems nice to have. But we should start to make Remarks:
For "how to find the real source file", I don't know but the |
|
@bobot, about backward compatibility: currently The intent is to keep the development as light as possible until a production software needs it. |
Just for info, at LexiFi we have a number of |
Yes, having both |
|
Is it possible to know if a file is generated or not when doing |
|
Another possibility instead of blindly dropping the build prefix from the filenames in |
Yes, I was having trouble with this. We want access to the original source files wherever possible because we want to apply changes to the original source files instead of the copied/generated sources in the build directory. I don't know enough about Dune's internal architecture to retrieve this information: isn't there some internal mapping or reverse map that we can use to determine which files came from where, even including rules?
In order to properly apply this heuristic we also need |
|
I don't think ROTOR is on the cards for dune anymore. |
|
@rgrinberg from what I heard recently, it's still in development. |
|
Ah well they're welcome to re-open with a fresh PR. |
For ROTOR we'd like to have access to the original source files in the output of
dune describe, not the locations of these artifacts in dune's build directory.In this PR we just drop the build dir from the paths, but this doesn't always work, e.g. when the .ml/.mli file has been created by a rule.
In addition, we add a new top-level
rootkey which tells us the absolute path to the current workspace root because we don't want to have to walk the filesystem to work it out, like dune already does.This is a work in progress and is definitely not ready for merging yet, especially since the recent reorganisation of dune's code (rules split?)