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-1747516: Fix native libraries relocation #1927

Conversation

laurentgo
Copy link
Contributor

@laurentgo laurentgo commented Oct 17, 2024

Overview

SNOW-1747516

Pre-review self checklist

  • PR branch is updated with all the changes from master branch
  • The code is correctly formatted (run mvn -P check-style validate)
  • New public API is not unnecessary exposed (run mvn verify and inspect target/japicmp/japicmp.html)
  • The pull request name is prefixed with SNOW-XXXX:
  • Code is in compliance with internal logging requirements

External contributors - please answer these questions before submitting a pull request. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Issue: SNOW-1747516: Native libraries are not relocated #1926

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency or upgrading an existing one
    • I am adding new public/protected component not marked with @SnowflakeJdbcInternalApi (note that public/protected methods/fields in classes marked with this annotation are already internal)
  3. Please describe how your code solves the related issue.

Native libraries used by conscrypt and grpc/netty are not relocated to a different name although their counterpart java classes are. This may cause a conflict with applications using the same dependencies but possibly different versions up to a JVM crash.

Modify maven-shade-plugin relocation configuration to rename the libraries using snowflake shade base:

  • relocate grpc/netty tcnative and epoll libraries (note that Netty java loader detects relocation automatically as long as the base is the same for the java classes and the native library (minus dot '.' being replaced with underscore '_'))
  • relocate conscrypt native library and change the prefix used to find the library in NativeCryptoJni class

@laurentgo laurentgo requested a review from a team as a code owner October 17, 2024 17:41
Copy link

github-actions bot commented Oct 17, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@laurentgo laurentgo changed the title Fix native libraries relocation SNOW-1747516: Fix native libraries relocation Oct 17, 2024
@laurentgo
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

recheck

@sfc-gh-dprzybysz
Copy link
Collaborator

recheck

Native libraries used by conscrypt and grpc/netty are not relocated to a
different name although their counterpart java classes are. This may
cause a conflict with applications using the same dependencies but
possibly different versions up to a JVM crash.

Modify maven-shade-plugin relocation configuration to rename the
libraries using snowflake shade base:
* relocate grpc/netty tcnative and epoll libraries (note that Netty java
  loader detects relocation automatically as long as the base is the
  same for the java classes and the native library (minus dot '.' being
  replaced with underscore '_'))
* relocate conscrypt native library and change the prefix used to find
  the library in NativeCryptoJni class
@laurentgo laurentgo force-pushed the laurentgo/native-libraries-relocation branch from d66d56a to 348075e Compare November 22, 2024 16:48
@laurentgo
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@laurentgo
Copy link
Contributor Author

recheck

@sfc-gh-dprzybysz sfc-gh-dprzybysz merged commit f1038e6 into snowflakedb:master Nov 26, 2024
141 of 143 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2024
@sfc-gh-dprzybysz
Copy link
Collaborator

@laurentgo thank you for the contribution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants