The open source OpenXR runtime

ci: check for 32/64bit protocol compatibility

Checks that structures referenced in the IPC protocol have the same size
in 32 and 64 bit builds

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2566>

+53 -6
+25 -4
.gitlab-ci.yml
··· 34 34 stages: 35 35 - container_prep 36 36 - build 37 + - check 37 38 - package 38 39 - reprepro 39 40 - pages ··· 129 130 .monado.variables.debian:bookworm: 130 131 variables: 131 132 FDO_DISTRIBUTION_VERSION: "bookworm" 132 - FDO_DISTRIBUTION_TAG: "2025-04-18" 133 + FDO_DISTRIBUTION_TAG: "2025-08-26" 133 134 134 135 # Variables for build and usage of Debian bullseye image 135 136 .monado.variables.debian:bullseye: ··· 178 179 - .fdo.container-build@debian # from ci-templates 179 180 180 181 variables: 181 - FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates clang-format cmake codespell curl debhelper devscripts doxygen dput-ng gettext-base git glslang-tools graphviz libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libdistro-info-perl libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pandoc patch pipx pkg-config python3 python3-click python3-pip reprepro unzip wayland-protocols wget' 182 + FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates clang-format cmake codespell curl debhelper devscripts doxygen dput-ng gettext-base git glslang-tools graphviz libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libdistro-info-perl libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pahole pandoc patch pipx pkg-config python3 python3-click python3-pip reprepro unzip wayland-protocols wget' 182 183 FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/i386_and_proclamation_container_prep.sh' 183 184 184 185 # Make Debian bullseye image ··· 365 366 script: 366 367 367 368 - .gitlab-ci/prebuild.sh 368 - - .gitlab-ci/ci-cmake-build.sh -DXRT_HAVE_OPENCV=OFF 369 + - .gitlab-ci/ci-cmake-build.sh -DCMAKE_BUILD_TYPE=Debug -DXRT_HAVE_OPENCV=OFF 370 + - src/xrt/ipc/shared/proto.py src/xrt/ipc/shared/proto.json structs.txt 371 + - mkdir -p "debian:cmake-no-opencv" 372 + - pahole --sizes --class_name file://structs.txt build/src/xrt/targets/openxr/libopenxr_monado.so > "debian:cmake-no-opencv/ipc-sizes.txt" 369 373 - cd build && ctest --output-on-failure 374 + artifacts: 375 + paths: 376 + - debian:cmake-no-opencv/ipc-sizes.txt 370 377 371 378 debian:cmake-no-sdl2: 372 379 stage: build ··· 398 405 script: 399 406 400 407 - .gitlab-ci/prebuild.sh 401 - - .gitlab-ci/ci-cmake-build.sh -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF 408 + - .gitlab-ci/ci-cmake-build.sh -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF 409 + - src/xrt/ipc/shared/proto.py src/xrt/ipc/shared/proto.json structs.txt 410 + - mkdir -p "debian:cmake:32bit" 411 + - pahole --sizes --class_name file://structs.txt build/src/xrt/targets/openxr/libopenxr_monado.so > "debian:cmake:32bit/ipc-sizes.txt" 402 412 - cd build && ctest --output-on-failure 413 + artifacts: 414 + paths: 415 + - debian:cmake:32bit/ipc-sizes.txt 403 416 404 417 debian:bullseye:cmake: 405 418 stage: build ··· 621 634 - install 622 635 - build/Testing/Temporary 623 636 637 + 638 + # Check compatibility of IPC protocol between 32 and 64 bits 639 + ipc-32-64-compatibility: 640 + stage: check 641 + dependencies: ["debian:cmake-no-opencv", "debian:cmake:32bit"] 642 + script: 643 + - diff -du "debian:cmake-no-opencv/ipc-sizes.txt" "debian:cmake:32bit/ipc-sizes.txt" 644 + - cmp "debian:cmake-no-opencv/ipc-sizes.txt" "debian:cmake:32bit/ipc-sizes.txt" 624 645 625 646 626 647 debian:bookworm:package:
+6 -1
.gitlab-ci/config.yml
··· 73 73 # This image does some extra work. 74 74 - codename: bookworm 75 75 script: i386_and_proclamation_container_prep.sh 76 - tag: "2025-04-18" 76 + tag: "2025-08-26" 77 77 deb_version_suffix: bpo12 78 78 packages: 79 79 <<: *default_debian_packages ··· 81 81 codespell: 82 82 doxygen: 83 83 graphviz: 84 + pahole: 84 85 pipx: 85 86 python3-click: 86 87 python3-pip: ··· 100 101 BUILD_DOC: "ON" 101 102 102 103 - name: "debian:cmake-no-opencv" 104 + pahole: true 103 105 cmake_defines: 106 + CMAKE_BUILD_TYPE: Debug 104 107 XRT_HAVE_OPENCV: "OFF" 105 108 106 109 - name: "debian:cmake-no-sdl2" ··· 112 115 XRT_FEATURE_SERVICE: "OFF" 113 116 114 117 - name: "debian:cmake:32bit" 118 + pahole: true 115 119 cmake_defines: 120 + CMAKE_BUILD_TYPE: Debug 116 121 CMAKE_TOOLCHAIN_FILE: .gitlab-ci/i386.cmake 117 122 # OpenCV doesn't play nicely with us in multi-arch. 118 123 XRT_HAVE_OPENCV: "OFF"
+22 -1
.gitlab-ci/templates/.gitlab-ci.yml.jinja
··· 49 49 stages: 50 50 - container_prep 51 51 - build 52 + - check 52 53 - package 53 54 - reprepro 54 55 - pages ··· 138 139 {%- if "cmake" in job.name or "ndk" in job.name %} 139 140 140 141 - .gitlab-ci/ci-cmake-build.sh {{- make_cmake_args(job.cmake_defines) }} 142 + {%- if job.pahole %} 143 + 144 + - src/xrt/ipc/shared/proto.py src/xrt/ipc/shared/proto.json structs.txt 145 + - mkdir -p "{{ job.name}}" 146 + - pahole --sizes --class_name file://structs.txt build/src/xrt/targets/openxr/libopenxr_monado.so > "{{ job.name}}/ipc-sizes.txt"{% endif %} 141 147 142 148 {#- gradle builds -#} 143 149 {%- elif "android" in job.name %} ··· 159 165 - cd build && ctest --output-on-failure 160 166 {%- endif %} 161 167 162 - {%- if job.artifact_path %} 168 + {%- if job.artifact_path or job.pahole %} 163 169 164 170 artifacts: 165 171 paths: 172 + {%- if job.artifact_path%} 173 + 166 174 - {{ job.artifact_path }} 167 175 {%- endif %} 176 + {%- if job.pahole%} 177 + 178 + - {{ job.name }}/ipc-sizes.txt 179 + {%- endif %} 180 + {%- endif %} 168 181 169 182 {% endfor -%} {%- endfor -%} {%- endfor %} 170 183 ··· 184 197 {% macro packaging_job_name(distro, image) -%} 185 198 {{ image_name(distro, image) }}:package 186 199 {%- endmacro %} 200 + 201 + # Check compatibility of IPC protocol between 32 and 64 bits 202 + ipc-32-64-compatibility: 203 + stage: check 204 + dependencies: ["debian:cmake-no-opencv", "debian:cmake:32bit"] 205 + script: 206 + - diff -du "debian:cmake-no-opencv/ipc-sizes.txt" "debian:cmake:32bit/ipc-sizes.txt" 207 + - cmp "debian:cmake-no-opencv/ipc-sizes.txt" "debian:cmake:32bit/ipc-sizes.txt" 187 208 188 209 {% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %} 189 210