pak silently fails to bootstrap Rust on fresh Ubuntu 22.04 when curl is missing
I can reproduce this in a fresh rocker/r2u:jammy container.
Minimal failing repro:
docker run --rm --platform linux/amd64 rocker/r2u:jammy \
bash -lc 'apt-get update >/dev/null && apt-get install -y r-cran-pak >/dev/null && R -q -e '\''pak::pak("hellorust")'\'''
This logs:
ℹ Executing `sh -c curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y`
and then later fails because cargo / rustc are still not found.
I can reproduce the same behavior with a rextendr package as well:
docker run --rm --platform linux/amd64 rocker/r2u:jammy \
bash -lc 'apt-get update >/dev/null && apt-get install -y r-cran-pak >/dev/null && R -q -e '\''pak::pak("tergo")'\'''
In this base image, curl is not installed:
docker run --rm --platform linux/amd64 rocker/r2u:jammy \
bash -lc 'which curl || true'
If I preinstall curl, the same pak install succeeds for hellorust:
docker run --rm --platform linux/amd64 rocker/r2u:jammy \
bash -lc 'apt-get update >/dev/null && apt-get install -y curl r-cran-pak >/dev/null && R -q -e '\''pak::pak("hellorust")'\'''
So this looks like the Rust bootstrap command is being run via a shell pipeline where curl: not found is masked, and pak proceeds as if the bootstrap succeeded.
Expected behavior:
- fail the Rust bootstrap step if
curl is missing, or
- ensure
curl is installed before using that command, or
- avoid the shell pipeline in a way that preserves the real exit status
Related reports:
paksilently fails to bootstrap Rust on fresh Ubuntu 22.04 whencurlis missingI can reproduce this in a fresh
rocker/r2u:jammycontainer.Minimal failing repro:
This logs:
and then later fails because
cargo/rustcare still not found.I can reproduce the same behavior with a
rextendrpackage as well:In this base image,
curlis not installed:docker run --rm --platform linux/amd64 rocker/r2u:jammy \ bash -lc 'which curl || true'If I preinstall
curl, the samepakinstall succeeds forhellorust:So this looks like the Rust bootstrap command is being run via a shell pipeline where
curl: not foundis masked, andpakproceeds as if the bootstrap succeeded.Expected behavior:
curlis missing, orcurlis installed before using that command, orRelated reports: