From 91edb5f9ff345a6bd9efc96c3c1a2cff5d2f149e Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 20 Jun 2023 08:43:34 +0100 Subject: [PATCH] crit: drop python 2 support This patch reverts changes introduced with the following commits: 4feb07020dedbf845fc00268d8ca02f4645641cd crit: enable python2 or python3 based crit b78c4e071a42ebe34aac82fa0711df07ed375e2b test: fix crit test and extend it Signed-off-by: Radostin Stoyanov --- .gitignore | 1 - Makefile | 16 ++++------------ crit/Makefile | 13 ------------- crit/{crit-python3 => crit} | 2 +- crit/crit-python2 | 6 ------ lib/Makefile | 2 +- lib/py/cli.py | 1 + test/others/env.sh | 11 +---------- 8 files changed, 8 insertions(+), 44 deletions(-) delete mode 100644 crit/Makefile rename crit/{crit-python3 => crit} (79%) delete mode 100755 crit/crit-python2 diff --git a/.gitignore b/.gitignore index 1ea828bbc..2f2ab2029 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,6 @@ images/google/protobuf/*.h .gitid criu/criu criu/unittest/unittest -crit/crit criu/arch/*/sys-exec-tbl*.c # x86 syscalls-table is not generated !criu/arch/x86/sys-exec-tbl.c diff --git a/Makefile b/Makefile index f89903d4a..a5c6c5bcc 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,7 @@ HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/ export AFLAGS CFLAGS USERCLFAGS HOSTCFLAGS # Default target -all: flog criu lib crit +all: flog criu lib .PHONY: all # @@ -268,26 +268,19 @@ criu: $(criu-deps) $(Q) $(MAKE) $(build)=criu all .PHONY: criu -crit/Makefile: ; -crit/%: criu .FORCE - $(Q) $(MAKE) $(build)=crit $@ -crit: criu - $(Q) $(MAKE) $(build)=crit all -.PHONY: crit - unittest: $(criu-deps) $(Q) $(MAKE) $(build)=criu unittest .PHONY: unittest # -# Libraries next once crit it ready +# Libraries next once criu is ready # (we might generate headers and such # when building criu itself). lib/Makefile: ; -lib/%: crit .FORCE +lib/%: criu .FORCE $(Q) $(MAKE) $(build)=lib $@ -lib: crit +lib: criu $(Q) $(MAKE) $(build)=lib all .PHONY: lib @@ -300,7 +293,6 @@ clean mrproper: $(Q) $(MAKE) $(build)=compel $@ $(Q) $(MAKE) $(build)=compel/plugins $@ $(Q) $(MAKE) $(build)=lib $@ - $(Q) $(MAKE) $(build)=crit $@ .PHONY: clean mrproper clean-amdgpu_plugin: diff --git a/crit/Makefile b/crit/Makefile deleted file mode 100644 index 988b481b6..000000000 --- a/crit/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -all-y += crit - -crit/crit: crit/crit-$(PYTHON) - $(Q) cp $^ $@ -crit: crit/crit -.PHONY: crit - -clean-crit: - $(Q) $(RM) crit/crit -.PHONY: clean-crit -clean: clean-crit -mrproper: clean diff --git a/crit/crit-python3 b/crit/crit similarity index 79% rename from crit/crit-python3 rename to crit/crit index 80467cba7..3b15ca654 100755 --- a/crit/crit-python3 +++ b/crit/crit @@ -3,4 +3,4 @@ from pycriu import cli if __name__ == '__main__': - cli.main() + cli.main() diff --git a/crit/crit-python2 b/crit/crit-python2 deleted file mode 100755 index b0b7d3c3a..000000000 --- a/crit/crit-python2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python2 - -from pycriu import cli - -if __name__ == '__main__': - cli.main() diff --git a/lib/Makefile b/lib/Makefile index ff540fb75..7ed73f9ab 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -41,7 +41,7 @@ clean: clean-lib cleanup-y += lib/c/$(CRIU_SO) lib/c/$(CRIU_A) lib/c/criu.pc mrproper: clean -install: lib-c lib-a lib-py crit/crit lib/c/criu.pc.in +install: lib-c lib-a lib-py lib/c/criu.pc.in $(E) " INSTALL " lib $(Q) mkdir -p $(DESTDIR)$(LIBDIR) $(Q) install -m 755 lib/c/$(CRIU_SO) $(DESTDIR)$(LIBDIR)/$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR).$(CRIU_SO_VERSION_MINOR) diff --git a/lib/py/cli.py b/lib/py/cli.py index 5419384c3..82079c7f4 100755 --- a/lib/py/cli.py +++ b/lib/py/cli.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 from __future__ import print_function import argparse import sys diff --git a/test/others/env.sh b/test/others/env.sh index a76207360..6d830fb58 100755 --- a/test/others/env.sh +++ b/test/others/env.sh @@ -2,16 +2,7 @@ CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu/criu) criu=$CRIU -if [ $(which python3) ]; then - PYTHON=python3 -elif [ $(which python2) ]; then - PYTHON=python2 -else - echo "FAIL: Neither python3 nor python2" - exit 1 -fi -#export PYTHON -CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit-"${PYTHON}") +CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit) crit=$CRIT CRIU_COREDUMP=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../coredump/coredump) criu_coredump=$CRIU_COREDUMP