Skip to content

running cargo from build dir can't find rustc #1806

Closed
@erickt

Description

@erickt

cargo is relying on the $PATH to find rustc, but if one runs cargo with x86_64-apple-darwin/stage2/lib/rustc/x86_64-apple-darwin/bin/cargo install tnetstring, cargo will error out with the unhelpful:

info: Installing with git from https://github.com/erickt/rust-tnetstring...
Cloning into '/Users/etryzelaar/Projects/rust/rust/.cargo/work/0UNNtyDTAsQQT2J1'...
remote: Counting objects: 36, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 36 (delta 14), reused 30 (delta 8)
Unpacking objects: 100% (36/36), done.
error: rustc failed: 1

cargo should detect this and return a proper error message for this. A proper workaround for this is to make sure that $PATH has an absolute path to the binaries set, as in:

export PATH=x86_64-apple-darwin/stage2/lib/rustc/x86_64-apple-darwin/bin:$PATH

It needs to be absolute because cargo does a chdir to the build directory, which would break a relative path.

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