-
Notifications
You must be signed in to change notification settings - Fork 96
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
Plugin seems incompatible with configuration cache #406
Comments
this is because in order to be configuration cache compatible you can't fork a process, at least generally speaking (I understand there might be a way around that). This is the solution which I copied shamelessly from static void preventJGitFromCallingExecutables() {
SystemReader reader = SystemReader.getInstance();
SystemReader.setInstance(
new SystemReader.Delegate(reader) {
@Override
public String getenv(String variable) {
if ("PATH".equals(variable)) {
return "";
} else {
return super.getenv(variable);
}
}
}
);
} I'm considering creating a shaded "fork" of jgit just for the purpose of applying this fix due to static usage. I say fork loosely because if you're doing more (which this plugin seems to), it wouldn't be a good idea to use it. jgit is unfortunately designed with mutable statics. I opened this bug for a discussion with the spotless guys if anyone is interested. |
While we could use a workaround to prevent it looking for system config, that also has the downside of impacting builds that may rely on the system config being detected. It feels like trading existing compatibility for the performance boost of configuration cache, which for the legacy status of grgit isn't where I want to go. Configuration cache has been a moving target over the years that sucks up too much maintenance time for me, so I plan to update the readme to say that it's explicitly not supported for grgit. |
When I try to enable Gradle's configuration cache, I received the following error.
The text was updated successfully, but these errors were encountered: