Python 2 syntax errors during jhbuild build in Docker
I'm building jhbuild
in Docker in order to automate a CI process with
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --yes git build-essential autoconf automake gettext pkg-config yelp-tools autopoint python3 python-is-python3
RUN git clone https://gitlab.gnome.org/krichter/jhbuild.git
RUN cd jhbuild && ./autogen.sh --prefix=/usr/local && make -j && make install && cd .. && rm -rf jhbuild
RUN python --version
RUN jhbuild --version
and I'm seeing Python syntax errors which are caused by 2.x code being built with 3.x. Afaik Python 2.x code is removed and building with Python 2.x is no longer supported. What could be the reason why I'm seeing errors like
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/lib/python3.8/site-packages/jhbuild/'
/usr/bin/install -c -m 644 __init__.py config.py defaults.jhbuildrc environment.py errors.py main.py moduleset.py monkeypatch.py '/usr/local/lib/python3.8/site-packages/jhbuild/'
Byte-compiling python modules...
__init__.pyconfig.pyenvironment.pyerrors.pymain.pymoduleset.pymonkeypatch.py
<string>:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
File "/usr/local/lib/python3.8/site-packages/jhbuild/main.py", line 69
print uencode(s),
^
SyntaxError: invalid syntax
Byte-compiling python modules (optimized versions) ...
during make install
and why jhbuild --version
fails due to
Traceback (most recent call last):
File "/usr/local/bin/jhbuild", line 6, in <module>
import __builtin__
ModuleNotFoundError: No module named '__builtin__'
The build errors don't seem to cause the build fail, however the start to fail.
The complete build log is build.log and the issue can be reproduced with the code for a Dockerfile
above.
experienced with 3.36.0-86-g2cae2916
Edited by Karl-Philipp Richter