| Summary: | [patch] [target] Resolution fails with "...is a folder but the repository is an archive or remote location" if recent workspaces have relative path | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Tobias Oberlies <t-oberlies> | ||||
| Component: | UI | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | curtis.windatt.public | ||||
| Version: | 3.7 | Keywords: | contributed | ||||
| Target Milestone: | 3.8 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Tobias Oberlies
For tracing this problem, place breakpoints in the following locations before step 6: a) entry of org.eclipse.pde.internal.core.target.P2TargetUtils.findWorkspaceRepos(Set) b) second line (after isFolderBased check) of org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(IArtifactDescriptor, OutputStream, IProgressMonitor) When hitting breakpoint a, make sure that @recent@ contains the relative path to the workspace location of step 1 so that @new File(bundlePool).exists()@ passes. This works out of the box in normal installations - if Eclipse is started as PDE run configuration, the @recent@ variable needs to be changed with the debugger. When hitting breakpoint b, step into getArtifactFile, getLocation and see how the mapper does something different with the invalid, opaque file URI as the rest of the broken p2 URI handling. You may claim that this is a p2 bug, but IMHO the whole URI handling in p2 is broken beyond repair. (feel free to open a bug report on p2, but I won't.) Therefore, I would say that this is a PDE bug: org.eclipse.pde.internal.core.target.P2TargetUtils.findWorkspaceRepos(Set) should only produce valid file URIs (as defined by java.io.File) in the first place and just not run into this p2 trap. Created attachment 207034 [details]
Fix: Add recent workspace bundle pools as absolute URIs
Applied the patch to HEAD. It is an edge case, but the provided code is a better way to create the URIs. Thanks. |