Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349583 - Do not download p2 artifacts even if .meta/p2-artifacts.properties was deleted
Summary: Do not download p2 artifacts even if .meta/p2-artifacts.properties was deleted
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 11:31 EDT by Tobias Oberlies CLA
Modified: 2021-04-28 16:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Oberlies CLA 2011-06-16 11:31:08 EDT
If the file .meta/p2-artifacts.properties is deleted from the local Maven repository, Tycho thinks that the p2 artifacts cache is empty, and hence re-downloads all p2 artifacts when resolving the target platform. This is not really necessary, because the files are still present in the file system, and the p2-artifacts.properties contains nothing more than a list of cached p2 artifacts.

While scanning the local Maven repository is not an option, Tycho could still look in the file system just before downloading a p2 artifact, and skip the download (and add the missing entry in the p2-artifacts.properties) if the file is there.
Comment 1 Tobias Oberlies CLA 2011-06-16 11:38:47 EDT
I would like to have this fixed, because the tycho-its deletes the @.meta/p2-artifacts.properties@ file.
Comment 2 Tobias Oberlies CLA 2011-07-21 03:58:46 EDT
I just stumbled over a piece of code in [1] that seems to do exactly what I requested, however only if the download from remote failed.

@Igor: Do you remember why Tycho always tries to download p2 artifacts from remote, and does not check for locally available artifacts first?

[1] org.eclipse.tycho.p2.impl.resolver.ResolutionContextImpl.downloadArtifacts(Collection<IInstallableUnit>)
Comment 3 Igor Fedorenko CLA 2011-07-21 09:14:55 EDT
Current implementation is metadata driven, if artifact does not have corresponding metadata the implementation assumes the artifact is not there. ResolutionContextImpl.downloadArtifacts actually only tries to download artifacts that are not available neither from reactor nor from local maven repository (based on available metadata).

I think it is okay to try to find artifacts under localrepo/p2/ directory, however keep in mind that locally installed artifacts can be located elsewhere in local repository, so direct file lookup should only be performed for artifacts that do not have metadata. Also, I am not certain current download logic guarantees only artifacts are ever created under localrepo/p2/ directory, so we need to double check that.
Comment 4 Tobias Oberlies CLA 2011-07-22 05:30:35 EDT
I understand the concerns. We could also just fix the Tycho integration test which deletes the p2-artifacts.properties.
Comment 5 Mickael Istria CLA 2021-04-08 18:03:14 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.