-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: use separate packages for pycriu and crit
Newer versions of pip use an isolated virtual environment when building Python projects. However, when the source code of CRIT is copied into the isolated environment, the symlink for `../lib/py` (pycriu) becomes invalid. As a workaround, we used the `--no-build-isolation` option for `pip install`. However, this functionality has issues in some versions of PIP [1, 2]. To fix this problem, this patch adds separate packages for pycriu and crit, and each package is installed independently. [1] pypa/pip#8221 [2] pypa/pip#8165 (comment) Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
- Loading branch information
Showing
28 changed files
with
150 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../lib/py/ | ||
../lib/pycriu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
crit.egg-info/ | ||
build/ | ||
dist/ | ||
version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
PYTHON_EXTERNALLY_MANAGED := $(shell $(PYTHON) -c 'import os, sysconfig; print(int(os.path.isfile(os.path.join(sysconfig.get_path("stdlib"), "EXTERNALLY-MANAGED"))))') | ||
PIP_BREAK_SYSTEM_PACKAGES := 0 | ||
|
||
VERSION_FILE := $(if $(obj),$(addprefix $(obj)/,crit/version.py),crit/version.py) | ||
|
||
all-y += ${VERSION_FILE} | ||
cleanup-y += ${VERSION_FILE} | ||
|
||
${VERSION_FILE}: | ||
$(Q) echo "__version__ = '${CRIU_VERSION}'" > $@ | ||
|
||
install: ${VERSION_FILE} | ||
ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) | ||
ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
$(E) " SKIP INSTALL crit: Externally managed python environment (See PEP 668 for more information)" | ||
$(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" | ||
else | ||
$(E) " INSTALL " crit | ||
$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
endif | ||
else | ||
$(E) " INSTALL " crit | ||
$(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit | ||
endif | ||
.PHONY: install | ||
|
||
uninstall: | ||
ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) | ||
ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) | ||
$(E) " SKIP UNINSTALL crit: Externally managed python environment (See PEP 668 for more information)" | ||
$(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make uninstall" | ||
else | ||
$(E) " UNINSTALL" crit | ||
$(Q) $(PYTHON) ./scripts/uninstall_module.py --prefix=$(DESTDIR)$(PREFIX) crit | ||
endif | ||
else | ||
$(E) " UNINSTALL" crit | ||
$(Q) $(PYTHON) ./scripts/uninstall_module.py --prefix=$(DESTDIR)$(PREFIX) crit | ||
endif | ||
.PHONY: uninstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .version import __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
[build-system] | ||
# Minimum requirements for the build system to execute. | ||
requires = ["setuptools", "wheel"] # PEP 508 specifications. | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "crit" | ||
description = "CRiu Image Tool" | ||
authors = [ | ||
{name = "CRIU team", email = "criu@openvz.org"}, | ||
] | ||
license = {text = "GPLv2"} | ||
dynamic = ["version"] | ||
requires-python = ">=3.7" | ||
|
||
[project.scripts] | ||
crit = "crit.__main__:main" | ||
|
||
[tool.setuptools] | ||
packages = ["crit"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "crit.__version__"} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
from setuptools import setup, find_packages | ||
import pycriu | ||
#!/usr/bin/env python3 | ||
|
||
setup( | ||
name='crit', | ||
version=pycriu.__version__, | ||
description='CRiu Image Tool', | ||
author='CRIU team', | ||
author_email='criu@openvz.org', | ||
license='GPLv2', | ||
url='https://github.com/checkpoint-restore/criu', | ||
packages=find_packages('.'), | ||
scripts=['crit'], | ||
install_requires=[], | ||
) | ||
import setuptools | ||
|
||
if __name__ == "__main__": | ||
setuptools.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pycriu.egg-info/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__pycache__ | ||
*_pb2.py | ||
*.pyc | ||
version.py |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from . import rpc_pb2 as rpc | ||
from . import images | ||
from .criu import * | ||
from .version import __version__ | ||
from .version import __version__ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[build-system] | ||
requires = ["setuptools", "protobuf<4.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pycriu" | ||
description = "Python bindings for CRIU" | ||
authors = [ | ||
{name = "CRIU team", email = "criu@openvz.org"}, | ||
] | ||
license = {text = "GPLv2"} | ||
dynamic = ["version"] | ||
requires-python = ">=3.7" | ||
|
||
[tool.setuptools] | ||
packages = ["pycriu"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "pycriu.__version__"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import setuptools | ||
|
||
if __name__ == "__main__": | ||
setuptools.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
#!/bin/sh | ||
|
||
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu/criu) | ||
BASE_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/../../")" | ||
|
||
CRIU="${BASE_DIR}/criu/criu" | ||
criu=$CRIU | ||
CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit) | ||
|
||
export PYTHONPATH="${BASE_DIR}/lib:${BASE_DIR}/crit:${PYTHONPATH-}" | ||
CRIT="python3 -m crit" | ||
crit=$CRIT | ||
CRIU_COREDUMP=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../coredump/coredump) | ||
|
||
CRIU_COREDUMP="${BASE_DIR}/coredump/coredump" | ||
criu_coredump=$CRIU_COREDUMP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../lib/py/ | ||
../lib/pycriu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters