Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Pull-request gate: the full suite on Ubuntu and Windows. Both jobs run in parallel and are
# cancelled when the PR is updated.
# Pull-request gate: the full suite on Ubuntu and Windows, plus the static musl release binary
# smoke-tested on old glibc and Alpine. The jobs run in parallel and are cancelled when the PR
# is updated.
name: ci

on:
Expand Down Expand Up @@ -32,6 +33,21 @@ jobs:
- run: cmp target/release/plannotator-tui herdr/bin/plannotator-tui.exe
- run: ./herdr/bin/plannotator-tui.exe --version

# Same build and smoke test as the musl entry in release.yml, so a break shows up here
# rather than on release day.
musl:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update && sudo apt-get install -y musl-tools
- run: cargo build --release -p plannotator-tui --target x86_64-unknown-linux-musl
- run: sh scripts/smoke-musl-containers.sh target/x86_64-unknown-linux-musl/release/plannotator-tui

check-windows:
runs-on: windows-latest
timeout-minutes: 30
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
matrix:
include:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
- { target: x86_64-unknown-linux-musl, os: ubuntu-22.04 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-22.04-arm }
- { target: x86_64-apple-darwin, os: macos-15-intel }
- { target: aarch64-apple-darwin, os: macos-15 }
Expand All @@ -41,7 +42,13 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: install musl linker
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get update && sudo apt-get install -y musl-tools
- run: cargo build --release -p plannotator-tui --target ${{ matrix.target }}
- name: smoke-test musl on older glibc and Alpine
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sh scripts/smoke-musl-containers.sh "target/${{ matrix.target }}/release/plannotator-tui"
- name: name the asset by target
shell: bash
run: |
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ Homebrew 6 asks you to trust a third-party tap once before installing from it.
Prebuilt binaries for macOS, Linux and Windows are on the
[releases page](https://github.com/plannotator/plannotator-tui/releases).

On x86_64 Linux, choose `plannotator-tui-x86_64-unknown-linux-musl` if the GNU
binary reports a missing `GLIBC_*` version, or if you use Alpine. This static
musl build does not require system glibc or a local Rust toolchain. Existing
GNU/Linux binaries remain available. Verify your download against `SHA256SUMS`
from the same release, make it executable, and put it on your `PATH` as
`plannotator-tui`.

## Use

```sh
Expand Down
10 changes: 10 additions & 0 deletions scripts/smoke-musl-containers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# Run scripts/smoke-musl.sh against a musl binary in minimal containers: Debian Bullseye
# (glibc 2.31, older than the GNU binary needs) and Alpine (no glibc). Shared by the ci and
# release workflows so both test the same images. The binary path is relative to the repo root.
set -eu
binary="${1:?usage: sh scripts/smoke-musl-containers.sh <binary>}"
for image in debian:bullseye-slim alpine:3.24; do
echo "== $image"
docker run --rm -v "$PWD:/work:ro" -w /work "$image" sh scripts/smoke-musl.sh "$binary"
done
28 changes: 28 additions & 0 deletions scripts/smoke-musl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
# Run against a musl release binary on the host or inside a minimal Linux container.
# No Rust toolchain, compiler, or interactive terminal is required.
set -eu
binary="${1:?usage: sh scripts/smoke-musl.sh <binary>}"
case "$binary" in
/*) ;;
*) binary="$PWD/$binary" ;;
esac
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
test "$("$binary" --version)" = "plannotator-tui $version"

tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
export PLANNOTATOR_DATA_DIR="$tmp/data"
export PLANNOTATOR_FEEDBACK_HISTORY=0
document="$tmp/smoke.md"
printf '# Musl compatibility test\n\nThis binary runs without glibc.\n' >"$document"

test "$("$binary" --export "$document")" = "No annotations."
"$binary" --annotate "$document" 'without glibc' 'Musl smoke test feedback'
"$binary" --export "$document" >"$tmp/feedback.md"
grep -Fq '# Annotations on smoke.md' "$tmp/feedback.md"
grep -Fq 'Comment on: "without glibc"' "$tmp/feedback.md"
grep -Fq '> Musl smoke test feedback' "$tmp/feedback.md"
"$binary" --snapshot "$document" 80 24 0 >"$tmp/snapshot.txt"
grep -Fq 'Musl compatibility test' "$tmp/snapshot.txt"
echo "musl smoke test passed"
Loading