Skip to content

Commit 641f622

Browse files
committed
GHA tweaks
1 parent 255f7aa commit 641f622

File tree

5 files changed

+43
-51
lines changed

5 files changed

+43
-51
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
include:
19+
variant:
20+
- name: Default (full feature set)
21+
b2_variant: "debug,release"
22+
- name: No capture / dynamic allocation
23+
b2_variant: "leaf_debug_capture0,leaf_release_capture0"
24+
- name: No diagnostics
25+
b2_variant: "leaf_debug_diag0,leaf_release_diag0"
26+
- name: Embedded
27+
b2_variant: "leaf_debug_embedded,leaf_release_embedded"
28+
- name: Single header
29+
b2_variant: "leaf_debug_single_header,leaf_release_single_header"
30+
config:
2031
- toolset: gcc-5
2132
cxxstd: "11,14,1z"
2233
container: ubuntu:18.04
@@ -185,27 +196,27 @@ jobs:
185196
cxxstd: "11,14,17,20,2b"
186197
os: macos-26
187198

188-
runs-on: ${{matrix.os}}
199+
runs-on: ${{matrix.config.os}}
189200

190201
container:
191-
image: ${{matrix.container}}
202+
image: ${{matrix.config.container}}
192203
volumes:
193204
- /node20217:/node20217:rw,rshared
194-
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
205+
- ${{ startsWith(matrix.config.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
195206

196207
defaults:
197208
run:
198209
shell: bash
199210

200211
steps:
201212
- name: Setup container environment
202-
if: matrix.container
213+
if: matrix.config.container
203214
run: |
204215
apt-get update
205216
apt-get -y install sudo python3 git g++ curl xz-utils
206217
207218
- name: Install nodejs20glibc2.17
208-
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
219+
if: ${{ startsWith( matrix.config.container, 'ubuntu:1' ) }}
209220
run: |
210221
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
211222
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
@@ -214,10 +225,10 @@ jobs:
214225
- uses: actions/checkout@v4
215226

216227
- name: Install packages
217-
if: matrix.install
228+
if: matrix.config.install
218229
run: |
219230
sudo apt-get update
220-
sudo apt-get -y install ${{matrix.install}}
231+
sudo apt-get -y install ${{matrix.config.install}}
221232
222233
- name: Setup Boost
223234
run: |
@@ -242,9 +253,9 @@ jobs:
242253
./b2 -d0 headers
243254
244255
- name: Create user-config.jam
245-
if: matrix.compiler
256+
if: matrix.config.compiler
246257
run: |
247-
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
258+
echo "using ${{matrix.config.toolset}} : : ${{matrix.config.compiler}} ;" > ~/user-config.jam
248259
249260
- name: Generate headers
250261
run: |
@@ -254,13 +265,24 @@ jobs:
254265
- name: Run tests
255266
run: |
256267
cd ../boost-root
257-
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} link=shared,static variant=debug,release,leaf_debug_capture0,leaf_release_capture0,leaf_debug_diag0,leaf_release_diag0,leaf_debug_embedded,leaf_release_embedded,leaf_debug_single_header,leaf_release_single_header
268+
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.config.toolset}} cxxstd=${{matrix.config.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} link=shared,static variant=${{matrix.variant.b2_variant}}
258269
259270
windows:
260271
strategy:
261272
fail-fast: false
262273
matrix:
263-
include:
274+
variant:
275+
- name: Default (full feature set)
276+
b2_variant: "debug,release"
277+
- name: No capture / dynamic allocation
278+
b2_variant: "leaf_debug_capture0,leaf_release_capture0"
279+
- name: No diagnostics
280+
b2_variant: "leaf_debug_diag0,leaf_release_diag0"
281+
- name: Embedded
282+
b2_variant: "leaf_debug_embedded,leaf_release_embedded"
283+
- name: Single header
284+
b2_variant: "leaf_debug_single_header,leaf_release_single_header"
285+
config:
264286
- toolset: msvc-14.3
265287
cxxstd: "14,17,20,latest"
266288
addrmd: 32,64
@@ -274,7 +296,7 @@ jobs:
274296
addrmd: 64
275297
os: windows-2022
276298

277-
runs-on: ${{matrix.os}}
299+
runs-on: ${{matrix.config.os}}
278300

279301
steps:
280302
- uses: actions/checkout@v4
@@ -310,4 +332,4 @@ jobs:
310332
shell: cmd
311333
run: |
312334
cd ../boost-root
313-
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} ${{matrix.embedmanifest}} variant=debug,release,leaf_debug_capture0,leaf_release_capture0,leaf_debug_diag0,leaf_release_diag0,leaf_debug_embedded,leaf_release_embedded,leaf_debug_single_header,leaf_release_single_header
335+
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.config.toolset}} cxxstd=${{matrix.config.cxxstd}} address-model=${{matrix.config.addrmd}} variant=${{matrix.variant.b2_variant}}

include/boost/leaf/config/tls_win32.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ namespace detail
259259
tls_failures_ |= tls_failure_create_mapping;
260260
return;
261261
}
262-
bool is_first_module = (GetLastError() != ERROR_ALREADY_EXISTS);
262+
DWORD mapping_status = GetLastError();
263+
BOOST_LEAF_ASSERT(mapping_status == ERROR_ALREADY_EXISTS || mapping_status == ERROR_SUCCESS);
264+
bool is_first_module = (mapping_status == ERROR_SUCCESS);
263265
slot_map * * mapped_ptr = static_cast<slot_map * *>(MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, sizeof(slot_map *)));
264266
if (!mapped_ptr)
265267
{

test/lightweight_test.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
#ifdef BOOST_LEAF_NO_EXCEPTIONS
99
namespace boost
1010
{
11-
[[noreturn]] void throw_exception( std::exception const & e )
11+
[[noreturn]] inline void throw_exception( std::exception const & e )
1212
{
1313
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
1414
std::terminate();
1515
}
1616

1717
struct source_location;
18-
[[noreturn]] void throw_exception( std::exception const & e, boost::source_location const & )
18+
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
1919
{
2020
throw_exception(e);
2121
}

test/so_dll_lib1.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
# include <boost/leaf/on_error.hpp>
1111
#endif
1212

13-
#ifdef BOOST_LEAF_NO_EXCEPTIONS
14-
#include <iostream>
15-
namespace boost
16-
{
17-
[[noreturn]] inline void throw_exception( std::exception const & e )
18-
{
19-
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
20-
std::terminate();
21-
}
22-
23-
struct source_location;
24-
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
25-
{
26-
throw_exception(e);
27-
}
28-
}
29-
#endif
13+
#include "lightweight_test.hpp"
3014

3115
#define BOOST_LEAF_SO_DLL_TEST_BUILDING_LIB1
3216

test/so_dll_lib2.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
# include <boost/leaf/on_error.hpp>
1111
#endif
1212

13-
#ifdef BOOST_LEAF_NO_EXCEPTIONS
14-
#include <iostream>
15-
namespace boost
16-
{
17-
[[noreturn]] inline void throw_exception( std::exception const & e )
18-
{
19-
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
20-
std::terminate();
21-
}
22-
23-
struct source_location;
24-
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
25-
{
26-
throw_exception(e);
27-
}
28-
}
29-
#endif
13+
#include "lightweight_test.hpp"
3014

3115
#define BOOST_LEAF_SO_DLL_TEST_BUILDING_LIB2
3216

0 commit comments

Comments
 (0)