Skip to content

Windows support gaps in clanker update (portability) #158

@rafeegnash

Description

@rafeegnash

Summary

Follow-up from PR #157. The new self-update flow has two Windows gaps that will silently fail.

Affected code

`internal/updater/updater.go:526-528` and asset selection at line 380.

Issues

  1. Asset selector expects `.tar.gz` for all platforms. Windows builds commonly ship as `.zip`. `SelectAsset` uses `strings.Contains(name, ""+goos+""+goarch+".tar.gz")` which won't match a `_windows_amd64.zip` asset.
  2. `os.Rename` on a running Windows executable typically fails because Windows locks the binary while it's executing. macOS/Linux unlink-on-rename works fine; Windows does not.
  3. `buildMainBinary` does add `.exe` for Windows, but the release-channel path doesn't, so even if a Windows tarball matched the suffix, the extracted binary wouldn't have the right name to be picked up.

Suggested fix

  • `SelectAsset`: detect Windows, look for `.zip` suffix.
  • Add a `.zip` extraction helper (`archive/zip` package) parallel to `extractBinaryFromTarGz`.
  • For `installBinary` on Windows, use the "rename-self-then-replace" pattern: rename the current exe to `clanker.exe.old`, write the new exe in place, schedule the old one for deletion on next launch (or use `MoveFileEx` with `MOVEFILE_DELAY_UNTIL_REBOOT`).

Priority

Low — project's CI matrix is macOS-only. Filing for visibility; not blocking.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions