Skip to content

fix: skip CLI download in build.rs when DOCS_RS env var is set#1660

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-docs-rs-error
Draft

fix: skip CLI download in build.rs when DOCS_RS env var is set#1660
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-docs-rs-error

Conversation

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

docs.rs builds fail because build.rs attempts to download the Copilot CLI binary in a network-restricted sandbox. The all-features = true docs.rs metadata enables bundled-cli, triggering the download path.

  • Detect the DOCS_RS environment variable (set automatically by docs.rs) and early-return from build.rs, skipping the download/bundle/cache mechanism — same behavior as the existing COPILOT_SKIP_CLI_DOWNLOAD escape hatch
  • Register DOCS_RS with cargo:rerun-if-env-changed for correct incremental rebuild invalidation

Neither has_bundled_cli nor has_extracted_cli cfg flags are emitted in this mode, which is fine — rustdoc only needs type signatures and doc comments, not a working CLI binary.

Fixes #1659

docs.rs builds in a sandboxed environment without network access.
The build.rs script was failing because it tried to download the
Copilot CLI binary. Detect the DOCS_RS environment variable (set
automatically by docs.rs) and skip the download, similar to the
existing COPILOT_SKIP_CLI_DOWNLOAD escape hatch.

Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in docs.rs for github-copilot-sdk fix: skip CLI download in build.rs when DOCS_RS env var is set Jun 13, 2026
Copilot AI requested a review from edburns June 13, 2026 14:29
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.

Fix error in docs.rs: docs.rs failed to build github-copilot-sdk-1.0.1

2 participants