Skip to content

Remove DottyPredef #10706

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 2 commits into from
Dec 10, 2020
Merged

Remove DottyPredef #10706

merged 2 commits into from
Dec 10, 2020

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Dec 8, 2020

No description provided.

@nicolasstucki nicolasstucki linked an issue Dec 8, 2020 that may be closed by this pull request
@nicolasstucki nicolasstucki requested a review from smarter December 8, 2020 21:10
@nicolasstucki nicolasstucki marked this pull request as ready for review December 8, 2020 21:10
@nicolasstucki
Copy link
Contributor Author

We are currently getting an error while running tests/run-staging. It looks like the library is not found in the classpath. Not sure how removing DottyPredef could have triggered this issue. @odersky @smarter do you know why this could be happening?
We use getClass.getClassLoader to get the classloader that loaded the application. Could this be linked with loading DottyPredef?

Test 'tests/run-staging/i8178.scala' failed with output:                        
Exception in thread "main" java.lang.reflect.InvocationTargetException
  | => sat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at dotty.tools.vulpix.ChildJVMMain.runMain(ChildJVMMain.java:40)
        at dotty.tools.vulpix.ChildJVMMain.main(ChildJVMMain.java:47)
Caused by: dotty.tools.dotc.MissingCoreLibraryException: Could not find package scalaShadowing from compiler core libraries.
Make sure the compiler core libraries are on the classpath.
   
        at dotty.tools.dotc.core.Denotations$.select$1(Denotations.scala:1237)
        at dotty.tools.dotc.core.Denotations$.recurSimple$1(Denotations.scala:1265)
        at dotty.tools.dotc.core.Denotations$.recur$1(Denotations.scala:1267)
        at dotty.tools.dotc.core.Denotations$.staticRef(Denotations.scala:1269)
        at dotty.tools.dotc.core.Symbols$.requiredPackage(Symbols.scala:841)
        at dotty.tools.dotc.core.Definitions.ScalaShadowingPackage(Definitions.scala:257)
        at dotty.tools.dotc.core.Definitions.init(Definitions.scala:1729)
        at dotty.tools.dotc.core.Contexts$ContextBase.initialize(Contexts.scala:830)
        at dotty.tools.dotc.core.Contexts$Context.initialize(Contexts.scala:542)
        at dotty.tools.dotc.Run.rootContext(Run.scala:67)
        at dotty.tools.dotc.Run.<init>(Run.scala:85)
        at scala.quoted.staging.QuoteCompiler$ExprRun.<init>(QuoteCompiler.scala:103)
        at scala.quoted.staging.QuoteCompiler.newRun(QuoteCompiler.scala:46)
        at scala.quoted.staging.QuoteDriver.run(QuoteDriver.scala:39)
        at scala.quoted.staging.Toolbox$$anon$1.run(Toolbox.scala:38)
        at scala.quoted.staging.package$.run(staging.scala:19)
        at i8178$package$.Test(i8178.scala:12)
        at Test.main(i8178.scala:8)
        ... 6 more

@nicolasstucki nicolasstucki force-pushed the remove-DottyPredef branch 3 times, most recently from 91ab1e1 to 3ebf3b6 Compare December 10, 2020 08:22
@griggt
Copy link
Contributor

griggt commented Dec 10, 2020

Just a passing thought on the test failure, not sure if relevant here: while investigating an unrelated issue that came up today on gitter, I noticed that calling getClass from a toplevel def showed up in the bytecode as

invokevirtual #29   // Method dotty/DottyPredef$.getClass:()Ljava/lang/Class;

@nicolasstucki
Copy link
Contributor Author

@griggt could you open an issue and point to the gitter thread?

In top level definitions we used to get `DottyPredef.getClass` when we did `getClass`. Now we get `Predef.getClass` which get us a class that was loaded with the wrong classloader.
@nicolasstucki
Copy link
Contributor Author

Thank you @griggt, you just saved me a few hours of frustration.

@nicolasstucki
Copy link
Contributor Author

@smarter I moved DottyPredef to src-non-bootstrapped and adapted some tests

@anatoliykmetyuk anatoliykmetyuk added this to the 3.0.0-M3 milestone Dec 10, 2020
@smarter smarter merged commit 51ac3ae into scala:master Dec 10, 2020
@smarter smarter deleted the remove-DottyPredef branch December 10, 2020 15:37
@Kordyjan Kordyjan modified the milestones: 3.0.0-M3, 3.0.0 Aug 2, 2023
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.

Remove DottyPredef from the library
5 participants