Commit 9cdadaa
committed
Exclude paths that start with ".." from recursive globbing
This mainly targets `importPaths ".."`, but to some degree applies to
all paths that may occur in a package description file.
One use case for requiring such a declaration is when the module root
is outside the Dub project root. For example, the library "foo"
containing a D module "foo.bar" may be in a directory called "foo" and
have "bar.d" at the directory root (same directory as "dub.sdl").
Currently, setting importPaths to ".." has the unpleasant side effect
of scanning the entire parent directory (which may host other,
unrelated projects). Dub does this for reasons such as caching; the
build process itself does not require a list of all files that may or
may not be imported, as the compiler discovers them not by globbing,
but by path construction and file existence checks, based on the names
of imported modules and the list of import paths specified with -I.
Ideally, Dub should NEVER recursively glob the importPaths list, and
instead communicate with the compiler to discover the full list of
files that were actually imported (e.g. from compilers' verbose
output). However, this change (which should not affect canonical use
cases) should facilitate this particular directory structure.1 parent 9d16313 commit 9cdadaa
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
497 | 505 | | |
498 | 506 | | |
499 | 507 | | |
| |||
0 commit comments