Skip to content

Add amd64 arch mapping, tar pre-check, and gzip SCP fallback#10534

Draft
alokedesai wants to merge 1 commit intomasterfrom
orchestrator/arch-script-gzip
Draft

Add amd64 arch mapping, tar pre-check, and gzip SCP fallback#10534
alokedesai wants to merge 1 commit intomasterfrom
orchestrator/arch-script-gzip

Conversation

@alokedesai
Copy link
Copy Markdown
Member

@alokedesai alokedesai commented May 8, 2026

Description

Problem: Three related install script issues:

  1. amd64 arch rejected (7 errors): Some hosts report amd64 from uname -m instead of x86_64 (FreeBSD-style, some WSL configs). Both the shell script and Rust-side parse_uname_output() reject this as unsupported, even though amd64 IS x86_64.
  2. tar not found (6 errors): Minimal Docker images and embedded systems lack tar. The install script downloads the full tarball before discovering tar is missing, wasting bandwidth and time.
  3. No fallback for tar-less hosts: When tar is missing, the install fails with no recovery path.

Solution:

  1. amd64 mapping: Add "amd64" to the x86_64 match arm in both parse_uname_output() and the install script case statement.
  2. tar pre-check: Add command -v tar check in the install script BEFORE downloading. Exits with NO_TAR_EXIT_CODE = 4 so the Rust side can handle it distinctly.
  3. gzip SCP fallback: New gzip_scp_install_fallback() function that downloads the tarball locally, extracts the binary locally with tar, gzips just the binary, SCPs the .gz to the remote, and runs gzip -d && chmod +x via SSH. This only requires gzip on the remote (present on virtually all Linux systems including minimal Docker images).

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

Testing

Unit tests (all passing):

  • cargo test -p remote_server -- setup::tests — 26 passed, 0 failed
  • cargo fmt / cargo clippy — clean

New tests:

  • parse_uname_linux_amd64 — verifies "Linux amd64" maps to RemotePlatform { os: Linux, arch: X86_64 }
  • parse_uname_unsupported_armv7l — verifies "Linux armv7l" returns UnsupportedArch
  • install_script_contains_no_tar_exit_code — verifies {no_tar_exit_code} placeholder is substituted
  • install_script_contains_tar_pre_check — verifies command -v tar is present in script

Integration tests (shell-based, 7/7 pass):

  • OLD script rejects amd64 with "unsupported arch: amd64" -> NEW script maps it to x86_64
  • OLD script fails late without tar ("tar: command not found") -> NEW script exits early with code 4
  • gzip decompression + chmod + execution verified on simulated tar-less environment

Impact: Addresses unsupported arch amd64 (0.7%), tar not found (0.6%)

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp AI Agent Mode

Co-Authored-By: Oz oz-agent@warp.dev

CHANGELOG-IMPROVEMENT: SSH extension now supports amd64 architecture and can install on hosts without tar via gzip fallback

Three related fixes for remote-server install failures:

1. amd64 arch mapping: Add 'amd64' to the x86_64 arm in both
   parse_uname_output() (setup.rs) and the install script's case
   statement. Some hosts report 'amd64' from uname -m instead of
   'x86_64'.

2. tar pre-check: Add a 'command -v tar' check in the install script
   before attempting any download. If tar is missing, the script exits
   with NO_TAR_EXIT_CODE (4) immediately, avoiding a wasted download.
   The new constant and placeholder substitution are wired through
   setup.rs.

3. gzip SCP fallback: Add a new gzip_scp_install_fallback() function
   in ssh_transport.rs, triggered when the install script exits with
   NO_TAR_EXIT_CODE. The fallback downloads the tarball locally,
   extracts the binary locally with tar, gzips just the binary,
   uploads the .gz via SCP, then runs 'gzip -d' + 'chmod +x' on the
   remote host.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 8, 2026
@alokedesai alokedesai changed the title Add amd64 arch mapping, tar pre-check, and gzip SCP fallback for remote-server install Add amd64 arch mapping, tar pre-check, and gzip SCP fallback May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant