Skip to content

rustc should be usable as-is from the build directory #20836

@SimonSapin

Description

@SimonSapin

Steps to reproduce:

  • Clone this git repository
  • Run ./configure && make
  • Run x86_64-unknown-linux-gnu/stage2/bin/rustc --help

Expected results: the help message. rustc can be used in place to compile stuff.

Actual result:

x86_64-unknown-linux-gnu/stage2/bin/rustc: symbol lookup error: x86_64-unknown-linux-gnu/stage2/bin/rustc: undefined symbol: _ZN2rt10lang_start20h8e79fc6788a362d0mJzE

The instructions in README.md also include make install which would fix this issue, but:

  • make install defaults to writing to a directory that typically requires root access
  • I might already have a (potentially different) version of Rust installed system-wide.

I’m told I can pass --enable-rpath to ./configure, but that’s exactly the kind of secret sauce that I shouldn’t need to know.

Possible solutions:

  • Make --enable-rpath the default for source builds (binary builds distributed on rust-lang.org don’t have to use that default)
  • Make bin/rustc a wrapper script that sets the correct environment variables (e.g. LD_LIBRARY_PATH on Linux). This might also help with Support installing multiple release channels #19263.

CC @brson

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