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

Toolkit to support compiler plugins #3134

Open
soronpo opened this issue Aug 27, 2024 · 5 comments
Open

Toolkit to support compiler plugins #3134

soronpo opened this issue Aug 27, 2024 · 5 comments
Labels
Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it enhancement New feature or request needs-minor-release This change should require a minor version bump. needs-sip This issue might require going through the SIP process. toolkit

Comments

@soronpo
Copy link

soronpo commented Aug 27, 2024

Is your feature request related to a problem? Please describe.
My library is dependent on a compiler plugin. I would like to define a toolkit to house both library and compiler plugin dependencies to simplify the user experience. It's a great general feature that enables library authors that depend on compile plugins to define tiny toolkits to house both definitions.

Describe the solution you'd like
The toolkit feature currently does not support compiler plugins. It would be great if we can have it. Hopefully within the next minor release of official Scala 3.6.0

Describe alternatives you've considered
Automatic mechanism for libraries to declare dependency on compiler plugins and have those automatically enabled.

Additional context
Currently when publishing the toolkit I get:

Skipping unused scalacOptions: -Xplugin
Setting -Xplugin is currently not supported.
@soronpo soronpo added the enhancement New feature or request label Aug 27, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Sep 2, 2024

Hopefully within the next minor release of official Scala 3.6.0

No promises. If you care about delivering this in a timely manner, external contribution would be welcome.

Additionally, this is a rather large feature, as it'd introduce compiler plugin flags via a toolkit dependency... which would potentially affect the whole tooling ecosystem.
When we have a PoC (which I don't think we'd have the resources to work on in the coming months on the maintenance team's side), we can discuss whether this would require going through SIP or not (I personally think it might need to).

@Gedochao Gedochao added Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it needs-minor-release This change should require a minor version bump. needs-sip This issue might require going through the SIP process. labels Sep 2, 2024
@soronpo
Copy link
Author

soronpo commented Sep 2, 2024

No promises. If you care about delivering this in a timely manner, external contribution would be welcome.

That's perfectly valid. I'll try to help out.

we can discuss whether this would require going through SIP or not (I personally think it might need to).

Under --power it does not, IMO. To have it out of the box without --power it does.

@Gedochao
Copy link
Contributor

Gedochao commented Sep 2, 2024

Under --power it does not, IMO. To have it out of the box without --power it does.

This would mean a separate flag for enabling compiler plugins with custom toolkits would be necessary until it goes through SIP.

@soronpo
Copy link
Author

soronpo commented Sep 2, 2024

Under --power it does not, IMO. To have it out of the box without --power it does.

This would mean a separate flag for enabling compiler plugins with custom toolkits would be necessary until it goes through SIP.

I do not think so. SIP46 defined the default scala behavior for everything without --power. Everything under --power is outside the scope of the SIP and language control, meaning that it can change as VirtusLabs wishes and without being considered a regression from a Scala perspective. So as long as --power is required for toolkits to also enable compiler plugins, this is not a change that requires a SIP.

@Gedochao
Copy link
Contributor

Gedochao commented Sep 2, 2024

That's true, but I'd still rather have it behind an experimental opt-in flag, rather than have everyone get those by just enabling --power mode (which some users may have enabled implicitly via global configuration or an environment variable).

Having this behind a flag would also make users get the experimental warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community help wanted Issues that idicate features that are nice-to-have but core team does not have time to work on it enhancement New feature or request needs-minor-release This change should require a minor version bump. needs-sip This issue might require going through the SIP process. toolkit
Projects
None yet
Development

No branches or pull requests

2 participants