Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

rust-lldb binary fails with I/O error #335

Closed
japaric opened this issue Apr 17, 2016 · 8 comments
Closed

rust-lldb binary fails with I/O error #335

japaric opened this issue Apr 17, 2016 · 8 comments

Comments

@japaric
Copy link
Member

japaric commented Apr 17, 2016

STR

$ rustup default nightly
$ echo 'fn main() {}' > hello.rs
$ rustc hello.rs
$ ./hello && echo OK
OK
$ rust-lldb ./hello
error: command failed: 'rust-lldb' (Io: No such file or directory (os error 2))

I also tried the rust-lldb shell script from the rust-lang/rust repo and that errors with a failed import:

$ sh rust-lldb ./hello
(lldb) command source -s 0 '/tmp/rust-lldb-commands.BUuutK'
Executing commands in '/tmp/rust-lldb-commands.BUuutK'.
(lldb) command script import "/home/japaric/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_rust_formatters.py"
error: module importing failed: invalid pathname
(lldb) target create "./hello"
Current executable set to './hello' (x86_64).
(lldb)

Because there is no lldb_rust_formatters.py file in the .multirust install:

$ ls $(find ~/.multirust -name etc)
/home/japaric/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/etc:
bash_completion.d

/home/japaric/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/etc:
debugger_pretty_printers_common.py  gdb_load_rust_pretty_printers.py  gdb_rust_pretty_printing.py

That missing file may be the reason why the rust-lldb binary also fails.

Meta

$ rustc -Vv
rustc 1.10.0-nightly (2174bd97c 2016-04-14)
binary: rustc
commit-hash: 2174bd97c1458d89a87eb2b614135d7ad68d6f18
commit-date: 2016-04-14
host: x86_64-unknown-linux-gnu
release: 1.10.0-nightly
@japaric
Copy link
Member Author

japaric commented Apr 17, 2016

The problem is that the rust-lldb binary shells out to the rust-lldb shell script:

$ strace -f -s 128 rust-lldb ./hello
(...)
[pid 10680] execve("/home/japaric/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-lldb", ["/home/japaric/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-lldb", "./hello"], [/* 49 vars */]) = -1 ENOENT (No such file or directory)
(...)

But that script didn't get installed:

$ ls $(rustc --print sysroot)/bin
cargo  rustc  rustdoc  rust-gdb

@japaric
Copy link
Member Author

japaric commented Apr 17, 2016

Manually installing the rust-lldb shell scrip and the lldb_rust_formatters.py python script from the rust-lang/rust into the ~/.multirust directory "solves" the issue locally. I guess rustup should install these files.

@brson
Copy link
Contributor

brson commented Apr 19, 2016

Upstream PR to install rust-lldb.

@Luthaf
Copy link

Luthaf commented Jul 3, 2016

Do you know when this will be available ? Trying to use any of rust-gdb on OSX or rust-lldb on Linux gives an error; with both the stable and latest nightly versions.

Also, shouldn't this file have been updated in the PR?

@brson
Copy link
Contributor

brson commented Jul 26, 2016

@Luthaf it does seem like my previous patch to package rust-lldb was insufficient (I'd expect it to be available in nightlies). Do you feel like submitting the fix you pointed out to rust-lang/rust?

@Luthaf
Copy link

Luthaf commented Jul 30, 2016

I can try to do that, I have some free time this week.

@Luthaf
Copy link

Luthaf commented Aug 29, 2016

Actually the code in prepare.mk looks fine, I have no idea what is wrong here.

@Diggsey
Copy link
Contributor

Diggsey commented May 4, 2017

I think this is fixed? Please re-open if not.

@Diggsey Diggsey closed this as completed May 4, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants