Bug 505620 - Allow Tycho to use an alternate cache location
Summary: Allow Tycho to use an alternate cache location
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-10 05:17 EDT by Ionel GARDAIS CLA
Modified: 2021-04-28 16:51 EDT (History)
2 users (show)

See Also:


Attachments
[PATCH] alternate cache (1.31 KB, patch)
2016-10-10 05:17 EDT, Ionel GARDAIS CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ionel GARDAIS CLA 2016-10-10 05:17:33 EDT
Created attachment 264754 [details]
[PATCH] alternate cache

Tycho's default cache location is under Maven's repository .m2/repository/.cache/tycho.

In some workflows, multiple builds share the same maven repository but requires independent tycho cache because they build concurrently, after having the tycho cache cleaned.

The attached patch allows to override the default cache path by leveraging the Maven session's userProperties.
Thus, calling maven with -Dtycho.cache=/path/to/job/$JOB_ID would allow concurrent jobs to run, each with its cache.
Comment 1 Jan Sievers CLA 2016-10-10 07:29:53 EDT
if I understood you right,

-Dmaven.repo.local=<PATH>

should achieve the same result 

See http://stackoverflow.com/questions/9123004/maven-is-it-possible-to-override-location-of-local-repository-via-the-use-of-co

by default the local maven repo is not multi-process safe either so you would have to use separate local maven repos too

https://issues.apache.org/jira/browse/MNG-2802
Comment 2 Ionel GARDAIS CLA 2016-10-10 09:03:32 EDT
You are right.
Some extentions (see http://takari.io/book/30-team-maven.html#concurrent-safe-local-repository) are (somewhat) concurrent-safe.
This have been discussed in the tycho-dev ML : http://dev.eclipse.org/mhonarc/lists/tycho-dev/msg01397.html
The patch allows tycho to use job-specific cache even when accessing a shared-maven local repository.
Comment 3 Rafael Chaves CLA 2019-06-19 20:20:59 EDT
This would be quite useful. Any chance this path could be integrated into Tycho?

I may want to discard the Tycho cache at a different rate than what I would do for Maven. I may want to use different filesystems for the MAven repo and the Tycho cache. The local Maven repo and Tycho cache have different tolerance levels to concurrency, so users may want to keep one longer than the other.
Comment 4 Mickael Istria CLA 2021-04-08 18:11:07 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.