Skip to content

Commit

Permalink
Initial python 3.9 client wheel build support (apache#9389)
Browse files Browse the repository at this point in the history
- Fix `build-client-lib-within-docker.sh`
- Fix `build-client-lib.sh` and add py39
- Add py39 to remaining docker build scripts

### Motivation

A python 3.9 client wheel is missing. This is an initial attempt to add it. I'm mainly concerned about Fedora + RHEL7.

### Modifications

Mostly just fixing up / modifying build scripts used with docker.

I don't know enough about the build system. I made sufficient changes for me to
be able to do this (roughly):

```console
$ cd pulsar-client-cpp/docker
$ ./create-images.sh
$ ./build-client-lib.sh
$ export BUILD_IMAGE_NAME=pulsar-build
$ ./build-wheels.sh 3.9 cp39-cp39
```

When I built the wheel on my laptop, I commented out all other versions or
specified just 3.9.
  • Loading branch information
vkvm authored Feb 12, 2021
1 parent 84cfb3a commit eeeb104
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pulsar-client-cpp/docker/build-client-lib-within-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ set -e -x

cd /pulsar/pulsar-client-cpp

find . -name CMakeCache.txt | xargs rm
find . -name CMakeFiles | xargs rm -rf
rm lib/*.pb.*
find . -name CMakeCache.txt | xargs -r rm
find . -name CMakeFiles | xargs -r rm -rf
rm -f lib/*.pb.*

cmake . -DBUILD_TESTS=OFF -DLINK_STATIC=ON \
-DPYTHON_INCLUDE_DIR=/opt/python/$PYTHON_SPEC/include/python$PYTHON_VERSION \
Expand Down
3 changes: 2 additions & 1 deletion pulsar-client-cpp/docker/build-client-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ cd $ROOT_DIR

PYTHON_VERSIONS=(
'3.6 cp36-cp36m'
'3.9 cp39-cp39'
)

for line in "${PYTHON_VERSIONS[@]}"; do
Expand All @@ -42,7 +43,7 @@ for line in "${PYTHON_VERSIONS[@]}"; do

VOLUME_OPTION=${VOLUME_OPTION:-"-v $ROOT_DIR:/pulsar"}
COMMAND="/pulsar/pulsar-client-cpp/docker/build-client-lib-within-docker.sh"
DOCKER_CMD="docker run -i ${VOLUME_OPTION} ${IMAGE}"
DOCKER_CMD="docker run -i ${VOLUME_OPTION} ${IMAGE_NAME}"

$DOCKER_CMD bash -c "${COMMAND}"

Expand Down
1 change: 1 addition & 0 deletions pulsar-client-cpp/docker/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ PYTHON_VERSIONS=(
'3.6 cp36-cp36m'
'3.7 cp37-cp37m'
'3.8 cp38-cp38'
'3.9 cp39-cp39'
)

function contains() {
Expand Down
1 change: 1 addition & 0 deletions pulsar-client-cpp/docker/create-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PYTHON_VERSIONS=(
'3.6 cp36-cp36m'
'3.7 cp37-cp37m'
'3.8 cp38-cp38'
'3.9 cp39-cp39'
)

for line in "${PYTHON_VERSIONS[@]}"; do
Expand Down
1 change: 1 addition & 0 deletions pulsar-client-cpp/docker/push-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PYTHON_VERSIONS=(
'3.6 cp36-cp36m'
'3.7 cp37-cp37m'
'3.8 cp38-cp38'
'3.9 cp39-cp39'
)

for line in "${PYTHON_VERSIONS[@]}"; do
Expand Down
3 changes: 2 additions & 1 deletion pulsar-client-cpp/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ endif()
set(PYTHON_WRAPPER_LIBS ${Boost_PYTHON_LIBRARY} ${Boost_PYTHON3_LIBRARY}
${Boost_PYTHON27-MT_LIBRARY} ${Boost_PYTHON37-MT_LIBRARY}
${Boost_PYTHON34_LIBRARY} ${Boost_PYTHON35_LIBRARY}
${Boost_PYTHON36_LIBRARY} ${Boost_PYTHON38_LIBRARY})
${Boost_PYTHON36_LIBRARY} ${Boost_PYTHON38_LIBRARY}
${Boost_PYTHON39_LIBRARY})

if (APPLE)
set(PYTHON_WRAPPER_LIBS ${PYTHON_WRAPPER_LIBS}
Expand Down

0 comments on commit eeeb104

Please sign in to comment.