From 20f312ad9c5bb58057e187ebe91ecca298ed6bdb Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 19 Nov 2024 09:43:32 +0000 Subject: [PATCH] Fix charm build. Add check/gate charmbuild target. Refresh test-requirements. Update charmcraft to use rust >= 1.76 to support newer versions of rpds-py. Change-Id: I9fda331731d29fecccd0a9c59ece9aa00d065333 --- .gitignore | 1 + .zuul.yaml | 5 +++ charmcraft.yaml | 92 +++++++++++-------------------------------- test-requirements.txt | 19 +-------- tox.ini | 5 +++ 5 files changed, 37 insertions(+), 85 deletions(-) diff --git a/.gitignore b/.gitignore index f53d7ed..4304411 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ interfaces layers *.swp *.charm +.coverage diff --git a/.zuul.yaml b/.zuul.yaml index fd20909..367392a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,3 +2,8 @@ templates: - openstack-python3-charm-jobs - openstack-cover-jobs + check: + jobs: + - charmbuild + vars: + charm_build_name: ovn-dedicated-chassis diff --git a/charmcraft.yaml b/charmcraft.yaml index cf0f149..be9dd12 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -12,77 +12,33 @@ parts: - python3-dev - libffi-dev - libssl-dev - - rustc - - cargo + - rustc-1.76 + - cargo-1.76 + - pkg-config + override-build: | + # Note(mylesjp): Force build to use rustc-1.76 + ln -s /usr/bin/rustc-1.76 /usr/bin/rustc + ln -s /usr/bin/cargo-1.76 /usr/bin/cargo + craftctl default build-snaps: - - charm + - charm/latest/edge build-environment: - CHARM_INTERFACES_DIR: $CRAFT_PROJECT_DIR/interfaces/ - CHARM_LAYERS_DIR: $CRAFT_PROJECT_DIR/layers/ - MAKEFLAGS: -j$(nproc) - CARGO_HTTP_MULTIPLEXING: "false" -bases: - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [amd64] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [amd64] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [s390x] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [s390x] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [ppc64el] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [ppc64el] - - build-on: - - name: ubuntu - channel: "22.04" - architectures: [arm64] - run-on: - - name: ubuntu - channel: "22.04" - architectures: [arm64] - - build-on: - - name: ubuntu - channel: "23.10" - architectures: [amd64] - run-on: - - name: ubuntu - channel: "23.10" - architectures: [amd64] - - build-on: - - name: ubuntu - channel: "23.10" - architectures: [s390x] - run-on: - - name: ubuntu - channel: "23.10" - architectures: [s390x] - - build-on: - - name: ubuntu - channel: "23.10" - architectures: [ppc64el] - run-on: - - name: ubuntu - channel: "23.10" - architectures: [ppc64el] - - build-on: - - name: ubuntu - channel: "23.10" - architectures: [arm64] - run-on: - - name: ubuntu - channel: "23.10" - architectures: [arm64] + +base: ubuntu@24.04 +platforms: + amd64: + build-on: amd64 + build-for: amd64 + arm64: + build-on: arm64 + build-for: arm64 + ppc64el: + build-on: ppc64el + build-for: ppc64el + s390x: + build-on: s390x + build-for: s390x diff --git a/test-requirements.txt b/test-requirements.txt index a7936e6..a9d104f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ # https://github.com/openstack-charmers/release-tools # pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here. -setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 stestr>=2.2.0 @@ -20,19 +19,5 @@ mock>=1.2 nose>=1.3.7 coverage>=3.6 git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack -# -# Revisit for removal / mock improvement: -# -# NOTE(lourot): newer versions of cryptography require a Rust compiler to build, -# see -# * https://github.com/openstack-charmers/zaza/issues/421 -# * https://mail.python.org/pipermail/cryptography-dev/2021-January/001003.html -# -netifaces # vault -psycopg2-binary # vault -tenacity # vault -pbr==5.6.0 # vault -cryptography<3.4 # vault, keystone-saml-mellon -lxml # keystone-saml-mellon -hvac # vault, barbican-vault -psutil # cinder-lvm + +netifaces diff --git a/tox.ini b/tox.ini index c2be05e..6d546ce 100644 --- a/tox.ini +++ b/tox.ini @@ -57,6 +57,11 @@ basepython = python3.10 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} +[testenv:py312] +basepython = python3.12 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + [testenv:pep8] basepython = python3 deps = flake8==3.9.2