Skip to content

Keep classpath used to run the compiler separate from compilation classpath. #44

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

Closed
adriaanm opened this issue Mar 5, 2014 · 5 comments

Comments

@adriaanm
Copy link
Contributor

adriaanm commented Mar 5, 2014

A program should not be able to see the classes of the compiler that's compiling it unless the compiler's classes are explicitly added to the compilation (user) classpath. Currently, they all leak through by default (you have one chance to opt-out by not setting usejavacp): https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/config/PathResolver.scala#L227

This is not a problem in sbt (it manages the classpath itself), and you might consider it a feature in the REPL, but it's pretty complicated for build tools to navigate the maze of settings. Would be good to clean this up early on.

@gkossakowski
Copy link
Contributor

An example of a problem: https://issues.scala-lang.org/browse/SI-8358

@smarter
Copy link
Member

smarter commented Nov 18, 2015

@adriaanm : is this fixed/planned to be fixed in Scala 2.12 ?

@adriaanm
Copy link
Contributor Author

No, but we were just talking about tackling this in 2.13 earlier this week!

@SethTisue
Copy link
Member

the context being, this is important if we want to support alternate and/or slimmer “standard” libraries as in Martin's proposal at scala/slip#31

@smarter
Copy link
Member

smarter commented Jan 26, 2019

Starting with Java 9, we cannot inspect the Java bootclasspath anymore, so I think the problem basically solved itself :). (usejavacp still exists, but I think that's OK since it's not enabled by default)

@smarter smarter closed this as completed Jan 26, 2019
noti0na1 added a commit to noti0na1/dotty that referenced this issue Nov 21, 2019
Merge Nullability Analysis; Changes according to scala#7546
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this issue Mar 19, 2025
Backport "Fix scaladoc graph highlight background color in dark mode" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants