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

build: fixes bytecode level and updates build versions #236

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

codefromthecrypt
Copy link
Member

This fixes a problem where we weren't releasing jars with the right bytecode level, due to a constant release=8. As we no longer can rely on RetroLambda to rewrite code, I've had to port things to the appropriate bytecode level manually. I also updated build deps that could be.

Fixes #235 and after this will cut a patch release (without any other pending PR)

This fixes a problem where we weren't releasing jars with the right
bytecode level, due to a constant release=8. As we no longer can rely on
RetroLambda to rewrite code, I've had to port things to the appropriate
bytecode level manually. I also updated build deps that could be.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- We don't use animal-sniffer anymore as release obviates it.
See https://github.com/mojohaus/animal-sniffer/issues/62 -->
<maven.compiler.release>8</maven.compiler.release>
Copy link
Member Author

Choose a reason for hiding this comment

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

the problem was that we never overrode this, so the bytecode ended up as 8 on all projects

Class.forName("java.io.UncheckedIOException");
return new Jre8(); // intentionally doesn't not access the type prior to the above guard
Class<?> clazz = Class.forName("java.io.UncheckedIOException");
Constructor<?> ctor = clazz.getConstructor(IOException.class);
Copy link
Member Author

Choose a reason for hiding this comment

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

this is annoying, but using this path is also very unlikely. It meant there was an IOException gzipping spans, which would be uncommon for sure.

Adrian Cole added 2 commits January 6, 2024 14:24
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
thread.start();
thread.interrupt();

assertThat(thread.isInterrupted()).isTrue();
// The callback thread receiving an interrupt has nothing to do with the caller of the captor
assertThat(Thread.currentThread().isInterrupted()).isFalse();
assertThat(returned.get()).isFalse();
Copy link
Member Author

Choose a reason for hiding this comment

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

this was winky depending on JDK. The important thing is that we interrupted the thread launched and not the current one, so I removed this part

@codefromthecrypt
Copy link
Member Author

cherry-picked a few classes and they look ok now

$ ./mvnw clean install  -Prelease -Dgpg.skip -Dmaven.javadoc.skip=true -DskipTests
--snip--
$ file core/target/classes//zipkin2/reporter/AsyncReporter.class
core/target/classes//zipkin2/reporter/AsyncReporter.class: compiled Java class data, version 50.0 (Java 1.6)
$ file brave/target/classes/zipkin2/reporter/brave/AsyncZipkinSpanHandler.class 
brave/target/classes/zipkin2/reporter/brave/AsyncZipkinSpanHandler.class: compiled Java class data, version 50.0 (Java 1.6)
$ file okhttp3/target/classes/zipkin2/reporter/okhttp3/OkHttpSender.class 
okhttp3/target/classes/zipkin2/reporter/okhttp3/OkHttpSender.class: compiled Java class data, version 51.0 (Java 1.7)
$ file spring-beans/target/classes/zipkin2/reporter/beans/URLConnectionSenderFactoryBean.class 
spring-beans/target/classes/zipkin2/reporter/beans/URLConnectionSenderFactoryBean.class: compiled Java class data, version 50.0 (Java 1.6)

@codefromthecrypt codefromthecrypt merged commit f195606 into master Jan 6, 2024
3 checks passed
@codefromthecrypt codefromthecrypt deleted the fix-build branch January 6, 2024 06:47
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.

Incorrect bytecode versions
1 participant