Closed msridhar closed 9 months ago
Possibly related to #203, but now I believe we already have the com.diffplug.configuration-cache-for-platform-specific-build
plugin set up correctly in our settings.gradle
.
It looks like this code is relevant, similar to #203 (in fact this issue may just be a duplicate and possibly #203 was closed erroneously):
Looks like this issue is specific to MacOS and detecting whether the chip is ARM or x86.
I attempted a fix for this in https://github.com/diffplug/durian-swt/pull/24.
Thanks for the PR! I posted my concerns there. If my concerns are incorrect, then this is easy to fix. If my concern is correct, I think we can fix it by using uname
within this: https://github.com/diffplug/goomph/blob/main/src/main/java/com/diffplug/gradle/swt/PlatformSpecificBuildPlugin.java
Hi @nedtwigg as I noted on the PR I think your concern is correct. As to changing PlatformSpecificBuildPlugin
instead, I'm not exactly sure how that would work; I think we'd need to make a change also in durian-swt? In any case, if you'd like me to make a PR, it will be a few days before I can look again. Again thanks for the feedback!
According to the docs [here](), this will work if it was run inside the plugin's apply block.
def gitVersion = providers.exec {
commandLine("git", "--version")
}.standardOutput.asText.get()
Seems like something along the lines of
OS.detectPlatform(
systemProp -> settings.getProviders().systemProperty(systemProp).forUseAtConfigurationTime().get(),
envVar -> settings.getProviders().environmentVariable(envVar).forUseAtConfigurationTime().get(),
(Function<List<String>, String> command executor) -> { args ->
settings.getProviders().exec {
commandLine(args)
}.standardOutput.asText.get()
}
);
Thanks for this fix!! I confirmed on the WALA project that this fixes the configuration cache problem we were seeing on an M1 Mac.
Fixed in 3.44.0
.
I see a configuration cache problem in particular circumstances when using this plugin on macOS. Here is my version info:
I'm using version 3.42.2 of the plugin. To reproduce, clone https://github.com/wala/WALA, and then run
./gradlew clean compileJava compileTestJava --no-build-cache --no-daemon
. I get the following error:I see the same error on JDK 11 and JDK 17. I'm attaching the configuration cache report from JDK 17.
Gradle Configuration Cache.pdf
Please let me know I can provide any other information.