From nobody Fri Mar 13 08:29:50 2026 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fXHjB57wKz6VhRq for ; Fri, 13 Mar 2026 08:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fXHjB4L4Cz3wbK for ; Fri, 13 Mar 2026 08:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773390590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtivWhziyuUZGCq3CgqswSYDLsATkEa0ZxVF/rRlfyA=; b=dCCOqFXiGW5tDlOz9dLDSRY0kfKXSbDZZWiiKTnjfQJ2vDWtuaocgXMprX6VPYdRjMckgb W8xBGxYAV0UVnf4Av5qss6jrYxeKJmH247nuprqAy8t49pw3hgj+Hw2hM8qTIm3sOUmDyp YMSzFZkMis1MqG4pc1L2cc79W9lpJhdh23OI9m/m/0ROndH6cZEOj0qVUslQYsYf16GaHo 0wcq+bEiCdrPM9z7e0cJmXnF0CJ3gv7Gyg+PAyU/kkXh4eCFRqWlRhcmchMXhZwXrGAvrB OoW5SmhzdWU4wVrrhm7IdAxRNNl3iRaQtuZkNd7SQV3sbvrYpRmHpbHFCJzssw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1773390590; a=rsa-sha256; cv=none; b=SU5PEcBmqfkX6wxJnj4nvM+25mqHkWnNc/hQzyz7EEQT6qtPPzCm31WfXGI+LYL0KSg8Bk x3vnlVaj6c+6ALPWJePasGCL2YRBVi9ZHzm35fWezG4BcsZ6BHsuJB/e3/CslIChx+8yDy OSsQ90e6OsdQHfWvvXIJ8DGm2/WUoV8mIzwveTdy6Pgg0ZdpmJDS/lvtLGN7cdjtlh8n3u +8Zd94vKdwIdYseYSHECTow37NL1vZxhTzSHA1oj3nns4SZEiUj9Kcs9Y6ffGK6kkUIziZ szsnvani9ksAAR6ArDXdx8MQvD3QXVoyfP4Z1QUWylxnj6NCEOLTHNmCQNKm9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773390590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtivWhziyuUZGCq3CgqswSYDLsATkEa0ZxVF/rRlfyA=; b=Hp5UtT72bBHTSqJpHgehWooryGtnJfzKutkDrKb22e6nyEfFuBpRjCefS3D1jQFZRNrqdr 6jz2CwkzT4KD5WqmgW5sTTXoSqz6Msu+WVOjiGd1zG42V+CzV0dLtovVCdTY7c370HGKVX pgsFIzlUE2C9u2Sd6B3NloTCiTmqTpfNxac9M9VylxEPZYoL0jXSibfZvYhSOhMX4jx9O9 dyecRehgWPB5lN6OjGR0FDz43AVBfiz3U71syalk+70doYqWgxuCweSt9+wD9PAyLmNTe2 GKVwWG6XVUafzJLzfO+tWnQGFaUiEpvl1eeWAWp1MRSHd0zUBDRvsiJay3S/bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fXHjB3x7dz7r5 for ; Fri, 13 Mar 2026 08:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a200 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 13 Mar 2026 08:29:50 +0000 To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 814f8741c251 - main - science/py-tensorflow: fix build with libc++ 21 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 814f8741c251862849f74431be09c0ab969e936a Auto-Submitted: auto-generated Date: Fri, 13 Mar 2026 08:29:50 +0000 Message-Id: <69b3cafe.3a200.41c98773@gitrepo.freebsd.org> The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=814f8741c251862849f74431be09c0ab969e936a commit 814f8741c251862849f74431be09c0ab969e936a Author: Dimitry Andric AuthorDate: 2026-02-23 13:18:05 +0000 Commit: Dimitry Andric CommitDate: 2026-03-13 08:29:30 +0000 science/py-tensorflow: fix build with libc++ 21 With libc++ 21 science/py-tensorflow fails to build, with errors similar to: In file included from tensorflow/tsl/framework/allocator_registry.cc:16: In file included from ./tensorflow/tsl/framework/allocator_registry.h:23: In file included from ./tensorflow/tsl/framework/allocator.h:28: ./tensorflow/tsl/framework/type_traits.h:96:8: error: 'is_signed' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization] 96 | struct is_signed : public is_signed {}; | ^ /usr/include/c++/v1/__type_traits/is_signed.h:25:8: note: marked '_Clang::no_specializations' here 25 | struct _LIBCPP_NO_SPECIALIZATIONS is_signed : _BoolConstant<__is_signed(_Tp)> {}; | ^ /usr/include/c++/v1/__config:1167:9: note: expanded from macro '_LIBCPP_NO_SPECIALIZATIONS' 1167 | [[_Clang::__no_specializations__("Users are not allowed to specialize this standard library entity")]] | ^ and later: tensorflow/lite/kernels/elementwise.cc:245:14: error: no matching function for call to 'EvalImpl' 245 | return EvalImpl(context, node, std::abs, type); | ^~~~~~~~~~~~~~~ tensorflow/lite/kernels/elementwise.cc:192:21: note: candidate function template not viable: no overload of 'abs' matching 'std::function' for 3rd argument 192 | inline TfLiteStatus EvalImpl(TfLiteContext* context, TfLiteNode* node, | ^ 193 | std::function func, | ~~~~~~~~~~~~~~~~~~~~~~~~ The former is fixed by https://github.com/openxla/xla/commit/0cead9f, which unfortunately happened after tsl got split off from tensorflow into a bunch of separate projects. The latter is fixed as part of https://github.com/tensorflow/tensorflow/commit/358119a, but that commit is quite large. Only the changes to elementwise.cc need to be applied. PR: 293384 Approved by: maintainer timeout (2 weeks) MFH: 2026Q1 --- .../patch-tensorflow_lite_kernels_elementwise.cc | 22 ++++++++++++++++++++++ .../patch-tensorflow_tsl_framework_type__traits.h | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc b/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc new file mode 100644 index 000000000000..7fad158af10a --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_lite_kernels_elementwise.cc @@ -0,0 +1,22 @@ +--- tensorflow/lite/kernels/elementwise.cc.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/lite/kernels/elementwise.cc +@@ -242,7 +242,8 @@ TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNod + const TfLiteType type = input->type; + switch (type) { + case kTfLiteFloat32: +- return EvalImpl(context, node, std::abs, type); ++ return EvalImpl( ++ context, node, [](float f) { return std::abs(f); }, type); + case kTfLiteInt8: + return AbsEvalQuantized(context, node, type); + case kTfLiteInt16: +@@ -250,7 +251,8 @@ TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNod + ? AbsInt16EvalImpl(context, node, type) + : AbsEvalQuantized(context, node, type); + case kTfLiteInt32: +- return EvalImpl(context, node, std::abs, type); ++ return EvalImpl( ++ context, node, [](int32_t i) { return std::abs(i); }, type); + default: + TF_LITE_KERNEL_LOG(context, "Current data type %s is not supported.", + TfLiteTypeGetName(type)); diff --git a/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h b/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h new file mode 100644 index 000000000000..8b2cfe43ee49 --- /dev/null +++ b/science/py-tensorflow/files/patch-tensorflow_tsl_framework_type__traits.h @@ -0,0 +1,21 @@ +--- tensorflow/tsl/framework/type_traits.h.orig 2023-09-12 16:46:28 UTC ++++ tensorflow/tsl/framework/type_traits.h +@@ -91,18 +91,6 @@ class numeric_limits : public numeric_lim + template <> + class numeric_limits : public numeric_limits {}; + +-// Specialize is_signed for quantized types. +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +-template <> +-struct is_signed : public is_signed {}; +- + } // namespace std + + #endif // TENSORFLOW_TSL_FRAMEWORK_TYPE_TRAITS_H_