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

Regression in cyclic reference observed in separate compilation #17233

Closed
WojciechMazur opened this issue Apr 11, 2023 · 2 comments
Closed

Regression in cyclic reference observed in separate compilation #17233

WojciechMazur opened this issue Apr 11, 2023 · 2 comments
Labels
itype:bug regression This worked in a previous version but doesn't anymore stat:needs minimization Needs a self contained minimization

Comments

@WojciechMazur
Copy link
Contributor

Compiler version

3.3.1-RC1-bin-20230302-8020c77-NIGHTLY

Minimized code

Not yet minimized. The issue is present in the library vigoo/prox based on Open CB failures https://github.com/VirtusLab/community-build3/actions/runs/4650721329/jobs/8231832515

Reproduction steps:

  1. git clone https://github.com/vigoo/prox.git -b v0.7.9
  2. Compile seperatly prox-core and prox-java9 modules with enabled flag -Ykind-projector, can be achieved with scala-cli by adding dummy test in prox-java9 module in runner.scala file and running
#Clone project repository into prox directory
git clone https://github.com/vigoo/prox.git -b v0.7.9 prox

# Modify only source in `prox-java9` module to force multi stage compilation
src=prox-java9/src/main/scala/io/github/vigoo/prox/java9/runner.scala
out=prox-java9/src/main/scala/io/github/vigoo/prox/java9/runner.test.scala
echo '//> using dep "org.scalameta:munit_2.13:0.7.29"' > $out       
cat $src >> $out
echo -e '\nclass DummyTest extends munit.FunSuite{}' >> $out
rm $src

# Run scala-cli with test command, all sources other then tests would be compiled as a single compilation unit, remaining tests would be compiled in separate unit
scalaVersion=$1
scala-cli test --scala-opt -Ykind-projector prox/prox-core prox/prox-java9 -S "$1"

Bisect points to range of commits 006e2e4 ... 2507577: but I was not able to get to exact commit due to the problems because of runtime failures when publishing locally snapshot versions of compiler (Error: Unexpected error when compiling project_9db0e00eda_15c531f81b-aac090f2f8: 'ZipFile invalid LOC header (bad signature)')

Last good release: 3.3.1-RC1-bin-20230215-006e2e4-NIGHTLY
First bad release: 3.3.1-RC1-bin-20230216-2507577-NIGHTLY

Output

[error] /home/wmazur/projects/virtuslab/community-build3/repo/prox-java9/src/main/scala/io/github/vigoo/prox/java9/runner.test.scala:13:9
[error] Could not read definition of trait ProcessConfiguration in /home/wmazur/projects/virtuslab/community-build3/repo/prox-core/.scala-build/.bloop/project_74bcc5750f_0028cda483-aac090f2f8/bloop-internal-classes/main-VoP6UW1XQYOM0Omugn5hZA==/io/github/vigoo/prox/ProcessModule.class
[error] An exception was encountered:
[error]   dotty.tools.dotc.core.CyclicReference: Cyclic reference involving trait Process
[error] Run with -Ydebug-unpickling to see full stack trace.
[error]   class JVM9ProcessRunner()
[error]         ^
Error compiling project (test, Scala 3.3.1-RC1-bin-20230407-bcaa1ca-NIGHTLY, JVM)

Expectation

@WojciechMazur WojciechMazur added itype:bug stat:needs minimization Needs a self contained minimization regression This worked in a previous version but doesn't anymore stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 11, 2023
@WojciechMazur WojciechMazur added this to the Future versions milestone Apr 12, 2023
@anatoliykmetyuk anatoliykmetyuk removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Apr 17, 2023
@WojciechMazur
Copy link
Contributor Author

The project wise bisect points to 8d65f19
Bisect logs: https://github.com/VirtusLab/community-build3/actions/runs/5476940539/jobs/9975227647 (large logs >20MB, requires downloading archive to have full logs)

@szymon-rd szymon-rd assigned szymon-rd and unassigned szymon-rd Jul 7, 2023
@dwijnand dwijnand changed the title Regression in cyclic reference observed in multistage compilation Regression in cyclic reference observed in separate compilation Jul 10, 2023
@WojciechMazur
Copy link
Contributor Author

Seems to be fixed already in both LTS (3.3.3) and 3.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug regression This worked in a previous version but doesn't anymore stat:needs minimization Needs a self contained minimization
Projects
None yet
Development

No branches or pull requests

3 participants