djc/rustc-version-rs

unexpected -vV format

Closed this issue · 4 comments

Using xargo, which calls rustc-version 1.7, I get that error. I changed to version 2.1 and it still complains.

Output of rustc -vV appears to be:

rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)
binary: rustc
commit-hash: 0e6f4cf51cd3b799fb057956f8e733d16605d09b
commit-date: 2017-09-27
host: x86_64-unknown-linux-gnu
release: 1.22.0-nightly
LLVM version: 4.0

Which seems to match a test case.

Above testing was done in a vagga container, so maybe it is messed up. Ubuntu Xenial 16.04

And rustc-version unit tests pass when run on the host computer Ubuntu 16.10.

And rustc-version unit tests pass within the container.

Sorry, spurious issue, flaw in my container.

Actually, I think it is an edge case, for possible improvement. In my environment, rustup and rustc are installed. But unfortunately (because some env vars were wrong) rustc seemed to invoke rustup which failed to create a lock file in a read-only directory. So the command did execute (i.e. start) but returned result "failed" and the output was not a valid version string. Maybe rustc_version should also check the success value from the command. In other words, add an error enum "command ran but failed."

The last suggestion sounds reasonable, I'll open an issue for it to keep it in mind.