-
Notifications
You must be signed in to change notification settings - Fork 49
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
setup-gradle
with gradle 7.x fails to replace environment variables in toolchains.xml
#511
Comments
Does the "after" version of
If so, this is clearly invalid XML and I would expect a different error message to result. It's also hard to understand how the different entries like |
I'm sorry, I re-checked my logs and the blank line made me misread the file! The actual file looks like below. In other words, it's working as intended. Should we simply ignore the lines about missing directories?
|
The only way I can see this happening is:
This is odd, because I'd expect the same environment variables to exist in both cases. Can you please check a few things?
Thanks! |
When the workflow starts it has the following JAVA-environment variables. It stays unchanged through both
Using
Output of
output of
After running
|
Thanks for your detailed reporting. For some reason, it seems that Gradle is unable to resolve the environment variables that are encoded in I've put together a
I've tested using this workflow and it appears to be detecting toolchains as expected. If this fix resolves your problem I'll definitely merge these changes and release. If not, the messages you see should give more clarity into what's going on. |
I tried using I also just now tried upgrading to use gradle 8.12 instead of 7.6.4, which also seems to resolve the issue, even when using v4 of the For posterity and in case others face the same issue, should I update the title of this issue? |
@asmundh Yes, please update the title to accurately reflect the issue. I guess Gradle 7.x may not be correctly replacing environment variables in Thanks for reporting that the fix works for you. To avoid other Gradle 7.x users hitting this issue, I'll merge the fix into |
setup-gradle
overrides toolchains.xml
with non-working JDK locationssetup-gradle
with gradle 7.x fails to replace environment variables in toolchains.xml
Great, thank you for the help! |
Figured I'd move this to its own issue. We are experiencing issues when bumping
setup-gradle
from V2 (gradle-buld-action@v2
) to v4 (also tested with v3). The version bump makes our gradle workflow several minutes slower.The problem seemingly occurs here. See below for outputs from our workflow.
Specifically, when running
run ./gradlew build
aftersetup-gradle@v4
gradle logs that it cannot find certain directories because they are named in thetoolchains.xml
-file after runningsetup-gradle
. However, aftersetup-java
has ran, onlyJAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.13-11/x64
andJAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.13-11/x64
are set.Originally posted by @asmundh in #89
The text was updated successfully, but these errors were encountered: