Skip to content

CI-2 Build the desktop updater bridge on Linux - #7

Open
ice-zeus wants to merge 2 commits into
mainfrom
fix/ci-2-updater-linux
Open

ice-zeus wants to merge 2 commits into
mainfrom
fix/ci-2-updater-linux

Conversation

@ice-zeus

@ice-zeus ice-zeus commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

native/updater never compiled for Linux: velopack 1.2.161 gates VelopackLocator::get_root_dir to non-Linux targets (src/locator.rs:216), so src/lib.rs:36 failed with E0599. CI-1's new Linux job found this (PR #5).

  • A cfg-gated root_dir helper reads the root through get_appimage_path on Linux and get_root_dir everywhere else. On Linux, velopack fills both from RootAppDir (the AppImage path), so the value is unchanged.
  • The locator-to-config mapping moves from config() into locator_config(&VelopackLocator) so a unit test can cover it with a constructed locator. config() is unchanged for callers.
  • No change to the shifter_updater C ABI, to Cargo.toml or to Cargo.lock. Behaviour on non-Linux targets is unchanged.

Area: update-desktop (native/updater/src/lib.rs only). Size: 38 added and 3 removed lines (about 16 production, the rest test). Boundary: n/a (single-repository project).

Regression

New test config_uses_locator_root checks three things: the config root equals the locator root, the packages directory is <AppImage dir>/.shifter-updates on Linux and <packages>/shifter-verified-v1 elsewhere, and config() fails closed for an unpackaged binary.

  • Before the fix (origin/main 3bb32ae, Linux, Rust 1.99.0): cargo fmt --check 0; cargo clippy --locked --all-targets -- -D warnings 101 and cargo test --locked 101, both with error[E0599]: no method named get_root_dir found for struct VelopackLocator at src/lib.rs:36.
  • After the fix (86f6fe2): see Validation.

Validation (head 86f6fe2)

  • Linux (disposable Ubuntu 24.04 c-4, Rust 1.99.0): cargo fmt --check 0, cargo clippy --locked --all-targets -- -D warnings 0, cargo test --locked 2 passed.
  • Changed-line coverage on Linux (cargo-llvm-cov 0.9.1): every changed line compiled on Linux is covered, so 100% of the measurable lines. The non-Linux root_dir is compiled out on Linux. It runs in the macOS test but its coverage was not measured.
  • macOS (shared pool, mini-one, Rust 1.99.0): fmt, clippy -D warnings and tests (2 passed) all green.
  • Windows: not built (no Windows host). The helper uses get_root_dir there, as before.
  • git diff --check clean.

Review fixes (head 013e816)

  • F1 (non-serious, test-only), fixed in 013e816: on Windows, Velopack replaces an unwritable custom packages directory with one under %LOCALAPPDATA%, so config_uses_locator_root would fail and write into the user profile. The test now creates <tmp>/packages before building the locator. Linux on 013e816 (disposable Ubuntu 24.04 c-4, Rust 1.99.0): cargo fmt --check 0, cargo clippy --locked --all-targets -- -D warnings 0, cargo test --locked 2 passed; cargo-llvm-cov counts the new line. Windows is still not built (no Windows host).

Documentation

No user-facing or API documentation change: the C ABI and documented behaviour are unchanged. The Linux root semantics are documented on the new helper.

velopack 1.2.161 gates VelopackLocator::get_root_dir to non-Linux targets,
so native/updater never compiled for Linux. Read the root through a
cfg-gated helper: get_appimage_path on Linux (the same RootAppDir value),
get_root_dir elsewhere. The locator-to-config mapping moves into
locator_config so a unit test covers it with a constructed locator.
The C ABI and non-Linux behaviour are unchanged.
Create the custom packages directory before building the locator, so
Windows Velopack keeps it instead of falling back to %LOCALAPPDATA%.
Test-only; fixes review finding F1.
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