xmlwrapp icon indicating copy to clipboard operation
xmlwrapp copied to clipboard

"make dist" doesn't work under Ubuntu 20.04 which uses Python 3

Open vadz opened this issue 3 years ago • 4 comments

Running bkl in dist-hook target fails under 20.04 because python is now Python 3 and we need Python 2 for it.

Unfortunately using python2 doesn't work everywhere neither (e.g. it fails under Ubuntu 18.04). Other than porting bkl to Python 3 (which is not trivial), is there any way to run it under all systems? All I can think about is to define PYTHON2 env var and use it in the makefile, which is a bit ugly but probably ought to work.

vadz avatar Jul 20 '21 00:07 vadz

This doesn't seem to be a xmlwrapp issue, is it? It just runs bkl as provided, so it's a matter of having the correct shebang in the bkl binary, no? E.g. it could be updated to hardcode /usr/bin/env python2.7 nowadays...

How is bkl installed?

vslavik avatar Jul 21 '21 14:07 vslavik

Of course it would be better to fix it in bkl, but this would require making a new release there, as we install it from the distribution tarball, so I hoped for a workaround here.

But you're right, it's probably best to do it there and just update the version being downloaded here to 1.2.7.

vadz avatar Jul 21 '21 15:07 vadz

I see. Seeing how the script does so much bkl-specific things, wouldn't the simplest fix be to do

sed --in-place -e 's,/usr/bin/env python,/usr/bin/env python2.7,g' bakefile-${BKL_VERSION}/src/tool.py

in the script?

vslavik avatar Jul 21 '21 16:07 vslavik

For now I've just added a CI build using Ubuntu 18.04 in a container (see #83) which will allow us to use it beyond the end of 2022, i.e. even after GitHub stops providing it natively, but the long term solution is probably to stop using bkl -- now that the generated solutions are included in the repository itself (or will be once/if #82 is merged), it's not really necessary any longer.

vadz avatar Sep 29 '22 00:09 vadz