Skip to content

Compiler bridge resolution ignores scalaOrganization #8731

@tanishiking

Description

@tanishiking

Context: We publish custom Scala3 compiler that supports Wasm Component Model under io.github.scala-wasm https://github.com/scala-wasm/scala3/tree/wasm

steps

resolvers += "Sonatype Central Snapshots" at "https://central.sonatype.com/repository/maven-snapshots/"
scalaOrganization := "io.github.scala-wasm"
scalaVersion := "3.8.3-RC1-bin-SNAPSHOT"

https://github.com/scala-wasm/component-example

problem

sbt should resolve org.scala-lang:scala3-sbt-bridge:3.8.3-RC1-bin-SNAPSHOT, but still tries to fetch the compiler bridge from org.scala-lang:scala3-sbt-bridge:3.8.3-RC1-bin-SNAPSHOT.

sbt> compile
...
[error] Missing org.scala-lang:scala3-sbt-bridge:3.8.3-RC1-bin-SNAPSHOT:compile
[error] (scalaCompilerBridgeBinaryJar) Missing org.scala-lang:scala3-sbt-bridge:3.8.3-RC1-bin-SNAPSHOT:compile

expectation

sbt should fetch compiler bridge from scalaOrganization (org.scala-lang:scala3-sbt-bridge:3.8.3-RC1-bin-SNAPSHOT) instead of org.scala-lang.

notes

ZincLmUtil.getDefaultBridgeModule hard-codes ScalaArtifacts.Organization (org.scala-lang) for scala2 and scala3. We might want to passing scalaOrganization value until here.

def getDefaultBridgeModule(scalaVersion: String): ModuleID = {
if (ScalaArtifacts.isScala3(scalaVersion)) {
ModuleID(ScalaArtifacts.Organization, "scala3-sbt-bridge", scalaVersion)
.withConfigurations(Some(Compile.name))
} else if (hasScala2SbtBridge(scalaVersion)) {
ModuleID(ScalaArtifacts.Organization, "scala2-sbt-bridge", scalaVersion)
.withConfigurations(Some(Compile.name))

object ScalaArtifacts {
final val Organization = "org.scala-lang"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions