From nobody Thu Nov 7 17:49:00 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 4XkqM074h5z5cGxy; Thu, 07 Nov 2024 17:49:00 +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 4XkqM06RXMz4TWf; Thu, 7 Nov 2024 17:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731001740; 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=GGLJEgE+Ncmz0YO4HX30VEh2dMKThKjxfn2J12LpTZY=; b=tGXC4V6t4VyqXR+hkarLwtgRR2I1HRH2+qSNujWoo1zJDiKvg4YchnoL5ynUvaiesr94th rR4ExBXSe62jGz4v4A1rO2/yHKPYWjjBV1cZh8TOhtNWh0ZBMCyC3zGtennqsGa+suiWIZ koQN+sU1Igg+yxkx8FGAcSIiX7iRh4bR/e+Q3kbed3oGQOshVsMWu0JSGFwTm/pSVSs7vy gL/XLdHjvnH8r8yQfS2WmI8vdEGCCgdBqz8nXnjwP0AeM0FVQDC+B9XoGRxcNs4RdfARtn wpUd5JfwcRQJcXWA2OVFmFpAceCsb+SWWDpb4d7DbCvolxZDAA4MfeYlp2BKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731001740; 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=GGLJEgE+Ncmz0YO4HX30VEh2dMKThKjxfn2J12LpTZY=; b=LH//jm8qI61zZrqkDF1Ospv2bfWZDS83DKP1leWEb65dzicCHa6IxtAV242xCfC4+el0/m Z6mAQJzMZKUsek5Wasp6oQ+ZwxHJC/zUp7iyB7tI6ZkhO0XRa8GN4Ov5l3pSmd6dWKINfr TwmNKhHdVe5wjoa/mkaxgKJfoEX7FKlm+y0bokkUjyx9BHHR0/dXgadFoUMqUUnu3SaO4t GtsQ4VRGbWb0STv9nSAY5g8czGqQr5L3BukBwJHXHmu5OBUcAoDVCnWxYUfDvlLq8b+p39 Ld4B0z0fZTdc8KU32OJHUdJv59OExd0iPzsJZUFLS4MERkTnCLZavAB3/CPHPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731001740; a=rsa-sha256; cv=none; b=myrGiGwUBNxF3sqqEqo8KyY05eMhySfI51yr5AiqSPLG0rw32xgKP8nb00x8rT2sNt+Or+ 8SSRnH2NRgSCLbUUu1eB/SmoxPahYbhKqvCKMTJCW0Lpz/y3JTNDVSjZLJLz9U+4bqGgUf Fon1yH3/DtbcmwomkvTzWhST4TktT9dHltXHlx4S307VQ2blLcd5zaeTLOQT0ug4GA41Al IRWq7RScoVogLNRjyqBun0IOL3ecxu4Yjm6vgp2qnHtX3s5/DvTAt0EmJrlN9hWHEDajIW b7n6WwzvCZjASVPaB2w3KrTIsVyOW18JGHjGabOmE0FOnTt/1ljmi9zOfcBk9A== 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 4XkqM05kjyzvy7; Thu, 7 Nov 2024 17:49:00 +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 4A7Hn0Sp004509; Thu, 7 Nov 2024 17:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7Hn025004506; Thu, 7 Nov 2024 17:49:00 GMT (envelope-from git) Date: Thu, 7 Nov 2024 17:49:00 GMT Message-Id: <202411071749.4A7Hn025004506@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Dimitry Andric Subject: git: 04c6d15b6efe - 2024Q4 - archivers/pbzip2: 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: dim X-Git-Repository: ports X-Git-Refname: refs/heads/2024Q4 X-Git-Reftype: branch X-Git-Commit: 04c6d15b6efeae4660e29027bd7a0368255f18f5 Auto-Submitted: auto-generated The branch 2024Q4 has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=04c6d15b6efeae4660e29027bd7a0368255f18f5 commit 04c6d15b6efeae4660e29027bd7a0368255f18f5 Author: Dimitry Andric AuthorDate: 2024-11-03 23:24:58 +0000 Commit: Dimitry Andric CommitDate: 2024-11-07 17:44:18 +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 (cherry picked from commit 29c80f114ea6cc60be39502339572af8c35ac440) --- 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; +