Fix resource folder handling for ancestor directories#2160
Conversation
df14175 to
70e8b8e
Compare
|
This pull request changes some projects for the first time in this development cycle. Warning 🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Test Results 339 files ±0 339 suites ±0 1h 4m 26s ⏱️ + 4m 47s For more details on these failures, see this check. Results for commit 3f3e690. ± Comparison against base commit 7ff8669. ♻️ This comment has been updated with latest results. |
6fda881 to
8b07819
Compare
|
@fbricon I actually undid the bump up bundle version. And by looking at the error log: Looks like it requires me to bump that version? |
|
try running "mvn clean verify -DskipTests -Dtycho.p2.baselineMode=failCommon" locally |
|
@fbricon Looks like over 13 modules need version bumps. Do you want me to do it in this PR? |
|
@chagong can you do it in a different PR? |
I have to say that I'm in strong doubt that this is really necessary. With the information I have, I cannot explain why this would be necessary. Furthermore I also just submitted a PR where this problem didn't surface. As #2160 (comment) suggests, you definitively need a version increment in |
|
@chagong please rebase this on the latest main. The baseline check should pass now since we had another PR applying the version bump for the touched Plug-in already. |
3fcf536 to
efd7fa4
Compare
|
@HannesWell pls let the workflows run. |
|
@chagong generally the build looks good now. |
|
@HannesWell resolve your comments, but not sure about the CI failure, seems should not be caused by this PR. |
|
@HannesWell can you take a look? |
74ddc2a to
f654158
Compare
|
@fbricon @HannesWell can you let the workflows run? |
|
@fbricon @HannesWell is it ok to merge? |
HannesWell
left a comment
There was a problem hiding this comment.
It looks better now, but I tried it with the Guava repository and noticed that returning null in getFolder() breaks the import too. See my comment below for details.
Furthermore, please squash all your commits into one with a suitable message for this change (not just an aggregation of all current ones), including the requested change and force push it to this PR's branch.
Then this should be ready.
f654158 to
61adf9e
Compare
61adf9e to
87db7ab
Compare
Handle resource directories whose canonical path is an ancestor of the project without passing invalid relative paths to Eclipse resource lookup. Skip ancestor resource directories in addResourceDirs before resolving them as workspace folders, and keep getFolder returning a non-null container for its other callers. Signed-off-by: Changyong Gong <chagon@microsoft.com>
87db7ab to
3f3e690
Compare
Problem
When a Maven resource directory resolves outside the project,
AbstractJavaProjectConfigurator.getFolder()can pass an invalid relative path to Eclipse resource lookup. For ancestor resource directories such as<directory>..</directory>, that can normalize to/and fail with:This affects projects whose child modules inherit or define resource directories outside the module directory, including cases seen with Apache Dubbo and Google Guava.
Fix
Normalize the project and resource paths before comparing them, and skip ancestor resource directories in
addResourceDirs()before callingproject.getFolder().getFolder()now keeps its non-null container contract for other callers and reports ancestor paths as invalid linked-resource targets.Fixes #1790