frankgh commented on code in PR #63:
URL: https://github.com/apache/cassandra-sidecar/pull/63#discussion_r1273919578


##########
vertx-client-shaded/build.gradle:
##########
@@ -55,8 +72,7 @@ shadowJar {
     relocate 'com.fasterxml.jackson.databind', 
'o.a.c.sidecar.client.shaded.com.fasterxml.jackson.databind'
     relocate 'io.netty', 'o.a.c.sidecar.client.shaded.io.netty'
     relocate 'io.vertx', 'o.a.c.sidecar.client.shaded.io.vertx'
-    relocate 'META-INF/native/libnetty', 
'META-INF/native/sidecar_client_netty_shaded_netty'
-    relocate 'META-INF/native/netty', 
'META-INF/native/io_sidecar_client_netty_shaded_netty'
+    relocate 'META-INF/native/libnetty', 
'META-INF/native/libo_a_c_sidecar_client_shaded_netty'
     relocate 'META-INF/versions/11/io/vertx', 
'META-INF/versions/11/o/a/c/sidecar/client/shaded/io/vertx'

Review Comment:
   those two lines are not doing quite the same. In line 75 we are renaming all 
the files inside the `META-INF/native` directory that start with name 
`libnetty`. And we end up with the following names.
   
   ```
   jar -tf 
~/.m2/repository/org/apache/cassandra/sidecar/vertx-client-all/1.0.0-local/vertx-client-all-1.0.0-local.jar
 | grep netty_tcn
   
   META-INF/native/libo_a_c_sidecar_client_shaded_netty_tcnative_linux_x86_64.so
   
META-INF/native/libo_a_c_sidecar_client_shaded_netty_tcnative_osx_aarch_64.jnilib
   
META-INF/native/libo_a_c_sidecar_client_shaded_netty_tcnative_linux_aarch_64.so
   
META-INF/native/libo_a_c_sidecar_client_shaded_netty_tcnative_osx_x86_64.jnilib
   ```
   
   This is what netty expects to be in the classpath to be able to load the 
native library.
   
   For line 76, we are changing the expected directory structure for vertx, 
where the original is `io/vertx`, it now expects the directory structure to 
match the package name of the shaded version. The result is the following:
   
   ```
    ls -R 11
   o
   
   11/o:
   a
   
   11/o/a:
   c
   
   11/o/a/c:
   sidecar
   
   11/o/a/c/sidecar:
   client
   
   11/o/a/c/sidecar/client:
   shaded
   
   11/o/a/c/sidecar/client/shaded:
   io
   
   11/o/a/c/sidecar/client/shaded/io:
   vertx
   
   11/o/a/c/sidecar/client/shaded/io/vertx:
   core
   
   11/o/a/c/sidecar/client/shaded/io/vertx/core:
   DeploymentOptions.class impl
   
   11/o/a/c/sidecar/client/shaded/io/vertx/core/impl:
   LoaderManager.class
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to