lhotari commented on code in PR #22230:
URL: https://github.com/apache/pulsar/pull/22230#discussion_r1518964156


##########
docker/pulsar/build-scripts/remove-unnecessary-native-binaries.sh:
##########
@@ -0,0 +1,38 @@
+#!/usr/bin/env sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -e
+
+# Retain only native libraries for the architecture of this
+# image
+ARCH=$(uname -m)
+
+# Remove extra binaries for Netty TCNative
+ls /pulsar/lib/io.netty-netty-tcnative-boringssl-static*Final-*.jar | grep -v 
linux-$ARCH | xargs rm
+
+# Prune extra libs from RocksDB JAR
+mkdir /tmp/rocksdb
+cd /tmp/rocksdb
+ROCKSDB_JAR=$(ls /pulsar/lib/org.rocksdb-rocksdbjni-*.jar)
+unzip $ROCKSDB_JAR > /dev/null
+
+ls librocksdbjni-* | grep -v librocksdbjni-linux-$ARCH-musl.so | xargs rm

Review Comment:
   the pattern doesn't seem to be correct for `x86_64`.
   
   ```
   ❯ unzip -v 
~/.m2/repository/org/rocksdb/rocksdbjni/7.9.2/rocksdbjni-7.9.2.jar 
"librocksdbjni*"
   Archive:  
/Users/lari/.m2/repository/org/rocksdb/rocksdbjni/7.9.2/rocksdbjni-7.9.2.jar
    Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
   --------  ------  ------- ---- ---------- ----- --------  ----
   12937108  Defl:N  4996651  61% 01-18-2023 18:22 2d175d3e  
librocksdbjni-linux32-musl.so
   12781984  Defl:N  4974662  61% 01-18-2023 17:55 f8ba407e  
librocksdbjni-linux32.so
   12946120  Defl:N  4687309  64% 01-18-2023 18:37 fe361e24  
librocksdbjni-linux64-musl.so
   12812776  Defl:N  4693523  63% 01-18-2023 18:07 cf184cca  
librocksdbjni-linux64.so
    7917296  Defl:N  3194101  60% 01-18-2023 17:43 75ee14a1  
librocksdbjni-osx-arm64.jnilib
    9155128  Defl:N  3663016  60% 01-18-2023 17:29 4fdb7657  
librocksdbjni-osx-x86_64.jnilib
   15525248  Defl:N  5135092  67% 01-19-2023 03:31 90e95fa5  
librocksdbjni-linux-ppc64le.so
   14804824  Defl:N  4960915  67% 01-19-2023 03:31 724f0ef8  
librocksdbjni-linux-ppc64le-musl.so
   12508504  Defl:N  4618102  63% 01-19-2023 03:32 0c0e21c8  
librocksdbjni-linux-aarch64.so
   12033184  Defl:N  4495421  63% 01-19-2023 03:32 69913c29  
librocksdbjni-linux-aarch64-musl.so
   13925544  Defl:N  4690123  66% 01-19-2023 03:33 3cf26f96  
librocksdbjni-linux-s390x.so
   13534664  Defl:N  4572116  66% 01-19-2023 03:33 80e404ce  
librocksdbjni-linux-s390x-musl.so
    7364096  Defl:N  3027907  59% 01-19-2023 03:36 e6d112d3  
librocksdbjni-win64.dll
   --------          -------  ---                            -------
   158246476         57708938  64%                            13 files
   ```
   
   the file is `librocksdbjni-linux64-musl.so`.
   
   
    



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to