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

rt.jar (class sbt.internal.inc.DummyVirtualFile) is not supported #1102

Open
eed3si9n opened this issue Jun 20, 2022 · 1 comment
Open

rt.jar (class sbt.internal.inc.DummyVirtualFile) is not supported #1102

eed3si9n opened this issue Jun 20, 2022 · 1 comment

Comments

@eed3si9n
Copy link
Member

steps

problem

[ERROR] ## Exception when compiling 669 sources to /basedir/spark-mine/core/target/scala-2.12/classes
java.lang.RuntimeException: rt.jar (class sbt.internal.inc.DummyVirtualFile) is not supported
scala.sys.package$.error(package.scala:27)
sbt.internal.inc.Locate$.definesClass(Locate.scala:92)
sbt.internal.inc.Locate.definesClass(Locate.scala)
sbt_inc.SbtIncrementalCompiler$1.definesClass(SbtIncrementalCompiler.java:119)
sbt.internal.inc.Locate$.$anonfun$entry$1(Locate.scala:60)
scala.collection.Iterator$$anon$9.next(Iterator.scala:575)
scala.collection.IterableOnceOps.collectFirst(IterableOnce.scala:1079)
scala.collection.IterableOnceOps.collectFirst$(IterableOnce.scala:1071)
scala.collection.AbstractIterator.collectFirst(Iterator.scala:1288)
sbt.internal.inc.Locate$.$anonfun$entry$2(Locate.scala:67)
sbt.internal.inc.LookupImpl.lookupOnClasspath(LookupImpl.scala:51)
sbt.internal.inc.IncrementalCommon$.$anonfun$isLibraryModified$3(IncrementalCommon.scala:764)
sbt.internal.inc.IncrementalCommon$.$anonfun$isLibraryModified$3$adapted(IncrementalCommon.scala:754)
scala.collection.IterableOnceOps.exists(IterableOnce.scala:591)
scala.collection.IterableOnceOps.exists$(IterableOnce.scala:588)
scala.collection.AbstractIterable.exists(Iterable.scala:919)
sbt.internal.inc.IncrementalCommon$.isLibraryChanged$1(IncrementalCommon.scala:754)

expectation

It works.

notes

sbt avoids this bug by working around like sbt/sbt#5522.

@Friendseeker
Copy link
Member

While it is easy to just let Locate.definesClass return false when encountering a DummyVirtualFile, I think the root issue is that the semantic of DummyVirtualFile is unclear. Like is DummyVirtualFile supposed to just represent rt.jar or ct.sym? (in this case might as well rename it as JavaRuntimeFile). Or it it supposed to represent any immutable jar file (so maybe Scala library should also be DummyVirtualFile)?

After all rt.jar defines some classes then why should Locate.definesClass always return false for rt.jar?

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

No branches or pull requests

2 participants