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

Pantbuild Jarjar Archived #15

Closed
vjkoskela opened this issue Jun 22, 2020 · 4 comments
Closed

Pantbuild Jarjar Archived #15

vjkoskela opened this issue Jun 22, 2020 · 4 comments

Comments

@vjkoskela
Copy link

vjkoskela commented Jun 22, 2020

The pantsbuild/jarjar project was recently archived. Since the Bazel rules in this project depend on pantsbuild/jarjar, I was wondering what the plans were for this project to continue supporting shading in Bazel?

Also, if anyone on this project has any insight into where the Bazel community stands on this feature I would appreciate some pointers. The only references I found to shading with Bazel actually just lead back here!

e.g,:

I can post this elsewhere (Stackoverflow or bazel-discuss@) if that would be more appropriate.

The rules here have been very useful for building extensions to existing JVM infrastructure in Bazel in the presence of dependency conflicts. Thanks for making these available!

@johnynek
Copy link
Collaborator

I'm glad this has been useful to you. The fact that the repo is archived doesn't seem necessarily like a problem. jarjar is pretty old, and that repo was a copy of the code with some very minor changes anyway.

Are there bugs you are seeing that need to be fixed?

I'm happy to merge any PRs to point to more recent published jars that have any bugfixes. But so far, I think this works well enough.

@vjkoskela
Copy link
Author

No bugs. However, in order to shade Google's GRPC package it looks like I need a few additional features. In fact, submitting a patch for one of these features is what prompted the archiving of the pantsbuild/jarjar project.

The first feature was to be able to rename resource files. GRPC which depends on netty which in turn embeds a native dependency in the JAR which requires a name derived from the shading rule used on the package name. Details about the netty shading can be found in netty-6665. My pull request for adding rename support is here:

pantsbuild/jarjar#52

The second snag that I hit was that GRPC relies on service providers declared in META-INF/services/ for its name resolvers. The defaults need to be relocated with the package path change. Alternatively, I could just package in new resource files, but seems somewhat hacky (and brittle should Google change the default). The processing of service providers through the mapper seems relatively simple as well; I can post a branch with the changes if you are interested.

@johnynek
Copy link
Collaborator

I see.

How is your rename different from rule? can't you accomplish what you want with a rule?

Anyway, I think your main question is "who owns jarjar now?" Maybe the answer, unfortunately, is no one.

I cannot step up to do that.

@vjkoskela
Copy link
Author

Unfortunately, I was unable to achieve the rename operation using the existing rule. I believe it was a combination of the file name changing and not the path, and the file being a resource (e.g. non .class) which are treated differently. There may be a more elegant way to extend rule to build out rename support.

Completely understand and appreciate your prompt response. I figured there was a good chance it was going to go unowned. If this becomes a bigger part of job I'll see if I can roll jarjar into that cycle.

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

No branches or pull requests

2 participants