diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index 8006ccd1..31c3d1f9 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -16,7 +16,7 @@ jobs: matrix: target_arch: [aarch64, armhf, x86_64] target_os: [ubuntu, debian] - rosdistro: [dashing, foxy, galactic, rolling, melodic] + rosdistro: [melodic, noetic, dashing, foxy, galactic, rolling] env: METRICS_OUT_DIR: /tmp/collected_metrics steps: @@ -51,12 +51,12 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - uses: ros-tooling/action-cloudwatch-metrics@0.0.5 - if: ${{ always() && !github.event.repository.fork && !github.event.pull_request.head.repo.fork && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'foxy' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'galactic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'rolling' ) }} + if: ${{ always() && !github.event.repository.fork && !github.event.pull_request.head.repo.fork && ( matrix.target_arch != 'armhf' || matrix.target_os != 'debian' || matrix.rosdistro != 'noetic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'foxy' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'galactic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'rolling' ) }} with: metric-data: "${{ env.METRICS_OUT_DIR }}/${{ matrix.target_arch }}_${{ matrix.target_os }}_${{ matrix.rosdistro }}_a" namespace: "CrossCompileMetrics" - uses: ros-tooling/action-cloudwatch-metrics@0.0.5 - if: ${{ always() && !github.event.repository.fork && !github.event.pull_request.head.repo.fork && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'foxy' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'galactic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'rolling' ) }} + if: ${{ always() && !github.event.repository.fork && !github.event.pull_request.head.repo.fork && ( matrix.target_arch != 'armhf' || matrix.target_os != 'debian' || matrix.rosdistro != 'noetic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'foxy' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'galactic' ) && ( matrix.target_arch != 'armhf' || matrix.rosdistro != 'rolling' ) }} with: metric-data: "${{ env.METRICS_OUT_DIR }}/${{ matrix.target_arch }}_${{ matrix.target_os }}_${{ matrix.rosdistro }}_b" namespace: "CrossCompileMetrics" diff --git a/.github/workflows/pip_e2e_test.yml b/.github/workflows/pip_e2e_test.yml index 05378fab..7f153b61 100644 --- a/.github/workflows/pip_e2e_test.yml +++ b/.github/workflows/pip_e2e_test.yml @@ -14,7 +14,7 @@ jobs: matrix: target_arch: [aarch64, armhf] target_os: [ubuntu] - rosdistro: [dashing] + rosdistro: [melodic, noetic, dashing, foxy] install_type: - test - prod diff --git a/README.md b/README.md index 714c36fa..def43701 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This tool supports compiling a workspace for all combinations of the following: * Architecture: `armhf`, `aarch64`, `x86_64` * ROS Distro - * ROS: `kinetic`, `melodic` + * ROS: `kinetic`, `melodic`, `noetic` * ROS 2: `dashing`, `foxy`, `galactic`, `rolling` * OS: `Ubuntu`, `Debian` @@ -307,7 +307,7 @@ Here is a detailed look at the arguments passed to the script (`ros_cross_compil * `.` * The first argument to `ros_cross_compile` is the directory of the workspace to be built. This could be any relative or absolute path, in this case it's just `.`, the current working directory. * `--rosdistro foxy` - * You may specify either a ROS and ROS 2 distribution by name, for example `melodic` (ROS) or `galactic` (ROS 2). + * You may specify either a ROS and ROS 2 distribution by name, for example `noetic` (ROS) or `galactic` (ROS 2). * `--arch aarch64` * Target the ARMv8 / ARM64 / aarch64 architecture (which are different names for effectively the same thing). * `--os ubuntu` diff --git a/ros_cross_compile/platform.py b/ros_cross_compile/platform.py index 1600b74b..e10c71c6 100644 --- a/ros_cross_compile/platform.py +++ b/ros_cross_compile/platform.py @@ -27,7 +27,7 @@ SUPPORTED_ARCHITECTURES = tuple(ARCHITECTURE_NAME_MAP.keys()) SUPPORTED_ROS2_DISTROS = ('dashing', 'foxy', 'galactic', 'rolling') -SUPPORTED_ROS_DISTROS = ('kinetic', 'melodic') +SUPPORTED_ROS_DISTROS = ('kinetic', 'melodic', 'noetic') ROSDISTRO_OS_MAP = { 'kinetic': { @@ -38,6 +38,10 @@ 'ubuntu': 'bionic', 'debian': 'stretch', }, + 'noetic': { + 'ubuntu': 'focal', + 'debian': 'buster', + }, 'dashing': { 'ubuntu': 'bionic', 'debian': 'stretch', diff --git a/ros_cross_compile/qemu/qemu-aarch64-static b/ros_cross_compile/qemu/qemu-aarch64-static new file mode 100755 index 00000000..55deaff5 Binary files /dev/null and b/ros_cross_compile/qemu/qemu-aarch64-static differ diff --git a/ros_cross_compile/qemu/qemu-arm-static b/ros_cross_compile/qemu/qemu-arm-static new file mode 100755 index 00000000..3e3fee7a Binary files /dev/null and b/ros_cross_compile/qemu/qemu-arm-static differ diff --git a/ros_cross_compile/sysroot_creator.py b/ros_cross_compile/sysroot_creator.py index 32aa5310..e4a0c924 100755 --- a/ros_cross_compile/sysroot_creator.py +++ b/ros_cross_compile/sysroot_creator.py @@ -64,7 +64,13 @@ def setup_emulator(arch: str, output_dir: Path) -> None: bin_dir.mkdir(parents=True, exist_ok=True) needs_emulator = (py_platform.system() != 'Darwin') and (py_platform.machine() != arch) if needs_emulator: - emulator_path = Path('/') / 'usr' / 'bin' / emulator_name + """ + Using the same qemu binaries as the ones provided in + https://github.com/osrf/multiarch-docker-image-generation in order to + work around https://bugs.launchpad.net/qemu/+bug/1805913 and so qemu + supports renameat2() syscall. + """ + emulator_path = Path(__file__).parent / 'qemu' / emulator_name if not emulator_path.is_file(): raise RuntimeError('Could not find the expected QEmu emulator binary "{}"'.format( emulator_path)) diff --git a/setup.py b/setup.py index 148cc92d..70371a66 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Software Development', ], description='A tool to build ROS workspaces for various target architectures and platforms.', @@ -48,7 +49,7 @@ long_description_content_type='text/markdown', license='Apache License, Version 2.0', package_data={ - package_name: ['docker/*.*', 'mixins/*.*'], + package_name: ['docker/*.*', 'mixins/*.*', 'qemu/*.*'], }, install_requires=[ 'docker>=2,<3', diff --git a/test/run_e2e_test.sh b/test/run_e2e_test.sh index 4a01b96a..89e656cb 100755 --- a/test/run_e2e_test.sh +++ b/test/run_e2e_test.sh @@ -91,6 +91,12 @@ setup(){ error "Foxy, Galactic and Rolling do not have armhf binaries available" exit 0 fi + if [ "$os" == "debian" ]; then + if [ "$distro" == "noetic" ]; then + error "Noetic does not have armhf binaries available to debian" + exit 0 + fi + fi fi } diff --git a/test/test_platform.py b/test/test_platform.py index fad171b4..aea2e35a 100644 --- a/test/test_platform.py +++ b/test/test_platform.py @@ -72,18 +72,22 @@ def test_get_docker_base_image(): verify_base_docker_images('aarch64', 'ubuntu', 'dashing', 'arm64v8/ubuntu:bionic') verify_base_docker_images('aarch64', 'ubuntu', 'kinetic', 'arm64v8/ubuntu:xenial') verify_base_docker_images('aarch64', 'ubuntu', 'melodic', 'arm64v8/ubuntu:bionic') + verify_base_docker_images('aarch64', 'ubuntu', 'noetic', 'arm64v8/ubuntu:focal') verify_base_docker_images('aarch64', 'debian', 'dashing', 'arm64v8/debian:stretch') verify_base_docker_images('aarch64', 'debian', 'kinetic', 'arm64v8/debian:jessie') verify_base_docker_images('aarch64', 'debian', 'melodic', 'arm64v8/debian:stretch') + verify_base_docker_images('aarch64', 'debian', 'noetic', 'arm64v8/debian:buster') verify_base_docker_images('armhf', 'ubuntu', 'dashing', 'arm32v7/ubuntu:bionic') verify_base_docker_images('armhf', 'ubuntu', 'kinetic', 'arm32v7/ubuntu:xenial') verify_base_docker_images('armhf', 'ubuntu', 'melodic', 'arm32v7/ubuntu:bionic') + verify_base_docker_images('armhf', 'ubuntu', 'noetic', 'arm32v7/ubuntu:focal') verify_base_docker_images('armhf', 'debian', 'dashing', 'arm32v7/debian:stretch') verify_base_docker_images('armhf', 'debian', 'kinetic', 'arm32v7/debian:jessie') verify_base_docker_images('armhf', 'debian', 'melodic', 'arm32v7/debian:stretch') + verify_base_docker_images('armhf', 'debian', 'noetic', 'arm32v7/debian:buster') def test_docker_py_version(): @@ -98,9 +102,13 @@ def test_docker_py_version(): def test_ros_version_map(): - platform = Platform('aarch64', 'ubuntu', 'dashing') + platform = Platform('armhf', 'ubuntu', 'dashing') assert platform.ros_version == 'ros2' - platform = Platform('aarch64', 'ubuntu', 'kinetic') + platform = Platform('x86_64', 'ubuntu', 'foxy') + assert platform.ros_version == 'ros2' + platform = Platform('armhf', 'ubuntu', 'melodic') + assert platform.ros_version == 'ros' + platform = Platform('aarch64', 'ubuntu', 'noetic') assert platform.ros_version == 'ros' diff --git a/test/test_sysroot_creator.py b/test/test_sysroot_creator.py index 4e5c3bc7..03fbae17 100644 --- a/test/test_sysroot_creator.py +++ b/test/test_sysroot_creator.py @@ -57,7 +57,7 @@ def test_prepare_docker_build_basic(tmpdir): def test_run_twice(tmpdir): # The test is that this doesn't throw an exception for already existing paths - platform = Platform('armhf', 'debian', 'kinetic') + platform = Platform('armhf', 'debian', 'noetic') tmp = Path(str(tmpdir)) prepare_docker_build_environment(platform, tmp, None, None) prepare_docker_build_environment(platform, tmp, None, None)