From nobody Thu Nov 07 17:43:57 2024 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 4XkqFB1p5bz5cGN4; Thu, 07 Nov 2024 17:43:58 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkqFB0LJhz4TC1; Thu, 7 Nov 2024 17:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731001438; 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=vHoL0LtNmXEoTygFsYh31yBWurf8q33w5zIOxrTYqoU=; b=MfK3Ao490MhBhPqi6RAbOPqmrYKBvtwb3HZAQ9UGACiXRuVvOqCopSVGblpF3FHYzD0dva ed4EEFu2NR+fb/wNyJvQaParo+S02HGwqqvx9IS3pLKNsRCrN58LyX6eT5PVZtud+yQuA1 TigeUgj2wwzR8HpzEVoumQ5Ji0WeJctc1/OhVttpKt8UBEj8Rl0R2AklX+ZMT6VYIwgNm9 mroIqeZFK87jU4x1fAq50fGdDNblA2EoD1LbELdVV3WXcB6UY7LT1aYHrXOvulzRzMl/Y8 kb9rnuKk7sErrypbddL0eQH5IsRJgRqSHvIOTH+UCA+ilJ1348+E3lzXxpqSXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731001438; 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=vHoL0LtNmXEoTygFsYh31yBWurf8q33w5zIOxrTYqoU=; b=ukYxl/gyVjDp3fcdxDQ2EouiECx88t4ZF8qhKyXUflLGVf49WrOcObygXuOkGUM0ZtMFIK CLoTF0uvhP79wrv4bTukR4HjWXytLzRSg+5+/FvePjBYrt+YOTPH21RbSR85wN1txrKnD+ qwR5ylVU3XFUJi5Djrm5nG4ZrMQPwL3kshm85h4tNrEIh07WpSu8QQoLTeETscSlkrs2TE T6NadHTYpUD1z9jPI6iw1FvdarM8HtQcbrlmf18DWCh2nBAEB5VR0iyL/ZzlXUys2fluPe KVfiJuXzfPBJ7CJphgNHsZCcDgPEJxSC2hLk5Nr2r74RPNQctxqEXE729+9Jlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731001438; a=rsa-sha256; cv=none; b=mz+rpnV+4iAcViRMXewf+vZEP5noug/JFJrsu5O9XDTiJUeRht4tsx/0eXs7LiF/nWNBJa 1n1fMXKSF3KMvQEj0u8/RLcVdnOz0RP6ke96h13kXpcOENzzJWRFmNrqrNzEXkxFvcn9CW D/wo61/3rVIUgYun93wW2FwOcY/hLOoqJkaQMYKqd5LLOxNjiYo2CwZVqaxdNxxdDLXx4A QNYdbufc5i2cEMUcLDjxEfeTGjwly/0ToUslk2wWUpNJ037DfRuh3RKf92eyS45Smi2cje sxpbPu+wcAAaBHxFdTHj6KezYfOrnbFfGKpN8+l39ijx8BGqawZuwg7t1TedRw== 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 4XkqF9734gzvV6; Thu, 7 Nov 2024 17:43:57 +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 4A7HhvIH002942; Thu, 7 Nov 2024 17:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7Hhv3K002939; Thu, 7 Nov 2024 17:43:57 GMT (envelope-from git) Date: Thu, 7 Nov 2024 17:43:57 GMT Message-Id: <202411071743.4A7Hhv3K002939@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: 29c80f114ea6 - main - archivers/pbzip2: fix build with libc++ 19 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: 29c80f114ea6cc60be39502339572af8c35ac440 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=29c80f114ea6cc60be39502339572af8c35ac440 commit 29c80f114ea6cc60be39502339572af8c35ac440 Author: Dimitry Andric AuthorDate: 2024-11-03 23:24:58 +0000 Commit: Dimitry Andric CommitDate: 2024-11-07 17:42:48 +0000 archivers/pbzip2: 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 archivers/pbzip2 to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /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, | ^ ./BZ2StreamScanner.h:128:25: note: in instantiation of template class 'std::basic_string' requested here 128 | basic_string _bz2Header; | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ This can be fixed by defining `_bz2Header` and `_bz2HeaderZero` as `std::vector` instead of `std::basic_string`. It requieres a few other changes, such as replacing `operator=` with `assign`, and `compare` with `equal`. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 282528 Approved by: farrokhi (maintainer) MFH: 2024Q4 --- archivers/pbzip2/files/patch-BZ2StreamScanner.cpp | 49 +++++++++++++++++++++++ archivers/pbzip2/files/patch-BZ2StreamScanner.h | 22 ++++++++++ 2 files changed, 71 insertions(+) diff --git a/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp new file mode 100644 index 000000000000..e6a3d82b789c --- /dev/null +++ b/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp @@ -0,0 +1,49 @@ +--- BZ2StreamScanner.cpp.orig 2024-11-03 23:01:39 UTC ++++ BZ2StreamScanner.cpp +@@ -49,8 +49,8 @@ int BZ2StreamScanner::init( int hInFile, size_t inBuff + + _hInFile = hInFile; + _eof = false; +- _bz2Header = bz2header; +- _bz2HeaderZero = bz2ZeroHeader; ++ _bz2Header.assign(begin(bz2header), end(bz2header)); ++ _bz2HeaderZero.assign(begin(bz2ZeroHeader), end(bz2ZeroHeader)); + _bz2HeaderFound = false; + _inBuffCapacity = 0; + _errState = 0; +@@ -361,7 +361,7 @@ BZ2StreamScanner::CharType * BZ2StreamScanner::locateH + _errState |= ERR_INVALID_FILE_FORMAT; + _inBuffSearchPtr = getInBuffEnd(); + } +- else if ( _bz2Header.compare( 0, prefixLen, getInBuffSearchPtr(), prefixLen ) == 0 ) ++ else if ( equal( _bz2Header.begin(), _bz2Header.begin() + prefixLen, getInBuffSearchPtr() ) ) + { + // header prefix found + } +@@ -416,7 +416,7 @@ BZ2StreamScanner::CharType * BZ2StreamScanner::searchN + while ( !failed() && ( getUnsearchedCount() >= getHeaderSize() ) ) + { + // _inBuffSearchPtr += prefixLen; +- basic_string * pHdr = NULL; ++ vector * pHdr = NULL; + + if ( getInBuffSearchPtr()[hsp] == _bz2Header[hsp] ) + { +@@ -441,13 +441,14 @@ BZ2StreamScanner::CharType * BZ2StreamScanner::searchN + (*pHdr)[prefixLen] = bwtSizeChar; + + // compare the remaining part of magic header +- int cmpres = pHdr->compare( hsp, pHdr->size() - hsp, +- getInBuffSearchPtr() + hsp, pHdr->size() - hsp ); ++ bool cmpres = equal( pHdr->begin() + hsp, pHdr->begin() + pHdr->size() - hsp, ++ getInBuffSearchPtr() ); + ++ + #ifdef PBZIP_DEBUG + fprintf( stderr, " searchNextHeaderInBuff:cmpres=%d\n", cmpres ); + #endif +- if ( cmpres == 0 ) ++ if ( cmpres ) + { + _searchStatus = true; + #ifdef PBZIP_DEBUG diff --git a/archivers/pbzip2/files/patch-BZ2StreamScanner.h b/archivers/pbzip2/files/patch-BZ2StreamScanner.h new file mode 100644 index 000000000000..e84924aac68b --- /dev/null +++ b/archivers/pbzip2/files/patch-BZ2StreamScanner.h @@ -0,0 +1,22 @@ +--- BZ2StreamScanner.h.orig 2015-12-17 23:32:49 UTC ++++ BZ2StreamScanner.h +@@ -44,7 +44,7 @@ class BZ2StreamScanner (public) + + size_t getInBuffSize() const { return ( _inBuffEnd - _inBuff ); } + size_t getInBuffCapacity() const { return _inBuffCapacity; } +- const basic_string & getHeader() const { return _bz2Header; } ++ const vector & getHeader() const { return _bz2Header; } + size_t getHeaderSize() const { return _bz2Header.size(); } + int getErrState() const { return _errState; } + bool failed() { return ( _errState != 0 ); } +@@ -125,8 +125,8 @@ class BZ2StreamScanner (public) + int _hInFile; // input file descriptor + bool _eof; + +- basic_string _bz2Header; +- basic_string _bz2HeaderZero; ++ vector _bz2Header; ++ vector _bz2HeaderZero; + bool _bz2HeaderFound; + bool _searchStatus; +