bazel-contrib / bazel-contrib/rules_jvm_external

jvm_import ignores embedded ProGuards

Open
#672 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

Hi wonderful Bazel folks,

I'd noticed that Bazel core was ignoring ProGuard files embedded in JARs, rather than bubbling them up in ProguardSpecProvider, so I'd pulled together a PR to fix it https://github.com/bazelbuild/bazel/pull/14966.

But that doesn't automatically fix the issue in this repo, since it looks like [rules_jvm_external rolls its own java_import](https://github.com/bazelbuild/rules_jvm_external/blob/master/private/rules/jvm_import.bzl), java_import having been [badly broken for Kotlin for years](https://github.com/bazelbuild/bazel/issues/4549). Sad times.

So, I thought I should give a heads, especially since the majority of JARs with these embedded ProGuard specs are probably being pulled from Maven. It seems like the right fix is probably to fix java_import and use that, rather than getting deeper into duplicating its essential logic. But you could also re-roll all the java_import proguard logic in jvm_import, using on the extractor tool I wrote in the PR (once it lands) and the Bazel proguard spec validator already available. Thoughts?

Thanks for reading,
Chris
(ex-Googler)

Contributor guide

Open the contributing guide

Research direction

Read private/rules/jvm_import.bzl and compare its custom java_import behavior with Bazel's java_import and ProguardSpecProvider. Inspect the extractor tool mentioned in PR #14966 and the existing ProGuard spec validator before choosing an approach. Done means embedded ProGuard files from Maven JARs are exposed correctly without regressing Kotlin imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.