criu: fix pycriu build of wheel

Inherit python_setuptools_build_meta instead of setuptools3, as
this is the build-backend declared in the pyproject.toml

We seem to need python3-protobuf-native as a DEPENDS, but
then the dependency check complains because our version in meta-python
is python3-protobuf_4.25.bb

Workaround this (for now?) by telling python3 -m build to --skip-dependency-check

This allows criu to _build_. Whether it is functional and proper is a different
story.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
This commit is contained in:
Tim Orling 2024-03-02 13:56:03 -08:00 committed by Bruce Ashfield
parent 9b4acf5185
commit cd11ca9de3
3 changed files with 53 additions and 9 deletions

View File

@ -20,11 +20,13 @@ SRC_URI = "git://github.com/checkpoint-restore/criu.git;branch=master;protocol=h
file://0001-criu-Skip-documentation-install.patch \
file://0002-criu-Change-libraries-install-directory.patch \
file://0003-crit-pycriu-build-and-install-wheels.patch \
file://0004-pycriu-attr-pycriu.version.__version__.patch \
file://0005-pycriu-skip-dependency-check-during-build.patch \
"
COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet"
DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet python3-protobuf-native"
RDEPENDS:${PN} = "bash cgroup-lite"
S = "${WORKDIR}/git"
@ -55,7 +57,6 @@ export HOST_SYS
export HOSTCFLAGS = "${BUILD_CFLAGS}"
inherit python_setuptools_build_meta
#inherit setuptools3
inherit pkgconfig
B = "${S}"
@ -73,10 +74,6 @@ do_compile:prepend() {
ln -s ${PKG_CONFIG_SYSROOT_DIR}/usr/include/google/protobuf/descriptor.proto ${S}/images/google/protobuf/descriptor.proto
}
#PEP517_SOURCE_PATH ="${S}/lib"
#do_compile[network] = "1"
do_compile () {
#python_pep517_do_compile
#export PEP517_SOURCE_PATH="${S}/crit"
@ -87,12 +84,9 @@ do_compile () {
oe_runmake FULL_PYTHON=${PYTHON} PYTHON=nativepython3
}
#do_install[network] = "1"
do_install () {
export INSTALL_LIB="${libdir}/${PYTHON_DIR}/site-packages"
export PEP517_WHEEL_PATH="${PEP517_WHEEL_PATH}"
#oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" PLUGINDIR="${localstatedir}/lib" PIP_BREAK_SYSTEM_PACKAGES=1 install
oe_runmake PREFIX=${exec_prefix} LIBDIR=${libdir} DESTDIR="${D}" PLUGINDIR="${localstatedir}/lib" FULL_PYTHON=${PYTHON} PYTHON=nativepython3 install
# python3's distutils has a feature of rewriting the interpeter on setup installed

View File

@ -0,0 +1,20 @@
From a2b17e7b082786e2d7b7585b33815572c9c521f0 Mon Sep 17 00:00:00 2001
From: Tim Orling <tim.orling@konsulko.com>
Date: Sat, 2 Mar 2024 13:47:46 -0800
Subject: [PATCH] pycriu: attr pycriu.version.__version__
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
lib/pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pyproject.toml b/lib/pyproject.toml
index 8eb4b7084..5a92f8540 100644
--- a/lib/pyproject.toml
+++ b/lib/pyproject.toml
@@ -16,4 +16,4 @@ requires-python = ">=3.6"
packages = ["pycriu", "pycriu.images"]
[tool.setuptools.dynamic]
-version = {attr = "pycriu.__version__"}
+version = {attr = "pycriu.version.__version__"}

View File

@ -0,0 +1,30 @@
From 2ec745ac11357e3243ef1f23f817c276518ce7cb Mon Sep 17 00:00:00 2001
From: Tim Orling <tim.orling@konsulko.com>
Date: Sat, 2 Mar 2024 13:48:54 -0800
Subject: [PATCH] pycriu: --skip-dependency-check during build
It complains about needing protobuf<4, python3-protobuf is 4.25 in meta-python
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
lib/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index b5f147482..e3faa7a06 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -66,11 +66,11 @@ ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0)
$(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install"
else
$(E) " INSTALL " pycriu
- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
+ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
endif
else
$(E) " BUILD " pycriu
- $(Q) $(PYTHON) -m build --no-isolation --wheel --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
+ $(Q) $(PYTHON) -m build --no-isolation --wheel --skip-dependency-check --outdir $(PEP517_WHEEL_PATH) $(PEP517_SOURCE_PATH) $(PEP517_BUILD_OPTS)
$(E) " INSTALL " pycriu
#nativepython3 -m installer ${INSTALL_WHEEL_COMPILE_BYTECODE} --interpreter "${USRBINPATH}/env ${PEP517_INSTALL_PYTHON}" --destdir=${D} ${PEP517_WHEEL_PATH}/*.whl