Comment #0 by timothee.cour2 — 2015-07-20T03:06:42Z
I'd like to have an option to exclude current directory from search path in dmd.
I already made a local modification to dmd to allow that (dmd -exclude_cwd_from_imports)
Would that be acceptable?
(cf forum EMAIL:exclude current directory from search path in dmd ?)
Comment #1 by timothee.cour2 — 2015-07-20T03:30:29Z
Reduced use case:
see https://github.com/timotheecour/dsnippet/tree/master/bug_14811
make
..//main.d(3): Error: module foo.fun1 from file fun1.d conflicts with another module fun1 from file ..//foo/fun1.d
With my modification (adds a flag -exclude_cwd_from_imports):
make with_flag
#works
Comment #2 by timothee.cour2 — 2015-07-20T08:06:25Z
Comment #5 by timothee.cour2 — 2015-07-30T01:50:39Z
>> Why you cannot do that from the project root directory?
There's not always an obvious project root directory, eg when using submodules or several outside packages.
>> The feature explanation does not argue the necessity of the enhancement. Please show to us the situation where the feature is necessary.
* I'm not the only one wanting this: http://forum.dlang.org/post/[email protected]
* It exists in c++
http://stackoverflow.com/questions/12353429/prevent-gcc-from-searching-the-current-dir-i-option-on-include-search-path
* if the 'natural' working directory is foo/ (current directory, where user edits files etc), wrapping every dmd invocation with
'cd root && dmd some_command && cd -'
is inconvenient. Eg, the error messages will be wrt to root, not wrt user's current directory
Comment #6 by robert.schadek — 2024-12-13T18:43:50Z