Skip to content

Fixes #2196, Specify the compiler bridge module in a setting#2197

Merged
eed3si9n merged 4 commits intosbt:0.13from
Duhemm:fix-2196
Sep 9, 2015
Merged

Fixes #2196, Specify the compiler bridge module in a setting#2197
eed3si9n merged 4 commits intosbt:0.13from
Duhemm:fix-2196

Conversation

@Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Sep 4, 2015

Fixes #2196

In order to restore reproducibility of builds, we no longer cascade over
the possibly available versions of the compiler bridge sources (a
specific version of the bridge sources may not be available one day, but
exist on the next day), but rather let the build definition configure
which module to use.

Also, download the compiler bridge sources and its dependencies in a temporary directory. We don't need to keep them around, because the next time we try to compile using this specific version of the compiler bridge, we will be able to immediately find the compiled version.

In order to restore reproducibility of builds, we no longer cascade over
the possibly available versions of the compiler bridge sources (a
specific version of the bridge sources may not be available one day, but
exist on the next day), but rather let the build definition configure
which module to use.

Fixes sbt#2196
Note that they won't be downloaded again, because the component compiler
will look for a previously-compiled version of the compiler bridge
before trying to fetch the sources again. If they've already been
downlaoded, then they have been compiled and a compiled version of the
compiler bridge already exists.
@eed3si9n eed3si9n added the ready label Sep 4, 2015
@typesafe-tools
Copy link

Can one of the admins verify this patch?

This will avoid all clashes between modules that may have the same name
as other components of sbt, or two different compiler bridges that would
happen to have the same name.
@dwijnand
Copy link
Member

dwijnand commented Sep 4, 2015

From as much as I understand what's going on, this LGTM.

@eed3si9n eed3si9n changed the title Specify the compiler bridge module in a setting Fixes #2196, Specify the compiler bridge module in a setting Sep 4, 2015
@eed3si9n
Copy link
Member

eed3si9n commented Sep 4, 2015

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should be a sequence, so I could have it be the "hierarchy" if I wanted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what the original design document said too, but I think Seq[ModuleID] means you still are reliant on the state of Internet, which defies the purpose of this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the idea is to replace the hierarchy by specifying directly in the build definition what version of the compiler bridge is required. After the compiler bridges have been split, it will become something like:

scalaCompilerBirdgeSource := scalaVersion.value match {
  case v if v startsWith "2.11" => "org.scala-sbt" % "compiler-interface" % sbtVersion.value
  case _  => "org.scala-sbt" % "compiler-interface-old" % sbtVersion.value
}

This way we keep the flexibility, but we don't rely on the hypothetical existence of some artefacts. The same build could yield totally different result depending on the availability of a specific compiler interface source at some point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is about forward compatibility here. If Scala 2.12 comes out and requires specific sources, then sbt 0.13.x will not work anymore until a new release comes out.

I understand the reasoning, I just wanted to err on the side of forward compatibility and letting the Scala team release their own bridge-sources if needed for milestone releases. You guys do not remember the pain-days of pre-scala-bridge-stability.

eed3si9n added a commit that referenced this pull request Sep 9, 2015
Fixes #2196, Specify the compiler bridge module in a setting
@eed3si9n eed3si9n merged commit 5401a77 into sbt:0.13 Sep 9, 2015
@eed3si9n eed3si9n removed the ready label Sep 9, 2015
@smarter smarter mentioned this pull request Dec 31, 2015
@Duhemm Duhemm deleted the fix-2196 branch January 27, 2016 08:11
@eed3si9n
Copy link
Member

Ref #681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants