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

cargo android run does not respect $*_HOME #122

Open
mamins1376 opened this issue Mar 28, 2023 · 0 comments
Open

cargo android run does not respect $*_HOME #122

mamins1376 opened this issue Mar 28, 2023 · 0 comments

Comments

@mamins1376
Copy link

I have set $RUSTUP_HOME and $CARGO_HOME to non-default values in my setup, and trying to build for android gave me the following results:

$ cargo android run
...
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:rustBuildArm64Debug'.
> Process 'command 'cargo'' finished with non-zero exit value 1

After some investigation, turns out cargo-android does not pass RUSTUP_HOME and CARGO_HOME environment variables down, resulting in the above error.

Current workaround: Make a symlink for each non-default path to the current one:

$ cd
$ rm -rf .rustup
$ ln -sr "$RUSTUP_HOME" .rustup
$ rm -rf .cargo
$ ln -sr "$CARGO_HOME" .cargo
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

1 participant