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
ocamldep option to not include the current directory in the searched directories #6969
Comments
Comment author: @xavierleroy Reclassifying as a feature wish. Proof-of-concept implementation is welcome. |
May I take this as my first contribution, I am an outreachy applicant and have gone through the |
I think it is a good idea as a first contribution. The logic for ocamldep's argument is defined in |
At Line 116 in P.s. - I am done with setting up of Ocaml on my system and started looking at the codebase in detail. |
This was a reasonable guess, but I think that it is not the right candidate; what this line does it to compute a path of the form |
hi @gasche, can we add a check in this line which when finds the current directory to be the root directory then it will not add that path to the
|
Whenever we are calling the let add_to_load_path dir = try let dir = Misc.expand_directory Config.standard_library dir in let contents = readdir dir in add_to_list load_path (dir, contents) with Sys_error msg -> Format.fprintf Format.err_formatter "@[Bad -I option: %s@]@." msg; Error_occurred.set () |
Your proposal is to have |
Line 577: add_to_list first_include_dirs Filename.current_dir_name; This seems to be the line where we add List.iter add_to_load_path ( (!Compenv.last_include_dirs @ !Clflags.include_dirs @ !Compenv.first_include_dirs )); we add |
You are right, the current directory is added at this line. So the next step is to not add the current directory conditionally if a flag is set. Once this is done, you would need to add a new argument to the list of arguments (which is also in driver/makedepend.ml). |
Fixed by #9357 . |
Original bug ID: 6969
Reporter: @dbuenzli
Status: confirmed (set by @gasche on 2015-08-25T17:43:34Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.02.3
Category: tools (ocaml{lex,yacc,dep,debug,...})
Tags: junior_job
Monitored by: @gasche @diml
Bug description
By default ocamldep includes the cwd to the list of include directories. It would be nice to have an option to disable this. This can facilitate the operation of the tools in certain contexts.
See for example samoht/assemblage#83 (comment)
The text was updated successfully, but these errors were encountered: