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

Fix #11939: Set up MiMa for scala3-interfaces in scala3-library. #12371

Merged
merged 1 commit into from
May 15, 2021

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented May 7, 2021

This already detects a couple things that break the backward source compatibility guarantee. They are excluded in project/MiMaFilters.scala. They should be reverted before we publish 3.0.1, or we should jump straight to 3.1.0.

@sjrd sjrd requested a review from smarter May 7, 2021 14:22
Comment on lines 7 to 11
// !!! These things are already violating the source compatibility guarantees of 3.0.1
// They need to be reverted, or we need to set the next version to 3.1.0
exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[MissingClassProblem]("scala.annotation.internal.ErasedParam"),
exclude[MissingClassProblem]("scala.annotation.internal.Stable"),
Copy link
Member

Choose a reason for hiding this comment

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

@nicolasstucki WDYT? Should we revert or mark these things as @experimental?

Copy link
Contributor

Choose a reason for hiding this comment

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

isErased should be reverted and added in 3.1. This includes scala.annotation.internal.ErasedParam. I guess adding @experimental would make sense here as some users might be using it already from nightly.

No idea about scala.annotation.internal.Stable. @odersky can we revert this or add @experimental

Copy link
Contributor

Choose a reason for hiding this comment

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

Added the @exerimentalon ErasedParam and isErased in #12102

Copy link
Member

Choose a reason for hiding this comment

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

No idea about scala.annotation.internal.Stable. @odersky can we revert this or add @experimental

It was introduced in #12159. Could we use the existing scala.annotation.unchecked.uncheckedStable instead? /cc @abgruszecki

Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible we could, yes. Does the fact that @Stable is only added by the compiler change anything here? I'm not sure what's the exact problem here, is it that at runtime we could have an older version of stdlib and there could be no scala.annotation.internal.Stable?

Copy link
Member

Choose a reason for hiding this comment

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

Does the fact that @stable is only added by the compiler change anything here?

That helps with source compatibility but not binary/tasty-compatibility.

is it that at runtime we could have an older version of stdlib and there could be no scala.annotation.internal.Stable?

Exactly, and we have to consider not only binary-compatibility but tasty-compatibility (e.g. if I'm in a 3.0.0 project and I call an inline def defined in a 3.0.1 project that contains @Stable somewhere in its body, that would likely lead to a compiler error).

Copy link
Contributor

@nicolasstucki nicolasstucki May 10, 2021

Choose a reason for hiding this comment

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

@sjrd we will need to exclude scala.annotation.experimental

Copy link
Contributor

Choose a reason for hiding this comment

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

@smarter so how should I go about fixing @Stable? In a separate PR?

Copy link
Member

Choose a reason for hiding this comment

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

@abgruszecki Sure.

Copy link
Member

Choose a reason for hiding this comment

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

@sjrd if you rebase all remaining excludes (experimental, isErased and ErasedParam) should now be @experimental.

Comment on lines +79 to +83
/** Version against which we check binary compatibility.
*
* This must be the latest published release in the same versioning line.
* For example, if the next version is going to be 3.1.4, then this must be
* set to 3.1.3. If it is going to be 3.1.0, it must be set to the latest
* 3.0.x release.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Can't we derive this from the version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. When the base version is 3.1.0, how do you know what's the previous version? It could be any 3.0.x for any value of x. You don't know without going through all the published version to determine which one is the latest 3.0.x.

Copy link
Member

Choose a reason for hiding this comment

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

but couldn't you use 3.0.0 as a base (likewise for 3.0.2)? That means we can't reset the whitelist after every release but I don't think that's a big deal?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could get away with that. That's not the established practice, though. And it means that you lose the ability to reasonably check experimental stuff that you introduce in the meantime, which you'd like not to accidentally break, at least.

IMO that's not a good trade off, but I can change if you prefer that it be automatically determined.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine as is if it's established practice, but we need to add the need to update these variables to the release checklist /cc @anatoliykmetyuk

@smarter smarter added this to the 3.0.1-RC1 milestone May 10, 2021
@sjrd
Copy link
Member Author

sjrd commented May 11, 2021

Rebased.

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.

Otherwise LGTM.

exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[MissingClassProblem]("scala.annotation.internal.ErasedParam"),
exclude[MissingClassProblem]("scala.annotation.internal.Stable"),
Copy link
Member

Choose a reason for hiding this comment

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

This class doesn't exist anymore.

Copy link
Member

Choose a reason for hiding this comment

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

Also isn't this missing experimental itself?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

@smarter smarter assigned sjrd and unassigned smarter May 11, 2021
@nafg
Copy link

nafg commented May 11, 2021 via email

@sjrd
Copy link
Member Author

sjrd commented May 11, 2021

Why can't you automate looking up the last version? If checking Maven Central is too expensive, can you use v* git tags?

It's not a question of efficiency. It's a question of build reproducibility. A commit that builds today may fail to build in the future if we publish a new patch version in the meantime that introduces a new experimental method.

Therefore, the git tag has the same issue as the Maven Central lookup.

exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TermParamClauseMethods.isErased"),
exclude[MissingClassProblem]("scala.annotation.internal.ErasedParam"),
exclude[MissingClassProblem]("scala.annotation.internal.Stable"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
exclude[MissingClassProblem]("scala.annotation.internal.Stable"),
exclude[MissingClassProblem]("scala.annotation.experimental"),

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, yes. Fixed.

@sjrd
Copy link
Member Author

sjrd commented May 12, 2021

The test_windows_fast keeps aborting itself. I don't know why.

@smarter
Copy link
Member

smarter commented May 15, 2021

The test_windows_fast keeps aborting itself. I don't know why.

Didn't happen after restarting the jobs so I'll assume this is spurious.

@smarter smarter merged commit 83e17f1 into scala:master May 15, 2021
@smarter smarter deleted the setup-mima branch May 15, 2021 18:37
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.

5 participants