-
Notifications
You must be signed in to change notification settings - Fork 202
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
Bloop fails to compile project with weird error #2053
Comments
Thanks for reporting! This looks like an issue with Zinc it or the way we are using it 🤔 |
Previously, when hashing would fail the whole compilation would also fail and while this seems incredibly rare let's try to guard ourselves here. Connected to scalacenter#2053
Previously, when hashing would fail the whole compilation would also fail and while this seems incredibly rare let's try to guard ourselves here. Connected to scalacenter#2053
Hey @tgodzik, after testing with the snapshot as you suggested on Twitter, I got the following error logs:
Hope it helps, If you need any more help just let me know. |
Och, that's curious. It shouldn't reach into the jar, just calculate the hash of the entire jar. |
Also, any idea where those |
Hey @tgodzik It doesn't look like those files are in the JDK runtime FS. val fs = java.nio.file.FileSystems.getFileSystem(java.net.URI.create("jrt:/"))
java.nio.file.Files.list(fs.getPath("modules", "java.base", "java/lang")).forEach(println(_))
modules/java.base/java/lang/AbstractMethodError.class
modules/java.base/java/lang/AbstractStringBuilder.class
modules/java.base/java/lang/Appendable.class
modules/java.base/java/lang/ApplicationShutdownHooks$1.class
modules/java.base/java/lang/ApplicationShutdownHooks.class
modules/java.base/java/lang/ArithmeticException.class
modules/java.base/java/lang/ArrayIndexOutOfBoundsException.class
modules/java.base/java/lang/ArrayStoreException.class
modules/java.base/java/lang/AssertionError.class
modules/java.base/java/lang/AssertionStatusDirectives.class
modules/java.base/java/lang/AutoCloseable.class
modules/java.base/java/lang/Boolean.class
modules/java.base/java/lang/BootstrapMethodError.class
modules/java.base/java/lang/Byte$ByteCache.class
modules/java.base/java/lang/Byte.class
modules/java.base/java/lang/CharSequence$1CharIterator.class
modules/java.base/java/lang/CharSequence$1CodePointIterator.class
modules/java.base/java/lang/CharSequence.class
modules/java.base/java/lang/Character$CharacterCache.class
....
java.nio.file.Files.lines(fs.getPath("modules", "java.base", "java/lang/CharSequence.sig")).forEach(println(_))
java.nio.file.NoSuchFileException: /modules/java.base/java/lang/CharSequence.sig
at java.base/jdk.internal.jrtfs.JrtFileSystem.checkNode(JrtFileSystem.java:486)
at java.base/jdk.internal.jrtfs.JrtFileSystem.getFileContent(JrtFileSystem.java:245)
at java.base/jdk.internal.jrtfs.JrtFileSystem.newInputStream(JrtFileSystem.java:334)
at java.base/jdk.internal.jrtfs.JrtPath.newInputStream(JrtPath.java:637)
at java.base/jdk.internal.jrtfs.JrtFileSystemProvider.newInputStream(JrtFileSystemProvider.java:325)
at java.base/java.nio.file.Files.newInputStream(Files.java:160)
at java.base/java.nio.file.Files.newBufferedReader(Files.java:2922)
at java.base/java.nio.file.Files.lines(Files.java:4141)
at java.base/java.nio.file.Files.lines(Files.java:4227)
... 59 elided |
the I will dig in a bit more. |
Are you using any JDK specific classes or options? How is the modules defined, would you be able to share that? Looks like the sig files should not pop up there and they are somehow 🤔 |
Should help with scalacenter#2053 The binary is described as: ``` A binary entry represents either the jar or the concrete class file from which the Scala compiler knows that <code>onBinaryClassName</code> comes from. ```
So this is the JDK im using locally:
And this, I think, are all the relevant build definition bits: val baseSettings =
Seq(
scalaVersion := Dependencies.Version.scala,
organization := "...",
logLevel := Level.Info,
scalacOptions ++= Seq("-release", "11"),
Compile / scalacOptions ++= Seq(
"-Wconf:any:warning-verbose",
"-Wunused:nowarn",
"-Ymacro-annotations",
"-Xsource:3"
),
PB.protocVersion := Version.protobufJava, // generate objects at same version as lib
Compile / scalacOptions ~= {
options: Seq[String] =>
options.filterNot(
Set(
"-Wunused:imports",
"-Wunused:params",
"-Wunused:privates",
"-Xlint:infer-any"
)
)
},
javacOptions ++= Seq("-source", "16", "-target", "16"),
// scalafmtOnCompile := true,
testFrameworks ++= Seq(
TestFramework("zio.test.sbt.ZTestFramework"),
TestFramework("hedgehog.sbt.Framework")
),
Global / cancelable := true,
Global / turbo := true, // 🤞
Global / fork := true, // https://github.com/sbt/sbt/issues/2274
Global / onChangedBuildSource := ReloadOnSourceChanges,
resolvers ++= Seq(
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"Confluent" at "https://packages.confluent.io/maven",
"Ovotech" at "https://kaluza.jfrog.io/artifactory/maven/"
// Resolver.bintrayRepo("ovotech", "maven")
),
// Don't make or publish scaladoc
Compile / doc / sources := Nil,
Compile / packageDoc / publishArtifact := false,
// parallel and forked tests
Test / fork := true,
Test / testForkedParallel := true,
Test / parallelExecution := true,
// [for the moment] Test / turbo := true,
Test / concurrentRestrictions := Seq(
Tags.limit(Tags.CPU, java.lang.Runtime.getRuntime.availableProcessors()),
Tags.limit(Tags.Test, java.lang.Runtime.getRuntime.availableProcessors())
),
// incremental compilation cache
pushRemoteCacheTo := Some(MavenCache("sbt-build-cache", file(".sbt-build-cache")))
)
val compilerPlugins =
List(
kindProjector,
betterMonadicFor
)
val commonSettings =
baseSettings ++
Seq(
Compile / compile / wartremoverErrors ++= warts,
libraryDependencies ++= compilerPlugins,
dependencyOverrides ++= List(
...
)
)
lazy val `merchant-model` = (project in file("modules/merchant-model"))
.settings(
commonSettings,
libraryDependencies ++=
List(
...
)
)
.dependsOn(
...
) |
Should help with scalacenter#2053 The binary is described as: ``` A binary entry represents either the jar or the concrete class file from which the Scala compiler knows that <code>onBinaryClassName</code> comes from. ```
I finally got back to the PR with a potential fix for your issue @ktonga <- it should be in the newest snapshot version |
Thank you so much, I'll give it a go. 🙏 |
Hey! I was able to update to 1.5.7 and I'm not seeing the error any more, so I think we could close this one as fixed. |
Previously, when hashing would fail the whole compilation would also fail and while this seems incredibly rare let's try to guard ourselves here. Connected to scalacenter#2053
Should help with scalacenter#2053 The binary is described as: ``` A binary entry represents either the jar or the concrete class file from which the Scala compiler knows that <code>onBinaryClassName</code> comes from. ```
It happens for only one of the modules (maybe some other after passing that one too) in a multi-module project, there are many modules before that one is attempted which finish compiling without issue. Also if I compile using sbt it doesn't happen.
I wasn't able to isolate the issue in a smaller self-contained project. I can help with any debugging if I'm guided, TBH I don't know where I could start from. To see that error I had to add the
--verbose
flag.The text was updated successfully, but these errors were encountered: