Skip to content
Snippets Groups Projects
Commit 502819fa authored by alice's avatar alice Committed by alice
Browse files

main/boost1.80: new aport

parent 820549db
No related branches found
No related tags found
2 merge requests!39304[3.16] main/expat: security upgrade to 2.4.9,!37487main/boost: upgrade to 1.80
From 436e1dbe6fcd31523d261d18ad011392f1d6fbbc Mon Sep 17 00:00:00 2001
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Date: Sun, 1 Dec 2019 20:40:28 +0100
Subject: [PATCH] Revert "Cease dependence on Range"
This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db.
see #44 (One test fails to compile after boostorg/coroutine submodule updated)
---
boost/coroutine/asymmetric_coroutine.hpp | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp
index ea96981..640896f 100644
--- a/boost/coroutine/asymmetric_coroutine.hpp
+++ b/boost/coroutine/asymmetric_coroutine.hpp
@@ -14,6 +14,7 @@
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/move/move.hpp>
+#include <boost/range.hpp>
#include <boost/throw_exception.hpp>
#include <boost/utility/explicit_operator_bool.hpp>
@@ -2354,19 +2355,12 @@ end( push_coroutine< R > & c)
}
-// forward declaration of Boost.Range traits to break dependency on it
-template<typename C, typename Enabler>
-struct range_mutable_iterator;
-
-template<typename C, typename Enabler>
-struct range_const_iterator;
-
template< typename Arg >
-struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void >
+struct range_mutable_iterator< coroutines::push_coroutine< Arg > >
{ typedef typename coroutines::push_coroutine< Arg >::iterator type; };
template< typename R >
-struct range_mutable_iterator< coroutines::pull_coroutine< R >, void >
+struct range_mutable_iterator< coroutines::pull_coroutine< R > >
{ typedef typename coroutines::pull_coroutine< R >::iterator type; };
}
--
2.24.1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=boost1.80
pkgver=1.80.0
_pkgver="${pkgver//./_}"
pkgrel=0
pkgdesc="Free peer-reviewed portable C++ source libraries"
url="https://www.boost.org/"
arch="all"
license="BSL-1.0"
depends="$pkgname-libs"
depends_dev="$pkgname linux-headers bzip2-dev icu-dev xz-dev zlib-dev"
makedepends="$depends_dev python3-dev>=3.8 flex bison"
subpackages="
$pkgname-static
$pkgname-dev
$pkgname-doc
boost-dev:_dev
"
source="https://boostorg.jfrog.io/artifactory/main/release/$pkgver/source/boost_$_pkgver.tar.bz2
boost-1.57.0-python-abi_letters.patch
boost-1.57.0-python-libpython_dep.patch
0001-revert-cease-dependence-on-range.patch
boost-1.80-filesystem-win-fix-dir-it-net-share.patch
boost-1.80-filesystem-fix-weakly-canonical-long-paths.patch
"
builddir="$srcdir/boost_$_pkgver"
_enginedir="tools/build/src/engine"
_bjam="$builddir"/$_enginedir/b2
_libs="
atomic
chrono
container
context
contract
coroutine
date_time
fiber
filesystem
graph
iostreams
locale
log_setup
log
math
prg_exec_monitor
program_options
python3
random
regex
serialization
stacktrace_basic
stacktrace_noop
system
thread
timer
type_erasure
unit_test_framework
wave
wserialization
json
nowide
"
for _lib in $_libs; do
subpackages="$subpackages $pkgname-${_lib}:_boostlib"
done; unset -v _lib
subpackages="$subpackages $pkgname-libs"
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost=$pkgver-r$pkgrel"
replaces="boost boost1.79"
_set_options() {
local _python="$(_pyversion python3)"
export PY3_VERSION="$_python"
export BOOST_ROOT="$builddir"
_options="
--user-config=\"$builddir/user-config.jam\"
--prefix=\"$pkgdir/usr\"
variant=release
python=$PY3_VERSION
toolset=gcc
debug-symbols=off
threading=multi
runtime-link=shared
link=shared,static
cflags=-fno-strict-aliasing
--layout=system
-q
-j${JOBS:-2}
"
}
prepare() {
default_prepare
_set_options
local abiflags="$(python3-config --abiflags)"
# create user-config.jam
cat > user-config.jam <<-__EOF__
using gcc : : $CC : <cxxflags>"$CXXFLAGS" <linkflags>"$LDFLAGS" ;
using python : $PY3_VERSION : /usr/bin/python3 : /usr/include/python${PY3_VERSION}$abiflags : : : : $abiflags ;
__EOF__
}
build() {
_set_options
msg "Building bjam"
cd "$builddir"/$_enginedir
CC= ./build.sh gcc
msg "Building bcp"
cd "$builddir"/tools/bcp
"$_bjam" -j${JOBS:-2}
msg "Building boost"
cd "$builddir"
"$_bjam" $_options
}
check() {
cd "$builddir"/tools/build/test
PATH="${_bjam%/*}:$PATH" python3 test_all.py --default-bjam
}
package() {
_set_options
install -Dm755 "$_bjam" \
"$pkgdir"/usr/bin/b2
ln -s b2 "$pkgdir"/usr/bin/bjam # old name for b2 binary
install -Dm755 dist/bin/bcp "$pkgdir"/usr/bin/bcp
install -Dm644 LICENSE_1_0.txt \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE_1_0.txt
"$pkgdir"/usr/bin/bjam $_options \
--includedir="$pkgdir"/usr/include \
--libdir="$pkgdir"/usr/lib \
install
}
static() {
pkgdesc="Boost static libraries"
depends="$depends_static"
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost-static=$pkgver-r$pkgrel"
replaces="boost-static"
amove usr/lib/lib*.a
}
_boostlib() {
local name="${subpkgname#$pkgname-}"
pkgdesc="Boost $name shared library"
depends="$depends__boostlib"
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost-$name=$pkgver-r$pkgrel"
replaces="boost-$name"
amove usr/lib/libboost_$name*.so.[0-9]*
}
libs() {
default_libs
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost-libs=$pkgver-r$pkgrel"
replaces="boost-libs"
pkgdesc="Boost shared libraries"
depends="$depends_libs"
local _pkg; for _pkg in $origsubpackages; do
case "$_pkg" in
*:_boostlib) depends="$depends ${_pkg%%:*}" ;;
esac
done
mkdir -p "$subpkgdir"
rmdir "$pkgdir"/usr/lib >/dev/null 2>&1 || :
}
dev() {
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version. Replace previous boost version for clean -dev
# upgrade
default_dev
replaces="boost1.79-dev"
}
_dev() {
# This makes boost-dev be a metapackage that depends on boostX.Y-dev
mkdir -p "$subpkgdir"
depends="$pkgname-dev=$pkgver-r$pkgrel"
}
doc() {
# Claim the unversioned name, this must be removed once we switch our
# boost to a new version
provides="boost-doc=$pkgver-r$pkgrel"
replaces="boost-doc"
default_doc
}
_pyversion() {
"$1" -c 'import sys; print("%i.%i" % (sys.version_info.major, sys.version_info.minor))'
}
sha512sums="
829a95b463473d69ff79ea41799c68429bb79d3b2321fbdb71df079af237ab01de9ad7e9612d8783d925730acada010068d2d1aa856c34244ee5c0ece16f208f boost_1_80_0.tar.bz2
d96d4d37394a31764ed817d0bc4a99cffa68a75ff1ecfd4417b9e1e5ae2c31a96ed24f948c6f2758ffdac01328d2402c4cf0d33a37107e4f5f721e636daebd66 boost-1.57.0-python-abi_letters.patch
132c4b62815d605c2d3c9038427fa4f422612a33711d47b2862f2311516af8a371d6b75bf078a7bffe20be863f8d21fb9fe74dc1a1bac3a10d061e9768ec3e02 boost-1.57.0-python-libpython_dep.patch
9b53d2fe2dddd592e43db03c26fadd6c07d4c45a980ae4c775b7a914346a3914f6e0c3ef42dad5e2ea4568afb86c9967e09444ff609cfba1e1d39f4980b22ad6 0001-revert-cease-dependence-on-range.patch
bfc055c63191379b6db91a5c862cea3ce9e0856d6b8efdb31869a4b684a30319880f7033cd90f9c5493d9fd69765e62f858a0710e1cf5364777061d6eace1f78 boost-1.80-filesystem-win-fix-dir-it-net-share.patch
0fe46226870bede3bd5a90a137e6ea406d217aa7de0582e6b08223bd0634b3640b93dfd6f7f6054f25edd42d815f313c20268e8f10fd3d520a287ac90b27d789 boost-1.80-filesystem-fix-weakly-canonical-long-paths.patch
"
--- boost_1_57_0/tools/build/src/tools/python.jam 2013-05-21 06:14:18.000000000 +0200
+++ boost_1_55_0/tools/build/src/tools/python.jam 2014-05-29 19:09:12.115413877 +0200
@@ -94,7 +94,7 @@ feature.feature pythonpath : : free opti
# using python : 2.3 : /usr/local/bin/python ;
#
rule init ( version ? : cmd-or-prefix ? : includes * : libraries ?
- : condition * : extension-suffix ? )
+ : condition * : extension-suffix ? : abi-letters ? )
{
project.push-current $(.project) ;
@@ -107,7 +107,7 @@ rule init ( version ? : cmd-or-prefix ?
}
}
- configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
+ configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) : $(abi-letters) ;
project.pop-current ;
}
@@ -653,7 +653,7 @@ local rule system-library-dependencies (
# Declare a target to represent Python's library.
#
-local rule declare-libpython-target ( version ? : requirements * )
+local rule declare-libpython-target ( version ? : requirements * : abi-letters ? )
{
# Compute the representation of Python version in the name of Python's
# library file.
@@ -677,13 +677,13 @@ local rule declare-libpython-target ( ve
}
# Declare it.
- lib python.lib : : <name>python$(lib-version) $(requirements) ;
+ lib python.lib : : <name>python$(lib-version)$(abi-letters) $(requirements) ;
}
# Implementation of init.
local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
- condition * : extension-suffix ? )
+ condition * : extension-suffix ? : abi-letters ? )
{
local prefix ;
local exec-prefix ;
@@ -699,6 +699,7 @@ local rule configure ( version ? : cmd-o
extension-suffix ?= _d ;
}
extension-suffix ?= "" ;
+ abi-letters ?= "" ;
# Normalize and dissect any version number.
local major-minor ;
@@ -922,7 +923,7 @@ local rule configure ( version ? : cmd-o
}
else
{
- declare-libpython-target $(version) : $(target-requirements) ;
+ declare-libpython-target $(version) : $(target-requirements) : $(abi-letters) ;
# This is an evil hack. On, Windows, when Python is embedded, nothing
# seems to set up sys.path to include Python's standard library
Index: boost_1_57_0/tools/build/src/tools/python.jam
===================================================================
--- boost_1_57_0/tools/build/src/tools/python.jam (revision 50406)
+++ boost_1_57_0/tools/build/src/tools/python.jam (working copy)
@@ -994,7 +994,7 @@
else
{
alias python_for_extensions
- :
+ : python
: $(target-requirements)
:
: $(usage-requirements)
commit 476ca7b6c1d37a5d796f8525813a9a64c9e54ffc
Author: Andrey Semashev <andrey.semashev@gmail.com>
Date: Wed Aug 10 04:57:21 2022 +0300
Fix weakly_canonical on Windows with long paths prefix.
During its operation, weakly_canonical would call status() on the path
consisting only from the root name of the input path. This would fail
with ERROR_INVALID_FUNCTION if the root name starts with the "\\?\" prefix,
as the root name path is not absolute.
To fix this, we don't check the status of the root name path (which is
not the correct check anyways as it tests the current directory on the
corresponding drive for existence, which is not what we want). Additionally,
avoid calling status() on the paths containing dot and dot-dot elements
during the weakly_canonical execution for the same reason - the "\\?\"
prefix disables most of the path processing in Windows APIs, including
dot and dot-dot elements resolution.
Fixes https://github.com/boostorg/filesystem/issues/247.
diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp
index dd636e9..ca2fff3 100644
--- a/libs/filesystem/src/operations.cpp
+++ b/libs/filesystem/src/operations.cpp
@@ -4434,7 +4434,7 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec)
path head(p);
for (; !head.empty(); --itr)
{
- file_status head_status = detail::status_impl(head, &local_ec);
+ file_status head_status(detail::status_impl(head, &local_ec));
if (BOOST_UNLIKELY(head_status.type() == fs::status_error))
{
if (!ec)
@@ -4450,32 +4450,83 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec)
head.remove_filename();
}
+ if (head.empty())
+ return p.lexically_normal();
+
+ path const& dot_p = dot_path();
+ path const& dot_dot_p = dot_dot_path();
+
#else
- // On Windows, filesystem APIs such as GetFileAttributesW perform lexical path normalization internally.
- // As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would break
- // canonical, as symlink_status that it calls internally would report an error that the file at the intermediate
- // path does not exist. To avoid this, scan the initial path in the forward direction.
- // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW,
- // which is called in status() may return "file not found" for paths to network shares and mounted cloud
- // storages that have forward slashes as separators.
+ // On Windows, filesystem APIs such as GetFileAttributesW and CreateFileW perform lexical path normalization
+ // internally. As a result, a path like "c:\a\.." can be reported as present even if "c:\a" is not. This would
+ // break canonical, as symlink_status that it calls internally would report an error that the file at the
+ // intermediate path does not exist. To avoid this, scan the initial path in the forward direction.
+ // Also, operate on paths with preferred separators. This can be important on Windows since GetFileAttributesW
+ // or CreateFileW, which is called in status() may return "file not found" for paths to network shares and
+ // mounted cloud storages that have forward slashes as separators.
+ // Also, avoid querying status of the root name such as \\?\c: as CreateFileW returns ERROR_INVALID_FUNCTION for
+ // such path. Querying the status of a root name such as c: is also not right as this path refers to the current
+ // directory on drive C:, which is not what we want to test for existence anyway.
path::iterator itr(p.begin());
path head;
- for (; itr != p_end; ++itr)
+ if (p.has_root_name())
{
- path const& p_elem = *itr;
- if (p_elem.size() == 1u && detail::is_directory_separator(p_elem.native()[0]))
+ BOOST_ASSERT(itr != p_end);
+ head = *itr;
+ ++itr;
+ }
+
+ if (p.has_root_directory())
+ {
+ BOOST_ASSERT(itr != p_end);
+ // Convert generic separator returned by the iterator for the root directory to
+ // the preferred separator.
+ head += path::preferred_separator;
+ ++itr;
+ }
+
+ if (!head.empty())
+ {
+ file_status head_status(detail::status_impl(head, &local_ec));
+ if (BOOST_UNLIKELY(head_status.type() == fs::status_error))
{
- // Convert generic separator returned by the iterator for the root directory to
- // the preferred separator.
- head += path::preferred_separator;
+ if (!ec)
+ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::weakly_canonical", head, local_ec));
+
+ *ec = local_ec;
+ return path();
}
- else
+
+ if (head_status.type() == fs::file_not_found)
+ {
+ // If the root path does not exist then no path element exists
+ return p.lexically_normal();
+ }
+ }
+
+ path const& dot_p = dot_path();
+ path const& dot_dot_p = dot_dot_path();
+ for (; itr != p_end; ++itr)
+ {
+ path const& p_elem = *itr;
+
+ // Avoid querying status of paths containing dot and dot-dot elements, as this will break
+ // if the root name starts with "\\?\".
+ if (p_elem == dot_p)
+ continue;
+
+ if (p_elem == dot_dot_p)
{
- head /= p_elem;
+ if (head.has_relative_path())
+ head.remove_filename();
+
+ continue;
}
- file_status head_status = detail::status_impl(head, &local_ec);
+ head /= p_elem;
+
+ file_status head_status(detail::status_impl(head, &local_ec));
if (BOOST_UNLIKELY(head_status.type() == fs::status_error))
{
if (!ec)
@@ -4492,33 +4543,22 @@ path weakly_canonical(path const& p, path const& base, system::error_code* ec)
}
}
+ if (head.empty())
+ return p.lexically_normal();
+
#endif
- path const& dot_p = dot_path();
- path const& dot_dot_p = dot_dot_path();
path tail;
bool tail_has_dots = false;
for (; itr != p_end; ++itr)
{
path const& tail_elem = *itr;
-#if defined(BOOST_WINDOWS_API)
- if (tail_elem.size() == 1u && detail::is_directory_separator(tail_elem.native()[0]))
- {
- // Convert generic separator returned by the iterator for the root directory to
- // the preferred separator.
- tail += path::preferred_separator;
- continue;
- }
-#endif
tail /= tail_elem;
// for a later optimization, track if any dot or dot-dot elements are present
if (!tail_has_dots && (tail_elem == dot_p || tail_elem == dot_dot_p))
tail_has_dots = true;
}
- if (head.empty())
- return p.lexically_normal();
-
head = detail::canonical(head, base, &local_ec);
if (BOOST_UNLIKELY(!!local_ec))
{
commit 9c9d127bddc2b72187c57f4933c49666255d7a4f
Author: Olavo Belloc <obelloc@think-cell.com>
Date: Mon Aug 8 10:54:02 2022 +0200
Limit the buffer size for compatibility with previous versions of Windows
The reported error was reproduced on Windows 7 and 8.1, but not on an early
version of Windows 10 (2004).
Closes https://github.com/boostorg/filesystem/pull/246.
Likely fixes https://github.com/boostorg/filesystem/issues/245.
diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp
index 6a3e1dc..9334893 100644
--- a/libs/filesystem/src/directory.cpp
+++ b/libs/filesystem/src/directory.cpp
@@ -599,9 +599,12 @@ extra_data_format g_extra_data_format = file_directory_information_format;
* \brief Extra buffer size for GetFileInformationByHandleEx-based or NtQueryDirectoryFile-based directory iterator.
*
* Must be large enough to accommodate at least one FILE_DIRECTORY_INFORMATION or *_DIR_INFO struct and one filename.
- * NTFS, VFAT, exFAT support filenames up to 255 UTF-16/UCS-2 characters. ReFS supports filenames up to 32768 UTF-16 characters.
+ * NTFS, VFAT, exFAT and ReFS support filenames up to 255 UTF-16/UCS-2 characters. (For ReFS, there is no information
+ * on the on-disk format, and it is possible that it supports longer filenames, up to 32768 UTF-16/UCS-2 characters.)
+ * The buffer cannot be larger than 64k, because up to Windows 8.1, NtQueryDirectoryFile and GetFileInformationByHandleEx
+ * fail with ERROR_INVALID_PARAMETER when trying to retrieve the filenames from a network share.
*/
-BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = sizeof(file_id_extd_dir_info) + 65536u;
+BOOST_CONSTEXPR_OR_CONST std::size_t dir_itr_extra_size = 65536u;
inline system::error_code dir_itr_close(dir_itr_imp& imp) BOOST_NOEXCEPT
{
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment