Skip to content

remote cache does not work with "compiler plugin" + "different coursier home(different OS or user.home)" #6027

@xuwei-k

Description

@xuwei-k

steps

xuwei-k/sbt-remote-cache-compiler-plugin@d4b466c

A.scala

package example

class A

build.sbt

name := "my-project"

scalaVersion := "2.13.3"

pushRemoteCacheTo := Some(
  MavenCache("local-cache", (ThisBuild / baseDirectory).value / "my_remote_cache")
)

remoteCacheId := "fixed-id"

remoteCacheIdCandidates := Seq(remoteCacheId.value)

pushRemoteCacheConfiguration := pushRemoteCacheConfiguration.value.withOverwrite(true)

addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full)

project/build.properties

sbt.version=1.4.1

run:

sbt pushRemoteCache
rm -rf target
sbt -Dsbt.coursier.home=my_coursier_home pullRemoteCache compile

problem

default coursier home dir

https://get-coursier.io/docs/cache.html#location

  • on Linux, ~/.cache/coursier/v1. This also applies to Linux-based CI environments, and FreeBSD too.
  • on OS X, ~/Library/Caches/Coursier/v1.
  • on Windows, %LOCALAPPDATA%\Coursier\Cache\v1, which, for user Alex, typically corresponds to C:\Users\Alex\AppData\Local\Coursier\Cache\v1.

https://github.com/xuwei-k/sbt-remote-cache-compiler-plugin/runs/1307158439#step:4:218

build log

remote cache does not works. recompile 😢

+ sbt -Dsbt.coursier.home=my_coursier_home pullRemoteCache compile
[info] welcome to sbt 1.4.1 (AdoptOpenJDK Java 1.8.0_272)
[info] loading project definition from /home/runner/work/sbt-remote-cache-compiler-plugin/sbt-remote-cache-compiler-plugin/project
[info] loading settings for project sbt-remote-cache-compiler-plugin from build.sbt ...
[info] set current project to my-project (in build file:/home/runner/work/sbt-remote-cache-compiler-plugin/sbt-remote-cache-compiler-plugin/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] remote cache artifact extracted for Some(cached-compile)
[info] remote cache artifact extracted for Some(cached-test)
[success] Total time: 1 s, completed Oct 26, 2020 5:56:57 AM
[info] compiling 1 Scala source to /home/runner/work/sbt-remote-cache-compiler-plugin/sbt-remote-cache-compiler-plugin/target/scala-2.13/classes ...
[info] done compiling
[success] Total time: 5 s, completed Oct 26, 2020 5:57:02 AM

Could not use retrieveManaged 😢 #5078

expectation

don't recompile

notes

plugins.map("-Xplugin:" + _.toAbsolutePath.toString).toSeq

sbt use absolute path for -Xplugin: args.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions