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

[CI] libcryostat should not only target JDK 11, but should be built with JDK 11 #425

Closed
andrewazores opened this issue Jul 18, 2024 · 1 comment · Fixed by #426 or #430
Closed
Assignees
Labels

Comments

@andrewazores
Copy link
Member

See #416

Currently, the cryostat-core and cryostat-core-parent define Java and Maven/compiler versions at 17:

  <java.version>17</java.version>
  <maven.compiler.target>${java.version}</maven.compiler.target>
  <maven.compiler.source>${java.version}</maven.compiler.source>

(

<java.version>17</java.version>
,
<java.version>17</java.version>
)

whereas libcryostat is intentionally requiring only Java 11:

(

<java.version>11</java.version>
)

However, the two modules and the parent project are all built together in the end using JDK 17:

This results in classes with the correct class file version, ex.:

$ javap -verbose Agent | less
Warning: File ./Agent.class does not contain class Agent
Classfile /home/work/workspace/quarkus-test/target/dependency/io/cryostat/agent/Agent.class
  Last modified Jul. 18, 2024; size 18175 bytes
  SHA-256 checksum 0914ef3cc5892ec85175af25a48b4ef4578b3ad0b5dd17abae8f4f89133f7772
  Compiled from "Agent.java"
public class io.cryostat.agent.Agent extends java.lang.Object implements java.util.concurrent.Callable<java.lang.Integer>, java.util.function.Consumer<io.cryostat.agent.AgentArgs>
  minor version: 0
  major version: 55

but it is not actually guaranteed that JDK 17 is able to generate bytecode that a JDK 11 JVM will understand. To guarantee this, cryostat-core should be built with JDK 17, but libcryostat must be built with JDK 11, then both of those must be published as-is rather than rebuilt using JDK 17 from cryostat-core-parent.

@andrewazores
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
1 participant