Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to sbt 1.0.0-M6 #323

Merged
merged 4 commits into from
Jul 3, 2017
Merged

Bump to sbt 1.0.0-M6 #323

merged 4 commits into from
Jul 3, 2017

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Jun 28, 2017

Ref #316, #327

@eed3si9n
Copy link
Member Author

[info] Non-compiled module 'compiler-bridge_2.10' for Scala 2.10.5. Compiling...
275s
2541
[info] Loading project definition from /tmp/sbt_cd9bdb55/deb10309809912fbf38cf891af2ac61342024632/project
278s
2542
[info] xsbt.ExtractUsedNamesPerformanceSpecification *** ABORTED ***
279s
2543
[info]   java.lang.NoClassDefFoundError: scala/Product$class
279s
2544
[info]   at xsbti.TestCallback$TestUsedName.<init>(TestCallback.scala:11)
279s
2545
[info]   at xsbti.TestCallback.usedName(TestCallback.scala:60)
279s
2546
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$5(ExtractUsedNames.scala:148)
279s
2547
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$5$adapted(ExtractUsedNames.scala:138)
279s
2548
[info]   at xsbt.JavaUtils$JavaForEach$.foreach$extension(JavaUtils.scala:16)
279s
2549
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$4(ExtractUsedNames.scala:138)
279s
2550
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$4$adapted(ExtractUsedNames.scala:136)
279s
2551
[info]   at xsbt.JavaUtils$JavaMapForEach$.foreach$extension(JavaUtils.scala:27)
279s
2552
[info]   at xsbt.ExtractUsedNames.extractAndReport(ExtractUsedNames.scala:136)
279s
2553
[info]   at xsbt.API$ApiPhase.processScalaUnit(API.scala:46)
279s
2554
[info]   ...
279s
2555
[info]   Cause: java.lang.ClassNotFoundException: scala.Product$class
279s
2556
[info]   at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
279s
2557
[info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
279s
2558
[info]   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
279s
2559
[info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
279s
2560
[info]   at xsbti.TestCallback$TestUsedName.<init>(TestCallback.scala:11)
279s
2561
[info]   at xsbti.TestCallback.usedName(TestCallback.scala:60)
279s
2562
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$5(ExtractUsedNames.scala:148)
279s
2563
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$5$adapted(ExtractUsedNames.scala:138)
279s
2564
[info]   at xsbt.JavaUtils$JavaForEach$.foreach$extension(JavaUtils.scala:16)
279s
2565
[info]   at xsbt.ExtractUsedNames.$anonfun$extractAndReport$4(ExtractUsedNames.scala:138)
279s
2566
[info]   ...

@eed3si9n eed3si9n force-pushed the wip/sbt1beta2 branch 2 times, most recently from 85070d5 to 152208f Compare June 30, 2017 07:27

/**
* Defines a util interface to get Scala compilers and the default implementation
* of the Scala incremental compiler if only {@link IncrementalCompiler} is required.
*/
public interface ZincCompilerUtil {
public class ZincCompilerUtil {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment to the Scaladoc that explains the reason why this is turned into a class instead of being an interface and linking to the issue?

@@ -126,4 +126,9 @@ object ZincUtil {
def compilers(javaTools: XJavaTools, scalac: ScalaCompiler): Compilers = {
new Compilers(scalac, javaTools)
}
}

def constantBridgeProvider(
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not passing formatting.

On both my local machine and on Drone box, `ZincComponentCompilerSpec` fails to compile 2.10 compiler bridge with the following error:

```
/T/sbt_1234/xsbti/compile/CompilerBridgeProvider.java:33: error: `;' expected but `{' found.
    static CompilerBridgeProvider constant(File file, ScalaInstance scalaInstance) {
                                                                                   ^
```

I suspected that this is due to Java `interface` defining a static method, a change introduced in only in Java 8.
After making this change, the spec passed the test.
@eed3si9n eed3si9n changed the title [wip] Bump to sbt 1.0.0-M6 Bump to sbt 1.0.0-M6 Jun 30, 2017
@sbt sbt deleted a comment from typesafe-tools Jun 30, 2017
@typesafe-tools
Copy link

dbuild has checked the following projects against Scala 2.12:

Project Reference Commit
sbt pull/3295/head sbt/sbt@0774a24
zinc pull/323/head eea9135
io 1.0 sbt/io@177ba25
librarymanagement pull/120/head sbt/librarymanagement@6953cb0
util 1.0 sbt/util@54cf4a4
website 1.0.x sbt/website@5c32a0a

✅ The result is: SUCCESS
(restart)

dwijnand
dwijnand previously approved these changes Jul 2, 2017
Copy link
Member

@jvican jvican left a comment

Choose a reason for hiding this comment

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

LGTM. Just some small comments to polish this, but looks great overall!

Lemme know when you've addressed feedback and I'll merge.

P.S. I wish we had a sbt release with the logs fixes. We'll be missing stack traces... Please, as soon as RC is out, upgrade the sbt version here. Future contributors in sprees will be affected by those old bugs.

build.sbt Outdated

def baseVersion = "1.0.0-X16-SNAPSHOT"
def internalPath = file("internal")

lazy val compilerBridgeScalaVersions = Seq(scala212, scala211, scala210)
lazy val compilerBridgeScalaVersions = List(scala212, scala211, scala210)

val scalafmtCheck = Command.command("scalafmtCheck") { state =>
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed.

@@ -271,12 +260,13 @@ lazy val zincCompileCore = (project in internalPath / "zinc-compile-core")
// format from which Java sources are generated by the sbt-contraband plugin.
lazy val compilerInterface = (project in internalPath / "compiler-interface")
.enablePlugins(ContrabandPlugin)
.disablePlugins(com.typesafe.sbt.SbtScalariform)
Copy link
Member

Choose a reason for hiding this comment

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

Context: sbt house rules has removed support for Scalariform.

.settings(
minimalSettings,
// javaOnlySettings,
name := "Compiler Interface",
crossScalaVersions := Seq(scala212),
// Use the smallest Scala version in the compilerBridgeScalaVersions
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to make this comment more descriptive and explain why this is the case so that future readers understand that the bridge has to be as much compatible as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

tbh I am not sure how much this had effect, but I did expand the comment.

Copy link
Member

Choose a reason for hiding this comment

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

I thought you did this so that the regression doesn't happen again. Forcing the latest Java version will always guarantee that our bridge compiles for all the Java versions supported, I presumed that was what you had in mind.

publishLocal := (),
publish := {},
publishLocal := {},
skip in publish := true,
Copy link
Member

Choose a reason for hiding this comment

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

If we already have skip in publish, why are publish and publishLocal definitions still required?

Copy link
Member Author

Choose a reason for hiding this comment

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

skip in publish AFAIK is only respected by sbt-pgp.

Copy link
Member

@jvican jvican Jul 3, 2017

Choose a reason for hiding this comment

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

Okay, I thought that you had already merged the skip in publish functionality in sbt 1.0.x.

@@ -396,11 +387,11 @@ lazy val publishBridgesAndSet = {
val userScalaVersion = args.mkString("")
s"${compilerInterface.id}/publishLocal" ::
compilerBridgeScalaVersions.flatMap { (bridgeVersion: String) =>
s"wow $bridgeVersion" ::
s"++ $bridgeVersion!" ::
Copy link
Member

Choose a reason for hiding this comment

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

The good thing about this is that we won't have OOM errors with ++ anymore in sbt 1.0.

@@ -1,27 +1,27 @@
import sbt._
import Keys._
// import sbt._
Copy link
Member

Choose a reason for hiding this comment

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

Can you open an issue to keep track of this? We will need to enable it after RC is out and sbt-header cross-compiles.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks.

@@ -1,6 +1,8 @@
import sbt._
import Keys._
import Def.Initialize
import sbt.internal.inc.ScalaInstance
Copy link
Member

Choose a reason for hiding this comment

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

Why are these required? Seem they are unnecessary. I wonder if this is a slip.

Copy link
Member Author

Choose a reason for hiding this comment

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

We should consider moving that out of internal.

Copy link
Member

Choose a reason for hiding this comment

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

But why are these necessary? Why are the imports the only changes in this file?

Copy link
Member

Choose a reason for hiding this comment

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

Because the name has moved, from the sbt package to sbt.internal.inc.

Copy link
Member

@jvican jvican left a comment

Choose a reason for hiding this comment

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

LGTM. All comments addressed.

@jvican jvican merged commit 9290758 into sbt:1.0 Jul 3, 2017
cunei pushed a commit to cunei/zinc that referenced this pull request Oct 25, 2017
Add support for atLeastOne method on a generator
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.

4 participants