mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 17:09:10 -07:00
dev-libs/glib: check that non-bootstrap gobject-introspection works
Right now, we don't depend on dev-libs/gobject-introspection to avoid
the circular dependency and we do a has_version check to see if we need
to bootstrap it if it isn't installed.
On the binhost, we had a failure like:
```
FAILED: girepository/introspection/GLib-2.0.gir
[...]
Traceback (most recent call last):
File "/usr/bin/g-ir-scanner", line 99, in <module>
from giscanner.utils import dll_dirs
File "/usr/lib64/gobject-introspection/giscanner/utils.py", line 385, in <module>
import distutils.cygwinccompiler
ModuleNotFoundError: No module named 'distutils'
[...]
ninja: build stopped: subcommand failed.
* ERROR: dev-libs/glib-2.82.5::gentoo failed (compile phase):
```
That's because we automagically used the installed gobject-introspection's
g-ir-scanner which doesn't yet have *its* setuptools dependency satisfied
(or hasn't been rebuilt for the same Python impl that setuptools has been)
but Portage doesn't know that dev-libs/glib uses gobject-introspection, so
it doesn't see the need to rebuild it yet.
Workaround this (fix it, really) by checking `g-ir-scanner --version` doesn't
crash. This may end up fixing bug #951487 too (which is a separate problem).
(If it doesn't fix bug #951487, we can go further and do a has_version vs
--version check here, just care will be needed to sanitise the --version
output before passing it into has_version. Or perhaps best_version and
a glob would work better.)
Bug: https://bugs.gentoo.org/951487
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -223,8 +223,25 @@ multilib_src_configure() {
|
||||
#esac
|
||||
#fi
|
||||
|
||||
_need_bootstrap_gi() {
|
||||
if ! multilib_native_use introspection ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Is the installed gobject-introspection usable?
|
||||
if ! g-ir-scanner --version &> /dev/null ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build internal copy of gobject-introspection to avoid circular dependency (built for native abi only)
|
||||
if multilib_native_use introspection && ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
if _need_bootstrap_gi ; then
|
||||
einfo "Bootstrapping gobject-introspection..."
|
||||
INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin"
|
||||
INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)"
|
||||
|
||||
@@ -211,8 +211,25 @@ multilib_src_configure() {
|
||||
#esac
|
||||
#fi
|
||||
|
||||
_need_bootstrap_gi() {
|
||||
if ! multilib_native_use introspection ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Is the installed gobject-introspection usable?
|
||||
if ! g-ir-scanner --version &> /dev/null ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build internal copy of gobject-introspection to avoid circular dependency (built for native abi only)
|
||||
if multilib_native_use introspection && ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
if _need_bootstrap_gi ; then
|
||||
einfo "Bootstrapping gobject-introspection..."
|
||||
INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin"
|
||||
INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)"
|
||||
|
||||
@@ -215,8 +215,25 @@ multilib_src_configure() {
|
||||
#esac
|
||||
#fi
|
||||
|
||||
_need_bootstrap_gi() {
|
||||
if ! multilib_native_use introspection ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Is the installed gobject-introspection usable?
|
||||
if ! g-ir-scanner --version &> /dev/null ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build internal copy of gobject-introspection to avoid circular dependency (built for native abi only)
|
||||
if multilib_native_use introspection && ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
if _need_bootstrap_gi ; then
|
||||
einfo "Bootstrapping gobject-introspection..."
|
||||
INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin"
|
||||
INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)"
|
||||
|
||||
@@ -216,8 +216,25 @@ multilib_src_configure() {
|
||||
#esac
|
||||
#fi
|
||||
|
||||
_need_bootstrap_gi() {
|
||||
if ! multilib_native_use introspection ; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Is the installed gobject-introspection usable?
|
||||
if ! g-ir-scanner --version &> /dev/null ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build internal copy of gobject-introspection to avoid circular dependency (built for native abi only)
|
||||
if multilib_native_use introspection && ! has_version ">=dev-libs/${INTROSPECTION_P}" ; then
|
||||
if _need_bootstrap_gi ; then
|
||||
einfo "Bootstrapping gobject-introspection..."
|
||||
INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin"
|
||||
INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)"
|
||||
|
||||
Reference in New Issue
Block a user