From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7EE001580FD for ; Sun, 29 Dec 2024 07:30:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21C94E0769; Sun, 29 Dec 2024 07:30:54 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C83F3E077F for ; Sun, 29 Dec 2024 07:30:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF5DD335DE9 for ; Sun, 29 Dec 2024 07:30:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1DD44126A for ; Sun, 29 Dec 2024 07:30:51 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1735457399.e6dc7912a8a81c9f25f6b550df2d5e52b5119398.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/glib/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/glib/glib-2.80.5-r1.ebuild dev-libs/glib/glib-2.82.4-r1.ebuild X-VCS-Directories: dev-libs/glib/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: e6dc7912a8a81c9f25f6b550df2d5e52b5119398 X-VCS-Branch: master Date: Sun, 29 Dec 2024 07:30:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 550f93b2-4f98-48aa-9889-d5e3303b8841 X-Archives-Hash: ea03d0b73db1e6d7950cde1e1ff0ea07 commit: e6dc7912a8a81c9f25f6b550df2d5e52b5119398 Author: Sam James gentoo org> AuthorDate: Sun Dec 29 07:22:22 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Dec 29 07:29:59 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6dc7912 dev-libs/glib: do a proper install for the bootstrap gobject-introspection In a fresh musl stage3, I could reproduce the reported "can't resolve libraries to shared libraries: m" error. In another, older musl chroot, it worked fine. The difference in the g-ir-scanner invocations between the two was the good build had `--extra-library=m` and friends, while the bad one used raw `-lm`. meson's `_gir_has_option` invokes `g-ir-scanner --help` to see if it supports `--extra-library` or not. The check was failing with: ImportError: Error loading shared library libglib-2.0.so.0: No such file or directory (needed by .../scanner.cpython-312-x86_64-linux-musl.so) because RPATH didn't reflect what we were trying to do. By using --prefix=${EPREFIX}/usr (the default) with --destdir ${T} and --skip-subprojects glib, we were having to pray that running everything with LD_LIBRARY_PATH & friends set would work out, rather than installing it properly to ${T} and letting RPATH do its job. We now let Meson install glib and gobject-introspection properly to ${T}/bootstrap-gi-prefix and tell everything where to find it. As for why it didn't show up earlier in glibc stage3s w/o glib already installed: musl doesn't have libm.so, it does have a stub libm.a. glibc has a stub libm.so nowadays as it merged everything in to libc.so. I haven't cleaned up all the previous workarounds and hacks which may no longer be needed in case we need to do more meddling here. Thanks to Eli for both letting me rubberduck and also giving critical suggestions that made the problem (and solution) obvious. Closes: https://bugs.gentoo.org/945911 Thanks-to: Eli Schwartz gentoo.org> Signed-off-by: Sam James gentoo.org> dev-libs/glib/glib-2.80.5-r1.ebuild | 17 +++++++++++------ dev-libs/glib/glib-2.82.4-r1.ebuild | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dev-libs/glib/glib-2.80.5-r1.ebuild b/dev-libs/glib/glib-2.80.5-r1.ebuild index cdc1222f8c58..5cd0b2716ca0 100644 --- a/dev-libs/glib/glib-2.80.5-r1.ebuild +++ b/dev-libs/glib/glib-2.80.5-r1.ebuild @@ -223,18 +223,21 @@ multilib_src_configure() { #esac #fi - # Build internal copy of gobject-introspection to avoid circular dependency (Built for native abi only) + # 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 einfo "Bootstrapping gobject-introspection..." - INTROSPECTION_BIN_DIR="${T}/${EPREFIX}/usr/bin" - INTROSPECTION_LIB_DIR="${T}/${EPREFIX}/usr/$(get_libdir)" + INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin" + INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)" local emesonargs=( + --prefix="${T}/bootstrap-gi-prefix/usr" -Dpython="${EPYTHON}" -Dbuild_introspection_data=true # Build an internal copy of glib for the internal copy of gobject-introspection --force-fallback-for=glib - # Tell meson to make paths in pkgconfig files relative, because we arent doing an actual install + # Make the paths in pkgconfig files relative as we used to not + # do a proper install here and it seems less risky to keep it + # this way. -Dpkgconfig.relocatable=true # We want as minimal a build as possible here to speed things up @@ -270,8 +273,10 @@ multilib_src_configure() { meson_src_configure meson_src_compile - # Install to the portage temp directory so that pkgconfig relative paths resolve correctly - meson_src_install --destdir "${T}" --skip-subprojects glib + # We already provide a prefix in ${T} above. Blank DESTDIR + # as it may be set in the environment by Portage (though not + # guaranteed in src_configure). + meson_src_install --destdir "" popd || die diff --git a/dev-libs/glib/glib-2.82.4-r1.ebuild b/dev-libs/glib/glib-2.82.4-r1.ebuild index 4c84301e4ef8..9cb47e594084 100644 --- a/dev-libs/glib/glib-2.82.4-r1.ebuild +++ b/dev-libs/glib/glib-2.82.4-r1.ebuild @@ -211,18 +211,21 @@ multilib_src_configure() { #esac #fi - # Build internal copy of gobject-introspection to avoid circular dependency (Built for native abi only) + # 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 einfo "Bootstrapping gobject-introspection..." - INTROSPECTION_BIN_DIR="${T}/${EPREFIX}/usr/bin" - INTROSPECTION_LIB_DIR="${T}/${EPREFIX}/usr/$(get_libdir)" + INTROSPECTION_BIN_DIR="${T}/bootstrap-gi-prefix/usr/bin" + INTROSPECTION_LIB_DIR="${T}/bootstrap-gi-prefix/usr/$(get_libdir)" local emesonargs=( + --prefix="${T}/bootstrap-gi-prefix/usr" -Dpython="${EPYTHON}" -Dbuild_introspection_data=true # Build an internal copy of glib for the internal copy of gobject-introspection --force-fallback-for=glib - # Tell meson to make paths in pkgconfig files relative, because we arent doing an actual install + # Make the paths in pkgconfig files relative as we used to not + # do a proper install here and it seems less risky to keep it + # this way. -Dpkgconfig.relocatable=true # We want as minimal a build as possible here to speed things up @@ -258,8 +261,10 @@ multilib_src_configure() { meson_src_configure meson_src_compile - # Install to the portage temp directory so that pkgconfig relative paths resolve correctly - meson_src_install --destdir "${T}" --skip-subprojects glib + # We already provide a prefix in ${T} above. Blank DESTDIR + # as it may be set in the environment by Portage (though not + # guaranteed in src_configure). + meson_src_install --destdir "" popd || die