fix: skip CLI download in build.rs when DOCS_RS env var is set#1660
Draft
Copilot wants to merge 3 commits into
Draft
fix: skip CLI download in build.rs when DOCS_RS env var is set#1660Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
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
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.
docs.rs builds fail because
build.rsattempts to download the Copilot CLI binary in a network-restricted sandbox. Theall-features = truedocs.rs metadata enablesbundled-cli, triggering the download path.DOCS_RSenvironment variable (set automatically by docs.rs) and early-return frombuild.rs, skipping the download/bundle/cache mechanism — same behavior as the existingCOPILOT_SKIP_CLI_DOWNLOADescape hatchDOCS_RSwithcargo:rerun-if-env-changedfor correct incremental rebuild invalidationNeither
has_bundled_clinorhas_extracted_clicfg flags are emitted in this mode, which is fine — rustdoc only needs type signatures and doc comments, not a working CLI binary.Fixes #1659