From 8704bb97923397dbc93dd6779ef2020deec6a769 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Fri, 18 Sep 2026 13:27:54 +0200 Subject: [PATCH] sci-ml/pytorch: should fix build with newer cpp-httplib Closes: https://bugs.gentoo.org/982667 Signed-off-by: Alfredo Tupone --- .../files/pytorch-2.14.0-cpp-httplib.patch | 21 +++++++++++++++++++ sci-ml/pytorch/pytorch-2.14.0-r3.ebuild | 1 + 2 files changed, 22 insertions(+) create mode 100644 sci-ml/pytorch/files/pytorch-2.14.0-cpp-httplib.patch diff --git a/sci-ml/pytorch/files/pytorch-2.14.0-cpp-httplib.patch b/sci-ml/pytorch/files/pytorch-2.14.0-cpp-httplib.patch new file mode 100644 index 0000000000000..48f286d3c11fc --- /dev/null +++ b/sci-ml/pytorch/files/pytorch-2.14.0-cpp-httplib.patch @@ -0,0 +1,21 @@ +--- a/torch/csrc/distributed/c10d/control_plane/WorkerServer.cpp 2026-09-18 13:16:02.333994098 +0200 ++++ b/torch/csrc/distributed/c10d/control_plane/WorkerServer.cpp 2026-09-18 13:18:25.083555926 +0200 +@@ -20,12 +20,17 @@ + } + + const std::multimap& params() const override { +- return req_.params; ++ cached_params_.clear(); ++ for (const auto& pair : req_.params) { ++ cached_params_.insert(pair); ++ } ++ return cached_params_; + } + + private: + // NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members) + const httplib::Request& req_; ++ mutable std::multimap cached_params_; + }; + + class ResponseImpl : public Response { diff --git a/sci-ml/pytorch/pytorch-2.14.0-r3.ebuild b/sci-ml/pytorch/pytorch-2.14.0-r3.ebuild index 3a85bae84abb2..1f2f5ed409850 100644 --- a/sci-ml/pytorch/pytorch-2.14.0-r3.ebuild +++ b/sci-ml/pytorch/pytorch-2.14.0-r3.ebuild @@ -177,6 +177,7 @@ PATCHES=( "${FILESDIR}"/${P}-unbundle_pocketfft.patch "${FILESDIR}"/${PN}-2.13.0-xnnpack.patch "${FILESDIR}"/${P}-license.patch + "${FILESDIR}"/${P}-cpp-httplib.patch ) src_prepare() {