Skip to content

scala-cli cache override bug #3523

@ankita-ndd

Description

@ankita-ndd

Version(s)
scala-cli v1.6.2 release

Describe the bug
While invoking the scala-cli tool in our build, we use the following command and the flag --cache to avoid using the default cache location:

mkdir -p /tmp/coursier-cache
export COURSIER_CACHE="/tmp/coursier-cache"
mkdir -p /tmp/scalacache

"./$scala_cli_path" --power package --scala 3.3.1 --cache /tmp/scalacache $SCALA_OUT/ --output $output_jar --library \
 --dependency com.thesamet.scalapb:scalapb-runtime_2.13:0.11.17 --dependency com.google.protobuf:protobuf-java:4.29.3

But the build errors out with
Error: java.nio.file.FileSystemException: /home/dev/.cache/scalacli/local-repo/.lock-1.6.2: Read-only file system

Verified that the location of $scala_cli_path is indeed pointing to the scala cli.

Appreciate any help!

To Reproduce
The command used is:

"./$scala_cli_path" --power package --scala 3.3.1 --cache /tmp/coursier-cache $SCALA_OUT/ --output $output_jar --library \
 --dependency com.thesamet.scalapb:scalapb-runtime_2.13:0.11.17 --dependency com.google.protobuf:protobuf-java:4.29.3

Expected behaviour
We expected the --cache flag will override looking into the home dir which is not permitted in our build system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoursierIssues tied with coursier integration.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions