Skip to content

jlink 4.0.2 + native installers + namegen cleanup#7568

Merged
karianna merged 8 commits into
PCGen:masterfrom
Vest:fix_packaging
Jun 3, 2026
Merged

jlink 4.0.2 + native installers + namegen cleanup#7568
karianna merged 8 commits into
PCGen:masterfrom
Vest:fix_packaging

Conversation

@Vest
Copy link
Copy Markdown
Contributor

@Vest Vest commented May 31, 2026

Summary

Three independent threads bundled into one PR — they were uncovered while debugging the first one. OK to squash on merge: the commit history was useful while iterating but the end-state changes are small and cohesive.

1. jlink plugin upgrade and merged-module fix

  • Bump org.beryx.jlink 4.0.1 → 4.0.2.
  • 4.0.1's createMergedModule failed with duplicate-requires compile errors. Root cause: asm 9.10 (pulled in by jlink 4.0.1) parses Java 25 class files that 9.9.1 silently skipped, so the plugin's auto-derived requires set grew enough to collide with our explicit list under additive = true.
  • Fix: keep only the modules the scanner can't infer on its own (java.naming, java.scripting, java.management, jdk.httpserver, jdk.unsupported.desktop).

2. Release pipeline now ships real native installers + portable zips

  • Windows was silently excluded from fullJpackage. A leftover Os.FAMILY_MAC || Os.FAMILY_UNIX predicate in release.gradle dated from when Windows shipped via NSIS (buildNsis); NSIS was retired in be48763530 but the jpackage hookup was never added on Windows. Removed the predicate.
  • fullJpackage only built the runtime image, never the installer. It depended on assembleJpackageImage (or patchMacJpackage on Mac), not the jpackage task that produces .dmg/.deb/.exe. Releases shipped only image-<os>.zip from jlinkZip — a JVM runtime without /data, /plugins, /preview, /outputsheets, so launching it gave the "missing required folders" dialog. Made jpackage depend on the data-bundling step (and on Mac, on patchMacJpackage so the patched plist + MacDirLauncher go into the installer); pointed fullJpackage at jpackage.
  • Pin one installerType per OS (dmg / deb / exe) — without it jpackage emits both formats per platform, doubling build time and (on Linux) requiring rpmbuild that isn't installed on the Ubuntu runner.
  • Added --win-shortcut --win-menu so the .exe creates Start-menu and desktop entries.
  • New portableZip task produces pcgen-<version>-<os>-<arch>-portable.zip alongside the installer — same self-contained app, but unzip-and-run for users who don't want an installer (USB sticks, locked-down environments, etc.). Wired into assembleArtifacts so CI uploads it to the GitHub Release.
  • Fixed Linux .deb not being uploaded. jpackage names Debian packages pcgen_<version>_<arch>.deb (underscore), which the existing pcgen-*.* glob (hyphen) missed. Added pcgen_*.deb to the include set. .rpm (pcgen-<version>.<arch>.rpm) was already covered.
  • Removed image-<os>.zip from the release uploads. Output of jlinkZip — a JVM runtime image without /data, /plugins, /preview, or /outputsheets. Misleadingly named: users who tried to run it got the "missing required folders" dialog. Autobuild keeps it via buildDist (separate distribution channel, unchanged).
  • Removed the checksum task and SHA256-digests-*.txt files. GitHub Releases compute and expose a SHA-256 for every uploaded asset automatically; anyone verifying integrity can shasum -a 256 against the value GitHub provides. The 4 generated digest files were noise.

3. pcgen.core.namegen perf / cleanup (no behavior change)

  • NameList / RuleSet: O(n) two-pass weighted pick() → O(log n) binarySearch over a precomputed cumulative-weight array.
  • DataValue: hand-rolled linked list (DataSubValue) → lazy LinkedHashMap.
  • NameGenLazyData.gendersForRuleset: O(categories) bucket scan → O(1) lookup via RuleSetMeta.categoryTitles().
  • NameGenerator.assemble: lazy meaning / pronunciation StringBuilders; only allocate when a part actually overrides.

Final release-asset list (per platform)

After this PR, each release produces a focused, user-meaningful asset list:

Platform Installer Portable
macOS (aarch64) pcgen-<v>.dmg pcgen-<v>-mac-aarch64-portable.zip
Linux (x64) pcgen_<v>_amd64.deb pcgen-<v>-linux-x64-portable.zip
Linux (aarch64) pcgen_<v>_arm64.deb pcgen-<v>-linux-aarch64-portable.zip
Windows (x64) pcgen-<v>.exe pcgen-<v>-windows-x64-portable.zip

Plus pcgen-<v>-sources.jar. 9 user-meaningful assets, down from 15 mixed-purpose ones. Per-asset SHA-256 hashes are available on the GitHub Release UI/API.

Test plan

  • ./gradlew createMergedModule succeeds (was the original failure).
  • ./gradlew fullJpackage on Mac produces pcgen-6.09.08.dmg (160 MB) with all four required folders inside PcGen.app/Contents/app/.
  • ./gradlew portableZip on Mac produces pcgen-6.09.08.RC1-mac-aarch64-portable.zip (148 MB) with the same self-contained PcGen.app.
  • Manual release run on Vest/pcgen (run 26779067448, tag v6.09.08.RC1): macOS, Ubuntu x64, Ubuntu ARM, and Windows jobs all green; produced .dmg + .exe + portable zips on all OSes. (Note: that run predates the .deb glob fix and the image-*.zip / digest-file removal — a fresh run is recommended before merge to confirm the final asset list.)
  • ./gradlew :test --tests 'pcgen.core.namegen.*' --tests 'pcgen.gui3.namegen.*' (173 tests, 0 failures).
  • Sanity check: open Random Name dialog, generate a few names.

Vest added 3 commits May 31, 2026 22:04
- NameList/RuleSet: precompute a cumulative-weight array at
  construction so pick() is O(log n) via binarySearch instead of two
  linear passes. Zero-weight entries are filtered into a parallel
  positives array, which keeps binarySearch correct when duplicates
  would otherwise let it land on a zero-weight index. Both records
  become final classes since cached state can't live on a record.
- DataValue: drop the hand-rolled DataSubValue linked list in favour
  of a lazily-allocated LinkedHashMap. putIfAbsent preserves the
  first-write-wins semantics the old recursive get() relied on.
- NameGenLazyData.gendersForRuleset: read directly from the ruleset's
  RuleSetMeta.categoryTitles() instead of scanning every Sex: bucket.
- NameGenerator.assemble: defer meaning/pronunciation StringBuilder
  allocation until a part actually overrides one, seeding from the
  name built so far. Avoids two builders' worth of churn on the
  common path where no part has sub-values.
The jlink plugin's `additive = true` mode emits both the auto-derived
and the user-listed `requires` blocks without dedup. asm 9.10 (pulled
in by jlink 4.0.1) parses Java 25 class files that 9.9.1 silently
skipped, growing the auto-derived set enough to collide with our
explicit list and breaking `createMergedModule` with duplicate-requires
errors. Bump to 4.0.2 and keep only the modules the scanner can't
infer on its own.
Brief description of each overload's contract (direct Element children,
optional tag-name filter) so future readers don't have to re-derive it
from the stream pipeline.
@Vest Vest changed the title fix: update Beryl jlink to 4.0.2 jlink: bump to 4.0.2 + namegen perf cleanup May 31, 2026
Vest added 2 commits June 1, 2026 12:29
Drop the Os.FAMILY_MAC || Os.FAMILY_UNIX predicate that excluded
Windows from fullJpackage. The carve-out dates from when Windows
shipped via NSIS (`buildNsis`); that path was retired in be48763
but the release-side hookup to invoke jpackage on Windows was never
added, leaving Windows release artifacts as the runtime zip only.
fullJpackage was wired to assembleJpackageImage (Mac: patchMacJpackage),
not the jpackage installer task — so each release shipped only the
jlinkZip runtime image, never a .dmg/.deb/.exe. Make jpackage depend on
the data-bundling step so it packages an image that already contains
data/plugins/preview/outputsheets, then point fullJpackage at jpackage.

Pin one installerType per OS (dmg / deb / exe) — without it jpackage
emits both formats per platform, doubling build time and (on Linux)
requiring rpmbuild that isn't installed on the Ubuntu runner.
Add --win-shortcut / --win-menu so the .exe creates Start-menu and
desktop entries; the existing --linux-shortcut and Mac-specific opts
were already in place. WiX 3.14 needed for the .exe is preinstalled
on the windows-latest runner.
@Vest Vest changed the title jlink: bump to 4.0.2 + namegen perf cleanup jlink 4.0.2 + native installers + namegen cleanup Jun 1, 2026
Same self-contained app the installer ships, but as an unzip-and-run
archive — useful for users who don't want to run an installer (USB sticks,
locked-down environments, etc.). Per-platform: pcgen-<version>-<os>-<arch>-portable.zip.

The zip captures whatever fullJpackage left in build/jpackage/PcGen[.app],
so it includes data/plugins/preview/outputsheets and (on Mac) the patched
Info.plist + MacDirLauncher.
@Vest
Copy link
Copy Markdown
Contributor Author

Vest commented Jun 1, 2026

I am optimizing a CI build again - I want to build artifacts for different platforms. When i am ready I will create a new pr

jpackage names Debian packages pcgen_<version>_<arch>.deb (underscore),
which the existing pcgen-*.* glob (hyphen) misses. Linux release runs
were uploading everything except the .deb. Add a second include for
the underscore form. .rpm uses pcgen-<version>.<arch>.rpm so it was
already covered.
The image-*.zip artifacts (output of jlinkZip) are a JVM runtime image,
not a runnable PcGen — no launcher, no /data, /plugins, /preview, or
/outputsheets. Users who tried to run them got the "missing required
folders" dialog. Now that fullJpackage produces real installers and a
portable zip with the same .app the installer ships, image-*.zip is
just a confusing leftover. Drop it from the release upload (autobuild
keeps it via buildDist).

The SHA256-digests-*.txt files are also redundant: GitHub computes a
SHA-256 for every release asset automatically and exposes it via the
API. Anyone verifying integrity can shasum the file locally.
@karianna karianna merged commit ba97fbe into PCGen:master Jun 3, 2026
3 checks passed
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.

2 participants