Skip to content

Flaky has_local in rustup-init.sh #5009

Description

@daniel-pfeiffer

Verification

Problem

On a system without local, it would continue searching in $PATH. If a such a command were found, that would wrongly be used throughout.

Steps

  1. Login to where /bin/sh has no builtin local
  2. Create an executable local in $PATH

Possible Solution(s)

I don’t know how portable an empty path is, nor whether prepending it will affect searching for the following command on such a Shell. This should probably work anywhere:

has_local() {
    # shellcheck disable=SC2034  # deliberately unused
    PATH= local _has_local
}

Notes

No response

Rustup version

Reading latest script on GitHub.

Installed toolchains

Irrelevant, since I don’t have a Shell with no builtin `local`

OS version

Irrelevant, since I don’t have a Shell with no builtin `local`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions