Skip to content

Commit 0602275

Browse files
committed
boost: apply merged patches from upstream bcp to fix build
Signed-off-by: James Rawlings <[email protected]>
1 parent 0592216 commit 0602275

3 files changed

+253
-0
lines changed

boost.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ environment:
1212
- build-base
1313
- busybox
1414
- ca-certificates-bundle
15+
- patch
1516
- python3
1617
- python3-dev
1718
- wolfi-base
@@ -56,6 +57,12 @@ pipeline:
5657
uri: https://boostorg.jfrog.io/artifactory/main/release/${{package.version}}/source/boost_${{vars.mangled-package-version}}.tar.gz
5758
expected-sha256: be0d91732d5b0cc6fbb275c7939974457e79b54d6f07ce2e3dfdd68bef883b0b
5859

60+
# Apply patches to fix build https://github.com/boostorg/bcp/pull/18
61+
- runs: |
62+
cd ./tools/bcp
63+
patch -p1 < ../../c98516b5b76e9132eba78a399af9c95ec8d23bd4.patch
64+
patch -p1 < ../../cd21e9b4a749a77c24facf2da44f01e032c40842.patch
65+
5966
- runs: |
6067
abiflags="$(python3-config --abiflags)"
6168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From c98516b5b76e9132eba78a399af9c95ec8d23bd4 Mon Sep 17 00:00:00 2001
2+
From: Andrey Semashev <[email protected]>
3+
Date: Sun, 24 Mar 2024 15:43:33 +0300
4+
Subject: [PATCH] Updated list of special dependencies.
5+
6+
---
7+
add_path.cpp | 16 ++++++----------
8+
1 file changed, 6 insertions(+), 10 deletions(-)
9+
10+
diff --git a/add_path.cpp b/add_path.cpp
11+
index 747bb8c..9ae43c9 100644
12+
--- a/add_path.cpp
13+
+++ b/add_path.cpp
14+
@@ -196,12 +196,6 @@ void bcp_implementation::add_file(const fs::path& p)
15+
//
16+
static const std::pair<fs::path, fs::path>
17+
specials[] = {
18+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "libs/predef/check"),
19+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "libs/predef/tools"),
20+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "tools/boost_install/boost-install.jam"),
21+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "tools/boost_install/boost-install-dirs.jam"),
22+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "tools/boost_install/Jamfile"),
23+
- std::pair<fs::path, fs::path>("tools/build/src/kernel/modules.jam", "libs/headers"),
24+
std::pair<fs::path, fs::path>("libs/test/build/Jamfile.v2", "libs/timer/src"),
25+
std::pair<fs::path, fs::path>("libs/test/build/Jamfile.v2", "libs/timer/build"),
26+
std::pair<fs::path, fs::path>("boost/atomic/capabilities.hpp", "boost/atomic/detail"),
27+
@@ -226,14 +220,14 @@ static const std::pair<fs::path, fs::path>
28+
std::pair<fs::path, fs::path>("libs/thread/build", "boost/system"),
29+
std::pair<fs::path, fs::path>("libs/thread/build", "boost/cerrno.hpp"),
30+
std::pair<fs::path, fs::path>("libs/thread/build", "boost/chrono"),
31+
- std::pair<fs::path, fs::path>("boost/filesystem/convenience.hpp", "boost/filesystem.hpp"),
32+
+ std::pair<fs::path, fs::path>("boost/filesystem/cstdio.hpp", "boost/filesystem.hpp"),
33+
+ std::pair<fs::path, fs::path>("boost/filesystem/directory.hpp", "boost/filesystem.hpp"),
34+
std::pair<fs::path, fs::path>("boost/filesystem/exception.hpp", "boost/filesystem.hpp"),
35+
std::pair<fs::path, fs::path>("boost/filesystem/fstream.hpp", "boost/filesystem.hpp"),
36+
std::pair<fs::path, fs::path>("boost/filesystem/operations.hpp", "boost/filesystem.hpp"),
37+
+ std::pair<fs::path, fs::path>("boost/filesystem/file_status.hpp", "boost/filesystem.hpp"),
38+
std::pair<fs::path, fs::path>("boost/filesystem/path.hpp", "boost/filesystem.hpp"),
39+
std::pair<fs::path, fs::path>("boost/filesystem.hpp", "libs/filesystem/build"),
40+
- std::pair<fs::path, fs::path>("boost/filesystem.hpp", "libs/filesystem/v2"),
41+
- std::pair<fs::path, fs::path>("boost/filesystem.hpp", "libs/filesystem/v3"),
42+
std::pair<fs::path, fs::path>("boost/config.hpp", "boost/config"),
43+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "libs/config/checks"),
44+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "libs/config/test"),
45+
@@ -242,6 +236,7 @@ static const std::pair<fs::path, fs::path>
46+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/BoostDetectToolset.cmake"),
47+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/boost-install.jam"),
48+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/boost-install-dirs.jam"),
49+
+ std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "tools/boost_install/Jamfile"),
50+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "boostcpp.jam"),
51+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "project-config.jam"),
52+
std::pair<fs::path, fs::path>("tools/build/bootstrap.sh", "bootstrap.bat"),
53+
@@ -271,7 +266,8 @@ static const std::pair<fs::path, fs::path>
54+
std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/src"),
55+
std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/build"),
56+
std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/predef/build.jam"),
57+
- std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/predef/check"),
58+
+ std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/predef/tools/check"),
59+
+ std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/predef/check"), // libs/predef/check if obsolete, but may still be used
60+
std::pair<fs::path, fs::path>("boost/typeof.hpp", "boost/typeof/incr_registration_group.hpp"),
61+
std::pair<fs::path, fs::path>("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail/pp_cc_loop"),
62+
std::pair<fs::path, fs::path>("boost/function_types/components.hpp", "boost/function_types/detail/components_impl"),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
From cd21e9b4a749a77c24facf2da44f01e032c40842 Mon Sep 17 00:00:00 2001
2+
From: Andrey Semashev <[email protected]>
3+
Date: Sun, 24 Mar 2024 14:49:18 +0300
4+
Subject: [PATCH] Remove usage of deprecated and removed Boost.Filesystem APIs.
5+
6+
---
7+
add_dependent_lib.cpp | 5 +++--
8+
add_path.cpp | 30 +++++++++++++++---------------
9+
bcp_imp.hpp | 1 +
10+
copy_path.cpp | 8 ++++----
11+
file_types.cpp | 2 +-
12+
5 files changed, 24 insertions(+), 22 deletions(-)
13+
14+
diff --git a/add_dependent_lib.cpp b/add_dependent_lib.cpp
15+
index 4852914..521b70d 100644
16+
--- a/add_dependent_lib.cpp
17+
+++ b/add_dependent_lib.cpp
18+
@@ -15,6 +15,7 @@
19+
#include "bcp_imp.hpp"
20+
#include "fileview.hpp"
21+
#include <boost/regex.hpp>
22+
+#include <boost/filesystem/directory.hpp>
23+
#include <boost/filesystem/operations.hpp>
24+
#include <boost/filesystem/exception.hpp>
25+
#include <iostream>
26+
@@ -43,12 +44,12 @@ static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::st
27+
//
28+
// Don't add files created by build system:
29+
//
30+
- if((p.leaf() == "bin") || (p.leaf() == "bin-stage"))
31+
+ if((p.filename() == "bin") || (p.filename() == "bin-stage"))
32+
return;
33+
//
34+
// Don't add version control directories:
35+
//
36+
- if((p.leaf() == "CVS") || (p.leaf() == ".svn"))
37+
+ if((p.filename() == "CVS") || (p.filename() == ".svn"))
38+
return;
39+
//
40+
// don't add directories not under version control:
41+
diff --git a/add_path.cpp b/add_path.cpp
42+
index 8a1fee3..747bb8c 100644
43+
--- a/add_path.cpp
44+
+++ b/add_path.cpp
45+
@@ -15,6 +15,7 @@
46+
#include "bcp_imp.hpp"
47+
#include "fileview.hpp"
48+
#include <boost/regex.hpp>
49+
+#include <boost/filesystem/directory.hpp>
50+
#include <boost/filesystem/operations.hpp>
51+
#include <boost/filesystem/exception.hpp>
52+
#include <iostream>
53+
@@ -24,8 +25,7 @@ void bcp_implementation::add_path(const fs::path& p)
54+
{
55+
if (m_excluded.find(p) != m_excluded.end())
56+
return;
57+
- fs::path normalized_path = p;
58+
- normalized_path.normalize();
59+
+ fs::path normalized_path = p.lexically_normal();
60+
if(fs::exists(m_boost_path / normalized_path))
61+
{
62+
if(fs::is_directory(m_boost_path / normalized_path))
63+
@@ -45,12 +45,12 @@ void bcp_implementation::add_directory(const fs::path& p)
64+
//
65+
// Don't add files created by build system:
66+
//
67+
- if((p.leaf() == "bin") || (p.leaf() == "bin-stage"))
68+
+ if((p.filename() == "bin") || (p.filename() == "bin-stage"))
69+
return;
70+
//
71+
// Don't add version control directories:
72+
//
73+
- if((p.leaf() == "CVS") || (p.leaf() == ".svn"))
74+
+ if((p.filename() == "CVS") || (p.filename() == ".svn"))
75+
return;
76+
//
77+
// don't add directories not under version control:
78+
@@ -180,7 +180,7 @@ void bcp_implementation::add_file(const fs::path& p)
79+
{
80+
// only concatonate if it's a relative path
81+
// rather than a URL:
82+
- fs::path dep(p.branch_path() / s);
83+
+ fs::path dep(p.parent_path() / s);
84+
if(!m_dependencies.count(dep))
85+
{
86+
m_dependencies[dep] = p; // set up dependency tree
87+
@@ -355,13 +355,13 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile)
88+
continue;
89+
}
90+
include_file = i->str();
91+
- fs::path test_file(m_boost_path / p.branch_path() / include_file);
92+
- if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost"))
93+
+ fs::path test_file(m_boost_path / p.parent_path() / include_file);
94+
+ if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.parent_path().string() != "boost"))
95+
{
96+
- if(!m_dependencies.count(p.branch_path() / include_file))
97+
+ if(!m_dependencies.count(p.parent_path() / include_file))
98+
{
99+
- m_dependencies[p.branch_path() / include_file] = p;
100+
- add_pending_path(p.branch_path() / include_file);
101+
+ m_dependencies[p.parent_path() / include_file] = p;
102+
+ add_pending_path(p.parent_path() / include_file);
103+
}
104+
}
105+
else if(fs::exists(m_boost_path / include_file))
106+
@@ -405,13 +405,13 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile)
107+
++i;
108+
continue;
109+
}
110+
- fs::path test_file(m_boost_path / p.branch_path() / include_file);
111+
- if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost"))
112+
+ fs::path test_file(m_boost_path / p.parent_path() / include_file);
113+
+ if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.parent_path().string() != "boost"))
114+
{
115+
- if(!m_dependencies.count(p.branch_path() / include_file))
116+
+ if(!m_dependencies.count(p.parent_path() / include_file))
117+
{
118+
- m_dependencies[p.branch_path() / include_file] = p;
119+
- add_pending_path(p.branch_path() / include_file);
120+
+ m_dependencies[p.parent_path() / include_file] = p;
121+
+ add_pending_path(p.parent_path() / include_file);
122+
}
123+
}
124+
else if(fs::exists(m_boost_path / include_file))
125+
diff --git a/bcp_imp.hpp b/bcp_imp.hpp
126+
index e515581..51c85ba 100644
127+
--- a/bcp_imp.hpp
128+
+++ b/bcp_imp.hpp
129+
@@ -14,6 +14,7 @@
130+
#include <set>
131+
#include <map>
132+
#include <queue>
133+
+#include <string>
134+
#include <boost/filesystem/path.hpp>
135+
136+
namespace fs = boost::filesystem;
137+
diff --git a/copy_path.cpp b/copy_path.cpp
138+
index 4143c79..6b7a370 100644
139+
--- a/copy_path.cpp
140+
+++ b/copy_path.cpp
141+
@@ -49,18 +49,18 @@ void bcp_implementation::copy_path(const fs::path& p)
142+
if(fs::exists(m_dest_path / p))
143+
{
144+
std::cout << "Copying (and overwriting) file: " << p.string() << "\n";
145+
- fs::remove(m_dest_path / p);
146+
+ fs::remove(m_dest_path / p);
147+
}
148+
else
149+
std::cout << "Copying file: " << p.string() << "\n";
150+
//
151+
// create the path to the new file if it doesn't already exist:
152+
//
153+
- create_path(p.branch_path());
154+
+ create_path(p.parent_path());
155+
//
156+
// do text based copy if requested:
157+
//
158+
- if((p.leaf() == "Jamroot") && m_namespace_name.size())
159+
+ if((p.filename() == "Jamroot") && m_namespace_name.size())
160+
{
161+
static std::vector<char> v1, v2;
162+
v1.clear();
163+
@@ -240,7 +240,7 @@ void bcp_implementation::create_path(const fs::path& p)
164+
if(!fs::exists(m_dest_path / p))
165+
{
166+
// recurse then create the path:
167+
- create_path(p.branch_path());
168+
+ create_path(p.parent_path());
169+
fs::create_directory(m_dest_path / p);
170+
}
171+
}
172+
diff --git a/file_types.cpp b/file_types.cpp
173+
index 297d304..69f6027 100644
174+
--- a/file_types.cpp
175+
+++ b/file_types.cpp
176+
@@ -52,7 +52,7 @@ bool bcp_implementation::is_binary_file(const fs::path& p)
177+
"|"
178+
"(Jamfile|makefile|configure)",
179+
boost::regex::perl | boost::regex::icase);
180+
- return !boost::regex_match(p.leaf().generic_string(), e);
181+
+ return !boost::regex_match(p.filename().generic_string(), e);
182+
183+
}
184+

0 commit comments

Comments
 (0)