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

SNOW-905110: META-INF/versions entires are not relocated #1503

Closed
pkoenig10 opened this issue Aug 31, 2023 · 7 comments
Closed

SNOW-905110: META-INF/versions entires are not relocated #1503

pkoenig10 opened this issue Aug 31, 2023 · 7 comments
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-merged

Comments

@pkoenig10
Copy link

pkoenig10 commented Aug 31, 2023

After #1382, the classes in META-INF/versions are no longer relocated to the shaded location.

This can be dangerous for consumers that depend on these bouncycastle JARs, since the versions bundled in snowflake-jdbc may be loaded instead, which can lead to runtime failures if consumers are using a newer version of bouncycastle.

Screenshot 2023-08-31 at 12 27 35 PM

There are two issues with #1382:

  • The sortpom plugin was added and configured with a sortPlugins element that reordered the plugins. Maven plugins are applied in the order in which they are declared. This caused the maven-antrun-plugin (which performs the relocations) to be applied before the maven-shade-plugin.
  • The move elements were removed from the maven-antrun-plugin. Without this, META-INF/versions will contain both the original and relocated classes.
@pkoenig10 pkoenig10 added the bug label Aug 31, 2023
@github-actions github-actions bot changed the title META-INF/versions entires are not relocated SNOW-905110: META-INF/versions entires are not relocated Aug 31, 2023
@sfc-gh-spanaite sfc-gh-spanaite self-assigned this Oct 3, 2023
@sfc-gh-spanaite
Copy link
Contributor

Thanks @pkoenig10 for submitting the PR. We will review it internally and provide feedback.

@jeffkkim
Copy link

I just noticed some compilation errors with Jackson being built against Java 17/19 for similar reasons, would it be possible to fix those issues alongside with a similar solution?

@ash211
Copy link
Contributor

ash211 commented Nov 16, 2023

Yes, in snowflake-jdbc 3.14.2 -> 3.14.3 there were more META-INF entries added for Jackson that aren't correctly shaded. My CI shows the diff:

Screenshot 2023-11-16 at 11 24 39 AM

@sfc-gh-spanaite are you able to review the PR and provide feedback?

@maxsumrall
Copy link

Just found this issue after having to skip/close another upgrade PR (3.14.5 released yesterday) because of this issue.

@sfc-gh-spanaite sfc-gh-spanaite removed their assignment Jan 29, 2024
@sfc-gh-dprzybysz
Copy link
Collaborator

We have merged PR #1621 fixing the relocation of classes in META-INF and it will be included in the February 2024 release. If you want to test it now you can build the driver from source as described in README

@sfc-gh-dszmolka sfc-gh-dszmolka added status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-merged and removed status-merged labels Feb 11, 2024
@sfc-gh-dprzybysz
Copy link
Collaborator

The fix was released in 3.15.0

@ash211
Copy link
Contributor

ash211 commented Feb 21, 2024

Yes this seems to be corrected now in 3.15.0

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants