<div dir="ltr"><div dir="ltr">On Fri, 3 May 2019 at 09:13, Adrian Reber <<a href="mailto:areber@redhat.com">areber@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The reason for all this mess is, is that usually the unversioned python<br>
binary is always python2. Almost never python3.<br>
<br>
Neither on Fedora nor on Ubuntu (18.04) python points to python3. I also<br>
think upstream python says that the python3 binary should always be<br>
versioned.<br>
<br>
So, for development I can create a link python -> python3, but this is<br>
not really a solution for packaging crit. Although, for Fedora, I could<br>
replace 'python' with python3 during packaging, but I already have<br>
problems with zdtm all the time because it uses an unversioned binary.<br>
Which we agreed to be acceptable as it is never shipped.<br>
<br>
It is still not clear to me how to correctly ship code for<br>
python2/python3 at the same time without some hack to change the<br>
shebang.<br>
<br>
So, I am against this change.<br></blockquote><div><br></div><div>I don't understand the problem. Are you implying that crit is not working with python2?</div><div>After the first commit from this series it should work fine with either 2 or 3.<br>Or am I missing something obvious?<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Adrian<br>
<br>
On Fri, May 03, 2019 at 08:28:37AM -0700, Kir Kolyshkin wrote:<br>
> Now crit should work equally well with either python 2 or 3,<br>
> so the python2/3 hack for crit is no longer needed.<br>
> <br>
> This reverts commit 4feb07020dedbf845fc00268d8ca02f4645641cd<br>
> ("crit: enable python2 or python3 based crit"), and changes<br>
> `python2` to `python`.<br>
> <br>
> Cc: Adrian Reber <<a href="mailto:areber@redhat.com" target="_blank">areber@redhat.com</a>><br>
> Signed-off-by: Kir Kolyshkin <<a href="mailto:kolyshkin@gmail.com" target="_blank">kolyshkin@gmail.com</a>><br>
> ---<br>
> .gitignore | 1 -<br>
> Makefile | 17 ++++-------------<br>
> crit/Makefile | 13 -------------<br>
> lib/py/cli.py => crit/crit | 1 +<br>
> crit/crit-python2 | 6 ------<br>
> crit/crit-python3 | 6 ------<br>
> 6 files changed, 5 insertions(+), 39 deletions(-)<br>
> delete mode 100644 crit/Makefile<br>
> rename lib/py/cli.py => crit/crit (99%)<br>
> delete mode 100755 crit/crit-python2<br>
> delete mode 100755 crit/crit-python3<br>
> <br>
> diff --git a/.gitignore b/.gitignore<br>
> index c231104af..048668905 100644<br>
> --- a/.gitignore<br>
> +++ b/.gitignore<br>
> @@ -24,7 +24,6 @@ images/google/protobuf/*.c<br>
> images/google/protobuf/*.h<br>
> .gitid<br>
> criu/criu<br>
> -crit/crit<br>
> criu/arch/*/sys-exec-tbl*.c<br>
> # x86 syscalls-table is not generated<br>
> !criu/arch/x86/sys-exec-tbl.c<br>
> diff --git a/Makefile b/Makefile<br>
> index 38887da99..ce03fa4c0 100644<br>
> --- a/Makefile<br>
> +++ b/Makefile<br>
> @@ -127,7 +127,7 @@ HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/<br>
> export CFLAGS USERCLFAGS HOSTCFLAGS<br>
> <br>
> # Default target<br>
> -all: criu lib crit<br>
> +all: criu lib<br>
> .PHONY: all<br>
> <br>
> #<br>
> @@ -228,22 +228,14 @@ criu: $(criu-deps)<br>
> $(Q) $(MAKE) $(build)=criu all<br>
> .PHONY: criu<br>
> <br>
> -crit/Makefile: ;<br>
> -crit/%: criu .FORCE<br>
> - $(Q) $(MAKE) $(build)=crit $@<br>
> -crit: criu<br>
> - $(Q) $(MAKE) $(build)=crit all<br>
> -.PHONY: crit<br>
> -<br>
> -<br>
> #<br>
> -# Libraries next once crit it ready<br>
> +# Libraries next once criu it ready<br>
> # (we might generate headers and such<br>
> # when building criu itself).<br>
> lib/Makefile: ;<br>
> -lib/%: crit .FORCE<br>
> +lib/%: criu .FORCE<br>
> $(Q) $(MAKE) $(build)=lib $@<br>
> -lib: crit<br>
> +lib: criu<br>
> $(Q) $(MAKE) $(build)=lib all<br>
> .PHONY: lib<br>
> <br>
> @@ -255,7 +247,6 @@ clean mrproper:<br>
> $(Q) $(MAKE) $(build)=compel $@<br>
> $(Q) $(MAKE) $(build)=compel/plugins $@<br>
> $(Q) $(MAKE) $(build)=lib $@<br>
> - $(Q) $(MAKE) $(build)=crit $@<br>
> .PHONY: clean mrproper<br>
> <br>
> clean-top:<br>
> diff --git a/crit/Makefile b/crit/Makefile<br>
> deleted file mode 100644<br>
> index 988b481b6..000000000<br>
> --- a/crit/Makefile<br>
> +++ /dev/null<br>
> @@ -1,13 +0,0 @@<br>
> -<br>
> -all-y += crit<br>
> -<br>
> -crit/crit: crit/crit-$(PYTHON)<br>
> - $(Q) cp $^ $@<br>
> -crit: crit/crit<br>
> -.PHONY: crit<br>
> -<br>
> -clean-crit:<br>
> - $(Q) $(RM) crit/crit<br>
> -.PHONY: clean-crit<br>
> -clean: clean-crit<br>
> -mrproper: clean<br>
> diff --git a/lib/py/cli.py b/crit/crit<br>
> similarity index 99%<br>
> rename from lib/py/cli.py<br>
> rename to crit/crit<br>
> index 29b21ec8f..28007217a 100755<br>
> --- a/lib/py/cli.py<br>
> +++ b/crit/crit<br>
> @@ -1,3 +1,4 @@<br>
> +#!/usr/bin/env python<br>
> from __future__ import print_function<br>
> from builtins import object<br>
> import argparse<br>
> diff --git a/crit/crit-python2 b/crit/crit-python2<br>
> deleted file mode 100755<br>
> index b0b7d3c3a..000000000<br>
> --- a/crit/crit-python2<br>
> +++ /dev/null<br>
> @@ -1,6 +0,0 @@<br>
> -#!/usr/bin/env python2<br>
> -<br>
> -from pycriu import cli<br>
> -<br>
> -if __name__ == '__main__':<br>
> - cli.main()<br>
> diff --git a/crit/crit-python3 b/crit/crit-python3<br>
> deleted file mode 100755<br>
> index 80467cba7..000000000<br>
> --- a/crit/crit-python3<br>
> +++ /dev/null<br>
> @@ -1,6 +0,0 @@<br>
> -#!/usr/bin/env python3<br>
> -<br>
> -from pycriu import cli<br>
> -<br>
> -if __name__ == '__main__':<br>
> - cli.main()<br>
> -- <br>
> 2.17.1<br>
> <br>
</blockquote></div></div>