Skip to content

replacing cargo should note subcommand caveat #262

Description

@CAD97

Example (paths generalized for clarity):

$ which cargo
$HOME/.local/bin/cargo

$ cat $(which cargo)
#!/bin/sh
case "$1" in
  +*) toolchain="$1"; shift; exec rustup.cargo "$toolchain" auditable "$@" ;;
   *)                        exec rustup.cargo              auditable "$@" ;;
esac

$ cat $(which cargo-which-cargo)
#!/bin/sh
exec echo "$CARGO"

$ cargo which-cargo
$RUSTUP_HOME/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo

If a build script or cargo subcommand wants to execute a cargo command, it SHOULD be doing so by running $CARGO instead of the path cargo. As such, these will bypass the cargo wrapper.

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