Update to v0.16.0

* .gitignore, sources: Update to v0.16.0
 * bpkg-git-v2.38.patch: delete
 * build2.spec:
    - Update to v0.16.0
    - Remove patches
    - Add libbuild2-cli module
 * libbuild2-cxx23-aligned_storage-deprecation.patch: delete
 * libbuild2-libpkgconf-error_handler-non-const-data.patch: likewise
This commit is contained in:
Matthew Krupcale 2023-08-31 19:04:18 -04:00
parent 37daaa0460
commit 23cf0d66a4
6 changed files with 44 additions and 625 deletions

14
.gitignore vendored
View File

@ -1,7 +1,7 @@
/build2-0.15.0.tar.gz
/libbutl-0.15.0.tar.gz
/libbpkg-0.15.0.tar.gz
/bpkg-0.15.0.tar.gz
/bdep-0.15.0.tar.gz
/libodb-2.5.0-b.23.tar.gz
/libodb-sqlite-2.5.0-b.23.tar.gz
/build2-0.16.0.tar.gz
/libbutl-0.16.0.tar.gz
/libbpkg-0.16.0.tar.gz
/bpkg-0.16.0.tar.gz
/bdep-0.16.0.tar.gz
/libodb-2.5.0-b.25.tar.gz
/libodb-sqlite-2.5.0-b.25.tar.gz

View File

@ -1,367 +0,0 @@
commit a97b12a027546b37f66d3e08064f92f5539cf79e
Author: Karen Arutyunov <karen@codesynthesis.com>
Date: 2022-10-26 18:38:32 +0300
Adapt to git 2.38 which drops submodule--helper-{list,name} subcommands
diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx
index 3f6115f..e2bfb2d 100644
--- a/bpkg/fetch-git.cxx
+++ b/bpkg/fetch-git.cxx
@@ -877,24 +877,25 @@ namespace bpkg
text << "querying " << url;
refs rs;
- fdpipe pipe (open_pipe ());
-
- // Note: ls-remote doesn't print anything to stderr, so no progress
- // suppression is required.
- //
- process pr (start_git (co,
- pipe, 2 /* stderr */,
- timeout_opts (co, url.scheme),
- co.git_option (),
- "ls-remote",
- to_git_url (url)));
-
- // Shouldn't throw, unless something is severely damaged.
- //
- pipe.out.close ();
for (;;) // Breakout loop.
{
+ fdpipe pipe (open_pipe ());
+
+ // Note: ls-remote doesn't print anything to stderr, so no progress
+ // suppression is required.
+ //
+ process pr (start_git (co,
+ pipe, 2 /* stderr */,
+ timeout_opts (co, url.scheme),
+ co.git_option (),
+ "ls-remote",
+ to_git_url (url)));
+
+ // Shouldn't throw, unless something is severely damaged.
+ //
+ pipe.out.close ();
+
try
{
ifdstream is (move (pipe.in), fdstream_mode::skip, ifdstream::badbit);
@@ -1683,6 +1684,255 @@ namespace bpkg
// If gitmodules is false, then don't check if the .gitmodules file is
// present, assuming this have already been checked.
//
+ static submodules
+ find_submodules (const common_options& co,
+ const dir_path& dir,
+ const dir_path& prefix,
+ bool gitmodules = true)
+ {
+ tracer trace ("find_submodules");
+
+ submodules r;
+
+ if (gitmodules && !exists (dir / gitmodules_file))
+ return r;
+
+ auto failure = [&prefix] (const string& d, const exception* e = nullptr)
+ {
+ submodule_failure (d, prefix, e);
+ };
+
+ // Use git-config to obtain the submodules names/paths and then
+ // git-ls-files to obtain their commits.
+ //
+ // Note that previously we used git-submodule--helper-list subcommand to
+ // obtain the submodules commits/paths and then git-submodule--helper-name
+ // to obtain their names. However, git 2.38 has removed these subcommands.
+
+ // Obtain the submodules names/paths.
+ //
+ for (;;) // Breakout loop.
+ {
+ fdpipe pipe (open_pipe ());
+
+ process pr (start_git (co,
+ pipe, 2 /* stderr */,
+ co.git_option (),
+ "-C", dir,
+ "config",
+ "--list",
+ "--file", gitmodules_file,
+ "-z"));
+
+ // Shouldn't throw, unless something is severely damaged.
+ //
+ pipe.out.close ();
+
+ try
+ {
+ ifdstream is (move (pipe.in), fdstream_mode::skip, ifdstream::badbit);
+
+ for (string l; !eof (getline (is, l, '\0')); )
+ {
+ auto bad = [&l] ()
+ {
+ throw runtime_error ("invalid submodule option '" + l + "'");
+ };
+
+ // The submodule configuration option line is NULL-terminated and
+ // has the following form:
+ //
+ // submodule.<submodule-name>.<option-name><NEWLINE><value>
+ //
+ // For example:
+ //
+ // submodule.style.path
+ // doc/style
+ //
+ l4 ([&]{trace << "submodule option: " << l;});
+
+ // If this is a submodule path option, then extract its name and
+ // path and add the entry to the resulting list.
+ //
+ size_t n (l.find ('\n'));
+
+ if (n != string::npos &&
+ n >= 15 &&
+ l.compare (0, 10, "submodule.") == 0 &&
+ l.compare (n - 5, 5, ".path") == 0)
+ {
+ string nm (l, 10, n - 15);
+ dir_path p (l, n + 1, l.size () - n - 1);
+
+ // For good measure verify that the name and path are not empty.
+ //
+ if (nm.empty () || p.empty ())
+ bad ();
+
+ r.push_back (submodule {move (p), move (nm), empty_string});
+ }
+ }
+
+ is.close ();
+
+ if (pr.wait ())
+ break;
+
+ // Fall through.
+ }
+ catch (const invalid_path& e)
+ {
+ if (pr.wait ())
+ failure ("invalid submodule directory path '" + e.path + "'");
+
+ // Fall through.
+ }
+ catch (const io_error& e)
+ {
+ if (pr.wait ())
+ failure ("unable to read submodule options", &e);
+
+ // Fall through.
+ }
+ // Note that the io_error class inherits from the runtime_error class,
+ // so this catch-clause must go last.
+ //
+ catch (const runtime_error& e)
+ {
+ if (pr.wait ())
+ failure (e.what ());
+
+ // Fall through.
+ }
+
+ // We should only get here if the child exited with an error status.
+ //
+ assert (!pr.wait ());
+
+ failure ("unable to list submodule options");
+ }
+
+ // Note that we could potentially bail out here if the submodules list is
+ // empty. Let's however continue and verify that via git-ls-files, for
+ // good measure.
+
+ // Complete the resulting submodules information with their commits.
+ //
+ for (;;) // Breakout loop.
+ {
+ fdpipe pipe (open_pipe ());
+
+ process pr (start_git (co,
+ pipe, 2 /* stderr */,
+ co.git_option (),
+ "-C", dir,
+ "ls-files",
+ "--stage",
+ "-z"));
+
+ // Shouldn't throw, unless something is severely damaged.
+ //
+ pipe.out.close ();
+
+ try
+ {
+ ifdstream is (move (pipe.in), fdstream_mode::skip, ifdstream::badbit);
+
+ for (string l; !eof (getline (is, l, '\0')); )
+ {
+ auto bad = [&l] ()
+ {
+ throw runtime_error ("invalid file description '" + l + "'");
+ };
+
+ // The line describing a file is NULL-terminated and has the
+ // following form:
+ //
+ // <mode><SPACE><object><SPACE><stage><TAB><path>
+ //
+ // The mode is a 6-digit octal representation of the file type and
+ // permission bits mask. For a submodule directory it is 160000 (see
+ // git index format documentation for gitlink object type). For
+ // example:
+ //
+ // 160000 59dcc1bea3509e37b65905ac472f86f4c55eb510 0 doc/style
+ //
+ if (!(l.size () > 50 && l[48] == '0' && l[49] == '\t'))
+ bad ();
+
+ // For submodules permission bits are always zero, so we can match
+ // the mode as a string.
+ //
+ if (l.compare (0, 6, "160000") == 0)
+ {
+ l4 ([&]{trace << "submodule: " << l;});
+
+ dir_path d (l, 50, l.size () - 50);
+
+ auto i (find_if (r.begin (), r.end (),
+ [&d] (const submodule& sm) {return sm.path == d;}));
+
+ if (i == r.end ())
+ bad ();
+
+ i->commit = string (l, 7, 40);
+ }
+ }
+
+ is.close ();
+
+ if (pr.wait ())
+ break;
+
+ // Fall through.
+ }
+ catch (const invalid_path& e)
+ {
+ if (pr.wait ())
+ failure ("invalid submodule directory path '" + e.path + "'");
+
+ // Fall through.
+ }
+ catch (const io_error& e)
+ {
+ if (pr.wait ())
+ failure ("unable to read repository file list", &e);
+
+ // Fall through.
+ }
+ // Note that the io_error class inherits from the runtime_error class,
+ // so this catch-clause must go last.
+ //
+ catch (const runtime_error& e)
+ {
+ if (pr.wait ())
+ failure (e.what ());
+
+ // Fall through.
+ }
+
+ // We should only get here if the child exited with an error status.
+ //
+ assert (!pr.wait ());
+
+ failure ("unable to list repository files");
+ }
+
+ // Make sure that we have deduced commits for all the submodules.
+ //
+ for (const submodule& sm: r)
+ {
+ if (sm.commit.empty ())
+ failure ("unable to deduce commit for submodule " + sm.name);
+ }
+
+ return r;
+ }
+
+ // @@ TMP Old, submodule--helper-{list,name} subcommands-based,
+ // implementation of find_submodules().
+ //
+#if 0
static submodules
find_submodules (const common_options& co,
const dir_path& dir,
@@ -1792,6 +2042,7 @@ namespace bpkg
submodule_failure ("unable to list submodules", prefix);
}
+#endif
// Return commit id for the submodule directory or nullopt if the submodule
// is not initialized (directory doesn't exist, doesn't contain .git entry,
@@ -1839,13 +2090,15 @@ namespace bpkg
co.git_option (),
"-C", dir,
- // Note that older git versions don't recognize the --super-prefix
- // option but seem to behave correctly without any additional
- // efforts when it is omitted.
+ // Note that git versions outside the [2.14.0 2.38.0) range don't
+ // recognize the --super-prefix option but seem to behave correctly
+ // without any additional efforts when it is omitted.
//
- !prefix.empty () && git_ver >= semantic_version {2, 14, 0}
- ? strings ({"--super-prefix", prefix.posix_representation ()})
- : strings (),
+ (!prefix.empty () &&
+ git_ver >= semantic_version {2, 14, 0} &&
+ git_ver < semantic_version {2, 38, 0}
+ ? strings ({"--super-prefix", prefix.posix_representation ()})
+ : strings ()),
"submodule--helper", "init",
verb < 2 ? "-q" : nullptr))
@@ -2188,7 +2441,7 @@ namespace bpkg
for (string l; !eof (getline (is, l, '\0')); )
{
- // The line describing a file is NUL-terminated and has the following
+ // The line describing a file is NULL-terminated and has the following
// form:
//
// <mode><SPACE><object><SPACE><stage><TAB><path>
@@ -2198,8 +2451,6 @@ namespace bpkg
//
// 100644 165b42ec7a10fb6dd4a60b756fa1966c1065ef85 0 README
//
- l4 ([&]{trace << "file: " << l;});
-
if (!(l.size () > 50 && l[48] == '0' && l[49] == '\t'))
throw runtime_error ("invalid file description '" + l + "'");
@@ -2207,7 +2458,11 @@ namespace bpkg
// mode as a string.
//
if (l.compare (0, 6, "120000") == 0)
+ {
+ l4 ([&]{trace << "symlink: " << l;});
+
r.push_back (make_pair (path (string (l, 50)), string (l, 7, 40)));
+ }
}
is.close ();

View File

@ -7,8 +7,8 @@
%undefine _auto_set_build_flags
Name: build2
Version: 0.15.0
Release: 3%{?dist}
Version: 0.16.0
Release: 1%{?dist}
Summary: Cross-platform build toolchain for developing and packaging C++ code
License: MIT
@ -22,18 +22,11 @@ Source5: macros.%{name}
# The latest official release of libodb is not compatible with build2
%if %{with bundle_libodb}
%global libodb_bundle_version 2.5.0-b.23
%global libodb_bundle_version 2.5.0-b.25
Source100: https://pkg.cppget.org/1/beta/odb/libodb-%{libodb_bundle_version}.tar.gz
Source101: https://pkg.cppget.org/1/beta/odb/libodb-sqlite-%{libodb_bundle_version}.tar.gz
%endif
# Upstream https://git.build2.org/cgit/build2/commit/?id=343d6e69e412166cfc21f268a51b692cb0201653
Patch0000: libbuild2-libpkgconf-error_handler-non-const-data.patch
# Upstream https://git.build2.org/cgit/build2/commit/?id=417be15231cb34a2e858d26b63406d1fb5535cb9
Patch0001: libbuild2-cxx23-aligned_storage-deprecation.patch
# Upstream https://git.build2.org/cgit/bpkg/commit/?id=a97b12a027546b37f66d3e08064f92f5539cf79e
Patch3000: bpkg-git-v2.38.patch
BuildRequires: gcc-c++
BuildRequires: libpkgconf-devel
%if %{with bootstrap}
@ -264,13 +257,6 @@ This package contains the %{name} RPM macros.
%else
%setup -q -c -n %{name}-toolchain-%{version} -a 1 -a 2 -a 3 -a 4 -a 100 -a 101
%endif
pushd %{name}-%{version}
%patch -p 1 -P 0000
%patch -p 1 -P 0001
popd
pushd bpkg-%{version}
%patch -p 1 -P 3000
popd
mv libbutl-%{version} %{name}-%{version}
%build
@ -320,6 +306,7 @@ export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/bash:${LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/bin:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/c:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cc:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cli:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cxx:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/in:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/version:${LD_LIBRARY_PATH}
@ -474,6 +461,7 @@ export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/bash:${LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/bin:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/c:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cc:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cli:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/cxx:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/in:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/lib%{name}/version:${LD_LIBRARY_PATH}
@ -510,30 +498,33 @@ b test:
%dir %{_defaultlicensedir}/lib%{name}
%license %{_defaultlicensedir}/lib%{name}/AUTHORS
%license %{_defaultlicensedir}/lib%{name}/LICENSE
%{_libdir}/lib%{name}-0.15.so
%{_libdir}/lib%{name}-bash-0.15-0.15.so
%{_libdir}/lib%{name}-bin-0.15-0.15.so
%{_libdir}/lib%{name}-c-0.15-0.15.so
%{_libdir}/lib%{name}-cc-0.15-0.15.so
%{_libdir}/lib%{name}-cxx-0.15-0.15.so
%{_libdir}/lib%{name}-in-0.15-0.15.so
%{_libdir}/lib%{name}-version-0.15-0.15.so
%{_libdir}/lib%{name}-0.16.so
%{_libdir}/lib%{name}-bash-0.16-0.16.so
%{_libdir}/lib%{name}-bin-0.16-0.16.so
%{_libdir}/lib%{name}-c-0.16-0.16.so
%{_libdir}/lib%{name}-cc-0.16-0.16.so
%{_libdir}/lib%{name}-cli-0.16-0.16.so
%{_libdir}/lib%{name}-cxx-0.16-0.16.so
%{_libdir}/lib%{name}-in-0.16-0.16.so
%{_libdir}/lib%{name}-version-0.16-0.16.so
%files -n lib%{name}-devel
%{_includedir}/lib%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}-bash{,-0.15}.so
%{_libdir}/lib%{name}-bin{,-0.15}.so
%{_libdir}/lib%{name}-c{,-0.15}.so
%{_libdir}/lib%{name}-cc{,-0.15}.so
%{_libdir}/lib%{name}-cxx{,-0.15}.so
%{_libdir}/lib%{name}-in{,-0.15}.so
%{_libdir}/lib%{name}-version{,-0.15}.so
%{_libdir}/lib%{name}-bash{,-0.16}.so
%{_libdir}/lib%{name}-bin{,-0.16}.so
%{_libdir}/lib%{name}-c{,-0.16}.so
%{_libdir}/lib%{name}-cc{,-0.16}.so
%{_libdir}/lib%{name}-cli{,-0.16}.so
%{_libdir}/lib%{name}-cxx{,-0.16}.so
%{_libdir}/lib%{name}-in{,-0.16}.so
%{_libdir}/lib%{name}-version{,-0.16}.so
%{_libdir}/pkgconfig/lib%{name}{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-bash{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-bin{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-c{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-cc{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-cli{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-cxx{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-in{,.shared}.pc
%{_libdir}/pkgconfig/lib%{name}-version{,.shared}.pc
@ -545,6 +536,7 @@ b test:
%{_libdir}/lib%{name}-bin.a
%{_libdir}/lib%{name}-c.a
%{_libdir}/lib%{name}-cc.a
%{_libdir}/lib%{name}-cli.a
%{_libdir}/lib%{name}-cxx.a
%{_libdir}/lib%{name}-in.a
%{_libdir}/lib%{name}-version.a
@ -553,6 +545,7 @@ b test:
%{_libdir}/pkgconfig/lib%{name}-bin.static.pc
%{_libdir}/pkgconfig/lib%{name}-c.static.pc
%{_libdir}/pkgconfig/lib%{name}-cc.static.pc
%{_libdir}/pkgconfig/lib%{name}-cli.static.pc
%{_libdir}/pkgconfig/lib%{name}-cxx.static.pc
%{_libdir}/pkgconfig/lib%{name}-in.static.pc
%{_libdir}/pkgconfig/lib%{name}-version.static.pc
@ -563,7 +556,7 @@ b test:
%license %{_defaultlicensedir}/libbutl/AUTHORS
%license %{_defaultlicensedir}/libbutl/COPYRIGHT
%license %{_defaultlicensedir}/libbutl/LICENSE
%{_libdir}/libbutl-0.15.so
%{_libdir}/libbutl-0.16.so
%files -n libbutl-devel
%dir %{_docdir}/libbutl
@ -584,7 +577,7 @@ b test:
%dir %{_defaultlicensedir}/libbpkg
%license %{_defaultlicensedir}/libbpkg/AUTHORS
%license %{_defaultlicensedir}/libbpkg/LICENSE
%{_libdir}/libbpkg-0.15.so
%{_libdir}/libbpkg-0.16.so
%files -n libbpkg-devel
%dir %{_docdir}/libbpkg
@ -640,6 +633,9 @@ b test:
%{_rpmmacrodir}/macros.%{name}
%changelog
* Thu Aug 31 2023 Matthew Krupcale <mkrupcale@matthewkrupcale.com> - 0.16.0-1
- Update to v0.16.0
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1,175 +0,0 @@
From 417be15231cb34a2e858d26b63406d1fb5535cb9 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Thu, 2 Mar 2023 15:38:15 +0200
Subject: Replace deprecated std::aligned_storage with alignas
Based on patch by Matthew Krupcale.
---
libbuild2/function.hxx | 9 +++++----
libbuild2/scheduler.hxx | 5 +++--
libbuild2/target.hxx | 8 ++++----
libbuild2/variable.cxx | 10 +++++-----
libbuild2/variable.hxx | 7 ++++---
5 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/libbuild2/function.hxx b/libbuild2/function.hxx
index 323ac41..cda856a 100644
--- a/libbuild2/function.hxx
+++ b/libbuild2/function.hxx
@@ -4,8 +4,9 @@
#ifndef LIBBUILD2_FUNCTION_HXX
#define LIBBUILD2_FUNCTION_HXX
-#include <utility> // index_sequence
-#include <type_traits> // aligned_storage
+#include <cstddef> // max_align_t
+#include <utility> // index_sequence
+#include <type_traits> // is_*
#include <libbuild2/types.hxx>
#include <libbuild2/forward.hxx>
@@ -133,8 +134,8 @@ namespace build2
// Auxiliary data storage. Note that it is expected to be trivially
// copyable and destructible.
//
- std::aligned_storage<sizeof (void*) * 3>::type data;
- static const size_t data_size = sizeof (decltype (data));
+ static const size_t data_size = sizeof (void*) * 3;
+ alignas (std::max_align_t) unsigned char data[data_size];
function_overload (const char* an,
size_t mi, size_t ma, types ts,
diff --git a/libbuild2/scheduler.hxx b/libbuild2/scheduler.hxx
index c34d41b..b579d80 100644
--- a/libbuild2/scheduler.hxx
+++ b/libbuild2/scheduler.hxx
@@ -7,7 +7,8 @@
#include <list>
#include <tuple>
#include <atomic>
-#include <type_traits> // aligned_storage, etc
+#include <cstddef> // max_align_t
+#include <type_traits> // decay, etc
#include <libbuild2/types.hxx>
#include <libbuild2/utility.hxx>
@@ -681,7 +682,7 @@ namespace build2
//
struct task_data
{
- std::aligned_storage<sizeof (void*) * 8>::type data;
+ alignas (std::max_align_t) unsigned char data[sizeof (void*) * 8];
void (*thunk) (scheduler&, lock&, void*);
};
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx
index 26c7208..037b18c 100644
--- a/libbuild2/target.hxx
+++ b/libbuild2/target.hxx
@@ -4,8 +4,9 @@
#ifndef LIBBUILD2_TARGET_HXX
#define LIBBUILD2_TARGET_HXX
+#include <cstddef> // max_align_t
#include <iterator> // tags, etc.
-#include <type_traits> // aligned_storage
+#include <type_traits> // is_*
#include <unordered_map>
#include <libbutl/multi-index.hxx> // map_iterator_adapter
@@ -189,7 +190,7 @@ namespace build2
? sizeof (string)
: sizeof (void*) * 4);
- std::aligned_storage<data_size>::type data_;
+ alignas (std::max_align_t) unsigned char data_[data_size];
void (*data_dtor_) (void*) = nullptr;
template <typename R,
@@ -1624,8 +1625,7 @@ namespace build2
group_view g_;
size_t j_; // 1-based index, to support enter_group().
const target* k_; // Current member of ad hoc group or NULL.
- mutable typename std::aligned_storage<sizeof (value_type),
- alignof (value_type)>::type m_;
+ alignas (value_type) mutable unsigned char m_[sizeof (value_type)];
};
iterator
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index 260d664..d55737b 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -3,7 +3,7 @@
#include <libbuild2/variable.hxx>
-#include <cstring> // memcmp()
+#include <cstring> // memcmp(), memcpy()
#include <libbutl/path-pattern.hxx>
@@ -57,7 +57,7 @@ namespace build2
else if (type->copy_ctor != nullptr)
type->copy_ctor (*this, v, true);
else
- data_ = v.data_; // Copy as POD.
+ memcpy (data_, v.data_, size_); // Copy as POD.
}
}
@@ -72,7 +72,7 @@ namespace build2
else if (type->copy_ctor != nullptr)
type->copy_ctor (*this, v, false);
else
- data_ = v.data_; // Copy as POD.
+ memcpy (data_, v.data_, size_); // Copy as POD.
}
}
@@ -106,7 +106,7 @@ namespace build2
else if (auto f = null ? type->copy_ctor : type->copy_assign)
f (*this, v, true);
else
- data_ = v.data_; // Assign as POD.
+ memcpy (data_, v.data_, size_); // Assign as POD.
null = v.null;
}
@@ -145,7 +145,7 @@ namespace build2
else if (auto f = null ? type->copy_ctor : type->copy_assign)
f (*this, v, false);
else
- data_ = v.data_; // Assign as POD.
+ memcpy (data_, v.data_, size_); // Assign as POD.
null = v.null;
}
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx
index 8a0adf8..b137789 100644
--- a/libbuild2/variable.hxx
+++ b/libbuild2/variable.hxx
@@ -4,7 +4,8 @@
#ifndef LIBBUILD2_VARIABLE_HXX
#define LIBBUILD2_VARIABLE_HXX
-#include <type_traits> // aligned_storage
+#include <cstddef> // max_align_t
+#include <type_traits> // is_*
#include <unordered_map>
#include <libbutl/prefix-map.hxx>
@@ -423,8 +424,8 @@ namespace build2
// specialization below). Types that don't fit will have to be handled
// with an extra dynamic allocation.
//
- static constexpr size_t size_ = sizeof (name_pair);
- std::aligned_storage<size_>::type data_;
+ static constexpr size_t size_ = sizeof (name_pair);
+ alignas (std::max_align_t) unsigned char data_[size_];
// Make sure we have sufficient storage for untyped values.
//
--
cgit v1.1

View File

@ -1,35 +0,0 @@
From 343d6e69e412166cfc21f268a51b692cb0201653 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Thu, 2 Mar 2023 11:18:59 +0200
Subject: Adapt to interface changes in libpkgconf 1.9
Patch by Matthew Krupcale.
---
libbuild2/cc/pkgconfig-libpkgconf.cxx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libbuild2/cc/pkgconfig-libpkgconf.cxx b/libbuild2/cc/pkgconfig-libpkgconf.cxx
index 81a96c3..f3754d3 100644
--- a/libbuild2/cc/pkgconfig-libpkgconf.cxx
+++ b/libbuild2/cc/pkgconfig-libpkgconf.cxx
@@ -81,10 +81,17 @@ namespace build2
#endif
;
+#if defined(LIBPKGCONF_VERSION) && LIBPKGCONF_VERSION >= 10900
+ static bool
+ pkgconf_error_handler (const char* msg,
+ const pkgconf_client_t*,
+ void*)
+#else
static bool
pkgconf_error_handler (const char* msg,
const pkgconf_client_t*,
const void*)
+#endif
{
error << runtime_error (msg); // Sanitize the message (trailing dot).
return true;
--
cgit v1.1

14
sources
View File

@ -1,7 +1,7 @@
SHA512 (bdep-0.15.0.tar.gz) = a60514b0a707f7e7286fabbe91cff16db342017b5918a00a73f6f7683108ba97b25ac0e6a21ff3a93ec8b5eb0bfec3de5602ce5048e419d83e7363c38f354c74
SHA512 (bpkg-0.15.0.tar.gz) = 6d90e3a1e7096a6a53a684f81fe49fcab21ba6d65f421a3157d64392fe8025a8a1fab9a15b6f1f706fd30c2fefd6d9415a47dd2a304420e9ad7b26656770c54e
SHA512 (build2-0.15.0.tar.gz) = c185f0dd9bc6e9357f88039c7ba9bb7b4e0471ecc7d95974f7d9a7bc9947cbdd16e8bc5a15d765b1461b410ef445deed2abddcd1760f7cead00b929f17a8a094
SHA512 (libbpkg-0.15.0.tar.gz) = b2cc79ece0c7a8d004e86beee47124cefc2f38d3ca8e839732ff455774737931d78b6defdb2c3ff137868339ab2b78330314ed206e02ea2aa09b28e166765ce7
SHA512 (libbutl-0.15.0.tar.gz) = f244bc3fdc31fadce64f86943c49e0901acfe4cde6c6fad3079647762cf2f26f76591db76b11357cd726360aaf4e2359e37f8cf6cdacb837af149a5e416cfe87
SHA512 (libodb-2.5.0-b.23.tar.gz) = 7b09ec662f0b21a44e241c33824a52c8a5ecfe30e9f82a52150b703ef75a8538dd0e101b665ddcdcfe2f3a5512070dbebca1f109d685ee80dbea33695f37c110
SHA512 (libodb-sqlite-2.5.0-b.23.tar.gz) = 0b349f342c29928051300d49e3c3ccc823a1628eb53f5e888808614e9ee5517bf4bd5c6d5e02922bfb261b69bb2be8b6ae3620c891f30b114aac9dca4aa725e4
SHA512 (bdep-0.16.0.tar.gz) = 49c6d500a9a875ceac2aeecc0951c4ff415033e5ba6735c835aa53382c0789bc0c6066630f2f802dbaba68d88bc2a84d323f511a9e482994f7970327e6a1f6e3
SHA512 (bpkg-0.16.0.tar.gz) = 80a47970f557a55279b94d1a0466562df1ef1e619fb4d45cf8598b5f243e7feac52f28e3e9752268ae04b8d126b8a83886194535fc71fc070884d0bbeacf68c8
SHA512 (build2-0.16.0.tar.gz) = 8190ae5812c46bca3df63564d2d96e5aa1781776420ff5f68a1b8001edea66feed32ee55fd3de763e35b2e84bde18341af5dbb3fc700d92942c18e8e7649a627
SHA512 (libbpkg-0.16.0.tar.gz) = fcc3ec82ee71a3f9b4124264d882baa0915f8b15804b94e7392d06217d850cc52f6a51d54a6022cec196ab441f3a3a2188a190d32cbb8d1544c2ca019abfb890
SHA512 (libbutl-0.16.0.tar.gz) = 43f545710eb1072afe71728a6a360e3618786e0ee14bfba4e8bb4b3be556943c1d55df8b536444b7f6dac61b1c650f591cc1b8410713738b21b5f2e24215814a
SHA512 (libodb-2.5.0-b.25.tar.gz) = f99eba87130f7c3ed0b707e1f4efdb839c97c221fee24056d955072767c36106297abe76e5f82054cf5bc3bf0fda631e7c92e4943645d6ff2be57831006505ef
SHA512 (libodb-sqlite-2.5.0-b.25.tar.gz) = 886119c8524939fa7c094afc157ada1797dca338d6e1a488aca8552615e2050c9d555e3784226e2d28faee58019a8e51b990ee9df1af1bdfe00d591d7268d673