-
Notifications
You must be signed in to change notification settings - Fork 140
Allow users to export and import coursier caches… #1061
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
cc @lbialy |
This would be very useful for us right now. |
One question that I have is - would it take into account only dependencies required by any given project? I mean - exporting cache items that are required on per-project basis would be massively more useful. I have, for instance, several different projects for which I use different, often weird dependencies and there's no need to export all of my deps to customers, just the ones that project in question requires. |
Hi @lbialy, |
After analyzing the pros and cons of importing and exporting the cache, I have concluded that the risks outweigh the benefits. While it is easy to implement, it raises security concerns. It would be necessary to add support for validating exported caches, such as checksum validation. Additionally, the main consideration is how this would be shared securely. If there is access to the internet, it would be safer to download from the maven repository. If not, scala-cli should allow users to disable downloading anything with the --offline option, and use a local repository where users can verify the downloaded jars. For this reason, I am closing this issue. However, if anyone still believes this mechanism is necessary, feel free to re-open the issue. |
…so that users with limited internet connections (like can happen in some corporate environments) can import pre-baked coursier caches, to run various Scala CLI commands.
We could add commands allowing to export (in a
.tar.gz
say) and import a whole coursier cache, either in the coursier CLI or in Scala CLI itself.Users wanting to distribute such a cache would be expected to generate it with commands like
To import the distribution, one would have to run things like
An important point to pay attention to when implementing this would be not to blindly copy the files of a distribution in the local coursier cache, but rather group together files that are logically tied (if
foo/a
is in cache, thenfoo/.a.*
is tied to it), and import each group as a whole (iffoo/a
is already there locally, comparefoo/.a.checked
to the one to be imported, and either don't importfoo/a
at all, or clear the localfoo/a
and linked files first).The text was updated successfully, but these errors were encountered: