diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3ca73a3e5..2d3917f67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ services: - docker:dind before_script: - - apk add --update bash coreutils tar # install industrial_ci dependencies + - apk add --update bash coreutils tar grep # install industrial_ci dependencies # for regular users: - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci .industrial_ci -b master - mkdir .industrial_ci && cp -a * .industrial_ci # this is only needed for branch testing of industrial_ci itself @@ -62,3 +62,8 @@ docker_no_pull: - docker pull rosindustrial/ci:kinetic-xenial-shadow-fixed - docker tag rosindustrial/ci:kinetic-xenial-shadow-fixed industrial-ci/ubuntu:xenial - .industrial_ci/gitlab.sh ROS_DISTRO=kinetic DOCKER_IMAGE="industrial-ci/ubuntu:xenial" DOCKER_PULL=false + +test_arm: + script: + - docker run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes + - .industrial_ci/gitlab.sh DOCKER_IMAGE='arm32v7/ros:melodic-ros-core' BEFORE_INIT='[[ $(uname -p) == armv7l ]] && exit 42' EXPECT_EXIT_CODE=42 diff --git a/.travis.yml b/.travis.yml index 761bc7148..e7ecc8090 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ env: - ROS_DISTRO=indigo TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' CATKIN_LINT=pedantic EXPECT_EXIT_CODE=1 - ROS_DISTRO=indigo TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' ROSDEP_SKIP_KEYS="rospy_tutorials rostest" EXPECT_EXIT_CODE=1 - ROS_DISTRO=indigo TARGET_WORKSPACE='industrial_ci/mockups/testpkg_broken_install' EXPECT_EXIT_CODE=1 - - DOCKER_IMAGE='arm32v7/ros:indigo-ros-core' ADDITIONAL_DEBS="build-essential python-catkin-tools python-pip" INJECT_QEMU=arm BEFORE_INIT='[[ $(uname -p) == armv7l ]]' - ROS_DISTRO=melodic NOT_TEST_BUILD='true' _GUARD_INTERVAL=10 - ROS_DISTRO=indigo NOT_TEST_INSTALL='true' BEFORE_INIT='test -z "${CXX+x}"' # test that CXX is not set - ROS_DISTRO=indigo NOT_TEST_INSTALL='true' CXX=/usr/bin/gcc BEFORE_INIT='test -z "${CXX+x}"' EXPECT_EXIT_CODE=1 # test the CXX test @@ -84,16 +83,19 @@ matrix: allow_failures: - env: ROS_DISTRO=indigo NOT_TEST_BUILD='true' NOT_TEST_INSTALL='true' POST_PROCESS='I_am_supposed_to_fail' include: + - install: + - docker run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes + env: + - DOCKER_IMAGE='arm32v7/ros:melodic-ros-core' BEFORE_INIT='[[ $(uname -p) == armv7l ]] && exit 42' EXPECT_EXIT_CODE=42 + name: "Test on ARM" - script: - industrial_ci/scripts/run_travis - industrial_ci/scripts/run_travis 1 - env: [run_travis] + name: run_travis - script: shellcheck -x *.sh industrial_ci/scripts/*_ci industrial_ci/src/*.sh industrial_ci/src/*/*.sh industrial_ci/*.sh - env: [shellcheck] + name: shellcheck -install: - - sudo apt-get install qemu-user-static script: - industrial_ci/_wrap_test.sh # this script is only for internal use - if ! [ -z "$POST_PROCESS" ]; then $POST_PROCESS; fi diff --git a/doc/index.rst b/doc/index.rst index 3c24a3d3b..84edf2a54 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -194,7 +194,6 @@ Note that some of these currently tied only to a single option, but we still lea * **DOWNSTREAM_CMAKE_ARGS** (default: not set): Addtional CMake arguments for downstream `workspace <#workspace-management>`__. * **DOWNSTREAM_WORKSPACE** (default: not set): Definition of downstream `workspace <#workspace-management>`__. * **EXPECT_EXIT_CODE** (default: 0): exit code must match this value for test to succeed -* **INJECT_QEMU** (default: not set): Inject static qemu emulator for cross-platform builds, e.g. `INJECT_QEMU=arm`. This requires to install `qemu-user-static` on the host. The emulated build might take much longer! * **IMMEDIATE_TEST_OUTPUT** (default: not set): If true, test output is printed immediately during the tests * **NOT_TEST_BUILD** (default: not set): If true, tests in `build` space won't be run. * **NOT_TEST_DOWNSTREAM** (default: not set): If true, tests in the downstream workspace won't be run. diff --git a/doc/migration_guide.md b/doc/migration_guide.md index 29607b945..d59fee7ba 100644 --- a/doc/migration_guide.md +++ b/doc/migration_guide.md @@ -20,6 +20,7 @@ Some features are not supported anymore: * Support of ROS hydro * Devel space builds * Testing installed \*.test files +* Injecting QEMU (see [`INJECT_QEMU`](#inject_qemu)) * Job control settings have been removed for now If you depend on these, you can still use the [legacy](https://github.com/ros-industrial/industrial_ci/tree/legacy) version. @@ -54,6 +55,7 @@ Special care must be taken, if you use any of these variables: * [`DOCKER_IMAGE`](#docker_image) * [`HASHKEY_SKS`](#hashkey_sks) * [`NOT_TEST_INSTALL`](#not_test_install) +* [`INJECT_QEMU`](#inject_qemu) * [`PKGS_DOWNSTREAM`](#pkgs_downstream) * [`ROSINSTALL_FILENAME`](#rosinstall_filename) * [`ROS_PARALLEL_JOBS`](#ros_parallel_jobs) @@ -197,6 +199,14 @@ This variable is still supported, but the [workspace layout has changed](#worksp Will only be used if [`APTKEY_STORE_HTTPS`](#aptkey_store_https) is not set. +### INJECT_QEMU + +This option was removed. It is not needed for newer versions of `qemu-user-static` (host OS: Ubuntu cosmic or newer, Debian buster or newer). +For older versions, please try +``` +docker run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes +``` + ### NOT_TEST_INSTALL This feature was removed, please use the [legacy](https://github.com/ros-industrial/industrial_ci/tree/legacy) version. diff --git a/industrial_ci/src/docker.sh b/industrial_ci/src/docker.sh index 06ca3ca6e..89aff5609 100644 --- a/industrial_ci/src/docker.sh +++ b/industrial_ci/src/docker.sh @@ -84,12 +84,6 @@ function ici_run_cmd_in_docker() { run_opts+=(-v "$CCACHE_DIR:/root/.ccache" -e "CCACHE_DIR=/root/.ccache") fi - if [ -n "$INJECT_QEMU" ]; then - local qemu_path - qemu_path=$(command -v "qemu-$INJECT_QEMU-static") || ici_error "please install qemu-user-static" - run_opts+=(-v "$qemu_path:$qemu_path:ro") - fi - local hooks=() for hook in $(env | grep -o '^\(BEFORE\|AFTER\)_[^=]*'); do hooks+=(-e "$hook") @@ -220,22 +214,6 @@ function ici_prepare_docker_image() { # (None) function ici_build_default_docker_image() { - if [ -n "$INJECT_QEMU" ]; then - local qemu_path - qemu_path=$(command -v "qemu-$INJECT_QEMU-static") || ici_error "please install qemu-user-static" - echo "Inject qemu..." - local qemu_temp - qemu_temp=$(mktemp -d) - cat < "$qemu_temp/Dockerfile" - FROM $DOCKER_BASE_IMAGE - COPY '$(basename "$qemu_path")' '$qemu_path' -EOF - cp "$qemu_path" "$qemu_temp" - unset INJECT_QEMU - export DOCKER_BASE_IMAGE="$DOCKER_BASE_IMAGE-qemu" - DOCKER_IMAGE="$DOCKER_BASE_IMAGE" ici_quiet ici_docker_build "$qemu_temp" - rm -rf "$qemu_temp" - fi # choose a unique image name export DOCKER_IMAGE="industrial-ci/$ROS_DISTRO/$DOCKER_BASE_IMAGE" echo "Building image '$DOCKER_IMAGE':" diff --git a/industrial_ci/src/env.sh b/industrial_ci/src/env.sh index a546388ff..283ca3efb 100644 --- a/industrial_ci/src/env.sh +++ b/industrial_ci/src/env.sh @@ -18,6 +18,7 @@ ici_enforce_deprecated BEFORE_SCRIPT "Please migrate to new hook system." ici_enforce_deprecated CATKIN_CONFIG "Explicit catkin configuration is not available anymore." +ici_enforce_deprecated INJECT_QEMU "Please check https://github.com/ros-industrial/industrial_ci/blob/master/doc/migration_guide.md#inject_qemu" if [ -n "$NOT_TEST_INSTALL" ]; then if [ "$NOT_TEST_INSTALL" != true ]; then