Skip to content

Rust bootstrap silently fails on fresh Ubuntu 22.04 when curl is missing #857

Description

@t-kalinowski

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions