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

Support spring 6 #1418

Open
codefromthecrypt opened this issue Feb 27, 2024 · 6 comments
Open

Support spring 6 #1418

codefromthecrypt opened this issue Feb 27, 2024 · 6 comments

Comments

@codefromthecrypt
Copy link
Member

Feature

Spring 6 requires Java 17+ and jakarta packages.

This makes things more complicated than now because we release with JDK11, so that old spring can compile to Java 6 bytecode.

Rationale

We can add jakarta-friendly instrumenation for spring-web and spring-webmvc

Example Scenario

Spring boot 3 code requires spring 6

@codefromthecrypt
Copy link
Member Author

my thinking is this, knowing there's no new LTS until Sep 2025, and our Java 6,7 projects already default to Java 8 but use the lower version when the release profile is active...

  • constrain the non-release profile to minimal JDK17 (17 can still compile Java 8 bytecode). This will allow instrumentation that use min Java 17 (currently just spring 6), to compile
  • make the release profile either use toolchains or a property override when compiling the java 6,7 bytecode modules. Otherwise use the default JDK (which would be 17)
  • install the extra JDK on the deploy and test workflows, and any variables to use them

This way, everything complicated is constrained to the release profile, which means dev/x normally is same as now (Except can no longer use JDK 11). If snapshot builds publish fine, and target the correct bytecode, we know a release will also work fine.

bonus points for a src/it test for the 6, 7 modules which.. when it is a release profile, fails if the bytecode of the classes is not the correct version!

cc @reta @anuraaga @shakuzen for input

@reta
Copy link
Contributor

reta commented Feb 27, 2024

cc @reta @anuraaga @shakuzen for input

We've been tackling this issue in different projects, the way it seems to work (and not requiring too much maintenance overhead):

  • keep the byte code at 8 (or 11) level
  • use JDK-17 to build and test (minimal baseline for Spring 6)
  • document that JDK baseline is JDK-8 (or 11) but for Spring dependent components it should be at least JDK-17

Not sure if that makes sense for Brave, but it seems to be viable option in general, wdyt @codefromthecrypt ?

@codefromthecrypt
Copy link
Member Author

@reta everything works except for this below part as we shouldn't kill the <6,7 part just for spring

keep the byte code at 8 (or 11) level

@codefromthecrypt
Copy link
Member Author

so I was thinking we use toolchain or a maven-compiler-plugin setting to make sure that in the release profile, we use an alternate JDK to compile the several modules we have which are pre-8. In their normal profile we claim they are bytecode 8, but basically they aren't at release time. Does this make sense?

https://github.com/openzipkin/brave/blob/master/brave/pom.xml#L110-L148

@codefromthecrypt
Copy link
Member Author

seems like setup-java can already configure multiple JDKs.. https://github.com/actions/setup-java?tab=readme-ov-file#install-multiple-jdks

@reta
Copy link
Contributor

reta commented Feb 27, 2024

In their normal profile we claim they are bytecode 8, but basically they aren't at release time. Does this make sense?

👍 I think it makes perfect sense, and yes, should be possible with GA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants