Skip to content

Commit 5a16e08

Browse files
committed
Run the examples serially in CI
The example programs write to fixed temp filenames---demo and demo_exception even share tmpdir()/demofile.txt---so running them under `b2 -jN` with N > 1 races: concurrent processes clobber each other's archive files and a reader picks up a half-written one, throwing `archive_exception`. Therefore, run the examples under `-j1` (the tests keep running in parallel).
1 parent f387cb6 commit 5a16e08

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,15 @@ jobs:
243243
run: |
244244
cd ../boost-root
245245
export ADDRMD=${{matrix.address-model}}
246-
./b2 -j3 libs/$LIBRARY/test libs/$LIBRARY/example toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
246+
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
247+
248+
- name: Run examples
249+
run: |
250+
cd ../boost-root
251+
export ADDRMD=${{matrix.address-model}}
252+
# The demos use fixed temp filenames, so run them serially (-j1)
253+
# to avoid concurrent runs clobbering each other's archive files.
254+
./b2 -j1 libs/$LIBRARY/example toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
247255
248256
windows:
249257
strategy:
@@ -298,7 +306,15 @@ jobs:
298306
shell: cmd
299307
run: |
300308
cd ../boost-root
301-
b2 -j3 libs/%LIBRARY%/test libs/%LIBRARY%/example toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
309+
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
310+
311+
- name: Run examples
312+
shell: cmd
313+
run: |
314+
cd ../boost-root
315+
rem The demos use fixed temp filenames, so run them serially (-j1)
316+
rem to avoid concurrent runs clobbering each other's archive files.
317+
b2 -j1 libs/%LIBRARY%/example toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
302318
303319
posix-cmake-subdir:
304320
strategy:

0 commit comments

Comments
 (0)