Skip to content

Improved documentation for rust crate release process - #423

Open
joeslice wants to merge 4 commits into
kson-org:mainfrom
joeslice:rust-release
Open

Improved documentation for rust crate release process#423
joeslice wants to merge 4 commits into
kson-org:mainfrom
joeslice:rust-release

Conversation

@joeslice

@joeslice joeslice commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Included are the improvements to the release documentation for the rust library as tested in the 0.3.0 release. Additionally, a bonus change to improve the rust readme.

Included is an untested draft version of release steps that might be useful when shipping a new release of the rust artifacts to crates.io. This should be validated and corrected with Adolfo's help before carrying on.
@joeslice
joeslice requested a review from aochagavia August 26, 2026 13:07
Comment thread docs/release_process.md Outdated

- `jni_simplified.h` — bindgen generates the bindings from this header; the build fails
without it
- `graal_isolate.h` and `graal_isolate_dynamic.h`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not 100% sure these are needed, but there's no harm in shipping them

@aochagavia aochagavia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 😉

Simplifying and improving the instructions while testing them.
This step was missed 17d124d and 3c147dd.

`cargo publish` was the first to regenerate and notice an error here.
@joeslice joeslice changed the title WIP: Draft rust crate release process Improved documented rust crate release process Aug 26, 2026
@joeslice joeslice changed the title Improved documented rust crate release process Improved documentation for rust crate release process Aug 26, 2026
The prior example was no longer accurate since requiring `options` instead of a boolean. This new example demonstrates some indentation options and also a bit more about the json->kson pipeline.
holodorum added a commit to holodorum/kson that referenced this pull request Aug 31, 2026
`store-native-artifacts` stored `kson-lib/build/bin/nativeKson/releaseShared`
and `releaseStatic`. Nothing writes those paths: kson-lib declares only `jvm()`
and `js()` targets, so there is no Kotlin/Native build to produce them, and all
three `build-*` jobs have been storing nothing. Meanwhile the native library
that does exist -- in `kson-lib/build/kotlin/compileGraalVmNativeImage` -- and
the CLI binary that `check` already builds on all three platforms were both
thrown away with the build directory.

Add `./gradlew packageReleaseArtifacts`, which stages this platform's share of
a release into `build/release-artifacts`:

  kson-lib-shared-<arch>-<os>.tar.gz  the native-image output directory, verbatim
  kson-cli-<arch>-<os>.tar.gz         the CLI binary
  SHA256SUMS                          checksums for both

The `<arch>-<os>` tokens are not ours to pick. `lib-rust/kson-sys/build.rs`
downloads `kson-lib-shared-{arch}-{os}.tar.gz` from the `kson-lib-X.Y.Z` release
on kson-org/kson-binaries and unpacks it straight into its `OUT_DIR`, so the
kson-lib archive carries that directory's contents at the archive root --
unpacking it leaves exactly what `build_kson_from_source` copies there -- and
the tokens live in `BinaryArtifactPaths` beside a note naming whose contract
they are. The CLI archive follows the same convention so there is one to learn
rather than two.

CI packages inside `gradle-core-tasks`, before `verifyCleanCheckout` so every
build proves packaging leaves the checkout clean, and all six jobs now store
through one `store-release-artifacts` command into `release-artifacts/<platform>`.
Branch filters and caching are untouched.

Also fixes `:tooling:cli:buildNativeImage` declaring `kson` as its output on
Windows, where native-image writes `kson.exe`: packaging needs the real name,
and the task could never be up to date there.

`docs/release_process.md` gains a table of which job produces what and where to
download it, and fills in the collection half of the lib-rust and tooling/cli
sections. Publishing the CLI stays a todo: no distribution channel has been
chosen for it.

The lib-rust process this builds on (kson-org#423) opened with a workaround for exactly
the gap closed here: download three Python wheels and unzip `jni_simplified.h`
and the platform library out of each. Its Step 1 becomes three downloads of
archives CI now builds ready-made, and the facts around it are corrected with
it -- the libraries come from the `build-*` jobs rather than
`test-python-sdist-*`, they land in `release-artifacts/<platform>`, and an
archive holds the native-image output directory verbatim (four files on macOS)
rather than the two a wheel could supply. That document's publish ordering,
`KSON_LIB_VERSION` check, crates.io steps and their warnings are kept as they
are.
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