Summary: | [PATCH] File paths to imported build files should not be canonicalized | ||
---|---|---|---|
Product: | Ant | Reporter: | Jesse Glick <jglick> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P3 | ||
Version: | 1.6.0 | ||
Target Milestone: | 1.6.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
Suggested patch (modified files)
ZIP of added files for the test case |
Description
Jesse Glick
2004-04-20 20:58:09 UTC
Created attachment 11294 [details]
Suggested patch (modified files)
Created attachment 11295 [details]
ZIP of added files for the test case
Hi Jesse, The reason I used canonicalpath here was because the imported file may import other files. One could set up something like this. /a/scripts/overall.xml /a/scripts/b/import.xml containing <import file="../overall.xml"/> and one could set a symbolic link to /a/scripts/b, say /usr/home/peter/b_scripts a build-file could then contain: <import file="/usr/home/peter/b_scripts/import.xml"/> which would work with the canonical path, but not with the AbsolutePath In such a case you could make the symlink to /a/scripts, not /a/scripts/b, and <import file="/usr/home/peter/a_scripts/b/import.xml"/> Clearly in this case /a/scripts is intended to be a whole (you cannot use the b subdir on its own), so linking to just a part of it sounds dubious to me. I realize that there are cases where having the canonical path would be handy, but is it worth the (possibly unsolvable) problems for those people who *don't* want the canonical path? Other Ant tasks (in particular, <property>) don't magically traverse symlinks or otherwise canonicalize file paths. Maybe better to have an explicit task to canonicalize a file path and store the result in a new property, if that's really what you want. Or perhaps an extra attribute 'canonicalize' on <import> (default should be false, IMHO). BTW import.html in the manual still states "Important: We have not finalized how relative file references will be resolved in deep/complex build hierarchies -such as what happens when an imported file imports another file. Use absolute references for enhanced build file stability, especially in the imported files." Ok applied the patch and updated the manual entry for the import task Cheers, Peter Re. <subant>: cf. bug #30438, fixed for 1.6.3. |