Skip to content

[WIP] Fix silent failure in install_build_deps script due to missing os-release#13

Closed
BunsDev with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-error-handling-install-build-deps
Closed

[WIP] Fix silent failure in install_build_deps script due to missing os-release#13
BunsDev with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-error-handling-install-build-deps

Conversation

Copilot AI commented May 14, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"The inline subshell with `source` may fail silently if /etc/os-release doesn't exist or lacks the ID variables. Consider adding explicit error handling or checking for the file's existence before sourcing it.","fixFiles":[{"filePath":"script/linux/install_build_deps","diff":"diff --git a/script/linux/install_build_deps b/script/linux/install_build_deps\n--- a/script/linux/install_build_deps\n+++ b/script/linux/install_build_deps\n@@ -13,7 +13,15 @@\n # Install some development libraries that will be needed in the compilation\n # process.\n UNAME=\"$(uname -a)\"\n-if [[ \"$(source /etc/os-release; echo $ID $ID_LIKE)\" = *\"debian\"* ]]; then\n+OS_ID=\"\"\n+OS_ID_LIKE=\"\"\n+if [[ -r /etc/os-release ]]; then\n+  # shellcheck disable=SC1091\n+  source /etc/os-release\n+  OS_ID=\"${ID:-}\"\n+  OS_ID_LIKE=\"${ID_LIKE:-}\"\n+fi\n+if [[ \"${OS_ID} ${OS_ID_LIKE}\" = *\"debian\"* ]]; then\n   echo \"⬇️  Installing build-time dependencies...\"\n   # Define the packages to install as a bash array so we can include\n   # comments between lines.\n"}]},{"message":"The unzip command syntax is incorrect. The `-d` flag should be followed immediately by the destination directory, and the files to extract should come after. This should be: `warp_sudo unzip -o /tmp/protoc.zip -d /usr/local 'bin/protoc' 'include/*'` or the more typical form with separate arguments.","fixFiles":[{"filePath":"script/linux/install_build_deps","diff":"diff --git a/script/linux/install_build_deps b/script/linux/install_build_deps\n--- a/script/linux/install_build_deps\n+++ b/script/linux/install_build_deps\n@@ -57,7 +57,7 @@\n   esac\n   curl -fsSL -o /tmp/protoc.zip \\\n     \"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}\"\n-  warp_sudo unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*'\n+  warp_sudo unzip -o /tmp/protoc.zip -d /usr/local 'bin/protoc' 'include/*'\n   rm /tmp/protoc.zip\n else\n   echo -e \"⚠️  ${red}Unknown Linux distribution; necessary build dependencies may not be installed!${reset}\"\n"}]}]

@BunsDev

BunsDev commented May 15, 2026

Copy link
Copy Markdown
Member

Superseded by #15 which implements all four fixes.

@BunsDev BunsDev closed this May 15, 2026
BunsDev added a commit that referenced this pull request May 15, 2026
…et -e, remove deprecated ::echo:: commands (#15)

- bundle.ps1: remove premature $BUNDLE_ID assignment using undefined $app_name (fixes #11)
- install_build_deps: guard /etc/os-release source with file existence check (fixes #13)
- install_cargo_bundle: move set -e to top of script so all failures are caught (fixes #14)
- Grammatical fix in wasm/bundle comment (fixes #12)
- Remove deprecated ::echo::on/off GitHub Actions commands from all bundle scripts and workflows (fixes #12)
@BunsDev
BunsDev deleted the copilot/fix-error-handling-install-build-deps branch June 15, 2026 06:26
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.

2 participants