Skip to content

Preliminary fix needed for the full bootstrap #6194

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

Merged
merged 7 commits into from
Mar 31, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Mar 29, 2019

No description provided.

smarter added 6 commits March 29, 2019 13:43
The hardcoded scala-2.12 won't be valid once we bootstrap.
This lead to crashes in the full bootstrap and doesn't seem necessary in
any case.
When compiling and running the tests for the bridge, we should have the
bootstrapped library on the classpath since this is what people will
actually use in the end. This is tricky to do since the bridge itself
cannot be compiled with anything bootstrapped on the classpath since the
bootstrapped projects need the bridge to be compiled !

We sidestep this issue by using two separate projects for the bridge and
its tests.
1. If we don't give a parent to the URLClassLoader constructor, it will use
the system ClassLoader by default, which includes the jars in the JVM classpath.
2. `getResourceAsStream` will first look for the resource in a parent
ClassLoader.
3. The reference compiler is in the JVM classpath.

So if the reference compiler is Dotty-compiled, we might pick up .tasty
files from it instead of the current compiler. Using `null` as the
parent ClassLoader avoids this problem.
We don't need to do anything special to compile code with dotty anymore,
but we do need to have the bootstrapped library on the classpath.
This test runs the compiler using -usejavacp which doesn't really
work when a non-bootstrapped Dotty is on the classpath.
They require having the current compiler on the classpath, and the
non-bootstrapped compiler cannot be loaded if it was compiled with an
old Dotty.
@smarter smarter force-pushed the prepare-bootstrap branch from 1933890 to dc0c818 Compare March 29, 2019 16:36
@smarter smarter merged commit c059b64 into scala:master Mar 31, 2019
@allanrenucci allanrenucci deleted the prepare-bootstrap branch March 31, 2019 17:37
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

Successfully merging this pull request may close these issues.

2 participants