Community
Participate
Working Groups
In the core.model: IncludeEntry; IncludeFileEntry; IncludeReference; MacroFileEntry all have their paths canonicalised in their constructor. Apparently this is to handle case-sensitivity issues on Windows (bug 158190). On Linux we use symlinks and see that the canonicalised paths are different from the paths entered (and in fact some managedbuild tests fail as /usr/local/... which is under a symlink here). There's also the issue that File#getCanonicalPath performs I/O and is likely unnecessarily expensive on platforms other than Windows. Is there a good reason to canonicalize the path on Linux?
Created attachment 187510 [details] patch 1 Potential fix for the issue: only canonicalise paths on Windows.
Tests seem happy having disabled path canonicalization on !WINDOWS.
*** cdt cvs genie on behalf of jblackburn *** Bug 335298 - IncludePaths are canonicalised on creation. Only need to do this on Windows. [*] PathUtil.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/PathUtil.java?root=Tools_Project&r1=1.11&r2=1.12
I agree, this is only necessary for Windows. Thanks!
> public static IPath getCanonicalPath(IPath fullPath) { > if (!WINDOWS || !fullPath.isAbsolute()) > return fullPath; > ... > } Is PathUtil.getCanonicalPath() a right place to do that? You are changing the semantics of the function. Now it does not return canonical path on Linux although its name "getCanonicalPath" implies that. And this in a public API.
Fair enough, added a #getCanonicalPathWindows and update the call-sites appropriately.
*** cdt cvs genie on behalf of jblackburn *** Bug 335298 - IncludePaths are canonicalised on creation - Add #getCanonicalPathWindows which only canonicalizes the path on windows. [*] OpenIncludeAction.java 1.36 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java?root=Tools_Project&r1=1.35&r2=1.36 [*] IncludeFileEntry.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java?root=Tools_Project&r1=1.8&r2=1.9 [*] IncludeReference.java 1.24 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java?root=Tools_Project&r1=1.23&r2=1.24 [*] IncludeEntry.java 1.30 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java?root=Tools_Project&r1=1.29&r2=1.30 [*] MacroFileEntry.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroFileEntry.java?root=Tools_Project&r1=1.7&r2=1.8 [*] PathUtil.java 1.13 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/PathUtil.java?root=Tools_Project&r1=1.12&r2=1.13