Skip to content

Build breakages involving scala-cc-library #19442

Open
@odersky

Description

@odersky

Compiler version

3.4.0

Minimized example

Change an item in stdlibPatches/Predef.scala.

In fact, it seems any change to a source in library/ will trigger the same problem.

Output

The build breaks with errors when trying to re-build scala-library-cc.

sbt:scala3> scala3-bootstrapped/testCompilation
[info] compiling 46 Scala sources to /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes ...
[info] compiling 45 Scala sources to /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-bootstrapped/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes ...
[error] -- [E008] Not Found Error: /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/scala/Enumeration.scala:100:23 
[error] 100 |    ((getClass.getName stripSuffix MODULE_SUFFIX_STRING split '.').last split
[error]     |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]     |value stripSuffix is not a member of ... (cannot display due to UnpicklingError Could not read definition type Stream in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/package.tasty. Caused by the following exception:
[error]     |dotty.tools.dotc.core.UnpicklingError: Could not read definition trait SeqOps in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/collection/SeqOps.tasty. Caused by the following exception:
[error]     |dotty.tools.dotc.core.UnpicklingError: Could not read definition trait SeqViewOps in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/collection/SeqViewOps.tasty. Caused by the following exception:
[error]     |dotty.tools.dotc.core.CyclicReference: Cyclic reference involving trait Seq
[error]     |
[error]     |Run with -Ydebug-unpickling to see full stack trace.) ....
[error]     |Extension methods were tried, but the search failed with:
[error]     |
[error]     |    Could not read definition method tuple3ToZippedOps in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/Predef.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition object Tuple3Zipped in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/runtime/Tuple3Zipped.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition class Tuple3Zipped in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/runtime/Tuple3Zipped.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition type Iterable in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/package.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition trait Iterable in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/collection/Iterable.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition trait Iterable in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/collection/immutable/Iterable.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.UnpicklingError: Could not read definition trait IterableOps in /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/classes/scala/collection/IterableOps.tasty. Caused by the following exception:
[error]     |    dotty.tools.dotc.core.CyclicReference: Cyclic reference involving trait Seq
[error]     |    
[error]     |    Run with -Ydebug-unpickling to see full stack trace.
[error] -- [E046] Cyclic Error: /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/scala/Enumeration.scala:119:43 
[error] 119 |      vset = (ValueSet.newBuilder ++= vmap.values).result()
[error]     |                                           ^
[error]     |                   Cyclic reference involving method tuple3ToZippedOps
[error]     |
[error]     | longer explanation available when compiling with `-explain`
[error] -- Error: /Users/odersky/workspace/dotty/out/bootstrap/scala2-library-cc/scala-3.4.0-RC1-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/scala/Enumeration.scala:148:35 
[error] 148 |  final def apply(x: Int): Value = vmap(x)
[error]     |                                   ^
[error]     |Recursion limit exceeded.
[error]     |Maybe there is an illegal cyclic reference?
[error]     |If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
[error]     |For the unprocessed stack trace, compile with -Yno-decode-stacktraces.
[error]     |A recurring operation is (inner to outer):
[error]     |
[error]     |  subtype CC[X0, X1] <:< CC[X0, X1]
[error]     |  subtype CC[X0, X1] <:< CC[X0, X1]
[error]     |  subtype CC[X0, X1] <:< CC[X0, X1]
[error]     |  subtype CC[X0, X1] <:< CC[X0, X1]

and lots of errors after that.

Expectation

If scala-cc-library needs to rebuild, the build script should force a clean build, since that's required to build it correctly.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions