Adapt the tool to projects compiled with dune - #9
Merged
Conversation
Signed-off-by: Yang Qian <yang.qian@citrix.com>
Contributor
|
Thanks! The project is used in a context where the Str library is not available. Would you be as kind as to replace the single use of it by a more manual string analysis? |
When processing the artifacts in a dune project, the *.cmi and *.cmt files are located in a separate folder named ".<name>.objs" or ".<name>.eobjs", so when searching for source files, we should consider searching them in the upper level folder in this case. Signed-off-by: Yang Qian <yang.qian@citrix.com>
Contributor
Author
|
@alainfrisch Sure, changes updated.
|
Contributor
|
Thanks! |
Contributor
Author
|
Thanks @alainfrisch . BTW, as the release on opam is quite out of date, do you have a plan to release a new version so that we can use this tool with compiler 4.04.x ? |
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After compiling project with dune, it will generates the
*.cmi/*.cmtfiles in a separate folder named.<name>.objsor.<name>.eobjs. Refer to: https://github.com/ocaml/dune/blob/master/src/utils.ml#L111 and https://github.com/ocaml/dune/blob/master/src/utils.ml#L116For example:
When compiling https://github.com/xapi-project/xen-api project (Of course I haved added the flag
-keep-locsand-bin-annot), thecmiandcmtfiles will be put into_build/default/ocaml/xapi/.xapi_internal.objs/while the correspondingmliandmlfiles are in_build/default/ocaml/xapi.So this patch aims to fix the search path when searching source files.
P.S. It also contains the fix of #8 as a separate small commit.