CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Preliminary & experimental support for... [ci: last-only] #7218
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
Conversation
do jpms lazily per unit, rather than forcing all units
Will only be available in the jdk11 preview nightly builds of the compiler, unlock with -Yjpms. ``` class C { sun.misc.Unsafe.getUnsafe } ``` ``` $ scalac -Yjpms --module-path . /Users/adriaan/Library/Preferences/IdeaIC2018.2/scratches/scratch_49.scala /Users/adriaan/Library/Preferences/IdeaIC2018.2/scratches/scratch_49.scala:2: error: class Unsafe in package misc cannot be accessed in package sun.misc sun.misc.Unsafe.getUnsafe ^ one error found ```
00d9681
to
fc3708b
Compare
Test Result (8 failures / +3) |
How come all of scala.reflect.internal.jpms is written in Java and not Scala ? |
I wanted to make it possible to host that code in an external build, built
with Java (9) only like Scala-asm, and then incorporate it into
Scala-compiler.jar
|
linesWithSeparators map (_.stripLineEnd) | ||
|
||
@deprecated("Use linesIterator. JDK 11 introduces its own lines method on String", "2.13.0-M5") |
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.
2.13.0-RC1
or 2.13.0
?
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.
Yes, should be RC1 now :-) I'll move these commits to their own PR.
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.
we normally just put "2.13.0" so we don't have to keep changing it
|
||
private val fileManager = impl.getFileManager | ||
private def locationAsPaths(location: StandardLocation): IndexedSeq[Path] = getLocationAsPaths(fileManager, location).asScala.toVector | ||
private val packageIndex = mutable.AnyRefMap[String, PackageEntryImpl]() |
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.
Unused.
} | ||
} | ||
} | ||
} |
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.
We need an else
branch for JARs on the module path, for which path
is the .jar
file.
I think the right approach is to index the package structure of the JARs eagerly, then use that index here.
WIP: https://github.com/retronym/scala/tree/review/jdk11
The indexing in that branch could be improved to be hierarchical.
To test:
$ cat sandbox/test.scala
class Test { println(org.apache.commons.io.IOUtils.EOF) }
$ ./build/quick/bin/scala -nobootcp -Yjpms -modulepath $(coursier fetch -q -p commons-io:commons-io:2.6) -addmodules:org.apache.commons.io -addreads:org.apache.commons.io=ALL-UNNAMED
We should make it possible for tools like Zinc to see inside Sketch:
|
Itsy-bitsy will rise again. |
... JPMS module access checks :-)
This will only be available in nightly builds (produced on jdk11), under -Yjpms. This also shows a path for future jdk11-specific features and how we might ship them before we bump our required Java version.
The PR is in rough shape, but it works for simple stuff. Putting this out there to facilitate discussion.
@retronym did most of the work, I just refactored until my paranoia of not affecting normal compiler operation was satisfied.
We wanted to have the basics in place before RC1, but we won't have time to refine or develop new functionality until later in the 2.13.x series.