Skip to content

Release the Linux binaries as .deb packages, built on Ubuntu 24.04 - #289

Merged
abashev merged 5 commits into
21.X.Xfrom
abashev/install-on-ubuntu-with-apt-from-a-repository-of
Nov 28, 2026
Merged

abashev merged 5 commits into
21.X.Xfrom
abashev/install-on-ubuntu-with-apt-from-a-repository-of

Conversation

@abashev

@abashev abashev commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Before this PR

A release has the Linux binaries only as plain files. The apt repository for #153, openjavaformat/apt, built its own .deb packages from them, outside the release, without the release's signatures and checksums. The binaries came from the newest images, ubuntu-latest and ubuntu-26.04-arm: a binary linked against a newer glibc can need that glibc to start, so the newest image is the one most likely to leave older systems behind.

After this PR

  • A release also carries open-java-format_<version>_amd64.deb and open-java-format_<version>_arm64.deb, signed and in checksums_sha256.txt like every other file. They install /usr/bin/open-java-format and are what openjavaformat/apt serves (Serve the release's own .deb packages apt#1); sudo apt install ./<file>.deb works without it.
  • The packaging is a composite action, .github/actions/deb-package. It reads the architecture and the libc6 dependency off the binary: the newest GLIBC_ symbol version it asks for, 2.34 today, so that apt refuses the package on an older system instead of installing a binary that does not start there. It then installs the package with apt on Ubuntu 22.04 and Debian 12, runs --version and formats a file. In a release the files take the time of the tag's commit, so a re-run makes the same bytes.
  • release.yml packages each Linux binary on the runner that built it, and the draft release waits for both packages. ci.yml runs the same action on every pull request, under the version the binary prints.
  • CI and the release build Linux on the previous LTS, ubuntu-24.04 and ubuntu-24.04-arm, rather than the newest images; the other platforms stay on the newest. 22.04 would match the oldest system better, but GitHub retires it on April 17, 2027, with failing brownouts from March 23 ([Ubuntu] The Ubuntu 22 based runner images will begin deprecation on September 17th and will be fully unsupported by April 17th for GitHub Actions and Azure DevOps actions/runner-images#14254). If a 24.04 build needs a newer glibc than 2.34, the package says so in its libc6 dependency. Only build is a required check, so the renamed native (…) jobs block nothing.

Checked locally: the action's build step, run in Docker on 21.1.1's binaries, gives the same bytes as before; its install step passes on Ubuntu 22.04 and Debian 12 and fails on a wrong version. Earlier, the same packages installed and ran on Ubuntu 22.04, 24.04 and 26.04 and on Debian 12 and 13. A JReleaser jreleaserChecksum --dryrun in a clone lists both packages in checksums_sha256.txt, and the release configuration fails when one is missing. The release jobs themselves run only on a tag.

Possible downsides?

The draft release now also waits for the two package jobs, so a failure there holds it back; "Re-run failed jobs" builds them again. When ubuntu-24.04 is retired from GitHub's runners, the Linux jobs have to move to the next image by hand.

A release now carries open-java-format_<version>_amd64.deb and
open-java-format_<version>_arm64.deb next to the plain Linux binaries,
signed and in checksums_sha256.txt like every other file. They install
/usr/bin/open-java-format and are what the apt repository,
openjavaformat/apt, serves (#153); `sudo apt install ./<file>.deb` works
without it.

open-java-format-native/deb/build-deb.sh packages a binary. It reads
the architecture and the libc6 dependency off the binary itself: the
newest GLIBC_ symbol version it asks for, 2.34 today, so that a build on
a newer image cannot reach an older system and fail to start there; apt
refuses the package instead. The files take the time of the tag's
commit, so a re-run makes the same bytes.

The release builds each package on the runner its binary came from and
installs it with apt on Ubuntu 22.04 and Debian 12 before the draft
release collects it. CI does the same on every pull request, under the
version the binary prints.
The Linux binaries came from ubuntu-latest and ubuntu-26.04-arm, the
newest images. A binary linked against a newer glibc can need that glibc
to start, so the newest image is the one most likely to leave older
systems behind. CI and the release now build Linux on the previous LTS,
ubuntu-24.04 and ubuntu-24.04-arm; the other platforms stay on the
newest images.

The packaging moves from two shell scripts into a composite action,
.github/actions/deb-package, which both workflows call: it builds the
package and installs it on Ubuntu 22.04 and Debian 12. The package is
the same bytes as before.
@abashev abashev changed the title Release the Linux binaries as .deb packages too Release the Linux binaries as .deb packages, built on Ubuntu 24.04 Nov 28, 2026
The packages, the apt repository and the docs say the binaries run on
glibc 2.34 or later, Ubuntu 22.04 and newer. Building on 22.04, glibc
2.35, keeps that true by construction rather than by luck of which
symbols a newer glibc versioned.
@abashev abashev changed the title Release the Linux binaries as .deb packages, built on Ubuntu 24.04 Release the Linux binaries as .deb packages, built on Ubuntu 22.04 Nov 28, 2026
GitHub retires ubuntu-22.04 and ubuntu-22.04-arm on April 17, 2027, with
failing brownouts from March 23 (actions/runner-images#14254), and
Ubuntu 22.04's standard support ends then too. The previous LTS,
24.04, is the image that stays. The packages' libc6 dependency is still
read off each binary, so a higher glibc need shows in the package
instead of in a binary that does not start.
@abashev abashev changed the title Release the Linux binaries as .deb packages, built on Ubuntu 22.04 Release the Linux binaries as .deb packages, built on Ubuntu 24.04 Nov 28, 2026
Outside a tag the binary prints a bare commit hash as its version, such
as 244d57b, and a Debian version must start with a digit: about six
hashes in sixteen would have failed the native job. Such a version now
gets 0~ in front, which sorts below every release; a release version
is unchanged.
@abashev
abashev merged commit d51c686 into 21.X.X Nov 28, 2026
17 checks passed
@abashev
abashev deleted the abashev/install-on-ubuntu-with-apt-from-a-repository-of branch November 28, 2026 18:59
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