Skip to content

Subcommand run does not search PATH for command argument #641

Description

@murarth

Binaries cargo install'd are placed in ~/.cargo/bin (which is in my shell's PATH), but rustup run <toolchain> foo does not search PATH, instead assuming the named executable to be within the named toolchain's bin directory and requiring the full path to successfully run the command. This is a change from the behavior of multirust, which did search PATH for the named command.

Activity

  1. brson commented on Aug 11, 2016

    @brson
    Contributor

    Can you clarify what you mean by 'requiring the full path to successfully run the command'? rustup should know the path to the toolchain directory and always be able to find the command in the toolchain directory.

    I don't know why run would search ~/.cargo/bin. The command is for running binaries out of the toolchain directory.

  2. brson commented on Aug 11, 2016

    @brson
    Contributor

    Thanks for the report @murarth !

  3. murarth commented on Aug 11, 2016

    @murarth
    Author

    I'm not suggesting that rustup run should search ~/.cargo/bin specifically. Rather, I think that it should search the list of directories in the environment variable PATH when the named executable is not found within the toolchain. Its primary purpose may be running toolchain binaries, but it's also the most straightforward way to run a binary that is built with a non-default toolchain and affected by #350.

    For example, if one uses cargo install to build and install rusti, one must run rustup run nightly ~/.cargo/bin/rusti in order to run the binary. Running rustup run nightly rusti gives a No such file or directory error, as rustup is not searching PATH.

    It seems sensible to me that, unless it would conflict with some other concept in rustup, the run subcommand ought to be thought of as providing the proper execution environment for any executable, not just those that make up the toolchain.

  4. Boddlnagg commented on Aug 24, 2016

    @Boddlnagg
    Contributor

    This is basically the same as #210, although that has nothing to do with the PATH, but is about running a command from the local directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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