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 #22787 (comment)

Closes #23067.

PiperOrigin-RevId: 655470599
Change-Id: I5ff6cd9c32f553fc3d8364ba1b6a4f4e3417418b
  • Loading branch information
fmeum authored and copybara-github committed Jul 24, 2024
1 parent 54820bd commit 497c2c3
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 @@ -308,13 +308,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 497c2c3

Please sign in to comment.