Skip to content
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

test_windows_full in the CI is broken: pickling difference in stdlibPatches #11654

Closed
smarter opened this issue Mar 8, 2021 · 5 comments · Fixed by #11666 or #11803
Closed

test_windows_full in the CI is broken: pickling difference in stdlibPatches #11654

smarter opened this issue Mar 8, 2021 · 5 comments · Fixed by #11666 or #11803
Assignees
Milestone

Comments

@smarter
Copy link
Member

smarter commented Mar 8, 2021

It appears to have started with 96ced02, the CI run is https://github.com/lampepfl/dotty/runs/2057136722:

 class dotty.tools.dotc.reporting.Diagnostic$Error at ?: pickling difference for module class language$ in library\src\scala\runtime\stdLibPatches\language.scala, for details:
Fatal compiler crash when compiling: library\src\scala\runtime\stdLibPatches:

  diff before-pickling.txt after-pickling.txt while compiling library\src\scala\runtime\stdLibPatches\language.scala, library\src\scala\runtime\stdLibPatches\Predef.scala
pickling difference for module class language$ in library\src\scala\runtime\stdLibPatches\language.scala, for details:

  diff before-pickling.txt after-pickling.txt
dotty.tools.dotc.report$.error(report.scala:71)
dotty.tools.dotc.transform.Pickler.testSame(Pickler.scala:145)
dotty.tools.dotc.transform.Pickler.testUnpickler$$anonfun$2(Pickler.scala:135)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
scala.collection.AbstractIterable.foreach(Iterable.scala:919)
scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:889)
dotty.tools.dotc.transform.Pickler.testUnpickler(Pickler.scala:136)
dotty.tools.dotc.transform.Pickler.runOn(Pickler.scala:119)
dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
dotty.tools.dotc.Run.runPhases$5(Run.scala:215)
dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:223)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
dotty.tools.dotc.Run.compileUnits(Run.scala:230)
dotty.tools.dotc.Run.compileSources(Run.scala:166)
dotty.tools.dotc.Run.compile(Run.scala:150)
dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
dotty.tools.dotc.Driver.process(Driver.scala:198)
dotty.tools.dotc.Driver.process(Driver.scala:166)
dotty.tools.vulpix.ParallelTesting$Test.compile(ParallelTesting.scala:490)
dotty.tools.vulpix.ParallelTesting$CompilationLogic.compileTestSource$$anonfun$2$$anonfun$1(ParallelTesting.scala:219)
scala.collection.immutable.List.map(List.scala:246)
dotty.tools.vulpix.ParallelTesting$CompilationLogic.compileTestSource$$anonfun$1(ParallelTesting.scala:219)
scala.util.Try$.apply(Try.scala:210)
dotty.tools.vulpix.ParallelTesting$CompilationLogic.dotty$tools$vulpix$ParallelTesting$CompilationLogic$$compileTestSource(ParallelTesting.scala:220)
dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource$$anonfun$1(ParallelTesting.scala:265)
dotty.tools.vulpix.ParallelTesting$Test.tryCompile(ParallelTesting.scala:433)
dotty.tools.vulpix.ParallelTesting$$anon$2.checkTestSource(ParallelTesting.scala:268)
dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run(ParallelTesting.scala:336)
dotty.tools.vulpix.ParallelTesting$Test$LoggedRunnable.run$(ParallelTesting.scala:318)
dotty.tools.vulpix.ParallelTesting$$anon$2.run(ParallelTesting.scala:263)
java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Error:  Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.picklingWithCompiler failed: java.lang.AssertionError: Expected no errors when compiling, failed for the following reason(s):
Error:  
Error:    - encountered 1 test failures(s), took 25.844 sec
Error:      at dotty.tools.vulpix.ParallelTesting$CompilationTest.checkCompile(ParallelTesting.scala:897)
Error:      at dotty.tools.dotc.BootstrappedOnlyCompilationTests.picklingWithCompiler(BootstrappedOnlyCompilationTests.scala:177)
Error:      ...
[info] Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.negWithCompiler started
[info] Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.posMacros started
Foo[T]
[info] Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.runWithCompiler started
foo
[info] Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.runBootstrappedOnly started

================================================================================
Test Report
================================================================================

10 suites passed, 1 failed, 11 total
    library\src\scala\runtime\stdLibPatches failed
@liufengyun
Copy link
Contributor

We have the following difference:

Screen Shot 2021-03-09 at 9 29 37 AM

liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 9, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 9, 2021
@smarter
Copy link
Member Author

smarter commented Mar 9, 2021

When we compile scala.runtime.stdLibPatches.language, we apply stdlibPatches on that file itself, which changes the owner of its members to scala.language, this doesn't really make sense and apparently doesn't survive unpickling (but why only on Windows?

I think we need to:

  • Change the logic in stdlibPatches: instead of modifying the denotation of existing symbols, create new symbols to insert in scala.language and leave the original definitions alone
  • Make sure all these definitions are @compileTimeOnly so that we never try to lookup non-existing classfiles for them.

@liufengyun
Copy link
Contributor

but why only on Windows?

That's the most mysterious thing. I conjectured it's related to SymDenocation.fullNameCache, and caching behavior is different on Windows.

However, when I disable the fullNameCache, we still have the same pickling test failure. So the conjecture is incorect.

smarter added a commit that referenced this issue Mar 15, 2021
Fix #11654: disable pickling test for language.scala
@smarter
Copy link
Member Author

smarter commented Mar 15, 2021

Reopened since the underlying issue isn't fixed.

@smarter smarter reopened this Mar 15, 2021
michelou pushed a commit to michelou/scala3 that referenced this issue Mar 15, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 18, 2021
liufengyun added a commit to dotty-staging/dotty that referenced this issue Mar 19, 2021
odersky added a commit that referenced this issue Mar 22, 2021
Fix #11654: create new symbol for stdlib patches
michelou pushed a commit to michelou/scala3 that referenced this issue Mar 22, 2021
michelou pushed a commit to michelou/scala3 that referenced this issue Mar 22, 2021
@Kordyjan Kordyjan modified the milestones: 3.0.0-RC2, 3.0.0 Aug 2, 2023
@ivan-klass
Copy link

ivan-klass commented Mar 17, 2025

It seems like I see something similar here in #22824 - https://github.com/scala/scala3/actions/runs/13907893536/job/38915103820?pr=22824

UPD: my issue isn't related to Windows at all, reproducible on MacOS also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment