-
Notifications
You must be signed in to change notification settings - Fork 92
Add Coursier to Travis cache #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👍 - any |
for anyone visiting this PR because I just tweeted about it, note that it's intentional that we keep the |
I've added the |
I'm relatively certain that coursier doesn't actually lock anything. I don't think removing the lock files as here or in SoftwareMill's build hurts anything, but it also probably doesn't matter. |
cache: | ||
directories: | ||
- $HOME/.ivy2/cache | ||
- $HOME/.sbt | ||
- $HOME/.sdkman | ||
- $HOME/.coursier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- $HOME/.coursier | |
- $HOME/.cache/coursier |
https://get-coursier.io/docs/cache says:
- on Linux,
~/.cache/coursier/v1
. This also applies to Linux-based CI environments, and FreeBSD too....
The default location above was set up in coursier 1.0.0-RC12-1 (released on 2017/10/31). The default cache path of former versions was~/.coursier/cache/v1
, both on Linux and OS X.In order not to re-download all artifacts again, the first version of coursier run on a system, either former or newer, sets the location for newer versions.
In other words, the location of the Coursier cache changes depending on if you've ever ran older coursier or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depending on if you've ever ran older coursier or not.
How does Coursier determine that?
Travis doesn't cache ~/.coursier
or ~/.cache/coursier
until the user says so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess coursier will use .coursier
if it exists, and .cache/coursier
otherwise. In the case of travis, both don't exist we didn't cache so far, so it's using the .cache/coursier
. I checked that with my https://github.com/lrytz/travis-test repo.
@alexarchambault do we not need the lock-removal line? |
as per discussion at scala/scala-xml#357
I had the same skepticism about the lock file, but I came across a reference to a cache lock file named |
but |
I thought that too, but it seems to work. |
right you are
|
@@ -45,8 +45,10 @@ script: | |||
before_cache: | |||
- find $HOME/.sbt -name "*.lock" | xargs rm | |||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm | |||
- find $HOME/.coursier -name "*.lock" | xargs rm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably search in .cache/coursier
too?
The existence of this file has no impact in itself. Only another process holding a You can remove those, but it won't change anything down the line (it's not worth the noise IMO, which is why I don't add that line to any of my projects' |
This should speed up the pull requests again.