From 23f01577b066f7f9a4f36decb24971da6c55a5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Mon, 25 Mar 2024 13:57:35 +0100 Subject: [PATCH 01/10] meson: Build using Python 3.10 limited API (LP: #2050881) This requires meson >= 1.3.0 --- meson.build | 2 +- python-cffi/netplan/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 68c740f96..16f816610 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project('netplan', 'c', 'warning_level=2', 'werror=true', ], - meson_version: '>= 0.61.0', + meson_version: '>= 1.3.0', ) glib = dependency('glib-2.0') diff --git a/python-cffi/netplan/meson.build b/python-cffi/netplan/meson.build index 2f820d132..17b661405 100644 --- a/python-cffi/netplan/meson.build +++ b/python-cffi/netplan/meson.build @@ -24,6 +24,7 @@ cffi_pyext = python.extension_module( link_with: [libnetplan], subdir: 'netplan', install: true, + limited_api: '3.10', ) bindings_sources = [ From f143c6f7a34936304fe37851df4467cac025df53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 28 Mar 2024 17:33:42 +0100 Subject: [PATCH 02/10] CI: fix codeql build --- .github/workflows/codeql-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cac50f194..3168ccff9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -58,6 +58,7 @@ jobs: # Installs the build dependencies - name: Install build depends run: | + echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates sudo sed -i 's/Types: deb/Types: deb deb-src/g' /etc/apt/sources.list.d/ubuntu.sources sudo apt update sudo apt install meson python3-coverage python3-pytest python3-pytest-cov libcmocka-dev python3-cffi libpython3-dev From 8fcdb5a67db134a27c358d21df8aba884ece3ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 28 Mar 2024 17:38:52 +0100 Subject: [PATCH 03/10] RPM: avoid meson upgrade for EL9 --- .github/workflows/rpmbuild.yml | 2 +- rpm/meson-python-no-limited-api.diff | 40 ++++++++++++++++++++++++++++ rpm/netplan.spec | 3 ++- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 rpm/meson-python-no-limited-api.diff diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 2a788febc..3d6424129 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -19,7 +19,7 @@ jobs: container: - fedora:latest # - fedora:rawhide - - rockylinux:9 + # - rockylinux:9 # lacking meson >= 1.3.0 container: image: ${{ matrix.container }} steps: diff --git a/rpm/meson-python-no-limited-api.diff b/rpm/meson-python-no-limited-api.diff new file mode 100644 index 000000000..71e0e6484 --- /dev/null +++ b/rpm/meson-python-no-limited-api.diff @@ -0,0 +1,40 @@ +From d3ac742b25df0b495968003bf695a1e202455e19 Mon Sep 17 00:00:00 2001 +From: Lukas Märdian +Date: Thu, 28 Mar 2024 17:37:44 +0100 +Subject: [PATCH] Revert "meson: Build using Python 3.10 limited API (LP: + #2050881)" + +This reverts commit 5377b8c856f3f7a5b19ee7c486759adfac582d91. +--- + meson.build | 2 +- + python-cffi/netplan/meson.build | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 8755ebe4..9556836a 100644 +--- a/meson.build ++++ b/meson.build +@@ -6,7 +6,7 @@ project('netplan', 'c', + 'warning_level=2', + 'werror=true', + ], +- meson_version: '>= 1.3.0', ++ meson_version: '>= 0.61.0', + ) + + glib = dependency('glib-2.0') +diff --git a/python-cffi/netplan/meson.build b/python-cffi/netplan/meson.build +index 17b66140..2f820d13 100644 +--- a/python-cffi/netplan/meson.build ++++ b/python-cffi/netplan/meson.build +@@ -24,7 +24,6 @@ cffi_pyext = python.extension_module( + link_with: [libnetplan], + subdir: 'netplan', + install: true, +- limited_api: '3.10', + ) + + bindings_sources = [ +-- +2.40.1 + diff --git a/rpm/netplan.spec b/rpm/netplan.spec index fcc6e101a..8cc72b470 100644 --- a/rpm/netplan.spec +++ b/rpm/netplan.spec @@ -15,13 +15,14 @@ %endif Name: netplan -Version: 0.106 +Version: 1.0 Release: 0%{?dist} Summary: Network configuration tool using YAML Group: System Environment/Base License: GPL-3.0-only URL: http://netplan.io/ Source0: https://github.com/canonical/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +#Patch0: meson-python-no-limited-api.diff BuildRequires: gcc BuildRequires: meson >= 0.61 From 46451502d24ff04763ed285f891df74220f9476c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:14:56 +0100 Subject: [PATCH 04/10] CI:rpmbuild: upgrade to EL10 --- .github/workflows/rpmbuild.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 3d6424129..905233465 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -19,7 +19,8 @@ jobs: container: - fedora:latest # - fedora:rawhide - # - rockylinux:9 # lacking meson >= 1.3.0 + - almalinux:10-kitten + # - rockylinux:10 container: image: ${{ matrix.container }} steps: @@ -30,7 +31,7 @@ jobs: dnf -y install dnf-plugins-core rpmdevtools # for 'dnf builddep' dnf -y install epel-release || true dnf config-manager --set-enabled crb || true # Meson/CMocka on EL9 - dnf -y install centos-release-nfv-openvswitch || true # OVS on EL9 + dnf config-manager --set-enabled nfv || true # OVS on EL10 dnf -y builddep rpm/netplan.spec adduser test chown -R test:test . From 11d3ce83efdb15f504ba0a1160dd6c51e5b4b5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:22:55 +0100 Subject: [PATCH 05/10] install git --- .github/workflows/rpmbuild.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 905233465..41754b7cc 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -24,6 +24,8 @@ jobs: container: image: ${{ matrix.container }} steps: + - name: Install git + run: dnf -y install git - uses: actions/checkout@v2 - name: Build & Test run: | From d572a5f410969c216155ee747b18c835d9ae3c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:27:46 +0100 Subject: [PATCH 06/10] build-dep --- .github/workflows/rpmbuild.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 41754b7cc..3cab8b34a 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -24,17 +24,18 @@ jobs: container: image: ${{ matrix.container }} steps: - - name: Install git - run: dnf -y install git + - name: Install Build-Dependencies + run: | + dnf -y install git + dnf config-manager --set-enabled crb || true # Meson/CMocka on EL9 + dnf config-manager --set-enabled nfv || true # OVS on EL10 + dnf -y install epel-release || true + dnf -y install dnf-plugins-core rpmdevtools # for 'dnf builddep' - uses: actions/checkout@v2 - name: Build & Test run: | cat /etc/os-release - dnf -y install dnf-plugins-core rpmdevtools # for 'dnf builddep' - dnf -y install epel-release || true - dnf config-manager --set-enabled crb || true # Meson/CMocka on EL9 - dnf config-manager --set-enabled nfv || true # OVS on EL10 - dnf -y builddep rpm/netplan.spec adduser test chown -R test:test . + dnf -y builddep rpm/netplan.spec su test -c 'rpmbuild -bi -D "debug_package %{nil}" --build-in-place rpm/netplan.spec' From 57cecf57ff07d2d00542303b5898de68833c77ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:37:34 +0100 Subject: [PATCH 07/10] powertools, ovs --- .github/workflows/rpmbuild.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 3cab8b34a..6a714dcf7 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -27,9 +27,11 @@ jobs: - name: Install Build-Dependencies run: | dnf -y install git - dnf config-manager --set-enabled crb || true # Meson/CMocka on EL9 + dnf config-manager --set-enabled powertools || true + dnf config-manager --set-enabled crb || true # Meson/CMocka on EL10 dnf config-manager --set-enabled nfv || true # OVS on EL10 dnf -y install epel-release || true + dnf -y install centos-release-nfv-openvswitch || true # OVS on EL9 dnf -y install dnf-plugins-core rpmdevtools # for 'dnf builddep' - uses: actions/checkout@v2 - name: Build & Test From b2270b8d716883a586aa2e86689ab2ba276ba35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:40:34 +0100 Subject: [PATCH 08/10] cleanup RPM --- rpm/meson-python-no-limited-api.diff | 40 ---------------------------- rpm/netplan.spec | 6 ++--- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 rpm/meson-python-no-limited-api.diff diff --git a/rpm/meson-python-no-limited-api.diff b/rpm/meson-python-no-limited-api.diff deleted file mode 100644 index 71e0e6484..000000000 --- a/rpm/meson-python-no-limited-api.diff +++ /dev/null @@ -1,40 +0,0 @@ -From d3ac742b25df0b495968003bf695a1e202455e19 Mon Sep 17 00:00:00 2001 -From: Lukas Märdian -Date: Thu, 28 Mar 2024 17:37:44 +0100 -Subject: [PATCH] Revert "meson: Build using Python 3.10 limited API (LP: - #2050881)" - -This reverts commit 5377b8c856f3f7a5b19ee7c486759adfac582d91. ---- - meson.build | 2 +- - python-cffi/netplan/meson.build | 1 - - 2 files changed, 1 insertion(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 8755ebe4..9556836a 100644 ---- a/meson.build -+++ b/meson.build -@@ -6,7 +6,7 @@ project('netplan', 'c', - 'warning_level=2', - 'werror=true', - ], -- meson_version: '>= 1.3.0', -+ meson_version: '>= 0.61.0', - ) - - glib = dependency('glib-2.0') -diff --git a/python-cffi/netplan/meson.build b/python-cffi/netplan/meson.build -index 17b66140..2f820d13 100644 ---- a/python-cffi/netplan/meson.build -+++ b/python-cffi/netplan/meson.build -@@ -24,7 +24,6 @@ cffi_pyext = python.extension_module( - link_with: [libnetplan], - subdir: 'netplan', - install: true, -- limited_api: '3.10', - ) - - bindings_sources = [ --- -2.40.1 - diff --git a/rpm/netplan.spec b/rpm/netplan.spec index 8cc72b470..c86d70100 100644 --- a/rpm/netplan.spec +++ b/rpm/netplan.spec @@ -15,17 +15,16 @@ %endif Name: netplan -Version: 1.0 +Version: 1.1 Release: 0%{?dist} Summary: Network configuration tool using YAML Group: System Environment/Base License: GPL-3.0-only URL: http://netplan.io/ Source0: https://github.com/canonical/%{name}/archive/%{version}/%{name}-%{version}.tar.gz -#Patch0: meson-python-no-limited-api.diff BuildRequires: gcc -BuildRequires: meson >= 0.61 +BuildRequires: meson >= 1.3 BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gio-2.0) @@ -43,7 +42,6 @@ BuildRequires: %{_sbindir}/ip BuildRequires: pkgconfig(cmocka) BuildRequires: python3dist(coverage) BuildRequires: dbus-x11 -BuildRequires: python3dist(netifaces) BuildRequires: python3dist(pycodestyle) BuildRequires: python3dist(pyflakes) BuildRequires: python3dist(pytest) From c1d984c0521c8111f3ed25a050575f7598818eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:47:20 +0100 Subject: [PATCH 09/10] config-manager --- .github/workflows/rpmbuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 6a714dcf7..3da983e21 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -27,6 +27,7 @@ jobs: - name: Install Build-Dependencies run: | dnf -y install git + dnf -y install 'dnf-command(config-manager)' dnf config-manager --set-enabled powertools || true dnf config-manager --set-enabled crb || true # Meson/CMocka on EL10 dnf config-manager --set-enabled nfv || true # OVS on EL10 From df3de3158d963704402fe424c2c3643e1dd886e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=A4rdian?= Date: Thu, 12 Dec 2024 09:52:23 +0100 Subject: [PATCH 10/10] cleanup for EL10 --- .github/workflows/rpmbuild.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rpmbuild.yml b/.github/workflows/rpmbuild.yml index 3da983e21..f13963f51 100644 --- a/.github/workflows/rpmbuild.yml +++ b/.github/workflows/rpmbuild.yml @@ -26,14 +26,11 @@ jobs: steps: - name: Install Build-Dependencies run: | - dnf -y install git - dnf -y install 'dnf-command(config-manager)' - dnf config-manager --set-enabled powertools || true + # for 'dnf builddep' and 'dnf config-manager' + dnf -y install git rpmdevtools 'dnf-command(config-manager)' dnf config-manager --set-enabled crb || true # Meson/CMocka on EL10 dnf config-manager --set-enabled nfv || true # OVS on EL10 - dnf -y install epel-release || true - dnf -y install centos-release-nfv-openvswitch || true # OVS on EL9 - dnf -y install dnf-plugins-core rpmdevtools # for 'dnf builddep' + dnf -y install epel-release || true # Pandoc, python-rich, ... - uses: actions/checkout@v2 - name: Build & Test run: |