buildfoundation / bazel_rules_detekt

Bazel rules for Detekt (Kotlin static analysis tool)
Apache License 2.0
29 stars 8 forks source link

Switch persistent worker from Protocol Buffers to JSON #133

Closed artem-zinnatullin closed 1 year ago

artem-zinnatullin commented 1 year ago

Based on @arturdryomov work in https://github.com/buildfoundation/bazel_rules_detekt/pull/107 rebased w/ current master, updated to Bazel changes and latest deps.

Switches Detekt Persistent Worker to JSON, thus allowing us to remove dependency on rules_proto and speedup dep resolution for downstream users of rules_detekt!

Back then when @arturdryomov made original PR Bazel still had JSON as experimental option which since was set to true by default and is now a stable feature w/o feature-flag, and there was a bug with newline delimeters that is now fixed.

This means that users on stable new versions of Bazel (since 2022-01-24) don't have to do anything on their end to use rules_detekt with this change and they'll just get speedup because of removed dependency on rules_proto.

Bencodes commented 1 year ago

We probably need to make a note in the README that you need to enable json worker support if you are using an older version of Bazel.

Double check, but I think the json worker protocol flag only got flipped to true recently in 5.x or 6.x. Bazel 4.x still has another year before it's no longer supported.

https://blog.bazel.build/2020/11/10/long-term-support-release.html

artem-zinnatullin commented 1 year ago

Added info on the --experimental_worker_allow_json_protocol to the README!