Skip to content

chore: remove cargo-dist, use native fetch for npm installer#646

Merged
jpoehnelt merged 4 commits into
mainfrom
cd/remove-cargo-dist
Mar 31, 2026
Merged

chore: remove cargo-dist, use native fetch for npm installer#646
jpoehnelt merged 4 commits into
mainfrom
cd/remove-cargo-dist

Conversation

@jpoehnelt
Copy link
Copy Markdown
Contributor

Summary

Removes cargo-dist entirely and replaces it with:

  • Custom GitHub Actions release workflow — standard matrix cross-compilation for all 7 targets
  • Zero-dependency npm installer — uses native Node 18+ fetch() instead of axios

Changes

File Change
dist-workspace.toml Deleted — cargo-dist config
npm/package.json New — zero runtime dependencies
npm/install.js New — native fetch binary downloader
npm/platform.js New — OS/arch detection with musl fallback
npm/run.js New — bin wrapper
.github/workflows/release.yml Rewritten — no cargo-dist
scripts/version-sync.sh Updated — syncs version into npm/package.json

Removed npm dependencies

  • axios
  • axios-proxy-builder
  • rimraf
  • detect-libc
  • console.table

Testing

On PRs, the release workflow runs the full build matrix (dry-run) without creating releases or publishing.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 45e49b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the release and installation process for the CLI by removing reliance on third-party distribution tools. By implementing a custom, zero-dependency installer and a native GitHub Actions workflow, the project reduces its dependency footprint and gains more control over the distribution pipeline.

Highlights

  • Removal of cargo-dist: Completely removed cargo-dist configuration and associated workflows, replacing them with a custom GitHub Actions release pipeline.
  • Zero-dependency npm installer: Implemented a new npm installer that utilizes native Node.js fetch (Node 18+) to download binaries, eliminating runtime dependencies like axios and rimraf.
  • Cross-platform support: Added robust OS/architecture detection with musl fallback to ensure the CLI works across all supported platforms.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@googleworkspace-bot googleworkspace-bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 31, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the cargo-dist release pipeline with a custom GitHub Actions workflow and a zero-dependency npm installer that utilizes native Node.js fetch. Key changes include the addition of scripts for platform-specific binary installation and execution, as well as updates to the version synchronization process. Feedback indicates that the wrapper script's exit status handling needs to account for signal-based termination to avoid false success reports. Additionally, the extraction logic in the installation script should be refactored to use spawnSync with an arguments array instead of execSync with shell strings to improve security and robustness against special characters in file paths.

Comment thread npm/run.js Outdated
Comment thread npm/install.js Outdated
@github-actions github-actions Bot added the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
@github-actions github-actions Bot removed the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
@googleworkspace-bot
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the cargo-dist release pipeline with a custom GitHub Actions workflow and a zero-dependency npm installer using native Node.js fetch. The changes remove several dependencies like axios and rimraf while introducing a cross-platform installation script. Feedback identifies a regression where native fetch does not respect system proxy settings, a potential crash if the response body is null, and path parsing vulnerabilities in the PowerShell extraction logic. It is also recommended to sanitize error strings to prevent escape sequence injection.

Comment thread npm/install.js
Comment thread npm/install.js
Comment thread npm/install.js
Comment thread npm/install.js Outdated
@github-actions github-actions Bot added the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
- Add null body guard for fetch response
- Fix PowerShell Expand-Archive path quoting vulnerability
- Sanitize error output to prevent ANSI escape injection
- Add proxy support limitation note
- Fix upgrade bug: use .version marker so npm update downloads new binary
- Downgrade changeset from minor to patch (chore, not feature)
- Update AGENTS.md: remove stale cargo-dist reference from labels
@github-actions github-actions Bot removed the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
@googleworkspace-bot
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the cargo-dist release pipeline and npm package with a custom GitHub Actions workflow and a zero-dependency npm installer using native Node.js fetch. The new implementation includes scripts for platform detection, binary downloading, and extraction. Feedback was provided regarding an inconsistency in the extraction logic between Unix and Windows platforms; specifically, the use of --strip-components 1 for tarballs versus the lack of a similar mechanism for ZIP files on Windows could lead to incorrect installation paths. It is recommended to standardize on flat archives to ensure the binary is correctly located across all environments.

Comment thread npm/install.js
@github-actions github-actions Bot added the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
Both tar.gz and zip archives now contain files at root (no nested
directory). Removes --strip-components 1 from install.js since it is
no longer needed. This makes extraction consistent across platforms.
@github-actions github-actions Bot removed the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
@googleworkspace-bot
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the cargo-dist release pipeline with a custom GitHub Actions workflow and a zero-dependency npm installer utilizing native Node.js fetch. The review identifies a security vulnerability in the ANSI escape sequence sanitization, the lack of a timeout for network requests, and a regression in proxy support for enterprise environments.

Comment thread npm/install.js
Comment thread npm/install.js
Comment thread npm/install.js
@github-actions github-actions Bot added the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 31, 2026
@jpoehnelt jpoehnelt merged commit 86c08cf into main Mar 31, 2026
33 checks passed
@jpoehnelt jpoehnelt deleted the cd/remove-cargo-dist branch March 31, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: distribution area: docs cla: yes This human has signed the Contributor License Agreement. gemini: reviewed Gemini Code Assist has reviewed the latest changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants