repo/gentoo:master commit in: sci-ml/pytorch/files/, sci-ml/pytorch/

"Alfredo Tupone" <[email protected]> Tue, 04 Aug 2026 17:27:38 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785864431.caea907343f4a8450d41b51c9a2a85915197cba2.tupone@gentoo>
commit:     caea907343f4a8450d41b51c9a2a85915197cba2
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  4 17:26:28 2026 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Aug  4 17:27:11 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caea9073

sci-ml/pytorch: glog changed namespace of IsGoogleLoggingInitialized

Closes: https://bugs.gentoo.org/980355
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-ml/pytorch/files/pytorch-2.13.0-glog.patch | 42 ++++++++++++++++++++++++++
 sci-ml/pytorch/pytorch-2.13.0.ebuild           |  1 +
 2 files changed, 43 insertions(+)

diff --git a/sci-ml/pytorch/files/pytorch-2.13.0-glog.patch b/sci-ml/pytorch/files/pytorch-2.13.0-glog.patch
new file mode 100644
index 000000000000..935a002f02fd
--- /dev/null
+++ b/sci-ml/pytorch/files/pytorch-2.13.0-glog.patch
@@ -0,0 +1,42 @@
+--- a/c10/util/Exception.cpp	2026-07-20 08:01:49.241949729 +0200
++++ b/c10/util/Exception.cpp	2026-07-20 08:02:53.751321052 +0200
+@@ -15,9 +15,7 @@
+ // (e.g. Torch, common/init). See also Logging.cpp in this directory.
+ #ifdef C10_USE_GLOG
+ namespace google {
+-namespace glog_internal_namespace_ {
+ bool IsGoogleLoggingInitialized();
+-} // namespace glog_internal_namespace_
+ } // namespace google
+ #endif
+ 
+@@ -265,7 +263,7 @@
+   // During static initialization (before InitGoogleLogging), glog's global
+   // flags may not be constructed yet. Accessing them causes SIOF crashes
+   // (T253115013, D96553733). Fall back to stderr in that case.
+-  if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized()) {
++  if (!::google::IsGoogleLoggingInitialized()) {
+     std::cerr << warning.source_location().file << ':'
+               << warning.source_location().line
+               << ": Warning: " << warning.msg() << " (function "
+--- a/c10/util/Logging.cpp	2026-08-04 17:56:50.870727752 +0200
++++ b/c10/util/Logging.cpp	2026-08-04 18:04:50.369891538 +0200
+@@ -390,9 +390,7 @@
+ // declaring it here. This is a hack but has been used by a bunch of others too
+ // (e.g. Torch).
+ namespace google {
+-namespace glog_internal_namespace_ {
+ bool IsGoogleLoggingInitialized();
+-} // namespace glog_internal_namespace_
+ } // namespace google
+ 
+ namespace c10 {
+@@ -401,7 +399,7 @@
+ void initGoogleLogging(char const* name) {
+ #if !defined(_MSC_VER)
+   // This trick can only be used on UNIX platforms
+-  if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized())
++  if (!::google::IsGoogleLoggingInitialized())
+ #endif
+   {
+     ::google::InitGoogleLogging(name);

diff --git a/sci-ml/pytorch/pytorch-2.13.0.ebuild b/sci-ml/pytorch/pytorch-2.13.0.ebuild
index 6a1dfd372d84..960a676020f5 100644
--- a/sci-ml/pytorch/pytorch-2.13.0.ebuild
+++ b/sci-ml/pytorch/pytorch-2.13.0.ebuild
@@ -161,6 +161,7 @@ BDEPEND="dev-build/cmake"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.10.0-cpp-extension-multilib.patch
+	"${FILESDIR}"/${P}-glog.patch
 	"${FILESDIR}"/${P}-removekineto-pr178960.patch
 	"${FILESDIR}"/${P}-unbundle_fbgemm.patch
 	"${FILESDIR}"/${P}-unbundle_flatbuffers.patch