Skip to content

Commit 788ace1

Browse files
authored
Merge pull request grpc#16836 from mehrdada/strip-manylinux-wheels
Strip manylinux1 binary wheels
2 parents 2b536a9 + be4b2db commit 788ace1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tools/run_tests/artifacts/build_package_python.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@ cd "$(dirname "$0")/../../.."
1919

2020
mkdir -p artifacts/
2121

22-
# All the python packages have been built in the artifact phase already
23-
# and we only collect them here to deliver them to the distribtest phase.
2422
cp -r "${EXTERNAL_GIT_ROOT}"/input_artifacts/python_*/* artifacts/ || true
2523

24+
strip_binary_wheel() {
25+
TEMP_WHEEL_DIR=$(mktemp -d)
26+
unzip "$1" -d "$TEMP_WHEEL_DIR"
27+
find "$TEMP_WHEEL_DIR" -name "_protoc_compiler*.so" -exec strip --strip-debug {} ";"
28+
find "$TEMP_WHEEL_DIR" -name "cygrpc*.so" -exec strip --strip-debug {} ";"
29+
(cd "$TEMP_WHEEL_DIR" && zip -r - .) > "$1"
30+
}
31+
32+
for wheel in artifacts/*.whl; do
33+
strip_binary_wheel "$wheel"
34+
done
35+
2636
# TODO: all the artifact builder configurations generate a grpcio-VERSION.tar.gz
2737
# source distribution package, and only one of them will end up
2838
# in the artifacts/ directory. They should be all equivalent though.

0 commit comments

Comments
 (0)