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

https://github.com/Bersier/physical requires sbt clean compile - fails to compile without the clean. #15724

Closed
dwalend opened this issue Jul 21, 2022 · 9 comments
Labels
area:match-types itype:bug itype:crash regression This worked in a previous version but doesn't anymore stat:needs minimization Needs a self contained minimization

Comments

@dwalend
Copy link

dwalend commented Jul 21, 2022

Compiler version

3.1.3

Minimized code

It's four files and a build.sbt - not very minimized, but several of us have been able to reproduce it. (If you can wait two weeks when I get a bit of free time I'd be happy to see if I can bracket the behavior. I think reporting this early is best.)

Start with https://github.com/Bersier/physical

Output (click arrow to expand)

sbt compile will finish in maybe 10 seconds, works great, everything compiles. Successive sbt clean compile calls work fine.

Make any change - maybe rename something - to Dimensions.scala .(Another person on Scala Users reported problems when adding just a blank line.)

sbt compile now takes so long that it seems like an infinite loop. It finishes after perhaps 10 minutes, failing to compile with a lot of excuses despite no interesting changes to the code.

I don't believe the problem is the opaque type in Dimensions because I replaced it with a value class and got the same effect.

@dwalend dwalend added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 21, 2022
@griggt
Copy link
Contributor

griggt commented Jul 21, 2022

The project seems to fail compilation with match type reduction errors on the 3.2.0-RCs and latest nightly, so that may need to be addressed first.

@szymon-rd szymon-rd added area:match-types regression This worked in a previous version but doesn't anymore and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 22, 2022
@szymon-rd
Copy link
Contributor

szymon-rd commented Jul 22, 2022

On 3.2.0-RC2, it fails with

[error] -- [E007] Type Mismatch Error: /.../src/main/scala/types/AdditionalUnits.scala:9:38
...

But compiles on 3.1.3. Therefore, I mark it as a regression. Please note that there are two issues:

  • A long compilation that is reported by @dwalend
  • Regression with failing compilation

@KacperFKorban KacperFKorban added the stat:needs minimization Needs a self contained minimization label Jul 22, 2022
@szymon-rd
Copy link
Contributor

szymon-rd commented Jul 22, 2022

@dwalend It would be very helpful if you could provide minimization in a free moment.

@Bersier
Copy link
Contributor

Bersier commented Aug 18, 2022

The code has grown since this has been reported. Here is a link to the code as it was back then. Frustratingly, I cannot even reproduce the issue at this time because of another bug:

sbt thinks that server is already booting because of this exception:
sbt.internal.ServerAlreadyBootingException: java.io.IOException: org.scalasbt.ipcsocket.NativeErrorException: [95] Operation not supported

@Bersier
Copy link
Contributor

Bersier commented Aug 27, 2022

I filed this ticket about the regression (assuming it is the only one).

@Kordyjan Kordyjan added this to the Future versions milestone Dec 12, 2022
@dwalend
Copy link
Author

dwalend commented Jun 5, 2023

I was able to (finally) commit some time, and can report some updates:

The part of the problem where the compiler runs for an absurdly long time seems gone in Scala 3.3.0.

The part of the problem where it needs an sbt clean test to compile remains. I was able to bracket things a little bit.

With 3 (or 2) dimensions - just Length, Time, and Temperature - things work fine consistently without the clean.

With 4 or more dimensions - Length, Time, Temperature, and Mass - the bug appears.

Procedure is sbt clean test , rename ceil to ceilNoClean in Dimensions.scala , sbt test . With 4 or more dimensions the second compile fails with

[error] -- [E007] Type Mismatch Error: /Users/dwalend/projects/physical/src/main/scala/dimensional/additionalunits/additionalUnits.scala:13:45 
[error] 13 |val electronVolt: Energy = 1.602176634e-19 * joule
[error]    |                                             ^^^^^
[error]    |                            Found:    (y$proxy5 :
[error]    |                              (dimensional.dimension.Dimensions.joule :
[error]    |                                dimensional.dimension.Dimensions.Energy)
[error]    |                             & $proxy10.Energy)
[error]    |                            Required: Double
...

as a first error.

If you'd like to use my fork for bracketing and testing, start with my fork's branches:

@Decel
Copy link
Contributor

Decel commented Jun 6, 2023

I was able to (finally) commit some time, and can report some updates:

The part of the problem where the compiler runs for an absurdly long time seems gone in Scala 3.3.0.

The part of the problem where it needs an sbt clean test to compile remains. I was able to bracket things a little bit.

With 3 (or 2) dimensions - just Length, Time, and Temperature - things work fine consistently without the clean.

With 4 or more dimensions - Length, Time, Temperature, and Mass - the bug appears.

Procedure is sbt clean test , rename ceil to ceilNoClean in Dimensions.scala , sbt test . With 4 or more dimensions the second compile fails with

[error] -- [E007] Type Mismatch Error: /Users/dwalend/projects/physical/src/main/scala/dimensional/additionalunits/additionalUnits.scala:13:45 
[error] 13 |val electronVolt: Energy = 1.602176634e-19 * joule
[error]    |                                             ^^^^^
[error]    |                            Found:    (y$proxy5 :
[error]    |                              (dimensional.dimension.Dimensions.joule :
[error]    |                                dimensional.dimension.Dimensions.Energy)
[error]    |                             & $proxy10.Energy)
[error]    |                            Required: Double
...

as a first error.

If you'd like to use my fork for bracketing and testing, start with my fork's branches:

On the latest version of the compiler:

sven@bot:~/physical$ sbt clean test
[info] welcome to sbt 1.7.1 (Ubuntu Java 11.0.19)
[info] loading global plugins from /home/sven/.sbt/1.0/plugins/project
[info] loading global plugins from /home/sven/.sbt/1.0/plugins
[info] loading project definition from /home/sven/physical/project
[info] loading settings for project root from build.sbt ...
[info] set current project to physical (in build file:/home/sven/physical/)
[success] Total time: 0 s, completed Jun 6, 2023, 4:49:09 PM
[info] compiling 14 Scala sources to /home/sven/physical/target/scala-3.3.2-RC1-bin-SNAPSHOT/classes ...
[success] Total time: 9 s, completed Jun 6, 2023, 4:49:18 PM
sven@bot:~/physical$ sbt test
[info] welcome to sbt 1.7.1 (Ubuntu Java 11.0.19)
[info] loading global plugins from /home/sven/.sbt/1.0/plugins/project
[info] loading global plugins from /home/sven/.sbt/1.0/plugins
[info] loading project definition from /home/sven/physical/project
[info] loading settings for project root from build.sbt ...
[info] set current project to physical (in build file:/home/sven/physical/)
[success] Total time: 1 s, completed Jun 6, 2023, 4:49:45 PM

And the regression was just fixed by #17180.

@dwijnand
Copy link
Member

dwijnand commented Jun 6, 2023

Fixed with #17180

@dwijnand dwijnand closed this as completed Jun 6, 2023
@dwalend
Copy link
Author

dwalend commented Jun 7, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:match-types itype:bug itype:crash 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

8 participants