Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot locate cargo and rustc on Windows. #53

Open
bsekura opened this issue Jun 19, 2021 · 1 comment
Open

Cannot locate cargo and rustc on Windows. #53

bsekura opened this issue Jun 19, 2021 · 1 comment
Assignees

Comments

@bsekura
Copy link

bsekura commented Jun 19, 2021

On Windows TC Agent (running as service), I'm getting the following errors:

[2021-06-18 22:17:18,298]   INFO - rver.rust.AbstractToolProvider - Locating Cargo tool
[2021-06-18 22:17:18,392]   WARN - rver.rust.AbstractToolProvider - Failed to parse Cargo version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)
[2021-06-18 22:17:18,485]   WARN - rver.rust.AbstractToolProvider - Failed to parse Cargo version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)
[2021-06-18 22:17:18,485]   INFO - rver.rust.AbstractToolProvider - Locating Rustc tool
[2021-06-18 22:17:18,595]   WARN - rver.rust.AbstractToolProvider - Failed to parse Rustc version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)
[2021-06-18 22:17:18,689]   WARN - rver.rust.AbstractToolProvider - Failed to parse Rustc version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)

Rust 1.53

It looks like because of this parsing errors, it cannot locate cargo and rustc.

However, rustup is correctly found:

[2021-06-18 22:17:18,689]   INFO - rver.rust.AbstractToolProvider - Locating Rustup tool
[2021-06-18 22:17:18,861]   INFO - rver.rust.AbstractToolProvider - Found Rustup at C:\Users\xxxx\.cargo\bin\rustup.exe

Using the same plugin on Linux works.

@urkle
Copy link

urkle commented Feb 27, 2023

This issue occurs for me on linux as well. I have a teamcity-minimal-agent based docker image that I added rustup to.

[2023-02-27 21:44:45,521]   INFO - rver.rust.AbstractToolProvider - Locating Cargo tool
[2023-02-27 21:44:45,548]   WARN - rver.rust.AbstractToolProvider - Failed to parse Cargo version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)
[2023-02-27 21:44:45,548]   INFO - rver.rust.AbstractToolProvider - Locating Rustc tool
[2023-02-27 21:44:45,576]   WARN - rver.rust.AbstractToolProvider - Failed to parse Rustc version: Input string is NULL or empty: java.lang.IllegalArgumentException: Input string is NULL or empty (enable debug to see stacktrace)
[2023-02-27 21:44:45,576]   INFO - rver.rust.AbstractToolProvider - Locating Rustup tool
[2023-02-27 21:44:45,612]   INFO - rver.rust.AbstractToolProvider - Found Rustup at /home/buildagent/.cargo/bin/rustup

Now sifting through the code it ( https://github.com/JetBrains/teamcity-rust-plugin/blob/master/plugin-rust-agent/src/main/kotlin/jetbrains/buildServer/rust/AbstractToolProvider.kt#L81 )
the code runs the tool to determine the version number. And that is where the issue stems from.

I had not configured a default rust toolchain!

Once I configured a default tool chain and kicked the agent to restart it detected cargo and rustc.

This behavior can be problematic if one just wants to setup rustup without any toolchain (and let each build step determine what it needs).

Possibly related to #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants