Skip to content

fix: stop a piped install.sh from silently skipping the install - #63

Merged
BatmanAoD merged 1 commit into
mainfrom
fix-install-for-curlbash
Aug 26, 2026
Merged

fix: stop a piped install.sh from silently skipping the install#63
BatmanAoD merged 1 commit into
mainfrom
fix-install-for-curlbash

Conversation

@BatmanAoD

Copy link
Copy Markdown
Contributor

install.sh is documented to be run as curl ... | bash, where the script text is itself standard input. A child process that reads stdin therefore consumes the rest of the script, after which bash reaches EOF and exits 0 -- having skipped everything that had not been read yet, and reporting success.

That is what sudo -u "$SUDO_USER" brew install did. With --install-deps on macOS the prerequisites were installed, the script ended there, and libquil was never downloaded. The step passed; the failure surfaced later and elsewhere, as HeaderNotFound in libquil-sys's build script, because /usr/local/include/libquil did not exist. See rigetti/libquil-sys#68.

Every command that could read stdin now gets </dev/null: both brew calls, the two apt-get calls, and unzip, which prompts on an existing file. The script cannot simply redirect its own stdin, because bash is still reading itself from there.

This is a regression from replacing the consumers' wrapper scripts with a direct curl ... | bash. Those wrappers downloaded the installer to a temporary file and ran it from disk, which never had this problem.

Verified by piping the script into bash: it now runs to completion and installs all seven files, where the shape of the old failure is reproducible with any stdin-reading child.

install.sh is documented to be run as `curl ... | bash`, where the script text
is itself standard input. A child process that reads stdin therefore consumes
the rest of the script, after which bash reaches EOF and exits 0 -- having
skipped everything that had not been read yet, and reporting success.

That is what `sudo -u "$SUDO_USER" brew install` did. With --install-deps on
macOS the prerequisites were installed, the script ended there, and libquil was
never downloaded. The step passed; the failure surfaced later and elsewhere, as
HeaderNotFound in libquil-sys's build script, because /usr/local/include/libquil
did not exist. See rigetti/libquil-sys#68.

Every command that could read stdin now gets </dev/null: both brew calls, the
two apt-get calls, and unzip, which prompts on an existing file. The script
cannot simply redirect its own stdin, because bash is still reading itself from
there.

This is a regression from replacing the consumers' wrapper scripts with a direct
`curl ... | bash`. Those wrappers downloaded the installer to a temporary file
and ran it from disk, which never had this problem.

Verified by piping the script into bash: it now runs to completion and installs
all seven files, where the shape of the old failure is reproducible with any
stdin-reading child.
@BatmanAoD
BatmanAoD merged commit ccfb619 into main Aug 26, 2026
2 checks passed
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.

1 participant