Skip to content

Fix #8839: Only warn if TASTy is not in sync with classfile #9125

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 1 commit into from
Jun 8, 2020

Conversation

nicolasstucki
Copy link
Contributor

If they are not in sync, we warn and suggest to clean.
We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
This way we are resiliant to the failiure if the loaded class API did not change or
did not have an impact on the code we are compiling.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand when this can happen, if tasty changed the classfile should have been updated to, if it isn't there's a bug somewhere in the toolchain.

@smarter
Copy link
Member

smarter commented Jun 8, 2020

@odersky When you encountered #8839, were you running dotc from inside sbt or by itself? sbt should take care of restoring .class and .tasty files in case of failed compilation, if it doesn't there's a bug somewhere.

@nicolasstucki nicolasstucki marked this pull request as ready for review June 8, 2020 13:32
@odersky
Copy link
Contributor

odersky commented Jun 8, 2020

I think I was running standalone.

@nicolasstucki
Copy link
Contributor Author

I also hit it in stand alone. Also reproduced it this way.

@nicolasstucki nicolasstucki requested a review from smarter June 8, 2020 15:09
@nicolasstucki nicolasstucki assigned smarter and unassigned odersky Jun 8, 2020
If they are not in sync, we warn and suggest to clean.
We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
This way we are resiliant to the failiure if the loaded class API did not change or
did not have an impact on the code we are compiling.
@nicolasstucki nicolasstucki merged commit fa84627 into scala:master Jun 8, 2020
@nicolasstucki nicolasstucki deleted the fix-#8839 branch June 8, 2020 17:07
jjudd added a commit to jjudd/scala that referenced this pull request Sep 11, 2021
This matches the behavior in Scala, which was changed in this pull request:
scala/scala3#9125

It was changed as a result of this issue:
scala/scala3#8839

The commit message from the Scala 3 fix is as follows:
"Only warn if TASTy is not in sync with classfile

If they are not in sync, we warn and suggest to clean.
We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
This way we are resiliant to the failiure if the loaded class API did not change or
did not have an impact on the code we are compiling."
jjudd added a commit to jjudd/scala that referenced this pull request Sep 11, 2021
This matches the behavior in Scala, which was changed in this pull request:
scala/scala3#9125

It was changed as a result of this issue:
scala/scala3#8839

The commit message from the Scala 3 fix is as follows:
> Only warn if TASTy is not in sync with classfile
>
> If they are not in sync, we warn and suggest to clean.
> We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
> This way we are resiliant to the failiure if the loaded class API did not change or
> did not have an impact on the code we are compiling."
jjudd added a commit to jjudd/scala that referenced this pull request Sep 11, 2021
This updates Scala 2.13 to match the current behavior in Scala 3 when
TASTy is not in sync with classfile, which is to print a warning and
suggest cleaning instead of erroring. The same change for Scala 3 happened
in the following pull request:
scala/scala3#9125

The Scala 3 change was made as a result of the following issue:
scala/scala3#8839

The commit message from the Scala 3 fix is as follows:
> Only warn if TASTy is not in sync with classfile
>
> If they are not in sync, we warn and suggest to clean.
> We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
> This way we are resiliant to the failiure if the loaded class API did not change or
> did not have an impact on the code we are compiling."
lrytz pushed a commit to jjudd/scala that referenced this pull request Sep 14, 2021
This updates Scala 2.13 to match the current behavior in Scala 3 when
TASTy is not in sync with classfile, which is to print a warning and
suggest cleaning instead of erroring. The same change for Scala 3 happened
in the following pull request:
scala/scala3#9125

The Scala 3 change was made as a result of the following issue:
scala/scala3#8839

The commit message from the Scala 3 fix is as follows:
> Only warn if TASTy is not in sync with classfile
>
> If they are not in sync, we warn and suggest to clean.
> We assume that the TASTy is up to date (arbitrary choise) and load it regardless.
> This way we are resiliant to the failiure if the loaded class API did not change or
> did not have an impact on the code we are compiling."
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.

3 participants