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

Frgaal integration in sbt #3421

Merged
merged 11 commits into from
May 4, 2022
Merged

Conversation

hubertp
Copy link
Contributor

@hubertp hubertp commented Apr 27, 2022

Pull Request Description

Frgaal allows to use latest Java features without requiring users to upgrade their runtime.
There is however no ready plugin for sbt to integrate with it.
This change replaces the regular local java compiler in the sbt definition.

Related to #181988063

Important Notes

This change demonstrates that we can compile shiny 16+ Java features without upgrading the requirements for the end users.
This currently migrates only runtime to Frgaal. We can eventually move other projects to that compiler as well.

For reasons unknown AutoService would fail to initialize and fail to
generate required builtin method classes.
Hidden error message is not particularly revealing on the reason for
that:

[error] error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider com.google.auto.service.processor.AutoServiceProcessor could not be instantiated

Replaced AutoService with ServiceProvider which does seem to do exactly the same thing.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the Scala, Java, and Rust style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH ./run dist and ./run watch.

Half-working since it chokes on generated classes from annotation
processor.
For reasons unknown AutoService would fail to initialize and fail to
generate required builtin method classes.
Hidden error message is not particularly revealing on the reason for
that:
```
[error] error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider com.google.auto.service.processor.AutoServiceProcessor could not be instantiated
```

The sample records is only to demonstrate that we can now use newer Java
features.
@hubertp hubertp requested a review from 4e6 as a code owner April 27, 2022 17:00
@hubertp hubertp changed the title Frgaal integration in sbt WIP: Frgaal integration in sbt Apr 27, 2022
@hubertp hubertp marked this pull request as draft April 27, 2022 17:05
@hubertp
Copy link
Contributor Author

hubertp commented Apr 27, 2022

@JaroslavTulach Runtime now compiles with a sample feature from latest Java. If you are OK with this I will apply this setting to all subprojects and make it non-WIP.
Also, don't want to spend too much time on debugging AutoService failure to initialize, but it looks to be happy with ServiceProvider instead. /cc @kustosz

Bench requires jmh classes which are not available because we obviously
had to limit `java.base` modules to get Frgaal to work nicely.
For now, we default to good ol' javac for Benchmarks.
Limiting Frgaal to runtime for now, if it plays nicely, we can expand it
to other projects.
@hubertp hubertp marked this pull request as ready for review April 28, 2022 11:31
@hubertp hubertp changed the title WIP: Frgaal integration in sbt Frgaal integration in sbt Apr 28, 2022
build.sbt Outdated Show resolved Hide resolved
build.sbt Show resolved Hide resolved
Copy link
Contributor

@4e6 4e6 left a comment

Choose a reason for hiding this comment

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

Looks good

@4e6
Copy link
Contributor

4e6 commented May 4, 2022

@JaroslavTulach do we want to switch to Java 17 GraalVM in the future?

@hubertp hubertp merged commit 79c82da into develop May 4, 2022
@hubertp hubertp deleted the wip/hubert/frgaal-sbt-integration-181988063 branch May 4, 2022 19:18
mergify bot pushed a commit that referenced this pull request Jul 19, 2022
Updating to Frgaal 19.0.0-RC1 to give us access to latest Java features including pattern matching on `record` classes. Builds upon #3421.
jdunkerley pushed a commit that referenced this pull request Jul 20, 2022
Updating to Frgaal 19.0.0-RC1 to give us access to latest Java features including pattern matching on `record` classes. Builds upon #3421.
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

4 participants