runningcode / gradle-doctor

The right prescription for your Gradle build.
http://runningcode.github.io/gradle-doctor
Apache License 2.0
736 stars 48 forks source link

fix: Ignore process exit value for Apple Rosetta check #285

Closed ninniuz closed 10 months ago

ninniuz commented 10 months ago

When running the Apple Rosetta check on an Intel MacOS machine, the sysctl command exists with non-success result value.

That case is correctly handled in the check logic but breaks Gradle configuration cache as the command output is an Exception.

It should be enough to ignore the exit value of the process to restore the configuration cache usage.

ninniuz commented 10 months ago

Thanks for doing this! I guess there isn't a good way to test this since it relies on having an intel based mac (which I assume is not provided for free on GHA runners)

Actually I am not sure, but it looks like there are MacOS runners

runningcode commented 10 months ago

It would be great to have an integration test for this. Can you check if they offer intel based runners? If so, do you think running the same workflow on an intel based mac runner would reproduce the issue?

ninniuz commented 10 months ago

Since the plugin is applied on the doctor-plugin module and the CC is on, I think any task on that module should fail at CC storage time on an intel based runner. WDYT?

ninniuz commented 10 months ago

@runningcode the current master is indeed failing when running on an intel based macos runner, see here

How would you like to proceed? I could add a new workflow to run a simple Gradle task, e.g. pluginTasks, on a macos runner to validate the fix in this PR.

runningcode commented 10 months ago

That sounds like a great idea, please add a new workflow to run a simple task to validate this scenario.