[ENG-27] Don't silently fail the examples download when unzip is missing - #311
Merged
zanjonke merged 1 commit intoSep 3, 2026
Conversation
Slim images ship no unzip. Under `set -euo pipefail` the failing `unzip ... 2>/dev/null` call aborted examples.sh - and with it the whole installer, since install.sh runs it as a plain command - without printing anything. - Check for unzip (Expand-Archive on PowerShell) before downloading and explain how to install it, instead of stopping. - Make the user acknowledge every failure path, including the previously unprompted "failed to create directory" case. - Replace the `cmd 2>/dev/null; if [ $? ... ]` patterns that `set -e` never reached with real checks, and keep the extractor's error output. - Reject a download that isn't a zip, so a server error page is reported as such instead of being handed to the extractor. - Never let the optional examples step take the installer down (bash: set -e; PowerShell: a terminating error propagating out of `& $scriptPath`).
zanjonke
force-pushed
the
zan/eng-27-installation-of-examples-should-not-silently-fail-if-unzip
branch
from
September 1, 2026 13:09
8bbdbe3 to
63cf9c6
Compare
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.
Closes ENG-27.
Problem
On an image without unzip (e.g.
python:3.12-slim),examples.shprintedExtracting to ...and then died with exit 127 and no message:unzip's stderr went to/dev/null, andset -euo pipefailexited before theif [ $? -eq 0 ]check could run. Becauseinstall.shruns the script as a plain command, the whole installer went down with it, skipping the final verification and summary.The same unreachable
cmd 2>/dev/null; if [ $? ... ]pattern was used formkdirandcurl.Changes
unzip(Expand-Archiveon PowerShell) before anything is downloaded, and explain how to install it plus where else to get the examples.Continue? Press [Enter] to acknowledge:) so the message isn't cleared away by the installer's next step. The "failed to create directory" case previously had no prompt at all.if ! cmdchecks instead of the$?patterns; a failed extraction shows the extractor's own error (capped at 3 lines) instead of discarding it.|| echo ...in bash,try/catchininstall.ps1, where& $scriptPathpropagates terminating errors into the parent under$ErrorActionPreference = 'Stop'(verified).clearcan't abort the script.Testing
Manually, in Docker with a pty, both with and without the extractor:
.shscripts still executableYou're all set!, exit 0Expand-Archivepresent → examples extractedAlso checked the failed-download and non-zip-download paths, and full
install.shruns end to end. Note the PowerShell runs were pwsh-on-Linux, so Windows-specific path/permission behaviour is untested.