Skip to content

Commit

Permalink
Use bootclasspath jar in proguard genrule
Browse files Browse the repository at this point in the history
Previously, proguard may attempt to access the Java runtime jmods, which aren't declared as inputs.

Fixes bazelbuild#22787 (comment)

Closes bazelbuild#23067.

PiperOrigin-RevId: 655470599
Change-Id: I5ff6cd9c32f553fc3d8364ba1b6a4f4e3417418b
  • Loading branch information
fmeum committed Sep 22, 2024
1 parent 67c3fc5 commit 468bf23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,14 @@ genrule(
name = "fastutil_stripped_jar",
srcs = [
"@maven//:it_unimi_dsi_fastutil_file",
"@rules_java//toolchains:platformclasspath",
],
outs = ["fastutil-stripped.jar"],
cmd = """
$(location :proguard) \
-injars $< \
-injars $(execpath @maven//:it_unimi_dsi_fastutil_file) \
-outjars $@ \
-libraryjars '<java.home>/jmods/java.base.jmod(!**.jar;!module-info.class)' \
-libraryjars $(execpath @rules_java//toolchains:platformclasspath) \
@$(location //tools:fastutil.proguard) \
| tail -n +2 # Skip the "ProGuard, version X" line
# Null out the file times stored in the jar to make the output reproducible.
Expand Down

0 comments on commit 468bf23

Please sign in to comment.