Open Dexterp37 opened 5 years ago
I think the OS is free to remove stuff in %Temp%
at any time, so that might be the issue here. I have what I think is the same issue on Linux, in /tmp
.
Perhaps we should use something in $GRADLE_HOME
instead, which I've seen other plugins use as a place to put gradle-managed-downloaded content.
I think the OS is free to remove stuff in
%Temp%
at any time, so that might be the issue here. I have what I think is the same issue on Linux, in/tmp
.Perhaps we should use something in
$GRADLE_HOME
instead, which I've seen other plugins use as a place to put gradle-managed-downloaded content.
I'm not really against this, although I don't love putting stuff in dot-directories either. @Dexterp37, can you see if @mdboom's theory is correct by using the different ways to set the toolchain directory listed around: https://github.com/mozilla/rust-android-gradle/blob/fcea23838ca8d95bc5e6caff504dfcf605b2e323/plugin/src/main/kotlin/com/nishtahir/CargoExtension.kt#L58
@ncalexan yes, the theory seems correct, the failures haven't shown up since I set rust.androidNdkToolchainDir
in local.properties
to different directory.
Yeah, I confirm the same.
I think there are two obvious choices for a better default, based on what other plugins I've seen do. If sharing these between projects is useful, it could use something under ~/.gradle
. In that case, you have to be explicit about putting version numbers in the paths so different projects don't clobber each other. Alternatively, you could use $PROJECT_ROOT/.gradle
. Even then, versioning is helpful to make jumping between git branches faster.
We went down a similar path making the Python environment "plugin" (it's not strictly a plugin) for Glean, and ultimately landed on using ~/.gradle/glean
as the installation location and haven't had any issues since.
Yeah, I confirm the same.
I think there are two obvious choices for a better default, based on what other plugins I've seen do. If sharing these between projects is useful, it could use something under
~/.gradle
. In that case, you have to be explicit about putting version numbers in the paths so different projects don't clobber each other. Alternatively, you could use$PROJECT_ROOT/.gradle
. Even then, versioning is helpful to make jumping between git branches faster.We went down a similar path making the Python environment "plugin" (it's not strictly a plugin) for Glean, and ultimately landed on using
~/.gradle/glean
as the installation location and haven't had any issues since.
Thanks for the experience from the trenches. I can't make this happen myself, but I'm totally happy to take a patch that does it. Thanks, Glean team!
In my project, the first time I build it in the morning, building fails when invoking the Gradle task
:project:cargoBuildArm
(I'm on Windows). That's the thrown exception:Looking a bit closer at Android Studio's errors, I can also see:
In order to make the build work again, I need to manually go to
%Temp%
and delete therust-android-ndk-toolchains
directory. After that, it rebuilds the directory and everything builds just fine.