Skip to content

Allow users to export and import coursier caches… #1061

Closed
@alexarchambault

Description

@alexarchambault

…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

$ export COURSIER_CACHE="$(pwd)/cache"
$ scala-cli run … # run a few Scala CLI commands that you want to work fine with the distribution
$ scala-cli cache export -o cache.tar.gz 

To import the distribution, one would have to run things like

$ scala-cli cache import cache.tar.gz

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, then foo/.a.* is tied to it), and import each group as a whole (if foo/a is already there locally, compare foo/.a.checked to the one to be imported, and either don't import foo/a at all, or clear the local foo/a and linked files first).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestinstallationEverything related to installing the CLI itselfwontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions