Skip to content

Dist: dump the base CDS archive when the copied JDK has none (fixes master on macOS x64) - #1390

Merged
Frotty merged 3 commits into
masterfrom
macos-dist-base-archive
Oct 8, 2026
Merged

Frotty merged 3 commits into
masterfrom
macos-dist-base-archive

Conversation

@Frotty

@Frotty Frotty commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

What

Master's CI fails on macos-15-intel since #1386: assembleSlimCompilerDist throws "The runtime has no base CDS archive". The macOS distribution copies the JDK instead of running jlink, and #1386 assumed the copy brings classes.jsa. The Temurin 25 that setup-java installs on the Intel runner has none (macos-latest, arm64, has one and passed). Run: https://github.com/wurstscript/WurstScript/actions/runs/37778085905 (job Gradle build on macos-15-intel).

  • assembleSlimCompilerDist dumps the archive with java -Xshare:dump when the copied runtime has none, so the runtime always has one.
  • It then starts the runtime with -Xshare:on, which fails without a usable archive, instead of looking for a file name (a file in the wrong mode passes a name check and does nothing).
  • The JVMs it starts run without JAVA_TOOL_OPTIONS, _JAVA_OPTIONS and JDK_JAVA_OPTIONS: an archive takes on the options of the JVM that writes it, and CI exports -XX:+UseCompactObjectHeaders.

Why master broke unnoticed

Pull-request CI runs one Linux job and does not package (Package slim runtime runs on pushes only), so #1386 was never packaged on macOS before it merged. To test this change where it matters I ran a temporary workflow in this pull request (packaging on macos-15-intel, macos-latest and Windows with CI's JAVA_TOOL_OPTIONS; run 37783008340, since removed). Whether packaging should run on pull requests which touch deploy.gradle or launchers/ is a call for the maintainers.

Checks

macOS and Windows, on CI (the temporary workflow, with CI's JAVA_TOOL_OPTIONS; packageSlimCompilerDist succeeded on all three):

  • macos-15-intel: the JDK's lib/server holds only libjsig.dylib and libjvm.dylib (Temurin 25.0.4+101.0). The distribution has a 15.6 MB classes.jsa after the build, and java -Xshare:on -version (without JAVA_TOOL_OPTIONS) starts with "sharing".
  • macos-latest (arm64) and windows-latest: pass.

Windows, local:

  • assembleSlimCompilerDist builds; bin/server has classes.jsa.
  • With the archive deleted from the jlink image and -x jlinkRuntime25 (the full-JDK case): "The runtime has no base CDS archive, dumping it", the guard passes.
  • With CI's JAVA_TOOL_OPTIONS set the archive is still the default-mode classes.jsa (not classes_coh.jsa).
  • A second run reuses the configuration cache entry and executes the new code.

Not run: Linux packaging (unchanged path: jlink makes the archive; master's push run for #1386 passed on ubuntu-latest).

Frotty added 3 commits October 8, 2026 15:15
The macOS distribution copies the JDK instead of running jlink, and assumed that it brings
classes.jsa. The Temurin for macOS x64 on CI has none, so assembleSlimCompilerDist failed on
macos-15-intel after #1386 (macos-latest, arm64, has one).

The task now dumps the archive with java -Xshare:dump when the copied runtime has none, and then
starts the runtime with -Xshare:on, which fails without a usable archive, instead of looking for a
file name. The JVMs run without JAVA_TOOL_OPTIONS and its siblings: an archive takes on the options of
the JVM which writes it, and CI exports -XX:+UseCompactObjectHeaders.
@Frotty
Frotty marked this pull request as ready for review October 8, 2026 13:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T13:23:30.864713Z 8cbec3a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty

Frotty commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8cbec3a41b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit 2206ef4 into master Oct 8, 2026
3 checks passed
@Frotty
Frotty deleted the macos-dist-base-archive branch October 8, 2026 13:31
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.

1 participant