Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(fix) Linux AppImage runs on RHEL 8/9 (glibc 2.28 baseline) (#82) (#189)

Egor Khindikaynen07333512e3d1
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 7e3c3b71..e00c464e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -162,7 +162,11 @@ jobs:
# --------------------------------------------------------------------------------
# Linux — one AppImage per arch. The native .so can't be cross-compiled, so each
- # arch builds on its own native runner.
+ # arch builds on its own native runner — inside a manylinux_2_28 container
+ # (AlmaLinux 8: glibc 2.28, gcc-toolset-14 pre-enabled on PATH) so the shipped
+ # binaries also run on RHEL/Alma/Rocky 8 & 9 and every distro with glibc >= 2.28.
+ # Building on the runner image itself (glibc 2.39) would tie them to it. The
+ # check-glibc-floor.sh step below fails the build on any regression above it.
# --------------------------------------------------------------------------------
linux:
name: Build Linux (${{ matrix.arch }})
@@ -174,9 +178,12 @@ jobs:
include:
- arch: x64
runner: ubuntu-latest
+ image: quay.io/pypa/manylinux_2_28_x86_64
- arch: arm64
runner: ubuntu-24.04-arm
+ image: quay.io/pypa/manylinux_2_28_aarch64
runs-on: ${{ matrix.runner }}
+ container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v5
with:
@@ -187,15 +194,19 @@ jobs:
- uses: actions/setup-node@v5 # builds the Nota Remote phone page (Vite: Node 20.19+ / 22.12+)
with:
node-version: '22'
+ # dnf names (EL8); cmake and gcc-toolset-14 (C++20) ship with the image, so
+ # only the engine's library headers, ninja, mksquashfs and the .NET SDK's
+ # libicu come from here. No sudo: the container already runs as root.
- name: Install build + packaging deps
run: |
- sudo apt-get update -qq
- sudo apt-get install -y --no-install-recommends \
- cmake ninja-build build-essential curl ca-certificates file squashfs-tools \
- libasound2-dev libx11-dev libxext-dev libxrandr-dev libxinerama-dev \
- libxcursor-dev libfreetype6-dev libfontconfig1-dev
+ dnf install -y --setopt=install_weak_deps=False \
+ alsa-lib-devel libX11-devel libXext-devel libXrandr-devel \
+ libXinerama-devel libXcursor-devel freetype-devel fontconfig-devel \
+ ninja-build squashfs-tools file libicu
- name: Package AppImage
run: bash scripts/package-linux.sh ${{ matrix.arch }}
+ - name: Guard the glibc floor (the AppImage must run on glibc >= 2.28)
+ run: bash scripts/check-glibc-floor.sh dist/Nota.AppDir/usr/bin
- uses: actions/upload-artifact@v6
with:
name: linux-${{ matrix.arch }}
diff --git a/.specify/bugs/linux-glibc-baseline/assessment.md b/.specify/bugs/linux-glibc-baseline/assessment.md
new file mode 100644
index 00000000..0ac868c3
--- /dev/null
+++ b/.specify/bugs/linux-glibc-baseline/assessment.md
@@ -0,0 +1,137 @@
+# Bug Assessment: Linux AppImage requires too-new glibc (fails on RHEL 8/9)
+
+- **Slug**: linux-glibc-baseline
+- **Created**: 2026-10-18
+- **Source**: https://github.com/nota-daw/nota/issues/82
+ - Host parsed from URL: `github.com` — URL trust policy branch: `allowlisted` (public bug-report host).
+- **Verdict**: valid
+- **Severity**: medium
+
+## Report (summarized)
+
+Issue #82 «Linux: build the AppImage against an older glibc so it runs on RHEL 8/9» (open, label
+`enhancement`). The Linux release jobs build on `ubuntu-latest` / `ubuntu-24.04-arm` (glibc 2.39),
+so the produced binaries (`libnota_engine.so`, `nota-scanworker`, the .NET apphost) refuse to load
+on RHEL/Alma/Rocky 8 (glibc 2.28) and 9 (2.34). The issue proposes building inside
+`manylinux_2_28` containers (AlmaLinux 8) with `gcc-toolset-13/14` for C++20, static-linking
+libstdc++/libgcc where needed, adding a CI `objdump -T` GLIBC-version guard, checking any bundled
+prebuilt binaries' glibc floor, documenting the FUSE requirement, and verifying by launching the
+AppImage in `rockylinux:8`/`:9` containers. Area: Build / packaging / CI. No comments.
+
+## Symptom
+
+The Linux AppImage built by CI does not start on distros with glibc < 2.39 (concretely RHEL 8/9
+and derivatives): the dynamic loader rejects `libnota_engine.so` / `nota-scanworker` with
+`GLIBC_x.xx not found`. Expected: the AppImage runs on glibc ≥ 2.28 (RHEL 8-era and practically
+every maintained distro).
+
+## Reproduction
+
+1. Download `Nota-<version>-x86_64.AppImage` from a release (built by `.github/workflows/release.yml`
+ on `ubuntu-latest`).
+2. On RHEL 9 (glibc 2.34): `./Nota-*.AppImage` → loader error naming a `GLIBC_2.3x` symbol.
+3. Confirm the floor: `objdump -T usr/bin/libnota_engine.so | grep GLIBC_ | sort -u` inside the
+ extracted AppImage shows requirements above the host's glibc.
+
+(Not reproduced locally in this assessment — macOS dev machine; the mechanism is well understood
+and the issue reporter verified the glibc versions. Marking reproduction as discoverable-from-artifact.)
+
+## Suspected Code Paths
+
+- `.github/workflows/release.yml:167-203` — the `linux` job: matrix runners `ubuntu-latest` /
+ `ubuntu-24.04-arm` (both glibc 2.39), apt-based dep install. This is the root cause and the
+ primary place to fix (add `container:` per matrix leg, swap apt→dnf package names, drop `sudo`).
+- `scripts/package-linux.sh` — the whole packaging flow. Already container-friendly: sets
+ `APPIMAGE_EXTRACT_AND_RUN=1` (no FUSE needed), downloads `appimagetool` if absent, guards against
+ cross-arch build dirs. Needs only: (a) libstdc++/libgcc static link flags for the engine when
+ built with gcc-toolset, (b) a possible `-comp` fallback if EL8 `mksquashfs` (4.3, no zstd) gets
+ used by the manual path, (c) hint-text updates (the macOS helper message and the mksquashfs error
+ mention apt names).
+- `src/native/nota.engine/CMakeLists.txt:134-146` — Linux link config: `asound pthread dl m` +
+ static FLAC/LAME + whole-archive `nota_pluginhost` (JUCE static, links X11/freetype/fontconfig at
+ build time). No runtime .so deps beyond `libasound.so.2` (present on RHEL 8) — so a
+ manylinux_2_28-built binary is runtime-portable once the glibc/libstdc++ floor is pinned.
+- `.github/workflows/ci.yml:70` — CI also builds on `ubuntu-latest`, but it never ships artifacts;
+ glibc there is irrelevant. No change required (optional hardening only).
+- `src/managed/Nota.Infrastructure/ModelStore/ModelCatalog.cs` — AI models (htdemucs ONNX,
+ onnxruntime) are downloaded at runtime from GitHub releases, **not bundled** in the AppImage;
+ Microsoft's onnxruntime Linux builds target an old glibc floor. Only worth a spot-check, no
+ packaging change.
+
+## Root Cause Hypothesis
+
+High confidence. The Linux release binaries are compiled and linked on Ubuntu 24.04 (glibc 2.39);
+ELF symbol versioning ties them to that glibc, so any older host fails at load. Nothing in the
+codebase prevents an old-baseline build: the engine's only non-static runtime dependency is
+`libasound`, the .NET self-contained runtime / Avalonia / SkiaSharp natives already target old
+glibc, and `package-linux.sh` already runs FUSE-less in containers. The fix is confined to CI job
+configuration plus small packaging-script adjustments.
+
+## Proposed Remediation
+
+**Preferred** (container baseline — the issue's own plan, and the standard practice):
+
+1. In `release.yml`, give each Linux matrix leg a `container:` — `quay.io/pypa/manylinux_2_28_x86_64`
+ (x64 on `ubuntu-latest`) and `quay.io/pypa/manylinux_2_28_aarch64` (arm64 on `ubuntu-24.04-arm`).
+ Replace the apt step with dnf installs (`alsa-lib-devel libX11-devel libXext-devel
+ libXrandr-devel libXinerama-devel libXcursor-devel freetype-devel fontconfig-devel
+ squashfs-tools …`, possibly enabling powertools/CRB + EPEL, which manylinux images largely have
+ set up) and a `gcc-toolset` providing C++20; no `sudo` inside the container. `actions/checkout`,
+ `setup-dotnet`, `setup-node` all work in glibc containers.
+2. Pin the C++ runtime floor: build the engine with `-static-libstdc++ -static-libgcc` (gcc-toolset's
+ libstdc++ is newer than RHEL 8's system one) — pass via `package-linux.sh` as CMake linker flags
+ so `CMakeLists.txt` stays untouched, or as a small CMake option.
+3. Add a regression guard step after packaging: `objdump -T` over the shipped ELF files
+ (`libnota_engine.so`, `nota-scanworker`, `Nota.App`), fail if any `GLIBC_` version exceeds 2.28.
+4. Verify: manual `workflow_dispatch` (linux) run, then launch the built AppImage with
+ `--appimage-extract-and-run` inside `rockylinux:8` and `rockylinux:9` containers (at minimum
+ headless start / smoke; `tests/Nota.SmokeTest` drives the engine end-to-end).
+5. Docs: one line in the Linux install docs (nota-docs) about FUSE / `--appimage-extract-and-run`
+ and the supported-distro floor.
+
+**Alternatives**:
+- `rockylinux:8` plain container instead of manylinux (same glibc; fewer preinstalled niceties —
+ you wire up EPEL/CRB and the toolset yourself). Slightly more YAML, zero pypa dependency.
+- Build on Ubuntu with a old-glibc sysroot / `cereal`-style toolchain or zig cc targeting glibc
+ 2.28. More fragile than a container of the real distro; not recommended.
+
+**Effort estimate**: the code change itself is small — ~30–40 lines of workflow YAML, ~10 lines of
+script tweaks, ~15 lines for the guard step. Realistically **half a day to a day and a half**
+including 2–3 CI iteration cycles (each linux-only `workflow_dispatch` run is the slow part) and
+the rockylinux verification launches. No engine C++ changes, no API/schema impact, nothing
+user-facing except the expanded distro support.
+
+**Files likely to change**:
+- `.github/workflows/release.yml` (container + dnf deps + glibc guard step)
+- `scripts/package-linux.sh` (linker flags, mksquashfs `-comp` fallback, hint text)
+- `../nota-docs` (one docs line, optional, separate repo/PR)
+
+**Tests to add or update**:
+- CI glibc-floor guard (objdump GLIBC check) — this is the automated lock-in.
+- Optional: a workflow step (or periodic job) launching the AppImage in `rockylinux:8` with
+ `--appimage-extract-and-run` to prove it loads.
+
+## Risks & Considerations
+
+- **gcc-toolset activation**: the toolset must be on PATH for cmake (`scl enable` / image default).
+ manylinux images ship an enabled modern GCC by default — verify which version; C++20 needs ≥ 10
+ (prefer 12+).
+- **libstdc++ runtime**: without `-static-libstdc++` the gcc-toolset-built binary would demand the
+ newer libstdc++ and fail on RHEL 8 exactly like the glibc failure — the guard step should also
+ check `GLIBCXX_` versions, not just `GLIBC_`.
+- **mksquashfs/zstd**: EL8's squashfs-tools 4.3 lacks zstd. Primary path (appimagetool with
+ `APPIMAGE_EXTRACT_AND_RUN=1`) should be unaffected, but the manual fallback in
+ `package-linux.sh:157` uses `-comp zstd` — may need a gzip fallback on EL8.
+- **Actions in containers**: JS actions run under the runner's node — standard, but the container
+ must not break `setup-dotnet`'s install script (glibc-based, fine on 2.28).
+- **Blast radius**: confined to the Linux release job; macOS/Windows jobs untouched. A bad change
+ is caught by the manual-run path before any tag, and reverting is trivial.
+- **SkiaSharp/Avalonia/.NET natives**: already old-glibc per the issue; the objdump guard over the
+ whole AppDir would prove it for every shipped ELF, not just ours.
+
+## Open Questions
+
+- [NEEDS CLARIFICATION: manylinux_2_28 vs rockylinux:8 as the base — recommend manylinux (preconfigured
+ EPEL/toolset, official arm64 image), but the choice is yours.]
+- [NEEDS CLARIFICATION: should the rockylinux launch/smoke be a permanent CI step or a one-off manual
+ verification of this change? Recommend one-off + keep the objdump guard permanent.]
diff --git a/.specify/bugs/linux-glibc-baseline/fix.md b/.specify/bugs/linux-glibc-baseline/fix.md
new file mode 100644
index 00000000..6dbcf3cc
--- /dev/null
+++ b/.specify/bugs/linux-glibc-baseline/fix.md
@@ -0,0 +1,113 @@
+# Bug Fix: Linux AppImage glibc baseline (runs on RHEL 8/9)
+
+- **Slug**: linux-glibc-baseline
+- **Fixed**: 2026-10-18
+- **Assessment**: ./assessment.md
+- **Status**: applied (CI verification run pending — see Local Verification)
+
+## Summary
+
+The Linux release now builds inside `manylinux_2_28` containers (AlmaLinux 8, glibc 2.28,
+gcc-toolset-14) instead of on the Ubuntu 24.04 runners (glibc 2.39), with the engine's C++
+runtime linked statically so nothing references a newer libstdc++ than RHEL 8's. A new
+`check-glibc-floor.sh` guard fails the release build if any shipped ELF would need glibc > 2.28
+or libstdc++ newer than GCC 8's.
+
+## Changes
+
+| File | Change | Notes |
+|------|--------|-------|
+| `.github/workflows/release.yml` | modified | linux matrix legs get `container: quay.io/pypa/manylinux_2_28_{x86_64,aarch64}`; apt step → dnf (no sudo, root container); new "Guard the glibc floor" step after packaging |
+| `scripts/check-glibc-floor.sh` | added | scans every ELF under the AppDir payload for `GLIBC_`/`GLIBCXX_`/`CXXABI_` symbol versions above the 2.28 / 3.4.25 / 1.3.11 baseline; exits 1 listing offenders |
+| `scripts/package-linux.sh` | modified | engine build passes `-static-libstdc++ -static-libgcc` (toolset libstdc++ is newer than RHEL 8's system one); manual mksquashfs path falls back from zstd to gzip (EL8 squashfs-tools 4.3 has no zstd); error hint made distro-agnostic |
+| `scripts/build-linux.sh` | modified | comment only: EL8/dnf equivalent of the dev-dependency list |
+| `CHANGELOG.md` | modified | [Unreleased] › Fixed entry referencing nota-daw/nota#82 |
+| `FEATURES.md` | modified | Linux bullet states the glibc ≥ 2.28 floor (RHEL/Alma/Rocky 8+, Debian 10+) |
+
+## Diff Highlights
+
+release.yml — per-arch container + guard step:
+
+```yaml
+ include:
+ - arch: x64
+ runner: ubuntu-latest
+ image: quay.io/pypa/manylinux_2_28_x86_64
+ - arch: arm64
+ runner: ubuntu-24.04-arm
+ image: quay.io/pypa/manylinux_2_28_aarch64
+ runs-on: ${{ matrix.runner }}
+ container: ${{ matrix.image }}
+ ...
+ - name: Install build + packaging deps
+ run: |
+ dnf install -y --setopt=install_weak_deps=False \
+ alsa-lib-devel libX11-devel libXext-devel libXrandr-devel \
+ libXinerama-devel libXcursor-devel freetype-devel fontconfig-devel \
+ ninja-build squashfs-tools file libicu
+ - name: Package AppImage
+ run: bash scripts/package-linux.sh ${{ matrix.arch }}
+ - name: Guard the glibc floor (the AppImage must run on glibc >= 2.28)
+ run: bash scripts/check-glibc-floor.sh dist/Nota.AppDir/usr/bin
+```
+
+package-linux.sh — static C++ runtime into the engine build:
+
+```bash
+STATIC_CXX_RT="-static-libstdc++ -static-libgcc"
+cmake -G Ninja -S src/native/nota.engine -B "${NATIVE}" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SHARED_LINKER_FLAGS="${STATIC_CXX_RT}" \
+ -DCMAKE_EXE_LINKER_FLAGS="${STATIC_CXX_RT}" >/dev/null
+```
+
+## Tests Added or Updated
+
+- `scripts/check-glibc-floor.sh` (run by release CI on every Linux build) — pins the whole
+ shipped payload, not just our binaries: our `.so`/scanworker/apphost plus the bundled
+ .NET/Avalonia/SkiaSharp natives. A build linked on a newer image fails the release.
+
+## Local Verification
+
+Everything below ran on this machine (macOS) against the real target image under Docker
+(x86_64 via QEMU; compilation/linking results are unaffected by emulation):
+
+- `quay.io/pypa/manylinux_2_28_x86_64`: gcc-toolset-14 (GCC 14.2.1) pre-enabled, cmake 4.4.4
+ present, EPEL repos configured — confirmed from the image itself and the pypa build scripts.
+- `-static-libstdc++ -static-libgcc` into a **shared** library (the main open risk in the
+ assessment): links cleanly; `objdump -T` shows **zero** `GLIBCXX_`/`CXXABI_` references and
+ max `GLIBC_2.25`. Same for a plain executable.
+- The exact CI dnf install: all package names resolve on EL8 (alsa-lib-devel 1.2.10,
+ ninja-build 1.8.2, squashfs-tools 4.3, …). mksquashfs 4.3 confirmed **without** zstd → the
+ gzip fallback in package-linux.sh is required and covers it.
+- .NET 10 SDK (10.0.402) in the container: `dotnet restore` from nuget.org (HTTPS via the
+ image's OpenSSL) and `dotnet run` both work — after installing `libicu`, which the bare
+ AlmaLinux 8 base lacks.
+- `check-glibc-floor.sh` functional tests in the same container: real static binaries → OK
+ (exit 0); stubbed symbol tables → correctly fails (exit 1) on `GLIBC_2.34`,
+ `GLIBCXX_3.4.33`, `CXXABI_1.3.13` and the numeric edge `GLIBC_2.28.1 > 2.28`, listing each
+ offender; good-only → exit 0; missing path → clear error, exit 1.
+- `bash -n` on all three scripts; `release.yml` parses as YAML.
+
+Not verifiable locally: the appimagetool primary packaging path inside the container — its
+static-PIE runtime doesn't exec under QEMU (the exact limitation package-linux.sh's manual
+fallback exists for, now with gzip). It runs on the real x86_64 runner today and the aarch64
+runner is native; the manual CI run is the proof.
+
+## Deviations from Assessment
+
+- `libicu` added to the CI dnf deps (not in the assessment's package list): the .NET SDK
+ hard-aborts without ICU and the AlmaLinux 8 base image doesn't include it. Build-time only;
+ desktop distros the AppImage targets ship libicu anyway.
+- The assessment's "verify by launching the AppImage in rockylinux:8/9 containers" is not part
+ of this change's CI; it stays a manual/`/speckit-bug-test` step (see Follow-ups).
+
+## Follow-ups
+
+- Push the branch and run Actions ▸ Release ▸ Run workflow with `platforms=linux` (no release
+ is created) — the real end-to-end proof, including appimagetool and the JUCE build under GCC 14.
+- Then `/speckit-bug-test slug=linux-glibc-baseline`: launch the produced AppImage with
+ `--appimage-extract-and-run` in `rockylinux:8` and `rockylinux:9` containers.
+- nota-docs (separate repo): one line on the Linux install/download page — supported distros
+ (glibc ≥ 2.28) and FUSE / `--appimage-extract-and-run` without it.
+- Close nota-daw/nota#82 when the verified release ships.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bb80df7..a7493ca7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -120,6 +120,11 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
Windows and Linux) always starts a new track.
### Fixed
+- **Linux: the AppImage runs on RHEL-class distros** (nota-daw/nota#82): Linux releases are
+ now built against a glibc 2.28 baseline (AlmaLinux 8 container) instead of the build
+ machine's glibc 2.39, so the AppImage starts on RHEL/Alma/Rocky 8 and 9, Debian 10+ and
+ every distro with glibc ≥ 2.28. CI now rejects any shipped binary that would need a newer
+ glibc or libstdc++.
- **Drum Rack crash while loading a kit** (nota-daw/nota#177): building a Drum Rack kit (or
any burst of rack edits) while audio was running could crash the audio engine with a
use-after-free in the rack's render (seen on macOS). A rack keeps every replaced chain
diff --git a/FEATURES.md b/FEATURES.md
index 1e194cad..36d2a06e 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -33,7 +33,8 @@ Contents
MIDI, **VST3** hosting. Distributed as an Inno Setup installer
(`Nota-Setup-<version>-x64.exe`; arm64 is also built).
- **Linux**: PulseAudio/ALSA (via miniaudio), ALSA MIDI (RtMidi), **VST3** hosting.
- Distributed as a portable **AppImage** (`Nota-<version>-<arch>`). Settings live in
+ Distributed as a portable **AppImage** (`Nota-<version>-<arch>`) that runs on any distro
+ with glibc ≥ 2.28 (RHEL/Alma/Rocky 8+, Debian 10+, Ubuntu 18.10+). Settings live in
`~/.config/nota` (or `$XDG_CONFIG_HOME/nota`).
Architecture: engine and DSP in C++20 (CMake + Ninja), UI in .NET 10 / Avalonia 12 (C#),
diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh
index dda0855a..f4cbd82d 100755
--- a/scripts/build-linux.sh
+++ b/scripts/build-linux.sh
@@ -9,6 +9,10 @@
# sudo apt install build-essential cmake ninja-build libasound2-dev \
# libx11-dev libxext-dev libxrandr-dev libxinerama-dev libxcursor-dev \
# libfreetype6-dev libfontconfig1-dev
+# on EL8 (e.g. the manylinux_2_28 container the release builds in):
+# dnf install gcc-toolset-14-gcc-c++ ninja-build alsa-lib-devel libX11-devel \
+# libXext-devel libXrandr-devel libXinerama-devel libXcursor-devel \
+# freetype-devel fontconfig-devel
# (miniaudio runtime-links PulseAudio/ALSA via dlopen, so libpulse/libasound are
# not needed at link time — only libasound2-dev for RtMidi.)
#
diff --git a/scripts/check-glibc-floor.sh b/scripts/check-glibc-floor.sh
new file mode 100755
index 00000000..de64c7ba
--- /dev/null
+++ b/scripts/check-glibc-floor.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: AGPL-3.0-only
+#
+# Guard the Linux release baseline: every ELF under the given tree (the AppDir
+# payload of the AppImage) must reference only GLIBC_ <= 2.28 and
+# GLIBCXX_/CXXABI_ <= RHEL 8's system libstdc++ (GCC 8: 3.4.25 / 1.3.11), so the
+# AppImage runs on RHEL/Alma/Rocky 8 and 9 and every newer distro. Release CI
+# (.github/workflows/release.yml) runs this right after packaging and fails the
+# build on the first regression — a binary linked on a newer build image quietly
+# demands a newer glibc/libstdc++ and stops loading on old distros otherwise.
+#
+# Usage: scripts/check-glibc-floor.sh [file-or-dir ...] (default: dist/Nota.AppDir/usr/bin)
+
+set -euo pipefail
+
+MAX_GLIBC="2.28"
+MAX_GLIBCXX="3.4.25" # GCC 8 — RHEL 8's system libstdc++
+MAX_CXXABI="1.3.11"
+
+# true when $1 sorts after $2 in version order (sort -V)
+too_new() {
+ [ "$(printf '%s\n%s\n' "$2" "$1" | sort -V | tail -n1)" != "$2" ]
+}
+
+targets=("$@")
+[ ${#targets[@]} -gt 0 ] || targets=("dist/Nota.AppDir/usr/bin")
+
+# Collect ELFs: everything the loader could refuse on an old distro — our own
+# engine + scanworker + apphost, plus the bundled .NET/Avalonia/SkiaSharp libs.
+elfs=()
+for t in "${targets[@]}"; do
+ if [ -d "$t" ]; then
+ while IFS= read -r -d '' f; do
+ case "$(file -b "$f")" in ELF*) elfs+=("$f") ;; esac
+ done < <(find "$t" -type f -print0)
+ elif [ -f "$t" ]; then
+ case "$(file -b "$t")" in ELF*) elfs+=("$t") ;; esac
+ else
+ echo "check-glibc-floor: no such file or directory: ${t}" >&2
+ exit 1
+ fi
+done
+if [ ${#elfs[@]} -eq 0 ]; then
+ echo "check-glibc-floor: no ELF files found under ${targets[*]}" >&2
+ exit 1
+fi
+
+fail=0
+for f in "${elfs[@]}"; do
+ refs="$(objdump -T "$f" 2>/dev/null | grep -oE '(GLIBC|GLIBCXX|CXXABI)_[0-9]+(\.[0-9]+)*' | sort -u || true)"
+ for ref in $refs; do
+ case "$ref" in
+ GLIBC_*) ver="${ref#GLIBC_}"; max="${MAX_GLIBC}" ;;
+ GLIBCXX_*) ver="${ref#GLIBCXX_}"; max="${MAX_GLIBCXX}" ;;
+ CXXABI_*) ver="${ref#CXXABI_}"; max="${MAX_CXXABI}" ;;
+ *) continue ;;
+ esac
+ if too_new "$ver" "$max"; then
+ echo "check-glibc-floor: FAIL ${f#./}: needs ${ref} (baseline ${ref%%_*} ${max})" >&2
+ fail=1
+ fi
+ done
+done
+
+if [ "$fail" -ne 0 ]; then
+ echo "check-glibc-floor: baseline exceeded — rebuild in the manylinux_2_28 container (the" >&2
+ echo "linux job of .github/workflows/release.yml); binaries built on a newer image only run" >&2
+ echo "on distros with a matching glibc/libstdc++." >&2
+ exit 1
+fi
+echo "check-glibc-floor: ${#elfs[@]} ELFs OK (GLIBC_ <= ${MAX_GLIBC}, GLIBCXX_ <= ${MAX_GLIBCXX}, CXXABI_ <= ${MAX_CXXABI})"
diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh
index 9033b7c9..b6a69674 100755
--- a/scripts/package-linux.sh
+++ b/scripts/package-linux.sh
@@ -70,8 +70,17 @@ if [ -f "${CACHE}" ]; then
rm -rf "${NATIVE}"
fi
fi
+# -static-libstdc++ -static-libgcc: the release container's toolset compiler
+# (gcc-toolset-14 in manylinux_2_28) carries a newer libstdc++ than the baseline
+# distro's (RHEL 8 ships GCC 8); linked dynamically the engine would demand the
+# newer one and stop loading on the user's machine. Statically linked it carries
+# no GLIBCXX_/CXXABI_ versioned references at all — scripts/check-glibc-floor.sh
+# verifies that. Harmless on newer local build hosts.
+STATIC_CXX_RT="-static-libstdc++ -static-libgcc"
cmake -G Ninja -S src/native/nota.engine -B "${NATIVE}" \
- -DCMAKE_BUILD_TYPE=Release >/dev/null
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SHARED_LINKER_FLAGS="${STATIC_CXX_RT}" \
+ -DCMAKE_EXE_LINKER_FLAGS="${STATIC_CXX_RT}" >/dev/null
cmake --build "${NATIVE}" >/dev/null
echo "==> Publishing managed app (${RID}, self-contained)…"
@@ -144,7 +153,7 @@ build_with_appimagetool() {
build_manually() {
echo " assembling AppImage by hand (mksquashfs + type2 runtime)…"
if ! command -v mksquashfs >/dev/null; then
- echo "error: need squashfs-tools (mksquashfs) for the manual AppImage path — apt install squashfs-tools" >&2
+ echo "error: need squashfs-tools (mksquashfs) for the manual AppImage path — install it (apt on Debian/Ubuntu, dnf on EL)" >&2
exit 1
fi
local runtime="dist/runtime-${AI_ARCH}" # cached under dist/ (gitignored)
@@ -152,9 +161,13 @@ build_manually() {
curl -fsSL -o "${runtime}" \
"https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-${AI_ARCH}"
fi
+ # zstd where available; the release container's EL8 squashfs-tools 4.3 has no
+ # zstd, and gzip is the AppImage type2 default anyway.
+ local comp="gzip"
+ mksquashfs -help 2>&1 | grep -q zstd && comp="zstd" || true
local sq="dist/nota-${AI_ARCH}.squashfs"
rm -f "${sq}"
- mksquashfs "${APPDIR}" "${sq}" -root-owned -noappend -quiet -comp zstd
+ mksquashfs "${APPDIR}" "${sq}" -root-owned -noappend -quiet -comp "${comp}"
cat "${runtime}" "${sq}" > "${OUT}" # type2 runtime finds the appended filesystem itself
chmod +x "${OUT}"
rm -f "${sq}"