Skip to content
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

Switch to using Jar Jar Abrams #38

Merged
merged 3 commits into from
Oct 4, 2023
Merged

Switch to using Jar Jar Abrams #38

merged 3 commits into from
Oct 4, 2023

Conversation

eed3si9n
Copy link
Contributor

@eed3si9n eed3si9n commented Oct 4, 2023

Jar Jar Links (jarjar) is in-sourced to Jar Jar Abrams (https://github.com/eed3si9n/jarjar-abrams) repository and receives regular maintenance since it's being used as sbt-assembly. I think we should switch to using Jar Jar Ambrams CLI:

  1. it's an extension of the original jarjar handling Scala signatures and $-mangling.
  2. it wipes out the Zip entry timestamps to 2010-01-01.

Note

The following demonstrates that the Zip entries for Spring Boot Actuator is 2010'ed out.

$ unzip -l bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
Archive:  bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-01-2010 00:00   META-INF/

I've also added src/test/bazel:jarjar_test to test this behavior on CI.

Since Jar Jar Abrams CLI is distributed as an uber JAR, we can also get rid of rules_jvm_external, and just download the JAR from Maven Central.

Jar Jar Links (`jarjar`) is in-sourced to Jar Jar Abrams (https://github.com/eed3si9n/jarjar-abrams)
repository and receieves regular maintenance since it's being used as sbt-assembly.
I think we should switch to using Jar Jar Ambrams CLI:
1. it's an extension of the original jarjar handling Scala signatures and `$`-mangling.
2. it wipes out the Zip entry timestamps to 2010-01-01.

**Note**

The following demonstrtes that the Zip entries for Spring Boot Actuator is 2010'ed out.

```
$ unzip -l bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
Archive:  bazel-out/darwin_arm64-fastbuild/bin/external/jvm__org_springframework_boot__spring_boot_actuator/spring-boot-actuator-shaded.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-01-2010 00:00   META-INF/
```

I've also added `src/test/bazel:jarjar_test` to test this behavior on CI.

Since Jar Jar Abrams CLI is distributed as an uber JAR, we can also get rid of rules_jvm_external, and just download the JAR from Maven Central.
@eed3si9n
Copy link
Contributor Author

eed3si9n commented Oct 4, 2023

GNU/Linux and macOS (BSD) unzip have different date formats I guess. I can check for 2010, instead of 01-01-2010.

+ cat unzip.txt
Archive:  src/test/bazel/scalding_args__shaded.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2010-01-01 00:00   META-INF/
        0  2010-01-01 00:00   foo/
      271  2010-01-01 00:00   META-INF/MANIFEST.MF
     6540  2010-01-01 00:00   foo/Args$.class
    17170  2010-01-01 00:00   foo/Args.class
     1603  2010-01-01 00:00   foo/ArgsException$.class
     4257  2010-01-01 00:00   foo/ArgsException.class
     1586  2010-01-01 00:00   foo/Range$.class
     7966  2010-01-01 00:00   foo/Range.class
      6[22](https://github.com/bazeltools/bazel_jar_jar/actions/runs/6409338848/job/17400307738?pr=38#step:5:23)  2010-01-01 00:00   foo/RangedArgs$.class
     [29](https://github.com/bazeltools/bazel_jar_jar/actions/runs/6409338848/job/17400307738?pr=38#step:5:30)89  2010-01-01 00:00   foo/RangedArgs.class
---------                     -------
    4[30](https://github.com/bazeltools/bazel_jar_jar/actions/runs/6409338848/job/17400307738?pr=38#step:5:31)04                     11 files

Copy link
Collaborator

@johnynek johnynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely seems good to share code that is used by more folks.

thanks @eed3si9n

@johnynek johnynek merged commit 6c473dd into main Oct 4, 2023
12 checks passed
@eed3si9n eed3si9n deleted the wip/alternative branch October 4, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants