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
-Yrelease
supplements -release
, allows access to additional JVM packages
#10543
Conversation
ccfc0dc
to
57391b0
Compare
@som-snytt it seems likely we'll merge this. but by merge time we'll need a public-facing PR description explaining what this does and when it's needed. but I think it would actually be helpful if you provided that now, to help reviewers? |
Another thought: do you intend to port this to Scala 3? We're always a bit reluctant to add things to Scala 2 unless the path to supporting them in 3 as well is clear. That's partly because the 3 folks aren't happy if they feel we are putting pressure on them to support things they don't want to support, and also partly because users can be annoyed or disappointed if the two versions seem gratuitously misaligned to them. Do we know if the workaround suggested on the scala/bug ticket also works in Scala 3? Because if it does, that would ease the 2 vs 3 tension here a bit, since 3 users wouldn't be blocked. |
A project that is cross-built probably has the machinery to build against the jar of its choice, if |
Nice description — thank you. Let's ponder the naming, prior to merge. |
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 LGTM, it's a very nice idea!
src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala
Outdated
Show resolved
Hide resolved
src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala
Outdated
Show resolved
Hide resolved
57391b0
to
a37a063
Compare
a37a063
to
bee5534
Compare
src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala
Outdated
Show resolved
Hide resolved
Instead of I assUME that |
6ea44b7
to
47e1f65
Compare
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.
LGTM. @SethTisue wdyt about the flag name -Yopen-packages
?
Maybe it should be |
-Yopen-packages
, for opening JVM-internal packages under --release
I'm almost ready to hit "approve" here, only remaining concerns are naming and doc
@som-snytt what is the relationship between this new flag and P.S. needs rebase! |
Apparently, An interesting post-mortem would be rates of change to modules (classes and packages), as a measure of what was so complicated. |
Thank you for this. |
This is just for considering packages on the real class path during compilation. Clearly it needs a better name
oh just |
47e1f65
to
8f55db5
Compare
Instead, we get a companion option |
-Yopen-packages
, for opening JVM-internal packages under --release
-Yrelease
opens JVM packages hidden by --release
@mdedetrich ping, pekko/akka can make use of it in future |
Yup, it has to be released in Scala 2.12/2.13/3.3.x for us to use it though |
That could happen! I might need a reminder... |
Ive been told I'm good at that, to the detriment of societies sanity |
@som-snytt what is the relationship between this new flag and What does the current workaround look like? Could someone point me to the relevant section of the Akka build or the Pekko build? I think |
@SethTisue this hasn't to do with modules, but with the Practically, it's to support access to Note to self: does |
-Yrelease
opens JVM packages hidden by --release
-Yrelease
allows access to JVM packages hidden by --release
-Yrelease
allows access to JVM packages hidden by --release
-Yrelease
supplements --release
, allowing access to additional JVM packages
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.
to @lrytz for final review/merge
Still curious about this, if @mdedetrich or @He-Pin or somebody could answer. |
-Yrelease
supplements --release
, allowing access to additional JVM packages-Yrelease
supplements --release
, allows access to additional JVM packages
@SethTisue This code origin from Akka too, some kind of this. |
Thanks @He-Pin — though I see now we already had this same exchange over at scala/bug#12643 😆 |
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.
Thank you! This is a nice improvement.
-Yrelease
supplements --release
, allows access to additional JVM packages-Yrelease
supplements -release
, allows access to additional JVM packages
Legacy usage of
sun.misc.Unsafe
makes it difficult to leverage-release
in a build, since the internal class is not available as API. To enable this common use case,-Yrelease
is introduced to allow access to specified platform packages.For example,
-release:8 -Yrelease:sun.misc
.This "private" option is a convenience intended to support a project while migrating away from using
Unsafe
.Fixes scala/bug#12643