You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "sangkyoonnam (via GitHub)" <gi...@apache.org> on 2026/10/20 10:41:23 UTC

[PR] [release][dist] Build release artifacts with JDK 21 and keep JDK 21 classes in thin JARs [flink-agents]

sangkyoonnam opened a new pull request, #1295:
URL: https://github.com/apache/flink-agents/pull/1295

   Linked issue: #1292
   
   ### Purpose of change
   
   As discussed in #1292, the release artifacts are built with JDK 21 so they contain the JDK 21 `ContinuationActionExecutor` and `ContinuationContext`, and the base classes keep their current bytecode targets.
   
   - `deploy_staging_jars.sh` requires JDK 21 instead of 17, and `create_binary_release.sh`, which builds the distribution JARs, gets the same check.
   - #413 pinned JDK 17 because `integrations/mcp` targets Java 17; the JDK 21 build still compiles it to Java 17 bytecode, the same as a JDK 17 build.
   - The thin JARs of all five distributions also include `META-INF/versions/*/org/apache/flink/agents/**`, and the common JAR excludes it. Both variants now live in the thin JAR, so selection no longer depends on JAR order.
   
   ### Tests
   
   Runtime runs used macOS arm64 and Flink 2.3.0, with `--add-exports=java.base/jdk.internal.vm=ALL-UNNAMED` on JDK 21. The Java job reused one JDK 21-built artifact set on every JDK without rebuilding, and the Python job reused one wheel.
   
   - Packaging: in the JDK 21 build, the `api`, `plan` and base `runtime` classes are Java 11 bytecode, and only the two `META-INF/versions/21` classes are Java 21. Each thin and full distribution JAR has both variants and `Multi-Release: true`; the common JAR has neither.
   - Release scripts: both reject JDK 17. On JDK 21, `deploy_staging_jars.sh` with `deploy` replaced by `install` and `-Dgpg.skip` builds with `-Prelease,docs-and-source`, including sources and Javadoc. `create_binary_release.sh` with `SKIP_GPG=true` produces the five distribution JARs (`Build-Jdk-Spec: 21`) and the Python sdist.
   - Java job, with the full distribution JAR, common then thin, and thin then common in `lib`: on JDK 11 and 17 it loads the base executor, skips the chat call because continuation is unsupported there, and finishes; on JDK 21 it loads `META-INF/versions/21/.../ContinuationActionExecutor.class` from the full or thin JAR and finishes a `ctx.chat(...).await()` call.
   - Python job: a wheel built from that sdist, with its JARs downloaded through `FLINK_AGENTS_MAVEN_MIRROR` from the locally installed staging artifacts and matching them by SHA-256, has both variants in each thin JAR. A Python agent job with no dist JAR in `lib` finishes on JDK 17 and 21, and only the JDK 21 run logs the JDK 21 executor's thread-pool initialization.
   
   I haven't run the actual staging deploy or tested Linux or other Flink versions. The second phase of `deploy_staging_jars.sh` still passes `-Pjava-11-target`, which no longer exists, so Maven warns and reruns the `api` lifecycle without producing a `jdk11` classifier; this PR leaves that unchanged.
   
   ### API
   
   No.
   
   ### Documentation
   
   - [ ] `doc-needed`
   - [x] `doc-not-needed`
   - [ ] `doc-included`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: Claude Code 2.1.303 (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [release][dist] Build release artifacts with JDK 21 and keep JDK 21 classes in thin JARs [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 merged PR #1295:
URL: https://github.com/apache/flink-agents/pull/1295


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [release][dist] Build release artifacts with JDK 21 and keep JDK 21 classes in thin JARs [flink-agents]

Posted by "wenjin272 (via GitHub)" <gi...@apache.org>.
wenjin272 commented on code in PR #1295:
URL: https://github.com/apache/flink-agents/pull/1295#discussion_r4324173686


##########
tools/releasing/create_binary_release.sh:
##########
@@ -43,6 +43,13 @@ if [[ `basename $CURR_DIR` != "tools" ]] ; then
   exit 1
 fi
 
+# Check JDK version - must be JDK 21
+JAVA_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | cut -d'.' -f1)

Review Comment:
   Could we enforce JDK 21 through the existing Maven Enforcer rule in the `release` profile, using `<version>[21,22)</version>`, and remove the duplicate checks from both release scripts? The scripts currently check `java` on `PATH`, while Maven uses `JAVA_HOME` when set, so the check can pass even when Maven actually runs on JDK 17. Both scripts already enable `-Prelease`, so this would validate the JVM performing the build while keeping the existing bytecode targets unchanged.
   
   While updating the staging script, could we also remove the obsolete second deployment with `-Pjava-11-target` and update the related log messages? That profile was removed in #452, so it no longer produces a `jdk11` classifier. Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [release][dist] Build release artifacts with JDK 21 and keep JDK 21 classes in thin JARs [flink-agents]

Posted by "sangkyoonnam (via GitHub)" <gi...@apache.org>.
sangkyoonnam commented on code in PR #1295:
URL: https://github.com/apache/flink-agents/pull/1295#discussion_r4325455753


##########
tools/releasing/create_binary_release.sh:
##########
@@ -43,6 +43,13 @@ if [[ `basename $CURR_DIR` != "tools" ]] ; then
   exit 1
 fi
 
+# Check JDK version - must be JDK 21
+JAVA_VERSION=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | cut -d'.' -f1)

Review Comment:
   Done in a01dfaa9. The `release` profile's `requireJavaVersion` is now `[21,22)`, and both scripts drop their own checks. Local runs reject Maven on JDK 17 and pass on JDK 21, even with the opposite `java` on `PATH`; staging was checked with `install` in place of `deploy`. I also removed the obsolete `-Pjava-11-target` deployment and updated the staging log messages, which now print `mvn -version`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org