Skip to content

build: Ensure to produce JDK 8 compatible bytecode #19750

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

Closed
WojciechMazur opened this issue Feb 21, 2024 · 2 comments · Fixed by #20018
Closed

build: Ensure to produce JDK 8 compatible bytecode #19750

WojciechMazur opened this issue Feb 21, 2024 · 2 comments · Fixed by #20018
Assignees
Labels
area:infrastructure itype:meta Issues about process/similar
Milestone

Comments

@WojciechMazur
Copy link
Contributor

Compiler version

3.4.nightly

With the recent changes to use JDK 17/21 in the CI we need to ensure that published artifacts and referenced API would be JDK 8 compatible. Otherwise we risk publishing with unexpected JDK bytecode version, as it was already found in some nightly releases #19721

Expectation

Modify the build.sbt to ensure that -target/-java-output-version / -release flags are set correctly. Possibly add dependency to publish tasks to fail compilation if required javac/scalac options are missing or are incorrect

@WojciechMazur WojciechMazur added area:infrastructure itype:meta Issues about process/similar labels Feb 21, 2024
@mbovel mbovel assigned mbovel and hamzaremmal and unassigned mbovel Feb 27, 2024
@hamzaremmal
Copy link
Member

We just discussed this during a meeting today. I will just add a big warning in the CI workflow mentioning that the java version should not change for the releases and community build

@reid-spencer
Copy link

I would prefer that the compiler generate code for the most recent JDK it is compatible with, but accept a command line option, say -java-output-version as suggested, to force it to (try to) generate code for older JDKs.

@WojciechMazur - While broad JDK version support is laudable, isn't it time to move on from 2014 (now a full decade out of date) and benefit from all the JDK improvements since 8? I am advocating that Scala consider what its minimum JDK version should be. I'd vote for 11. The Java/Scala/xxx community needs to forget about JDK 8. IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:infrastructure itype:meta Issues about process/similar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants