Commit c5cd4e06 authored by Jérome Perrin's avatar Jérome Perrin

component/glib: set --with-python to generate scripts with slapos python

glib configure script uses by default python2.7 to substitute in scripts,
but it also supports --with-python argument. Since the scripts support
python2 or python3, we can use the full path of the python used by
buildout. This will sometimes create shebang lines like:

    #!/usr/bin/env /path/to/slapos/python3/bin/python

but this also work fine.

This replaces the following commits:
 - 7581b668 (component/glib: remove bad file bin/gtester-report after compilation, 2020-08-07)
 - 9c47f828 (componnent/gtk-2: Add python2.7 as the dependency of pango, 2022-08-18)
parent c6fd4a40
......@@ -25,6 +25,7 @@ configure-options =
--disable-fam
--disable-xattr
--disable-man
--with-python=${buildout:executable}
environment =
PATH=${gettext:location}/bin:${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
CPPFLAGS=-I${gettext:location}/include -I${zlib:location}/include
......@@ -33,7 +34,6 @@ environment =
LIBFFI_LIBS= -L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
PCRE_CFLAGS=-I${pcre:location}/include
PCRE_LIBS=-L${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib -lpcre
post-install = rm %(location)s/bin/gtester-report
[x86-cygwin-glib]
patches =
......
......@@ -14,7 +14,6 @@ extends =
../libtool/buildout.cfg
../m4/buildout.cfg
../perl/buildout.cfg
../python-2.7/buildout.cfg
../pkgconfig/buildout.cfg
../xorg/buildout.cfg
../icu/buildout.cfg
......@@ -82,7 +81,7 @@ configure-options =
--disable-static
--disable-gtk-doc-html
environment =
PATH=${python2.7:location}/bin:${glib:location}/bin:${freetype:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
PATH=${glib:location}/bin:${freetype:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${:pkg_config_depends}
CPPFLAGS=-I${bzip2:location}/include -I${zlib:location}/include
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${harfbuzz:location}/lib -Wl,-rpath=${harfbuzz:location}/lib
......
  • What about 6acdc8ca ?

  • I forgot about that !

    The commit message reads:

    ... it will be the caller responsibility to set $PATH to use the expected python.

    in practice this was not really happening.

    What made me to do this change is build failures like this one. glib uses python2.7 by default (configure.ac for reference, so it was generating scripts with #!/usr/bin/env python2.7 and such scripts were either using system python2.7 or failing when there was no python2.7 on the system.

    Since that commit we have changed testnodes to have shorter paths (because of paths too long for sockets so we could not test some scenario of ERP5 in Theia for resilience if I followed correctly), maybe that kind of problems are no longer visible on testnodes.

    Since 3f930869 we always have python in $PATH when building software, so component/defaults.cfg is taking care of the "responsability to set $PATH", and we should tell this configure to use python and not the default python2.7 (by using --with-python=python). Do you think that makes sense ? (glib is a bit old, but the python scripts support python2 or python3)

  • mentioned in merge request !1265 (merged)

    Toggle commit list
  • I tried !1265 (merged) , but it does not work python3 does not install bin/python, only bin/python3 and bin/python3.8

    image

  • let' try --with-python=$PYTHON

  • This $PYTHON approach seems OK, I'll amend 69d59bb9 to write a commit message and apply it to master.

    All this made me think that we could run the software releases tests with a special python in $PATH, here, just before the default /bin:/usr/bin/, this python would just exit with an error, it would be here to catch software releases using system python.

  • mentioned in commit 4c89be22

    Toggle commit list
  • mentioned in commit af5747c7

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment