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

[POC] Use Unroll plugin for binary compatibility #3008

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Feb 10, 2024

No description provided.

def report(
reportType: ReportType,
sources: Seq[os.Path],
dataDirs: Seq[os.Path],
sourceRoot: os.Path
@Unroll sourceRoot: os.Path = null
Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate how the use of the unroll plugin changes the code? Will API users who freshly compile against the binary code, always use the new API? Are the backward-compatible stubs only for binary compat, or are they still public non-deprecated API?

Copy link
Member Author

Choose a reason for hiding this comment

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

@lefou it generates bincompat forwarder overloads. The plugin repo has some description and links to further discussion. I hope to get this into the Scala language via a SIP

https://github.com/com-lihaoyi/unroll

For now, the generated forwarders aren't hidden. It doesn't really matter, since it's just a forwarder, calling it does the same thing as calling the "real" definition. There's some discussion on how to hide them, but nothing really decided upon

Copy link
Member

Choose a reason for hiding this comment

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

Understood. Would be nice if there is an option to mark the forwarders as deprecated, since then, it's in the hand of the API user to hack around them and produce bytecode that may be more safe, if needed. But it's not needed here, I think.

build.sc Outdated
@@ -364,11 +364,13 @@ trait MillScalaModule extends ScalaModule with MillJavaModule with ScalafixModul
def scalacPluginIvyDeps =
super.scalacPluginIvyDeps() ++
Agg(Deps.acyclic) ++
Agg(ivy"com.lihaoyi::unroll-plugin:0.1.9") ++
Copy link
Member

Choose a reason for hiding this comment

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

We should move this into Deps.unroll or Deps.scalac.unroll.

@lihaoyi lihaoyi marked this pull request as draft February 10, 2024 17:12
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.

None yet

2 participants