{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/20836","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/20836/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/20836/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/20836/events","html_url":"https://github.com/rust-lang/rust/issues/20836","id":53927767,"number":20836,"title":"rustc should be usable as-is from the build directory","user":{"login":"SimonSapin","id":291359,"avatar_url":"https://avatars.githubusercontent.com/u/291359?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSapin","html_url":"https://github.com/SimonSapin","followers_url":"https://api.github.com/users/SimonSapin/followers","following_url":"https://api.github.com/users/SimonSapin/following{/other_user}","gists_url":"https://api.github.com/users/SimonSapin/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSapin/subscriptions","organizations_url":"https://api.github.com/users/SimonSapin/orgs","repos_url":"https://api.github.com/users/SimonSapin/repos","events_url":"https://api.github.com/users/SimonSapin/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSapin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-infrastructure","name":"A-infrastructure","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-papercut","name":"I-papercut","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-01-09T23:19:00Z","updated_at":"2015-02-21T19:43:26Z","closed_at":null,"body":"Steps to reproduce:\r\n\r\n* Clone this git repository\r\n* Run `./configure && make`\r\n* Run `x86_64-unknown-linux-gnu/stage2/bin/rustc --help`\r\n\r\nExpected results: the help message. rustc can be used in place to compile stuff.\r\n\r\nActual result:\r\n\r\n```\r\nx86_64-unknown-linux-gnu/stage2/bin/rustc: symbol lookup error: x86_64-unknown-linux-gnu/stage2/bin/rustc: undefined symbol: _ZN2rt10lang_start20h8e79fc6788a362d0mJzE\r\n```\r\n\r\nThe instructions in `README.md` also include `make install` which would fix this issue, but:\r\n\r\n* `make install` defaults to writing to a directory that typically requires root access\r\n* I might already have a (potentially different) version of Rust installed system-wide.\r\n\r\nI’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.\r\n\r\nPossible solutions:\r\n\r\n* Make `--enable-rpath` the default for source builds (binary builds distributed on rust-lang.org don’t have to use that default)\r\n* Make `bin/rustc` a wrapper script that sets the correct environment variables (e.g. `LD_LIBRARY_PATH` on Linux). This might also help with #19263.\r\n\r\nCC @brson"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/75388878","html_url":"https://github.com/rust-lang/rust/issues/20836#issuecomment-75388878","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/20836","id":75388878,"user":{"login":"kmcallister","id":444997,"avatar_url":"https://avatars.githubusercontent.com/u/444997?v=3","gravatar_id":"","url":"https://api.github.com/users/kmcallister","html_url":"https://github.com/kmcallister","followers_url":"https://api.github.com/users/kmcallister/followers","following_url":"https://api.github.com/users/kmcallister/following{/other_user}","gists_url":"https://api.github.com/users/kmcallister/gists{/gist_id}","starred_url":"https://api.github.com/users/kmcallister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmcallister/subscriptions","organizations_url":"https://api.github.com/users/kmcallister/orgs","repos_url":"https://api.github.com/users/kmcallister/repos","events_url":"https://api.github.com/users/kmcallister/events{/privacy}","received_events_url":"https://api.github.com/users/kmcallister/received_events","type":"User","site_admin":false},"created_at":"2015-02-21T19:43:26Z","updated_at":"2015-02-21T19:43:26Z","body":"What I mentioned on IRC is that projects which use [Cargo build scripts](http://doc.crates.io/build-script.html) (i.e. `build.rs`) will hit a dynamic linker error trying to run the resulting Rust program.  I guess that's because Cargo isn't using `rust -C rpath`.\r\n\r\nIt does seem weird to have two options for how to find dynamic libraries.  I'm okay sticking to `LD_LIBRARY_PATH` if that's the simple solution.  This is a long-standing problem on UNIX and not one we're likely to solve in a breakthrough way.  afaik a lot of projects would use a shell script named `rustc` that figures out the right variables and invokes `rustc.bin`."}}