You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue cross-compiling projects that import avro classifier artifacts and use default sbt-avro settings. Basically, the first compilation succeeds, but the second fails, because avroUnpackDependencies has cached the result for external-library-avro.jar... except that by default, these dependencies are unpacked into target dir target/scala-{VERSION}/src_managed.
Therefore, if we cross compile Seq(2.12, 2.13), the first compilation succeeds because the records are unpacked to target/scala-2.12/src_managed then compiled, but the second compilation fails because sbt-avro thinks that the unpacking is complete, but it looks for unpacked records in target/scala-2.13/src_managed, which is empty.
This is fixable by setting avroUnpackDependencies / target := target.value / "avro_external", but ideally it would work out of the box.
Maybe we can incorporate Scala binary version into the cache key if the value of avroUnpackDependencies / target contains -{scalaBinaryVersion.value}? Or just update the default value of avroUnpackDependencies outside of sourceManaged?
I'm encountering an issue cross-compiling projects that import
avro
classifier artifacts and use default sbt-avro settings. Basically, the first compilation succeeds, but the second fails, becauseavroUnpackDependencies
has cached the result forexternal-library-avro.jar
... except that by default, these dependencies are unpacked into target dirtarget/scala-{VERSION}/src_managed
.Therefore, if we cross compile
Seq(2.12, 2.13)
, the first compilation succeeds because the records are unpacked totarget/scala-2.12/src_managed
then compiled, but the second compilation fails because sbt-avro thinks that the unpacking is complete, but it looks for unpacked records intarget/scala-2.13/src_managed
, which is empty.This is fixable by setting
avroUnpackDependencies / target := target.value / "avro_external",
but ideally it would work out of the box.Maybe we can incorporate Scala binary version into the cache key if the value of
avroUnpackDependencies / target
contains-{scalaBinaryVersion.value}
? Or just update the default value ofavroUnpackDependencies
outside ofsourceManaged
?Repro here: https://github.com/clairemcginty/sbt-avro/tree/cross-compile-issue
The text was updated successfully, but these errors were encountered: