From 88910b7c70d130b222c8e866cb0891c55addfe70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Jun 2026 14:22:00 +0000 Subject: [PATCH 1/2] Initial plan From 8866829060b2b5316fe116b990f5b5492c1bb048 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Jun 2026 14:28:31 +0000 Subject: [PATCH 2/2] fix: skip CLI download in build.rs when DOCS_RS env var is set 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> --- rust/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust/build.rs b/rust/build.rs index 630a0d100..bc944a318 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -5,6 +5,7 @@ use std::time::Duration; use sha2::Digest; fn main() { + println!("cargo:rerun-if-env-changed=DOCS_RS"); println!("cargo:rerun-if-env-changed=COPILOT_SKIP_CLI_DOWNLOAD"); println!("cargo:rerun-if-env-changed=COPILOT_CLI_EXTRACT_DIR"); println!("cargo:rerun-if-env-changed=BUNDLED_CLI_CACHE_DIR"); @@ -43,6 +44,13 @@ fn main() { return; } + // docs.rs builds in a sandboxed environment without network access. + // Skip the CLI download so documentation can be generated successfully. + if std::env::var_os("DOCS_RS").is_some() { + println!("cargo:warning=DOCS_RS is set — skipping CLI download/bundle/cache"); + return; + } + let Some(platform) = target_platform() else { println!("cargo:warning=Unsupported target platform for Copilot CLI bundling — skipping"); return;