From nobody Mon Oct 07 20:55:19 2024 X-Original-To: dev-commits-ports-branches@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 4XMryH3mH0z5YRtS; Mon, 07 Oct 2024 20:55:19 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMryH35gmz54VH; Mon, 7 Oct 2024 20:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728334519; 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=5tocntkn+G7l+viCqL6yEZN+XSZ1VBvrJcwDK+t62N8=; b=wpLk6JMX+bGF22KjQYGK1ODPfzMZUt9B7o1K7zbWgnk5lg/wFbkUKk/ZtCem9NC0x19v+q uqRWP46OtZ5CoMAurdlBSpk8wIoKrqClCcQF0e9+doJ91dw+SILRwXqyyC/WvNyGHhCMIP a4TWa/oEn0ZRgsURSNJf+fpC9nOXr9EEG1Fzmi2WRlz7+cA25KDvhALwCyl2q5fij1RqnU rvNZmr6ocoLLiTnukjD1rzjHn7BmpiTaHzlPFP7fwXZJOh1QMyjty3V45SNVX/XETR0sNU KF+fb9iqIxijxOTi3l5SfrQBPzd3OWxT/oWx7tl6vdFpiL7FqGnPYn5GUrNGDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728334519; 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=5tocntkn+G7l+viCqL6yEZN+XSZ1VBvrJcwDK+t62N8=; b=dbwoDZCuRA+GsBDxhydJ70hLoIX4Zpq97TOrcMLrt/E2oXSFyRNG7myJIDMv+af7uE4ZIa YATKWYxatuphzkAkO7WP3Drc+ehU3Al8YWNcmF4YJfNEnbyHlSqcMor2fGhIeKBvx160yG dSDGPo/Z8e3STevW7csNEAJv/EGw2vUl2mdnztHZYDgyOfo3Yu/j0PwbBg1DTu6h7pAM2u K5H+VAlwOabSweKc5VaYTTrPeuc1QzEqP+VryXEyetrk6GWN4Dx0bV4DiqkDz0aBVH+N7m PJj/Z+SkHbLiME++OBAwfzWi48tkv61HG+FSV5xmvvEiFmcgp3o1ggZCmF/AAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728334519; a=rsa-sha256; cv=none; b=Nw0XUgVrq6hr56a9Y3gOTY3takIILrJh8tcahboa/cCaliTCk7QaEcsZdoMXYaFfibYdgk Z2YyYNcnX4e1oqkDfLm8yrbhlexsXSb4N5Sqzx/GwHNFxmdMZhB7ZUG8Z3lNF0VbOQ/Emz 47NdRtatlJued7faPs9B/y/LrzXtEDwKIY1tuIghAByxuxlPoc8hf6WQFE9HidcZa3Qv64 JRXkt/yqYqqAKus673ylBAHqMKj5iLc6iQDh/V0tWJsrvGSz1FxnurIcFe4D0sgLvPSAgh g2soht0881V3VswvWlXev77vMJZxVmmROAq3qJpoGtRkQStA40H7MXx402Vacg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMryH2Yz9z12Wq; Mon, 7 Oct 2024 20:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 497KtJYI012019; Mon, 7 Oct 2024 20:55:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 497KtJfr012016; Mon, 7 Oct 2024 20:55:19 GMT (envelope-from git) Date: Mon, 7 Oct 2024 20:55:19 GMT Message-Id: <202410072055.497KtJfr012016@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: c5b74ac54ae1 - 2024Q4 - cad/kicad: fix build with libc++ 19 List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-branches@freebsd.org Sender: owner-dev-commits-ports-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/2024Q4 X-Git-Reftype: branch X-Git-Commit: c5b74ac54ae1c5510a2fda3d3d7211e73c7745ae Auto-Submitted: auto-generated The branch 2024Q4 has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=c5b74ac54ae1c5510a2fda3d3d7211e73c7745ae commit c5b74ac54ae1c5510a2fda3d3d7211e73c7745ae Author: Dimitry Andric AuthorDate: 2024-10-07 20:50:06 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2024-10-07 20:54:46 +0000 cad/kicad: fix build with libc++ 19 As noted in the libc++ 19 release notes [1], std::char_traits<> is now only provided for char, char8_t, char16_t, char32_t and wchar_t, and any instantiation for other types will fail. This causes cad/kicad to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /wrkdirs/usr/ports/cad/kicad/work/kicad-7.0.2/thirdparty/nanodbc/nanodbc/nanodbc.cpp:261:25: error: implicit instantiation of undefined template 'std::char_traits' 261 | auto const n = std::char_traits::length(array); | ^ /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here 45 | struct char_traits; | ^ /wrkdirs/usr/ports/cad/kicad/work/kicad-7.0.2/thirdparty/nanodbc/nanodbc/nanodbc.cpp:3576:52: error: implicit instantiation of undefined template 'std::char_traits' 3576 | dsn.name = string(&name[0], &name[std::char_traits::length(name)]); | ^ /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here 45 | struct char_traits; | ^ /wrkdirs/usr/ports/cad/kicad/work/kicad-7.0.2/thirdparty/nanodbc/nanodbc/nanodbc.cpp:3578:49: error: implicit instantiation of undefined template 'std::char_traits' 3578 | string(&driver[0], &driver[std::char_traits::length(driver)]); | ^ /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here 45 | struct char_traits; | ^ /wrkdirs/usr/ports/cad/kicad/work/kicad-7.0.2/thirdparty/nanodbc/nanodbc/nanodbc.cpp:3629:54: error: implicit instantiation of undefined template 'std::char_traits' 3629 | drv.name = string(&descr[0], &descr[std::char_traits::length(descr)]); | ^ /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here 45 | struct char_traits; | ^ and: /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits' 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ /wrkdirs/usr/ports/cad/kicad/work/kicad-7.0.2/thirdparty/compoundfilereader/compoundfilereader.h:226:21: note: in instantiation of template class 'std::basic_string' requested here 226 | utf16string dir; | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ The first batch of errors can be fixed by providing a simple `length()` function for the `NANODBC_SQLCHAR const*` type. The second batch can be fixed by using `std::basic_string` for `utf16string`, and adjusting the call to `std::basic_string::append`. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 281886 MFH: 2024Q3 (cherry picked from commit 0cb9394fcd48f9247a6b9faa072701b25df6471a) --- ...rdparty_compoundfilereader_compoundfilereader.h | 20 ++++++++++ .../patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp | 44 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/cad/kicad/files/patch-thirdparty_compoundfilereader_compoundfilereader.h b/cad/kicad/files/patch-thirdparty_compoundfilereader_compoundfilereader.h new file mode 100644 index 000000000000..e076a7d505d2 --- /dev/null +++ b/cad/kicad/files/patch-thirdparty_compoundfilereader_compoundfilereader.h @@ -0,0 +1,20 @@ +--- thirdparty/compoundfilereader/compoundfilereader.h.orig 2023-04-13 20:27:39 UTC ++++ thirdparty/compoundfilereader/compoundfilereader.h +@@ -129,7 +129,7 @@ struct helper + } + }; + +-typedef std::basic_string utf16string; ++typedef std::basic_string utf16string; + typedef std::function + EnumFilesCallback; + +@@ -246,7 +246,7 @@ class CompoundFileReader (private) + utf16string newDir = dir; + if (dir.length() != 0) + newDir.append(1, '\n'); +- newDir.append(entry->name, entry->nameLen / 2); ++ newDir.append(reinterpret_cast(entry->name), entry->nameLen / 2); + EnumNodes(GetEntry(entry->childID), currentLevel + 1, maxLevel, newDir, callback); + } + diff --git a/cad/kicad/files/patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp b/cad/kicad/files/patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp new file mode 100644 index 000000000000..685a94fc55c7 --- /dev/null +++ b/cad/kicad/files/patch-thirdparty_nanodbc_nanodbc_nanodbc.cpp @@ -0,0 +1,44 @@ +--- thirdparty/nanodbc/nanodbc/nanodbc.cpp.orig 2023-04-13 20:27:39 UTC ++++ thirdparty/nanodbc/nanodbc/nanodbc.cpp +@@ -255,10 +255,19 @@ constexpr std::size_t size(const T (&array)[N]) noexce + } + #endif + ++inline std::size_t length(NANODBC_SQLCHAR const* s) ++{ ++ std::size_t len = 0; ++ for (; *s != 0; ++s) ++ ++len; ++ return len; ++ ++} ++ + template + inline std::size_t size(NANODBC_SQLCHAR const (&array)[N]) noexcept + { +- auto const n = std::char_traits::length(array); ++ auto const n = length(array); + NANODBC_ASSERT(n < N); + return n < N ? n : N - 1; + } +@@ -3573,9 +3582,9 @@ std::list list_datasources() + "incompatible SQLCHAR and string::value_type"); + + datasource dsn; +- dsn.name = string(&name[0], &name[std::char_traits::length(name)]); ++ dsn.name = string(&name[0], &name[length(name)]); + dsn.driver = +- string(&driver[0], &driver[std::char_traits::length(driver)]); ++ string(&driver[0], &driver[length(driver)]); + + dsns.push_back(std::move(dsn)); + direction = SQL_FETCH_NEXT; +@@ -3626,7 +3635,7 @@ std::list list_drivers() + "incompatible SQLCHAR and string::value_type"); + + driver drv; +- drv.name = string(&descr[0], &descr[std::char_traits::length(descr)]); ++ drv.name = string(&descr[0], &descr[length(descr)]); + + // Split "Key1=Value1\0Key2=Value2\0\0" into list of key-value pairs + auto beg = &attrs[0];