Support to linux zcode - #20
Closed
eltonacosta wants to merge 5 commits into
Closed
eltonacosta wants to merge 5 commits into
eltonacosta wants to merge 5 commits into
Conversation
added 5 commits
September 13, 2026 18:17
Write updater test archives with an in-process ZIP writer so Linux tests no longer shell out to bsdtar, and make the in-process archive the only fixture source on every platform. Record whether the installer generated the ZCode shortcut, remove that entry on uninstall, and fall back to matching the stored target against the launcher path for install states written before this change. Relax the install state schema so a generated shortcut can carry an empty original target, and cover fresh installs, legacy states without shortcut data, and restored pre-existing desktop entries in the installer tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two Linux portability issues reported together:
1. Portable updater test archives (no more
bsdtar)The Linux test path shelled out to
bsdtarto build fixture archives, but that binary is not a project dependency and isn't provisioned by CI. On a clean Linux environment withoutlibarchive-tools,bun testfailed with an executable-not-found error before exercising the updater. Bothcompress()helpers intests/extension-updater.test.tsandtests/host-updater.test.tsnow use a single in-process ZIP writer.Changes:
tests/fixtures/archive.ts: an in-process ZIP builder (store/deflate, CRC32 table, UTF-8 filename flags, Unix mode attributes) with no external dependencies.tests/extension-updater.test.ts/tests/host-updater.test.ts:compress()delegates towriteZipFromDirectory();bsdtar/Compress-Archiveshell-outs removed on every platform.extractArchive/yauzl), so the fixture format stays honest.2. Remove generated
zcode.desktopon uninstallWhen no desktop entry existed,
readShortcutreturnedundefined, soinstallOrRepairstored no shortcut state — yet still createdzcode.desktop.uninstallonly restoredstate.shortcut, so a fresh Linux install left a broken launcher pointing at the deletedzdp-launcher.Changes:
src/cli/shortcut.ts: newcaptureShortcut()recordscreated: truewhen no entry exists, and newremoveLauncherShortcut()removes launcher-created entries, restores pre-existing ones, and safely handles legacy install states (matches the stored target against the launcher path) or missing state (skips non-launcher entries).src/cli/installer.ts:installOrRepairnow always persists shortcut state (includingcreated);uninstalldelegates toremoveLauncherShortcut()even when no state was recorded.src/shared/schemas.ts: shortcut schema accepts an emptyoriginalTargetand the optionalcreatedflag; older states remain valid.Tests (
tests/installer.test.ts):.desktopremoved on uninstall.state.shortcutwasundefinedon fresh installs).Verification
bun run checkpasses fully: typecheck, 58 tests / 0 failures, SDK packaging check, example build, and host build.doctorrun confirmsshortcutManaged: truewith the existing install intact.Files changed