Skip to content

Commit

Permalink
Merged PR 8698: Merge feature/release-next to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Klug, Stefan authored and Klug, Stefan committed Aug 20, 2020
2 parents cc93d3d + 9b18629 commit b59c3b9
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ install:
- 7z x swigwin.zip -oC:\ > NUL
- set PATH=C:\swigwin-4.0.1;%PATH%
# install pylon
- appveyor-retry curl -sSfL -o pylon_installer.exe %PYLON_DOWNLOAD_URL_BASE%Basler_pylon_6.1.0.19674.exe
- appveyor-retry curl -sSfL -o pylon_installer.exe %PYLON_DOWNLOAD_URL_BASE%Basler_pylon_6.1.1.19832.exe
- pylon_installer.exe /quiet /install
# PYLON_DEV_DIR is not available in the shell after installation, so we set it manually
- set PYLON_DEV_DIR=%PROGRAMFILES%\Basler\pylon 6\development
# install numpy for the unittests
- "%PYTHON%\\python.exe -m pip install numpy"

build_script:
- "scripts\\build\\msvc_build_wrapper.cmd %PYTHON%\\python.exe setup.py test"
- "scripts\\build\\msvc_build_wrapper.cmd %PYTHON%\\python.exe setup.py bdist_wheel"

test_script:
Expand Down
28 changes: 25 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,37 @@ jobs:
env: P=linux_aarch64 A=cp37m
- arch: arm64
env: P=linux_aarch64 A=cp38
allow_failures:
# manylinux fails, because the runtime dependencies of current pylon are higher than manylinux2014.
# The jobs are still kept in here to keep the mechanics alive.
# manylinux2014_x86_64
- arch: amd64
env: P=manylinux2014_x86_64 A=cp35m
- arch: amd64
env: P=manylinux2014_x86_64 A=cp36m
- arch: amd64
env: P=manylinux2014_x86_64 A=cp37m
- arch: amd64
env: P=manylinux2014_x86_64 A=cp38
# manylinux2014_i686
- arch: amd64
env: P=manylinux2014_i686 A=cp35m
- arch: amd64
env: P=manylinux2014_i686 A=cp36m
- arch: amd64
env: P=manylinux2014_i686 A=cp37m
- arch: amd64
env: P=manylinux2014_i686 A=cp38


install:
- cd $TRAVIS_BUILD_DIR
- mkdir pylon_installer && cd pylon_installer
- |
for PYLON_ARCH in armhf arm64 x86 x86_64 ; do
travis_retry curl -sSfL -O "${PYLON_DOWNLOAD_URL_BASE}pylon-5.2.0.13457-${PYLON_ARCH}.tar.gz"
for PYLON_VERSION in 6.1.0.19674_x86 6.1.1.19861_x86_64 6.1.3.20159_armhf 6.1.3.20159_aarch64 ; do
travis_retry curl -sSfL -O "${PYLON_DOWNLOAD_URL_BASE}pylon_${PYLON_VERSION}_setup.tar.gz"
done
- echo "Pylon Installer:" && ls

script:
Expand All @@ -98,7 +120,7 @@ script:
if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
docker run --rm --privileged multiarch/qemu-user-static:register --reset
fi
- "./scripts/build/build-arch.sh --platform-tag $P --abi-tag $A --pylon-dir ./pylon_installer --disable-tests"
- "./scripts/build/build-arch.sh --platform-tag $P --abi-tag $A --pylon-dir ./pylon_installer"

deploy:
provider: releases
Expand Down
7 changes: 5 additions & 2 deletions VersionInfo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# The pylon version this source tree was designed for, by platform
ReferencePylonVersion = {
"Windows": "6.1.0",
"Linux": "5.2.0",
"Windows": "6.1.1",
# ATTENTION: This version is the pylon core version reported by pylon-config,
# which is not equal to the version on the outer tar.gz
"Linux": "6.1.0",
"Linux_x86_64": "6.1.1",
"Darwin": "5.1.1"
}
10 changes: 6 additions & 4 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Version ?.?.?
- Date ????-??-??
- Fix issues with callbacks due to intptr_t truncation on linux
- Fix unittests that failed in python 3.8
Version 1.6.0
- Date 2020-08-20
- Fixed issues with callbacks due to intptr_t truncation on linux
- Fixed unittests that failed in python 3.8
- Updated to current pylon version for windows and linux
- Enabled unittests in CI-builds

Version 1.5.4
- Date 2020-04-16
Expand Down
12 changes: 11 additions & 1 deletion scripts/build/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG DOCKER_BASE_IMAGE
FROM multiarch/qemu-user-static:4.2.0-6 as qemu

FROM $DOCKER_BASE_IMAGE
ARG CMD_WRAPPER
COPY --from=qemu /usr/bin/* /usr/bin/

# Quick fix for the now archived debian jessie. Security updates are also no longer provided for arm64.
Expand Down Expand Up @@ -37,5 +38,14 @@ RUN apt-get update && apt-get install -y locales \

RUN mkdir /work
RUN mkdir /pylon_installer
RUN mkdir /worker_home && chmod go+rwx /worker_home
ENV HOME=/worker_home

RUN uname -a

# run everything wrapped using CMD_WRAPPER
# In most cases the wrapper is linux64/32.
# This is for example required when running the armv7 container on armv8 hardware to ensure that python really builds for armv7
RUN echo "#!/bin/sh" > /entrypoint.sh; echo exec $CMD_WRAPPER \"\$@\" >> /entrypoint.sh; chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

RUN /entrypoint.sh uname -a
4 changes: 4 additions & 0 deletions scripts/build/Dockerfile.manylinux
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ RUN mkdir /build && \
./configure --with-python3 && make -j2 && make install && \
rm -rf /build

# one genicam unittest requires a french locale
RUN yum -y reinstall glibc-common

RUN mkdir /work
RUN mkdir /pylon_installer
RUN mkdir /worker_home && chmod go+rwx /worker_home
ENV HOME=/worker_home

RUN uname -a
21 changes: 13 additions & 8 deletions scripts/build/build-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ if [ $BUILD_DISTRO = "debian" ]; then

#Note: Be careful when changing the base image. Not every image is available for every architecture.
case $ABI_TAG in
cp27m) BASE_IMAGE="python:2.7.16-jessie" ;;
cp34m) BASE_IMAGE="python:3.4.8-jessie" ;;
cp35m) BASE_IMAGE="python:3.5.5-jessie" ;;
cp36m) BASE_IMAGE="python:3.6.5-jessie" ;;
cp27m) BASE_IMAGE="python:2.7.16-stretch" ;;
cp34m) BASE_IMAGE="python:3.4.8-stretch" ;;
cp35m) BASE_IMAGE="python:3.5.5-stretch" ;;
cp36m) BASE_IMAGE="python:3.6.5-stretch" ;;
cp37m) BASE_IMAGE="python:3.7.5-stretch" ;;
cp38) BASE_IMAGE="python:3.8.2-buster" ;;
*)
Expand All @@ -77,13 +77,18 @@ else
esac
fi

# When running a armv7 container on a native aarch64 machine, uname -a still outputs aarch64 instead of armv7
# Python assumes it should buid for aarch64. Wrapping everything with linux32 fixes the issue.
# linux64 is the default
CMD_WRAPPER=linux64

case $PLATFORM_TAG in
linux_x86_64) QEMU_ARCH="x86_64"; BASE_IMAGE="amd64/$BASE_IMAGE"; PYLON_ARCH=x86_64 ;;
linux_i686) QEMU_ARCH="i386"; BASE_IMAGE="i386/$BASE_IMAGE"; PYLON_ARCH=x86 ;;
linux_armv7l) QEMU_ARCH="arm"; BASE_IMAGE="arm32v7/$BASE_IMAGE"; PYLON_ARCH=armhf ;;
linux_i686) QEMU_ARCH="i386"; BASE_IMAGE="i386/$BASE_IMAGE"; PYLON_ARCH=x86 ; CMD_WRAPPER=linux32 ;;
linux_armv7l) QEMU_ARCH="arm"; BASE_IMAGE="arm32v7/$BASE_IMAGE"; PYLON_ARCH=armhf CMD_WRAPPER=linux32 ;;
linux_aarch64) QEMU_ARCH="aarch64"; BASE_IMAGE="arm64v8/$BASE_IMAGE"; PYLON_ARCH=aarch64 ;;
manylinux2014_x86_64) QEMU_ARCH="x86_64"; BASE_IMAGE="quay.io/pypa/manylinux2014_x86_64"; PYLON_ARCH=x86_64 ;;
manylinux2014_i686) QEMU_ARCH="i386"; BASE_IMAGE="quay.io/pypa/manylinux2014_i686"; PYLON_ARCH=x86 ;;
manylinux2014_i686) QEMU_ARCH="i386"; BASE_IMAGE="quay.io/pypa/manylinux2014_i686"; PYLON_ARCH=x86 ; CMD_WRAPPER=linux32 ;;
manylinux2014_aarch64) QEMU_ARCH="aarch64"; BASE_IMAGE="quay.io/pypa/manylinux2014_aarch64"; PYLON_ARCH=aarch64 ;;
*)
echo "Unsupported platform tag '$PLATFORM_TAG'. Supported platforms: linux_x86_64, linux_i686, linux_armv7l, linux_aarch64, manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64"
Expand Down Expand Up @@ -117,11 +122,11 @@ if [ ! -f "$PYLON" ]; then
exit 1
fi


DOCKER_TAG="pypylon-$PLATFORM_TAG-$(date +%s)"
docker build --network host \
--build-arg "QEMU_TARGET_ARCH=$QEMU_ARCH" \
--build-arg "DOCKER_BASE_IMAGE=$BASE_IMAGE" \
--build-arg "CMD_WRAPPER=$CMD_WRAPPER" \
--tag "$DOCKER_TAG" - < $THISDIR/Dockerfile.$BUILD_DISTRO


Expand Down
3 changes: 2 additions & 1 deletion scripts/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export PYLON_ROOT
$PYTHON setup.py clean

if [ -z "$DISABLE_TESTS" ]; then
$PYTHON -m pip install --user numpy
#For now failed tests are accepted until all are fixed
$PYTHON setup.py test || true
$PYTHON setup.py test
fi

$PYTHON setup.py bdist_wheel
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def get_machinewidth():
def get_platform():
return platform.system()

def get_machine():
return platform.machine()

class BuildSupport(object):

# --- Constants ---
Expand Down Expand Up @@ -291,6 +294,12 @@ def get_version(self):
pylon_version_tag = match.group(2)

reference_version = VersionInfo.ReferencePylonVersion[get_platform()]

# check for a more specialized reference version
platform_machine = get_platform() + "_" + get_machine()
if platform_machine in VersionInfo.ReferencePylonVersion:
reference_version = VersionInfo.ReferencePylonVersion[platform_machine]

if (
pylon_version_no_build == reference_version and
pylon_version_tag == ''
Expand Down

0 comments on commit b59c3b9

Please sign in to comment.