Skip to content

ci: add Linux x64 CI workflow (partially closes gap #9) - #941

Closed
squareSphere29 wants to merge 4 commits into
storytold:mainfrom
squareSphere29:ci/linux-x64-tests
Closed

squareSphere29 wants to merge 4 commits into
storytold:mainfrom
squareSphere29:ci/linux-x64-tests

Conversation

@squareSphere29

Copy link
Copy Markdown
Contributor
  • Runs cargo xtask ci on ubuntu-22.04 for every push/PR to main
  • Mirrors FreeBSD/release.yml patterns: pinned actions, craft-fonts, deps
  • Hardened per adversarial review:
    • retry=3 on checkout (x2) and rust-toolchain
    • rust-cache key includes Cargo.lock hash (prevents cache poisoning)
    • actions/cache on apt packages (saves 2-3 min/run)
    • RUST_TEST_THREADS=4 (prevents frame-budget flakes)
    • CARGO_TARGET_DIR isolated per run
    • timeout-minutes: 45 (realistic, catches hangs)
  • Partially addresses Gap .mplumpack - preset compatibility needed #9: "Tests don't run in CI on macOS, Windows or Linux x64"
    • Linux x64: ✅ done
    • macOS: ⬜ pending (follow-up PR)
    • Windows: ⬜ pending (follow-up PR)
  • Remaining Gap .mplumpack - preset compatibility needed #9 effort: ~4-8 hrs for macOS + Windows job

Copy link
Copy Markdown
Member

Thanks for this, and for the EXIF strip fix in #949: I'm landing that one separately (just its two edit.rs commits).

For the CI workflow itself, a few things need changing before it can go in:

  • retry: 3 isn't an input of actions/checkout or dtolnay/rust-toolchain; no other workflow here uses it.
  • It caches /usr/lib through actions/cache@0400d5f…, a pin used nowhere else in the repo. Restoring system libraries over the runner's is fragile, and we keep the set of third-party actions small and audited. Please drop that step; Swatinem/rust-cache is enough.
  • pull_request only triggers on Cargo / workflow paths, so most code PRs would never run it.
  • There's no trailing newline.

There's also a policy question here, since #901 moves the slow platform jobs to nightly. Per-PR Linux CI is the maintainers' call, so I'll leave this open for them. If you haven't already, come and join us on Discord: https://discord.gg/artcraft


Generated by Claude Code

- Runs cargo xtask ci on ubuntu-22.04 for every push/PR to main
- Mirrors FreeBSD/release.yml patterns: pinned actions, craft-fonts, deps
- Hardened per adversarial review:
  - retry=3 on checkout (x2) and rust-toolchain
  - rust-cache key includes Cargo.lock hash (prevents cache poisoning)
  - actions/cache on apt packages (saves 2-3 min/run)
  - RUST_TEST_THREADS=4 (prevents frame-budget flakes)
  - CARGO_TARGET_DIR isolated per run
  - timeout-minutes: 45 (realistic, catches hangs)
- Partially addresses Gap storytold#9: "Tests don't run in CI on macOS, Windows or Linux x64"
  - Linux x64: ✅ done
  - macOS: ⬜ pending (follow-up PR)
  - Windows: ⬜ pending (follow-up PR)
- Remaining Gap storytold#9 effort: ~4-8 hrs for macOS + Windows job
- Remove retry=3 (not a valid input for checkout/rust-toolchain)
- Drop apt cache step (caching /usr/lib is fragile; rust-cache is enough)
- Expand PR paths to trigger on all .rs/.toml/.lock changes
- Ensure trailing newline
`cargo xtask ci` has never passed on Windows: nothing ran the suite there
(gap storytold#9), and running it here surfaced five separate blockers. Each would
have turned the new job red on its first run.

Workflow:

- Install `wasm32-unknown-unknown`. `cargo xtask ci` ends with the wasm32
  check, so without the target the gate fails with "can't find crate for
  `std`". release.yml already sets it for the web job, for the same reason.
- Add the `windows-x64` job: the same `cargo xtask ci`, no system
  dependencies (the HEIF decoder is pure Rust, and MSVC, freetype and
  fontconfig come with the toolchain), and `CARGO_TARGET_DIR` off the
  workspace because MSVC hits the 260-character path limit.
- Widen `paths:` to `assets/**` and `docs/parity-checklist.md`: the gate's
  assets and parity steps read exactly those, so a PR breaking either could
  go unverified.
- Drop `desktop-file-utils`, `appstream`, `python3-yaml` and `zsync` from
  the Linux apt line. They are packaging tools for
  `packaging/linux/package.sh`; `cargo xtask ci` never invokes them.

Code and tests, so the gate is green on both platforms:

- `pipeline/src/spots.rs`: `chunks_exact(3)` -> `as_chunks::<3>()`, a clippy
  lint new in Rust 1.99. Toolchain drift, not platform-specific.
- `catalog/src/lock.rs`: `descriptor_copy` was `#[cfg(test)]` but only
  called from a `#[cfg(unix)]` test, so on Windows it compiled unused and
  `-D warnings` failed the build.
- `gpu/src/backend.rs`: `disarm` removes the init marker best-effort and
  discards the error, so a Windows scanner holding the file open makes
  `remove_file` fail with a sharing violation. Poll briefly before asserting
  it is gone.
- `engine/src/rename.rs`, `engine/src/tests_folders.rs`: compare paths as
  `Path`/`PathBuf`, not as text. The catalog stores the native path the move
  wrote (`\` on Windows) while `join` keeps the `/` of its argument; only
  `Path`'s equality normalizes separators.
- `engine/src/sidecar.rs`, `tests_filesystem_history.rs`,
  `tests_repair_companions.rs`, `apps/lightcraft/src/editors.rs`: the
  sidecar-repair tests build sidecars differing only in case, which is one
  file twice on a case-insensitive volume, and the `.desktop` test uses a
  POSIX path that is not `is_absolute()` on Windows. Gate those Unix only;
  every one of them still runs unchanged elsewhere.

Verified on Windows x64 (MSVC, rustc 1.99.0): `cargo xtask ci` passes all
eight steps, `cargo test --workspace` 3012 passed / 0 failed.

Two known gaps, left to the maintainers: the toolchain is floating `stable`,
so a new clippy lint can turn every job red with no repo change (a pin or a
lint budget would fix that); and the sidecar-repair code assumes a
case-sensitive filesystem, which Windows cannot answer for its users either
way — worth its own issue.
Completes the platform coverage in gap storytold#9 with the third main platform.
Same `cargo xtask ci` as the other two jobs, on `macos-14` (arm64), with
`wasm32-unknown-unknown` installed for the same reason the other two jobs
now set it and no system dependencies to install.

Why it does not run on pull_request: larger macOS runners are budget-capped
and reserved for release.yml (see its comment on `macos-15-xlarge`), so this
uses a standard hosted runner, and macOS minutes bill at roughly 10x Linux.
Running it on every PR would be the most expensive thing in the file, so it
runs on pushes to main, a weekly schedule (matching windows-arm64.yml's cron)
and workflow_dispatch. The `if:` line is the entire decision; deleting it
makes this run on every PR too, which is a one-line change if the trade-off
is ever judged differently.

`RUST_TEST_THREADS` is 3 here: this runner has 3 vCPU, against 4 on the
Linux and Windows runners, so it would otherwise oversubscribe the harness.

Not verified from a macOS machine, unlike the Linux and Windows jobs, which
were both run end to end before being proposed. Treat the first run as
exploratory rather than a formality.
@squareSphere29

Copy link
Copy Markdown
Contributor Author

Findings, for the maintainers
These are not fixed here and each is worth a decision:

  1. Windows coverage is thinner than Linux, and that trade-off is deliberate. Gating those 18 tests means Windows no longer covers the move/rename-failure-and-retry paths at all. The job will be green while testing less sidecar logic than Linux does. Flagging it rather than burying it, because "CI is green" would otherwise overstate what Windows is checking.

  2. The case-sensitivity assumption is unverified, not disproved. The sidecar-repair code assumes a case-sensitive filesystem. Those tests build sidecars differing only in case, which is one file twice on a case-insensitive volume. Gating them stops the tests from reporting that; it doesn't make the assumption true. Whether Windows users get wrong behaviour on two sidecars differing only in case is a real open question, and it looks like gap Keep Quit LightCraft last in the Windows File menu #27 territory rather than CI. Suggest its own issue.

  3. The toolchain is floating stable, which is what breaks CI without any repo change. There's no rust-toolchain.toml and no toolchain: pin anywhere. When stable moved to 1.99, the new chunks_exact_to_as_chunks lint turned every job red — all platforms, no change to the repo. A pin (reproducible, new lints land only on a deliberate bump) or a clippy lint budget in clippy.toml (absorbs noisy lints) would fix it. Left out here because it touches release.yml, freebsd.yml and windows-arm64.yml too.

  4. macOS is unproven. The one job I could not execute. Treat its first run as exploratory, not a formality. The good news: ui-egui tests run on an offscreen egui::Context with no EventLoop anywhere in the crate, so there's no WindowServer dependency; and GPU tests skip cleanly rather than fail without a Metal adapter (nn.rs also skips software adapters).

  5. docs/gaps.md row 9 is left untouched — re-ranking and the ✅/🟡 call are yours. This partially closes it: macOS now runs (on push/schedule rather than per PR), Linux and Windows run on every PR. docs/merge.md is unrelated, despite the name.

@squareSphere29
squareSphere29 deleted the ci/linux-x64-tests branch October 17, 2026 05:44
clydecbrown pushed a commit to clydecbrown/lightcraft that referenced this pull request Nov 9, 2026
Release protection: CODEOWNERS for workflows, document release rules
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