Skip to content

Commit 509b920

Browse files
committed
ci: b2 workflow builds examples
1 parent 7b8ad31 commit 509b920

File tree

10 files changed

+93
-34
lines changed

10 files changed

+93
-34
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
generator: "MinGW Makefiles"
136136
is-latest: true
137137
is-earliest: true
138-
name: "MinGW"
138+
name: "MinGW (shared)"
139139
shared: true
140140
build-type: "Release"
141141
build-cmake: true
@@ -149,7 +149,7 @@ jobs:
149149
generator: "MinGW Makefiles"
150150
is-latest: true
151151
is-earliest: true
152-
name: "MinGW"
152+
name: "MinGW (static)"
153153
shared: false
154154
build-type: "Release"
155155
build-cmake: true
@@ -339,7 +339,7 @@ jobs:
339339
b2-toolset: "gcc"
340340
is-latest: true
341341
name: "GCC 14: C++17-20 (ubsan)"
342-
shared: true
342+
shared: false
343343
ubsan: true
344344
build-type: "RelWithDebInfo"
345345

@@ -848,7 +848,7 @@ jobs:
848848
ref: develop
849849

850850
- name: Setup C++
851-
uses: alandefreitas/cpp-actions/setup-cpp@v1.8.10
851+
uses: ashtum/cpp-actions/setup-cpp@v1.8.13
852852
id: setup-cpp
853853
with:
854854
compiler: ${{ matrix.compiler }}
@@ -857,17 +857,17 @@ jobs:
857857
trace-commands: true
858858

859859
- name: Install packages
860-
uses: alandefreitas/cpp-actions/package-install@v1.8.10
860+
uses: ashtum/cpp-actions/package-install@v1.8.13
861861
id: package-install
862862
with:
863863
apt-get-add-architecture: ${{ matrix.x86 && 'i386' || '' }}
864864
apt-get: >-
865865
${{ matrix.install }}
866866
build-essential libssl-dev zlib1g-dev libbrotli-dev libpsl-dev
867-
${{ matrix.x86 && 'zlib1g-dev:i386 libbrotli-dev:i386 libpsl-dev:i386' || '' }}
867+
${{ matrix.x86 && 'libssl-dev:i386 zlib1g-dev:i386 libbrotli-dev:i386 libpsl-dev:i386' || '' }}
868868
869869
- name: Clone Boost
870-
uses: alandefreitas/cpp-actions/boost-clone@v1.8.10
870+
uses: ashtum/cpp-actions/boost-clone@v1.8.13
871871
id: boost-clone
872872
with:
873873
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
@@ -886,7 +886,7 @@ jobs:
886886
rts
887887
888888
- name: Install Packages (Windows)
889-
uses: alandefreitas/cpp-actions/package-install@v1.8.10
889+
uses: ashtum/cpp-actions/package-install@v1.8.13
890890
if: ${{ startsWith(matrix.runs-on, 'windows') }}
891891
id: package-install-windows
892892
with:
@@ -958,7 +958,7 @@ jobs:
958958
cp -r "$workspace_root"/rts-root libs/rts
959959
960960
- name: Boost B2 Workflow
961-
uses: alandefreitas/cpp-actions/b2-workflow@v1.8.10
961+
uses: ashtum/cpp-actions/b2-workflow@v1.8.13
962962
if: ${{ !matrix.coverage && !matrix.time-trace }}
963963
env:
964964
ASAN_OPTIONS: ${{ (startsWith(matrix.compiler, 'apple-clang') && 'detect_invalid_pointer_pairs=0') || 'detect_invalid_pointer_pairs=2' }}
@@ -977,9 +977,10 @@ jobs:
977977
cxxflags: ${{ (matrix.asan && '-fsanitize=pointer-subtract') || '' }}
978978
user-config: ${{ (startsWith(matrix.runs-on, 'windows') && format('{0}/user-config.jam', steps.patch.outputs.workspace_root)) || '' }}
979979
stop-on-error: true
980+
extra-args: "libs/http_io/example" # https://github.com/ashtum/cpp-actions/issues/23
980981

981982
- name: Boost CMake Workflow
982-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
983+
uses: ashtum/cpp-actions/cmake-workflow@v1.8.13
983984
if: ${{ matrix.coverage || matrix.time-trace || matrix.build-cmake || matrix.is-earliest }}
984985
with:
985986
source-dir: boost-root
@@ -1016,7 +1017,7 @@ jobs:
10161017
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/.local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
10171018
10181019
- name: Find Package Integration Workflow
1019-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
1020+
uses: ashtum/cpp-actions/cmake-workflow@v1.8.13
10201021
if: ${{ matrix.build-cmake || matrix.is-earliest }}
10211022
with:
10221023
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
@@ -1040,7 +1041,7 @@ jobs:
10401041
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}
10411042

10421043
- name: Subdirectory Integration Workflow
1043-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
1044+
uses: ashtum/cpp-actions/cmake-workflow@v1.8.13
10441045
if: ${{ matrix.build-cmake || matrix.is-earliest }}
10451046
with:
10461047
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
@@ -1061,7 +1062,7 @@ jobs:
10611062
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}
10621063

10631064
- name: Root Project CMake Workflow
1064-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.10
1065+
uses: ashtum/cpp-actions/cmake-workflow@v1.8.13
10651066
if: ${{ matrix.build-cmake || matrix.is-earliest }}
10661067
with:
10671068
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}
@@ -1084,7 +1085,7 @@ jobs:
10841085
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}
10851086

10861087
- name: FlameGraph
1087-
uses: alandefreitas/cpp-actions/flamegraph@v1.8.10
1088+
uses: ashtum/cpp-actions/flamegraph@v1.8.13
10881089
if: matrix.time-trace
10891090
with:
10901091
source-dir: boost-root/libs/http_io
@@ -1137,7 +1138,7 @@ jobs:
11371138
fetch-depth: 100
11381139

11391140
- name: Changelog
1140-
uses: alandefreitas/cpp-actions/create-changelog@v1.8.10
1141+
uses: ashtum/cpp-actions/create-changelog@v1.8.13
11411142
with:
11421143
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
11431144
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -1159,7 +1160,7 @@ jobs:
11591160
shell: bash
11601161
steps:
11611162
- name: Install packages
1162-
uses: alandefreitas/cpp-actions/package-install@v1.8.7
1163+
uses: ashtum/cpp-actions/package-install@v1.8.13
11631164
with:
11641165
apt-get: git cmake
11651166

@@ -1190,7 +1191,7 @@ jobs:
11901191
ref: develop
11911192

11921193
- name: Clone Boost
1193-
uses: alandefreitas/cpp-actions/boost-clone@v1.8.10
1194+
uses: ashtum/cpp-actions/boost-clone@v1.8.13
11941195
id: boost-clone
11951196
with:
11961197
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}

example/client/burl/Jamfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,31 @@ import ../../../../config/checks/config : requires ;
1212
using openssl ;
1313
import ac ;
1414

15+
lib advapi32 ;
16+
lib crypt32 ;
17+
lib gdi32 ;
18+
lib user32 ;
19+
1520
project
1621
: requirements
1722
[ requires
1823
cxx20_hdr_concepts
24+
cxx20_hdr_format
1925
]
2026
<library>/boost/http_io//boost_http_io
2127
[ ac.check-library /boost/rts//boost_rts_zlib : <library>/boost/rts//boost_rts_zlib : ]
2228
[ ac.check-library /boost/rts//boost_rts_brotli : <library>/boost/rts//boost_rts_brotli : ]
29+
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
30+
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
31+
<target-os>windows:<library>advapi32
32+
<target-os>windows:<library>crypt32
33+
<target-os>windows:<library>gdi32
34+
<target-os>windows:<library>user32
2335
<library>/boost/url//boost_url
2436
<library>/boost/program_options//boost_program_options
2537
<library>/boost/scope//boost_scope
26-
<library>/openssl//ssl/<link>shared
27-
<library>/openssl//crypto/<link>shared
28-
<target-os>windows:<library>crypt32
2938
<include>.
39+
<link>shared:<define>BOOST_PROGRAM_OPTIONS_DYN_LINK=1 # workaround Jamfile issue in program_options
3040
;
3141

3242
exe burl :

example/client/burl/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,10 @@ retry(
751751
asio::awaitable<void>
752752
co_main(int argc, char* argv[])
753753
{
754-
auto [oc, ssl_ctx, ropt_gen] = parse_args(argc, argv);
754+
auto args_rs = parse_args(argc, argv);
755+
auto& oc = args_rs.oc;
756+
auto& ropt_gen = args_rs.ropt_gen;
757+
auto& ssl_ctx = args_rs.ssl_ctx;
755758

756759
auto executor = co_await asio::this_coro::executor;
757760
auto task_group = ::task_group{ executor, oc.parallel_max };

example/client/burl/options.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ parse_args(int argc, char* argv[])
783783
if(!url.has_value())
784784
return boost::optional<glob_result>{};
785785
return boost::optional<glob_result>(
786-
{ std::exchange(url, {}).value(), {} });
786+
glob_result{ std::exchange(url, {}).value(), {} });
787787
};
788788
};
789789

@@ -830,11 +830,11 @@ parse_args(int argc, char* argv[])
830830
auto& request_info = requests.back();
831831
if(auto o = request_info.url_gen())
832832
{
833-
return request_opt(
833+
return request_opt{
834834
o->result,
835835
o->interpolate(request_info.output),
836836
request_info.input,
837-
request_info.remotename);
837+
request_info.remotename };
838838
}
839839
requests.pop_back();
840840
}

example/client/burl/request.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class async_request_op
8787
return self.complete(ec);
8888

8989
// TODO: use associated allocator
90-
exp100_.reset(new exp100(
90+
exp100_.reset(new exp100{
9191
exp100::awaiting,
92-
asio::steady_timer{ stream_.get_executor() }));
92+
asio::steady_timer{ stream_.get_executor() } });
9393
exp100_->timer.expires_after(exp100_timeout_);
9494

9595
BOOST_ASIO_CORO_YIELD

example/client/burl/task_group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ enum class task_group_errc
3030
template<typename Executor>
3131
class basic_task_group
3232
{
33-
asio::steady_timer::rebind_executor<Executor>::other cv_;
33+
typename asio::steady_timer::rebind_executor<Executor>::other cv_;
3434
std::uint32_t max_;
3535
std::list<asio::cancellation_signal> css_;
3636

example/client/get/Jamfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@
1010
using openssl ;
1111
import ac ;
1212

13+
lib advapi32 ;
14+
lib crypt32 ;
15+
lib gdi32 ;
16+
lib user32 ;
17+
1318
project
1419
: requirements
1520
<library>/boost/http_io//boost_http_io
1621
[ ac.check-library /boost/rts//boost_rts_zlib : <library>/boost/rts//boost_rts_zlib : ]
1722
[ ac.check-library /boost/rts//boost_rts_brotli : <library>/boost/rts//boost_rts_brotli : ]
18-
<library>/boost/url//boost_url
19-
<library>/openssl//ssl/<link>shared
20-
<library>/openssl//crypto/<link>shared
23+
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
24+
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
25+
<target-os>windows:<library>advapi32
2126
<target-os>windows:<library>crypt32
27+
<target-os>windows:<library>gdi32
28+
<target-os>windows:<library>user32
29+
<library>/boost/url//boost_url
2230
<include>.
2331
;
2432

example/client/jsonrpc/Jamfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@ import ../../../../config/checks/config : requires ;
1212
using openssl ;
1313
import ac ;
1414

15+
lib advapi32 ;
16+
lib crypt32 ;
17+
lib gdi32 ;
18+
lib user32 ;
19+
1520
project
1621
: requirements
1722
<library>/boost/http_io//boost_http_io
18-
<library>/boost/url//boost_url
23+
[ ac.check-library /boost/rts//boost_rts_zlib : <library>/boost/rts//boost_rts_zlib : ]
24+
[ ac.check-library /boost/rts//boost_rts_brotli : <library>/boost/rts//boost_rts_brotli : ]
25+
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
26+
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
27+
<target-os>windows:<library>advapi32
28+
<target-os>windows:<library>crypt32
29+
<target-os>windows:<library>gdi32
30+
<target-os>windows:<library>user32 <library>/boost/url//boost_url
1931
<library>/boost/json//boost_json
2032
<library>/boost/multiprecision//boost_multiprecision
21-
<library>/openssl//ssl/<link>shared
22-
<library>/openssl//crypto/<link>shared
23-
<target-os>windows:<library>crypt32
2433
<include>.
2534
;
2635

example/server/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@ target_link_libraries(http_io_server_example
2828
OpenSSL::SSL
2929
OpenSSL::Crypto
3030
)
31+
32+
if (WIN32)
33+
target_link_libraries(http_io_server_example crypt32)
34+
endif()
35+
36+
if (TARGET Boost::rts_zlib)
37+
target_link_libraries(http_io_server_example Boost::rts_zlib)
38+
endif()
39+
40+
if (TARGET Boost::rts_brotli)
41+
target_link_libraries(http_io_server_example Boost::rts_brotli)
42+
endif()

example/server/Jamfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,26 @@
88
# Official repository: https://github.com/CPPAlliance/http_proto
99
#
1010

11+
using openssl ;
12+
import ac ;
13+
14+
lib advapi32 ;
15+
lib crypt32 ;
16+
lib gdi32 ;
17+
lib user32 ;
18+
1119
project
1220
: requirements
1321
<library>/boost/http_io//boost_http_io
1422
<library>/boost/url//boost_url
23+
[ ac.check-library /boost/rts//boost_rts_zlib : <library>/boost/rts//boost_rts_zlib : ]
24+
[ ac.check-library /boost/rts//boost_rts_brotli : <library>/boost/rts//boost_rts_brotli : ]
25+
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
26+
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
27+
<target-os>windows:<library>advapi32
28+
<target-os>windows:<library>crypt32
29+
<target-os>windows:<library>gdi32
30+
<target-os>windows:<library>user32
1531
<include>.
1632
;
1733

0 commit comments

Comments
 (0)