From ee96f77c1b0ecc2452e7a1bd53d840e7f1b7a450 Mon Sep 17 00:00:00 2001 From: Alex Reinking Date: Wed, 3 Aug 2022 19:08:28 -0400 Subject: [PATCH] Remove unused GHA and packaging workflows. --- .github/workflows/packaging.yml | 61 ---- .github/workflows/test.yml | 495 ------------------------------- CMakePresets.json | 29 -- packaging/ubuntu/changelog | 5 - packaging/ubuntu/config.cmake | 137 --------- packaging/ubuntu/copyright | 26 -- packaging/ubuntu/extra-strip.sh | 6 - packaging/ubuntu/package.sh | 45 --- packaging/ubuntu/pre_build.cmake | 25 -- packaging/ubuntu/triggers | 1 - 10 files changed, 830 deletions(-) delete mode 100644 .github/workflows/packaging.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 packaging/ubuntu/changelog delete mode 100644 packaging/ubuntu/config.cmake delete mode 100644 packaging/ubuntu/copyright delete mode 100755 packaging/ubuntu/extra-strip.sh delete mode 100755 packaging/ubuntu/package.sh delete mode 100644 packaging/ubuntu/pre_build.cmake delete mode 100644 packaging/ubuntu/triggers diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml deleted file mode 100644 index 2b6e9625d69a..000000000000 --- a/.github/workflows/packaging.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Packaging -on: [ 'pull_request' ] -jobs: - package-ubuntu: - name: Package for Ubuntu - runs-on: ubuntu-20.04 - env: - CMAKE_CXX_COMPILER_LAUNCHER: ccache - CMAKE_C_COMPILER_LAUNCHER: ccache - LLVM_ROOT: /usr/lib/llvm-13 - steps: - - name: Install dependencies - run: | - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \ - | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null - sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' - # from apt.llvm.org - # wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421 - sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-13 main" - sudo apt update - sudo apt install cmake ninja-build doxygen ccache - sudo apt install llvm-13-dev liblld-13-dev clang-13 libclang-13-dev libjpeg-dev libpng-dev - sudo apt install lintian dpkg-dev - - name: Check out sources - uses: actions/checkout@v2 - - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1 - - name: Run Ubuntu packaging script - run: ./packaging/ubuntu/package.sh . ubuntu - - name: Upload packages - uses: actions/upload-artifact@v2 - with: - name: packages - path: ubuntu/*.deb - test-ubuntu: - name: Test Ubuntu package - needs: package-ubuntu - runs-on: ubuntu-20.04 - steps: - # Specifically use the CMake version that comes with Ubuntu. - - name: Install dependencies - run: | - # from apt.llvm.org - # wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421 - sudo apt-add-repository "deb https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-13 main" - sudo apt update - sudo apt install cmake ninja-build libc6-dev-arm64-cross gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user - - name: Check out sources - uses: actions/checkout@v2 - - name: Download Halide Ubuntu packages - uses: actions/download-artifact@v2 - with: - name: packages - - name: Install Halide Ubuntu packages - run: sudo apt install ./*.deb - - name: Test integration - run: | - cmake -S test/integration -B build - cd build && ctest -j$(nproc) --output-on-failure diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f7e1dbea8c97..000000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,495 +0,0 @@ -# TODO (known issues) -# - no GPU tests are attempted (probably not possible) -# - cmake static builds aren't handled yet. -# - arm32 and arm64 is build-only, no testing (qemu is too slow). -# Perhaps some limited testing instead of none? -# - python is built+tested for x86-64 targets only (no arm or 32-bit) -# - apps are skipped for x86-32, arm-32, arm-64 -# -# TODO (stuff that could be usefully added, perhaps) -# - build + test of WASM -# - build + test of PyTorch -# -# TODO (GHA issues) -# - GHA is occasionally flaky and some VMs just fail, but there isn't a way -# to restart just one of the jobs (it's currently all-or-none) - -name: Halide Presubmit Build + Test -on: - workflow_dispatch: - # inputs: - # logLevel: - # description: 'Log level' - # required: true - # default: 'warning' - # tags: - # description: 'Test scenario tags' - - # pull_request: - # # We don't want 'edited' (that's basically just the description, title, etc) - # # We don't want 'review_requested' (that's redundant to the ones below for our purposes) - # types: [opened, synchronize, reopened] - # # TODO: do we want to limit this to certain filetypes? - # # paths: - # # - '**.h' - # # - '**.c' - # # - '**.cpp' - -jobs: - test_halide: - name: HL-${{matrix.llvm_version}}-${{matrix.target_arch}}-${{matrix.target_bits}}-${{matrix.target_os}}-${{matrix.build_tool}} - runs-on: ${{matrix.host_os}} - env: - CC: ${{matrix.cc}} - CXX: ${{matrix.cxx}} - LD: ${{matrix.ld}} - - strategy: - fail-fast: false # Keep running other jobs even if one fails - # free-tier projects (like Halide) get 20 concurrent tasks. - # The build matrix here has only 7 tasks -- should we limit it to fewer - # than that? Need to experiment. - # max-parallel: TBD TODO - matrix: - # TODO: this matrix is probably overkill; we don't need to build every combination. - # (Some combinations are nonsensical and excluded via the 'exclude:' section below.) - target_arch: [x86, arm] - target_bits: [32, 64] - target_os: [linux, osx, windows] - llvm_version: [12] - build_tool: [cmake_shared] - # llvm_version: [10, 11, 12] # TODO - # build_tool: [cmake_shared, make] # TODO - - # This section basically allows us to define additional values for - # each matrix entry, e.g. to map an llvm version number to the specific - # git branch that is needed. - include: - # - llvm_version: 10 - # llvm_branch: release/10.x - # - llvm_version: 11 - # llvm_branch: release/11.x - - llvm_version: 12 - llvm_branch: master - - # map things to the necessary host cross-compiler host - - target_os: osx - host_os: macos-10.15 - cc: clang - cxx: clang++ - ld: ld - - - target_os: linux - host_os: ubuntu-18.04 - # GHA has clang 6, 8, and 9 and GCC 7.4, 8.3, 9.2 preinstalled. - # We will explicitly choose gcc 7.x (even though the default is gcc 7.4) - # to ensure we match gcc versions with the arm crosscompiler. - cc: gcc-7 - cxx: g++-7 - ld: ld - - - target_os: windows - host_os: windows-2019 - cc: cl.exe - cxx: cl.exe - ld: ld.exe - - - target_arch: x86 - python_version: '3.7' - uses_python: true - run_tests: true - - - target_bits: 32 - # We don't build/test Python bindings on any 32-bit targets - uses_python: false - - - target_arch: arm - # We don't build/test Python bindings on any ARM targets - uses_python: false - # Running our test suite (via e.g. QEMU) is too slow to be useful - # at present (> 5 hours on current GHA VMs). That said, we'll leave - # in the relevant code for now (disabled via this flag) in case - # it proves useful later. - run_tests: false - - exclude: - - target_os: osx - target_arch: arm # OSX is x86-only - - target_os: osx - target_bits: 32 # OSX is 64-bit only - - target_os: windows - target_arch: arm # OSX is x86-only - - target_os: windows - build_tool: make # Windows is CMake-only - - target_arch: arm - build_tool: make # In this setup, all ARM builds require CMake - - steps: - - uses: actions/checkout@v2 - with: - path: 'halide' - - - name: Configure Python - if: matrix.uses_python - uses: actions/setup-python@v1 - with: - python-version: '${{matrix.python_version}}' - architecture: 'x64' - - - name: Configure Ubuntu Host - if: startsWith(matrix.host_os, 'ubuntu') - shell: bash - run: | - sudo apt-get update - - sudo apt-get install \ - doxygen \ - libjpeg-dev \ - libpng-dev \ - ninja-build - - - name: Configure MacOS Host - if: startsWith(matrix.host_os, 'macos') - shell: bash - run: | - # coreutils is for gtimeout - brew install \ - coreutils \ - doxygen \ - jpeg \ - libpng \ - ninja - - - name: Configure Windows Host - if: startsWith(matrix.host_os, 'windows') - shell: bash - run: | - if [[ ${{matrix.target_bits}} == 32 ]]; then - export VCPKG_DEFAULT_TRIPLET=x86-windows - else - export VCPKG_DEFAULT_TRIPLET=x64-windows - fi - - vcpkg install \ - libjpeg-turbo \ - libpng \ - zlib - - - name: Configure x86-32 Crosscompilation - if: matrix.target_os == 'linux' && matrix.target_arch == 'x86' && matrix.target_bits == 32 - shell: bash - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install \ - ${{matrix.cc}}-multilib \ - ${{matrix.cxx}}-multilib \ - libjpeg-dev:i386 \ - libpng-dev:i386 \ - - - name: Configure Arm32 Crosscompilation - if: matrix.target_os == 'linux' && matrix.target_arch == 'arm' && matrix.target_bits == 32 - shell: bash - run: | - # Note that we are configuring this for user-mode emulation: - # syscalls will be native, only user-mode code will be emulated. - # This is not 100% perfect (there are various corner cases that - # can bite us), but is *much* faster than full machine emulation. - - sudo apt-get update - sudo apt-get install --install-suggests \ - ${{matrix.cc}}-arm-linux-gnueabihf \ - ${{matrix.cxx}}-arm-linux-gnueabihf - - # TODO: figure out how to install libjpeg and libpng for armhf; - # the standard apt repository for GHA VMs barfs on these. - # sudo apt-get install \ - # libjpeg-dev:armhf \ - # libpng-dev:armhf - - # Note that we need QEMU even if not running tests, as Generators - # will be built for arm by default, and we need to be able to run them. - sudo apt-get install --install-suggests \ - qemu-user \ - qemu-user-binfmt - - qemu-arm --version - echo ::set-env name=QEMU_LD_PREFIX::"/usr/arm-linux-gnueabihf" - - - name: Configure AArch64 Crosscompilation - if: matrix.target_os == 'linux' && matrix.target_arch == 'arm' && matrix.target_bits == 64 - shell: bash - run: | - sudo apt-get update - sudo apt-get install --install-suggests \ - ${{matrix.cc}}-aarch64-linux-gnu \ - ${{matrix.cxx}}-aarch64-linux-gnu - - # TODO: figure out how to install libjpeg and libpng for armhf; - # the standard apt repository for GHA VMs barfs on these. - # sudo apt-get install \ - # libjpeg-dev:aarch64 \ - # libpng-dev:aarch64 - - # Note that we need QEMU even if not running tests, as Generators - # will be built for arm by default, and we need to be able to run them. - sudo apt-get install --install-suggests \ - qemu-user \ - qemu-user-binfmt - - qemu-arm --version - echo ::set-env name=QEMU_LD_PREFIX::"/usr/aarch64-linux-gnu" - - - name: Configure Env Vars - shell: bash - run: | - echo "github.event_name is ${{github.event_name}}" # should always be "pull_request" - echo "github.event.action is ${{github.event.action}}" - - # Demangle Windows names, to simplify CMake stuff later - _ROOT=${GITHUB_WORKSPACE//\\//} - _TEMP_RAW="${{runner.temp}}" - _TEMP=${_TEMP_RAW//\\//} - - # This is the trick GitHub Actions uses to allow us to set env vars across all subsequent job steps - echo ::set-env name=BUILD_TYPE::"Release" - echo ::set-env name=LLVM_INSTALL_DIR::"${_ROOT}/llvm" - echo ::set-env name=LLVM_CONFIG::"${_ROOT}/llvm/bin/llvm-config" - echo ::set-env name=HALIDE_SOURCE_DIR::"${_ROOT}/halide" - echo ::set-env name=HALIDE_BUILD_DIR::"${_ROOT}/halide_build" - echo ::set-env name=HALIDE_TEMP_DIR::"${_TEMP}" - echo ::set-env name=PARALLEL_JOBS::"4" - if [[ ${{matrix.host_os}} == windows* ]]; then - # On Windows, it's just 'python', apparently - echo ::set-env name=PYTHON::"python" - else - echo ::set-env name=PYTHON::"python${{matrix.python_version}}" - fi - - - name: Install Python Dependencies - if: matrix.uses_python - shell: bash - run: | - ${PYTHON} -m pip --version - ${PYTHON} -m pip install --upgrade pip - ${PYTHON} -m pip install -r ${HALIDE_SOURCE_DIR}/python_bindings/requirements.txt - - echo ::set-env name=PYTHON::"${PYTHON}" - - - name: Install LLVM - shell: bash - run: | - LLVM_ID="llvm-${{matrix.llvm_version}}-${{matrix.target_arch}}-${{matrix.target_bits}}-${{matrix.target_os}}" - - curl \ - --user llvm_user:${{secrets.LLVM_USER_PASSWORD}} \ - --output ${HALIDE_TEMP_DIR}/llvm-prebuilt.tgz \ - https://buildbot.halide-lang.org/llvm/${LLVM_ID}.tgz - - TAR_CMD="tar" - if [[ ${{matrix.host_os}} == windows* ]]; then - # Must use --force-local to avoid tar misinterpreting the : in - # a Windows pathname as a hostname. - TAR_CMD="tar --force-local" - fi - - mkdir ${LLVM_INSTALL_DIR} - ${TAR_CMD} -xf ${HALIDE_TEMP_DIR}/llvm-prebuilt.tgz -C ${LLVM_INSTALL_DIR} - rm -rf ${HALIDE_TEMP_DIR}/llvm-prebuilt.tgz - - LLVM_COMMIT_HASH=`cat ${LLVM_INSTALL_DIR}/.halide_builder_llvm_commit` - echo "Using LLVM v${{matrix.llvm_version}} commit=${LLVM_COMMIT_HASH}" - - - name: Configure Halide (Make) - if: startsWith(matrix.build_tool, 'make') - shell: bash - run: | - # Configure Make - mkdir ${HALIDE_BUILD_DIR} - - if [[ ${{matrix.target_arch}} == x86 && \ - ${{matrix.target_os}} == linux && \ - ${{matrix.target_bits}} == 32 ]]; then - echo ::set-env name=CC::"${CC} -m32" - echo ::set-env name=CXX::"${CXX} -m32" - echo ::set-env name=LD::"${LD} -melf_i386" - fi - - - name: Configure Halide (CMake) - if: startsWith(matrix.build_tool, 'cmake') - shell: bash - run: | - # Configure CMake - echo `cmake --version` - - mkdir ${HALIDE_BUILD_DIR} - - CMAKE_GEN="Ninja" - EXTRA_CMAKE_FLAGS= - - if [[ ${{matrix.host_os}} == windows* ]]; then - CMAKE_GEN="Visual Studio 16 2019" - - # CMAKE_TOOLCHAIN_FILE is necessary for CMake to find things installed by vcpkg - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D CMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT//\\//}/scripts/buildsystems/vcpkg.cmake \ - -T host=x64" - if [[ ${{matrix.target_bits}} == 32 ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -A Win32" - else - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -A x64" - fi - fi - - if [[ ${{matrix.target_arch}} == x86 && \ - ${{matrix.target_os}} == linux && \ - ${{matrix.target_bits}} == 32 ]]; then - # Assume host_os is ubuntu* - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D CMAKE_TOOLCHAIN_FILE=${HALIDE_SOURCE_DIR}/cmake/toolchain.linux-i386.cmake" - fi - - if [[ ${{matrix.target_os}} == osx ]]; then - # LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS=OFF is needed for compatibility with older XCode versions - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D LLVM_ENABLE_SUPPORT_XCODE_SIGNPOSTS=FORCE_OFF" - fi - - if [[ ${{matrix.target_arch}} == arm ]]; then - # The arm toolchain files default to "gcc"/"g++" with no version appended, - # but we installed specific versions, so be sure it can find those specific versions. - if [[ ${{matrix.target_bits}} == 32 ]]; then - export ARCH_FOR_TESTS=armv7-a - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D CMAKE_C_COMPILER=arm-linux-gnueabihf-${{matrix.cc}} \ - -D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-${{matrix.cxx}} \ - -D CMAKE_TOOLCHAIN_FILE=${HALIDE_SOURCE_DIR}/cmake/toolchain.linux-arm32.cmake" - else - export ARCH_FOR_TESTS=armv8-a - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D CMAKE_C_COMPILER=aarch64-linux-gnu-${{matrix.cc}} \ - -D CMAKE_CXX_COMPILER=aarch64-linux-gnu-${{matrix.cxx}} \ - -D CMAKE_TOOLCHAIN_FILE=${HALIDE_SOURCE_DIR}/cmake/toolchain.linux-aarch64.cmake" - fi - fi - - REQUIRE_LLVM_VERSION="${{matrix.llvm_version}}0" - SHARED_LIBRARY=$([ ${{matrix.build_tool}} == "cmake_shared" ] && echo "ON" || echo "OFF") - - if [[ "${{matrix.uses_python}}" == "true" ]]; then - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D WITH_PYTHON_BINDINGS=ON" - else - EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} \ - -D WITH_PYTHON_BINDINGS=OFF" - fi - - cmake \ - -D CMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -D LLVM_DIR="${LLVM_INSTALL_DIR}/lib/cmake/llvm" \ - -D HALIDE_REQUIRE_LLVM_VERSION="${REQUIRE_LLVM_VERSION}" \ - -D HALIDE_SHARED_LIBRARY=${SHARED_LIBRARY} \ - -G "${CMAKE_GEN}" \ - ${EXTRA_CMAKE_FLAGS} \ - -S "${HALIDE_SOURCE_DIR}" \ - -B "${HALIDE_BUILD_DIR}" - - - name: Build Halide (Make) - if: startsWith(matrix.build_tool, 'make') - shell: bash - run: | - # Build Halide - cd ${HALIDE_BUILD_DIR} - - BUILD_TARGETS="distrib build_tests" - if [[ "${{matrix.uses_python}}" == "true" ]]; then - # build_apps requires the python bindings - BUILD_TARGETS="${BUILD_TARGETS} build_apps build_python_bindings" - fi - - make -f ${HALIDE_SOURCE_DIR}/Makefile -j ${PARALLEL_JOBS} ${BUILD_TARGETS} - - - name: Build Halide (CMake) - if: startsWith(matrix.build_tool, 'cmake') - shell: bash - run: | - # Build Halide - cd ${HALIDE_BUILD_DIR} - cmake \ - --build ${HALIDE_BUILD_DIR} \ - --config ${BUILD_TYPE} \ - -j ${PARALLEL_JOBS} - - - name: Run Tests (Make) - if: matrix.run_tests && startsWith(matrix.build_tool, 'make') - shell: bash - run: | - # Test Halide - export TEST_TMPDIR="${HALIDE_TEMP_DIR}" - cd ${HALIDE_BUILD_DIR} - - TEST_GROUPS_PARALLEL="internal correctness error warning generator" - if [[ "${{matrix.uses_python}}" == "true" ]]; then - TEST_GROUPS_PARALLEL="${TEST_GROUPS_PARALLEL} python" - fi - - # tutorial has some performance measurements that can be flaky if we run them in parallel - TEST_GROUPS_SERIAL="tutorial" - - # performance is never going to be reliable on VMs. - # auto_schedule is just flaky. - TEST_GROUPS_BROKEN="performance auto_schedule" - - if [[ ${{matrix.target_bits}} == 32 ]]; then - # TODO: Skip testing apps on 32-bit systems for now; - # in particular, apps/autoscheduler can time out, and also has build - # issues on ubuntu-32 at the moment (__udivdi3). - TEST_GROUPS_BROKEN="${TEST_GROUPS_BROKEN} apps" - else - TEST_GROUPS_PARALLEL="${TEST_GROUPS_PARALLEL} apps" - fi - - # Parallel - for t in ${TEST_GROUPS_PARALLEL}; do - make -f ${HALIDE_SOURCE_DIR}/Makefile -j ${PARALLEL_JOBS} test_${t} - done - - # Serial - for t in ${TEST_GROUPS_SERIAL}; do - make -f ${HALIDE_SOURCE_DIR}/Makefile test_$t - done - - - name: Run Tests (CMake) - if: matrix.run_tests && startsWith(matrix.build_tool, 'cmake') - shell: bash - run: | - # Test Halide - TEST_GROUPS_PARALLEL="internal|correctness|error|warning|generator" - - if [[ "${{matrix.uses_python}}" == "true" ]]; then - TEST_GROUPS_PARALLEL="${TEST_GROUPS_PARALLEL}|python" - fi - - # tutorial has some performance measurements that can be flaky if we run them in parallel - TEST_GROUPS_SERIAL="tutorial" - - # performance is never going to be reliable on VMs. - # auto_schedule is just flaky. - TEST_GROUPS_BROKEN="performance|auto_schedule" - - export TEST_TMPDIR="${HALIDE_TEMP_DIR}" - cd ${HALIDE_BUILD_DIR} - - # Parallel - ctest \ - -C ${BUILD_TYPE} \ - -j ${PARALLEL_JOBS} \ - -L "${TEST_GROUPS_PARALLEL}" \ - --output-on-failure - - # Serial - ctest \ - -C ${BUILD_TYPE} \ - -L "${TEST_GROUPS_SERIAL}" \ - -E "${TEST_GROUPS_BROKEN}" \ - --output-on-failure diff --git a/CMakePresets.json b/CMakePresets.json index ad4fda831578..8e71d3c1efcf 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -145,35 +145,6 @@ "BUILD_SHARED_LIBS": "NO", "Halide_BUNDLE_LLVM": "YES" } - }, - { - "name": "package-ubuntu-shared", - "inherits": "package-unix-shared", - "displayName": "Package shared Halide for Ubuntu", - "description": "Package shared Halide for Ubuntu, using system packages.", - "binaryDir": "shared-release", - "cacheVariables": { - "Halide_SHARED_LLVM": "YES", - "LLVM_DIR": "$env{LLVM_ROOT}/lib/cmake/llvm", - "Clang_DIR": "$env{LLVM_ROOT}/lib/cmake/clang", - "LLD_DIR": "$env{LLVM_ROOT}/lib/cmake/lld", - "CMAKE_INSTALL_INCLUDEDIR": "include/Halide", - "CMAKE_INSTALL_LIBDIR": "lib/x86_64-linux-gnu", - "Halide_INSTALL_PLUGINDIR": "lib/x86_64-linux-gnu/Halide", - "Halide_INSTALL_HELPERSDIR": "lib/cmake/HalideHelpers", - "CMAKE_STRIP": "${sourceDir}/packaging/ubuntu/extra-strip.sh" - } - }, - { - "name": "package-ubuntu-static", - "inherits": "package-ubuntu-shared", - "displayName": "Package static Halide for Ubuntu", - "description": "Package static Halide for Ubuntu, using system packages.", - "binaryDir": "static-release", - "cacheVariables": { - "BUILD_SHARED_LIBS": "NO", - "WITH_DOCS": "NO" - } } ] } diff --git a/packaging/ubuntu/changelog b/packaging/ubuntu/changelog deleted file mode 100644 index f36c015c23e5..000000000000 --- a/packaging/ubuntu/changelog +++ /dev/null @@ -1,5 +0,0 @@ -@package_name@ (@CPACK_PACKAGE_VERSION@) UNRELEASED; urgency=low - - * Initial package release. - - -- @CPACK_PACKAGE_CONTACT@ @timestamp@ -0000 diff --git a/packaging/ubuntu/config.cmake b/packaging/ubuntu/config.cmake deleted file mode 100644 index d4df26dee844..000000000000 --- a/packaging/ubuntu/config.cmake +++ /dev/null @@ -1,137 +0,0 @@ -cmake_minimum_required(VERSION 3.19) - -include("shared-Release/CPackConfig.cmake") - -## General setup - -set(CPACK_PACKAGE_CONTACT "Alex Reinking ") -set(CPACK_STRIP_FILES TRUE) -set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/pre_build.cmake") - -############################## -## Components configuration ## -############################## - -# This is a mapping from CPack component names to CMake install() components. -# We use the identity mapping here for simplicity; some advanced configurations -# with GUI installers require these to diverge. -set(CPACK_COMPONENTS_HALIDE_RUNTIME Halide_Runtime) -set(CPACK_COMPONENTS_HALIDE_DEVELOPMENT Halide_Development) -set(CPACK_COMPONENTS_HALIDE_DOCUMENTATION Halide_Documentation) - -set(CPACK_COMPONENTS_ALL Halide_Runtime Halide_Development Halide_Documentation) - -set(CPACK_INSTALL_CMAKE_PROJECTS - static-Release Halide ALL / - shared-Release Halide ALL /) - -################################### -## Ubuntu-specific configuration ## -################################### - -# We set every variable documented here: https://cmake.org/cmake/help/latest/cpack_gen/deb.html -# even if it's just to the default. That way there are no surprises. - -set(CPACK_DEB_COMPONENT_INSTALL YES) - -set(CPACK_DEBIAN_HALIDE_RUNTIME_PACKAGE_NAME libHalide${CPACK_PACKAGE_VERSION_MAJOR}) -set(CPACK_DEBIAN_HALIDE_DEVELOPMENT_PACKAGE_NAME libHalide${CPACK_PACKAGE_VERSION_MAJOR}-dev) -set(CPACK_DEBIAN_HALIDE_DOCUMENTATION_PACKAGE_NAME libHalide${CPACK_PACKAGE_VERSION_MAJOR}-doc) - -set(CPACK_DEBIAN_HALIDE_RUNTIME_FILE_NAME DEB-DEFAULT) -set(CPACK_DEBIAN_HALIDE_DEVELOPMENT_FILE_NAME DEB-DEFAULT) -set(CPACK_DEBIAN_HALIDE_DOCUMENTATION_FILE_NAME DEB-DEFAULT) - -# Debian package versions look like: :- -# is a number that increases when changing the whole versioning schema. -# We would ideally _never_ have to set this since we're using semver. -# is the version number of the actual software being packaged. -# is the version number of the _package_. Set/increment this when fixing -# bugs in the package itself. This should also not be incremented too -# frequently. It's always safe to bump the patch version when in doubt. -unset(CPACK_DEBIAN_PACKAGE_EPOCH) -set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") -unset(CPACK_DEBIAN_PACKAGE_RELEASE) - -# The default here is the host system architecture. It will generally be best -# to package for ARM on ARM, for x86 on x86, etc. The documentation gets the -# pseudo-architecture "all" to indicate that it has no binaries (ie. is arch -# independent). -unset(CPACK_DEBIAN_PACKAGE_ARCHITECTURE) -set(CPACK_DEBIAN_HALIDE_DOCUMENTATION_PACKAGE_ARCHITECTURE all) - -# Package dependencies. -# TODO: figure out how to get LLVM major version piped in here. -set(CPACK_DEBIAN_HALIDE_RUNTIME_PACKAGE_DEPENDS "llvm-13 (>= 13.0.0)") -set(CPACK_DEBIAN_HALIDE_DEVELOPMENT_PACKAGE_DEPENDS "llvm-13-dev (>= 13.0.0), liblld-13-dev (>= 13.0.0)") -set(CPACK_DEBIAN_HALIDE_DOCUMENTATION_PACKAGE_DEPENDS "") - -# Sets up package dependencies based on CPack component dependencies -set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON) - -# Uses CPACK_PACKAGE_CONTACT as default -unset(CPACK_DEBIAN_PACKAGE_MAINTAINER) - -# These inherit their values from cpack cpack_add_component -unset(CPACK_DEBIAN_HALIDE_RUNTIME_DESCRIPTION) -unset(CPACK_DEBIAN_HALIDE_DEVELOPMENT_DESCRIPTION) -unset(CPACK_DEBIAN_HALIDE_DOCUMENTATION_DESCRIPTION) - -# The Debian repository package section. -# See: https://packages.debian.org/unstable/ -# libs = Libraries to make other programs work. They provide special features to developers. -# libdevel = Libraries necessary for developers to write programs that use them. -# doc = FAQs, HOWTOs and other documents trying to explain everything related to -# Debian, and software needed to browse documentation (man, info, etc). -set(CPACK_DEBIAN_HALIDE_RUNTIME_PACKAGE_SECTION libs) -set(CPACK_DEBIAN_HALIDE_DEVELOPMENT_PACKAGE_SECTION libdevel) -set(CPACK_DEBIAN_HALIDE_DOCUMENTATION_PACKAGE_SECTION doc) - -# Deprecated: do not use -unset(CPACK_DEBIAN_ARCHIVE_TYPE) - -# Could also choose from lzma, xz, or bzip2 if one gave a better ratio. -set(CPACK_DEBIAN_COMPRESSION_TYPE "gzip") - -# Optional just means that it is optional for the safe running of -# a Debian system to have our package installed. The other categories -# do not apply to us: required (won't boot without), important (core -# system utils), and standard (basic niceties for a character-mode -# system). -set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") - -# Uses CMAKE_PROJECT_HOMEPAGE_URL as default. -unset(CPACK_DEBIAN_PACKAGE_HOMEPAGE) - -# Call dpkg-shlibdeps to get dependencies on system libraries. -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -unset(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS) # CMake 3.20+ only - -# Disable debug messaging -unset(CPACK_DEBIAN_PACKAGE_DEBUG) - -# Special variables for package constraints. We don't have any yet. -unset(CPACK_DEBIAN_PACKAGE_PREDEPENDS) -unset(CPACK_DEBIAN_PACKAGE_ENHANCES) -unset(CPACK_DEBIAN_PACKAGE_BREAKS) -unset(CPACK_DEBIAN_PACKAGE_CONFLICTS) -unset(CPACK_DEBIAN_PACKAGE_PROVIDES) -unset(CPACK_DEBIAN_PACKAGE_REPLACES) -unset(CPACK_DEBIAN_PACKAGE_RECOMMENDS) -unset(CPACK_DEBIAN_PACKAGE_SUGGESTS) - -# Generate debian/shlibs control file; require exact versions. -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS YES) -set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY "=") - -# Add custom scripts to package. Used to ensure ldconfig runs. -unset(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA) -set(CPACK_DEBIAN_HALIDE_RUNTIME_PACKAGE_CONTROL_EXTRA - "${CMAKE_CURRENT_LIST_DIR}/triggers") -set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) - -# Name the source package for this one. TODO? -unset(CPACK_DEBIAN_PACKAGE_SOURCE) - -# Name the package containing debug symbols for this one. TODO? -unset(CPACK_DEBIAN_DEBUGINFO_PACKAGE) diff --git a/packaging/ubuntu/copyright b/packaging/ubuntu/copyright deleted file mode 100644 index f5529a29b208..000000000000 --- a/packaging/ubuntu/copyright +++ /dev/null @@ -1,26 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: @CPACK_PACKAGE_NAME@ -Upstream-Contact: @CPACK_PACKAGE_CONTACT@ -Source: @CPACK_PACKAGE_HOMEPAGE_URL@ - -Files: * -Copyright: @copyright_line@ -License: MIT - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject - to the following conditions: - . - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packaging/ubuntu/extra-strip.sh b/packaging/ubuntu/extra-strip.sh deleted file mode 100755 index 993dbfcf70cc..000000000000 --- a/packaging/ubuntu/extra-strip.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# See https://github.com/Debian/debhelper/blob/5d1bb29841043d8e47ebbdd043e6cd086cad508e/dh_strip#L362-L384 -# for what dh_strip removes. - -strip --remove-section=.comment --remove-section=.note "$@" diff --git a/packaging/ubuntu/package.sh b/packaging/ubuntu/package.sh deleted file mode 100755 index c831d3cfb710..000000000000 --- a/packaging/ubuntu/package.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -set -e -o pipefail - -halide_source=$(realpath "$1") -halide_build_root=$(realpath "$2") - -[ -z "$halide_source" ] && echo "Usage: $0 " && exit -[ -z "$halide_build_root" ] && echo "Usage: $0 " && exit -[ -z "$LLVM_ROOT" ] && echo "Must set LLVM_ROOT to /usr/lib/llvm-VERSION" && exit - -function group() { - [[ -n "${GITHUB_ACTIONS}" && -n "${SEEN_GROUP}" ]] && echo "::endgroup::" - [[ -n "${GITHUB_ACTIONS}" ]] && echo "::group::$*" - export SEEN_GROUP=1 -} - -group "Configure shared Halide build" -cmake --preset=package-ubuntu-shared -S "$halide_source" -B "$halide_build_root/shared-Release" - -group "Configure static Halide build" -cmake --preset=package-ubuntu-static -S "$halide_source" -B "$halide_build_root/static-Release" - -group "Build shared Halide" -cmake --build "$halide_build_root/shared-Release" -- -v - -group "Build static Halide" -cmake --build "$halide_build_root/static-Release" -- -v - -group "Create Ubuntu packages" -cd "$halide_build_root" -rm -rf ./_CPack_Packages ./*.deb lintian.log -umask 0022 -export LD_LIBRARY_PATH="$halide_build_root/shared-Release/src" - -cpack -G DEB -C Release --config "$halide_source/packaging/ubuntu/config.cmake" - -# Lintian: https://lintian.debian.org/tags - -group "Run strict Lintian checks" -lintian --no-tag-display-limit -i ./*.deb - -group "Run extra Lintian checks" -lintian --no-tag-display-limit -L "=info" -i ./*.deb - -echo "Success!" diff --git a/packaging/ubuntu/pre_build.cmake b/packaging/ubuntu/pre_build.cmake deleted file mode 100644 index a74370d1fd70..000000000000 --- a/packaging/ubuntu/pre_build.cmake +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 3.19) - -file(STRINGS "${CPACK_RESOURCE_FILE_LICENSE}" copyright_line LIMIT_COUNT 1) -string(TIMESTAMP timestamp "%a, %d %b %Y %H:%M:%S" UTC) - -find_program(GZIP gzip) -if (NOT GZIP) - message(FATAL_ERROR "Could not find gzip") -endif () - -foreach (comp IN LISTS CPACK_COMPONENTS_ALL) - string(TOUPPER "CPACK_DEBIAN_${comp}_PACKAGE_NAME" package_name_var) - string(TOLOWER "${${package_name_var}}" package_name) - - # Write copyright information to the package. - configure_file("${CMAKE_CURRENT_LIST_DIR}/copyright" - "${CPACK_TEMPORARY_DIRECTORY}/${comp}/usr/share/doc/${package_name}/copyright" - @ONLY NO_SOURCE_PERMISSIONS) - - # Write changelog to the package. - set(changelog "${CPACK_TEMPORARY_DIRECTORY}/${comp}/usr/share/doc/${package_name}/changelog") - configure_file("${CMAKE_CURRENT_LIST_DIR}/changelog" "${changelog}" - @ONLY NO_SOURCE_PERMISSIONS) - execute_process(COMMAND "${GZIP}" -n9 "${changelog}" COMMAND_ERROR_IS_FATAL ANY) -endforeach () diff --git a/packaging/ubuntu/triggers b/packaging/ubuntu/triggers deleted file mode 100644 index dd8660367847..000000000000 --- a/packaging/ubuntu/triggers +++ /dev/null @@ -1 +0,0 @@ -activate-noawait ldconfig