-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Kill reflect io #2313
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
Kill reflect io #2313
Conversation
Admittedly, I did not run this locally before pushing - jumping on a plane. Will amend. |
77ca8d4
to
7de9410
Compare
Did still work, just gotta have a look at the failing tests now. |
55d8db0
to
a055aad
Compare
@dotty-bot: could you recheck this PR, please? |
Sure thing, I got your back! ❤️ |
@odersky - I seem to have encountered an ordering problem. The test that fails - does not fail on different orderings. I.e. the legacy tests contain the same test This is the error: -- [E045] Syntax Error: /Users/fixel/Projects/dotty/compiler/../compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala:58:49
58 | override protected def createFileEntry(file: FileZipArchive#Entry): ClassFileEntryImpl = ClassFileEntryImpl(file)
| ^^^^^^^^^^^^^^
| cyclic reference involving class FileZipArchive And here's the stacktrace:
I'll try to minimize it as much as possible. |
It's enough with:
|
Which in turn can be simplified to: // Foo.scala
import dotty.tools.io.FileZipArchive
trait Foo {
def bar(entry: FileZipArchive#Entry): Any
} compiled with:
|
There's a further hint:
|
You should try to get the stacktrace for that cyclicreference exception. |
Would also be nice if you could minimize it to something that can reproduced on master, that means taking |
I'll try that, in the meanwhile - here's the stacktrace from the unpickling:
|
"Blocker": #2391 |
a055aad
to
9d89076
Compare
@smarter - would you mind reviewing? |
9d89076
to
a7bec36
Compare
@@ -0,0 +1,410 @@ | |||
/** Taken from the original implementation of WeakHashSet in scala-reflect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should include the hash of the version of scalac from which this file was taken.
@@ -101,7 +101,7 @@ class ExtractDependencies extends Phase { | |||
val classSegments = Path(ze.path).segments | |||
binaryDependency(zipFile, className(classSegments)) | |||
} | |||
case pf: scala.reflect.io.PlainFile => | |||
case pf: dotty.tools.io.PlainFile => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just be PlainFile
now, it's imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
@@ -0,0 +1,114 @@ | |||
/* __ *\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should include the hash of the version of theses files you're importing. If it works, try importing the latest version from scala 2.12.
@@ -274,12 +206,11 @@ final class ManifestResources(val url: URL) extends ZipArchive(null) { | |||
for (zipEntry <- iter) { | |||
val dir = getDir(dirs, zipEntry) | |||
if (!zipEntry.isDirectory) { | |||
class FileEntry() extends Entry(zipEntry.getName) { | |||
val f = new Entry(zipEntry.getName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is no longer necessary now that #2282 got merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project/Build.scala
Outdated
@@ -621,6 +621,7 @@ object Build { | |||
settings( | |||
publishArtifact := false, | |||
parallelExecution in Test := false, | |||
testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? Could you leave a comment?
a7bec36
to
1096a28
Compare
Previously, we would use `scala.reflect.io._` directly. The first part of abstracting away reflect is to kill this direct dependency.
b505c29
to
ea59cb3
Compare
I fixed the backend, inlined the sources. I still want to change one thing. I want to make the API private to Dotty - does that make sense?
I'd rather expose something else or only parts of it.