Skip to content

Commit 7ba7e46

Browse files
authored
Merge pull request #197 from Flamefire/windows-ci
Fix standalone CI, especially MinGW
2 parents 4538c54 + 24692c3 commit 7ba7e46

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

.github/workflows/ci_tests.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ jobs:
4848
generator: Visual Studio 17 2022
4949
- os: ubuntu-22.04
5050
buildType: Debug
51-
- os: windows-2022
52-
standalone: Boost
5351
runs-on: ${{matrix.os}}
5452
env:
5553
DEP_DIR: ${{github.workspace}}/dependencies
56-
BOOST_VERSION: 1.56.0
54+
# VS 2022 only supported by Boost.Build 1.78+ with changes to build files (e.g. in Boost.Thread) required that are introduced in Boost 1.66
55+
# Boost.Iostreams doesn't support VS 2022 until 1.69
56+
BOOST_VERSION: ${{ startsWith(matrix.generator, 'Visual Studio') && '1.69.0' || '1.56.0' }}
5757
steps:
5858
- uses: actions/checkout@v4
5959
- name: Sanity check version
@@ -70,6 +70,7 @@ jobs:
7070
- name: Set BOOST_ROOT
7171
if: matrix.standalone == 'Boost'
7272
run: echo "BOOST_ROOT=${DEP_DIR//\\/\/}/boost_${BOOST_VERSION//./_}" >> $GITHUB_ENV
73+
7374
# Install Boost
7475
- uses: actions/checkout@v4
7576
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true'
@@ -80,34 +81,59 @@ jobs:
8081
fetch-depth: 1
8182
- name: Bootstrap Boost
8283
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true'
84+
working-directory: __buildBoost
8385
run: |
84-
cd __buildBoost
8586
git submodule update --init --jobs 3 tools/boostdep libs/filesystem tools/inspect libs/wave # Last 2 are required for pre-1.64
86-
(cd tools/boostdep && git fetch && git checkout boost-1.73.0 && git checkout boost-1.63.0 -- depinst/exceptions.txt)
87-
python tools/boostdep/depinst/depinst.py --include tools --exclude test --git_args '--jobs 3' filesystem
88-
[[ "${{matrix.os}}" =~ "windows" ]] && toolset=mingw || toolset=gcc
89-
./bootstrap.sh --with-toolset="$toolset" --with-libraries=system,filesystem threading=multi || (cat bootstrap.log && false)
90-
sed -i 's/mingw/gcc/' project-config.jam
91-
[[ "${{matrix.generator}}" =~ "Visual Studio" ]] && toolset=msvc-14.3 || toolset=gcc
87+
if [[ $BOOST_VERSION < '1.73.0' ]]; then
88+
(cd tools/boostdep && git fetch origin && git checkout boost-1.73.0 && git checkout boost-1.63.0 -- depinst/exceptions.txt)
89+
fi
90+
python tools/boostdep/depinst/depinst.py --include tools --exclude test --git_args '--jobs 3 --depth 1' wave # Should be filesystem, but works because that is a dependency of wave
91+
if [[ "${{matrix.generator}}" =~ "Visual Studio" ]]; then
92+
toolset=msvc-14.3
93+
# Boost.Build doesn't support MSVC 2022 (14.3) until 1.78
94+
if [[ $BOOST_VERSION < '1.78.0' ]]; then
95+
(cd tools/build && git fetch --depth 1 origin boost-1.78.0 && git checkout FETCH_HEAD)
96+
git fetch --depth 1 origin boost-1.78.0 && git checkout FETCH_HEAD -- bootstrap.bat
97+
fi
98+
else
99+
toolset=gcc
100+
[[ "${{matrix.os}}" =~ "windows" ]] && botstrap_toolset=mingw || botstrap_toolset=gcc
101+
./bootstrap.sh --with-toolset="$botstrap_toolset" --with-libraries=system,filesystem threading=multi || (cat bootstrap.log && false)
102+
sed -i 's/mingw/gcc/' project-config.jam
103+
./b2 headers
104+
fi
92105
echo "B2_TOOLSET=$toolset" >> $GITHUB_ENV
93-
./b2 headers
106+
# The updated Boost requires a C++11 compiler which MinGW isn't and using VS implies using the CMD shell
107+
- name: Bootstrap Boost (MSVC)
108+
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows') && startsWith(matrix.generator, 'Visual Studio')
109+
shell: cmd
110+
working-directory: __buildBoost
111+
run: |
112+
CALL .\bootstrap.bat --with-toolset=%B2_TOOLSET% --with-libraries=system,filesystem threading=multi
113+
IF %ERRORLEVEL% NEQ 0 (
114+
ECHO Build failed, printing log
115+
TYPE bootstrap.log
116+
EXIT /B 1
117+
)
118+
.\b2 headers
119+
94120
- name: Build Boost (Linux)
95121
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu')
96-
shell: bash
122+
working-directory: __buildBoost
97123
run: |
98-
cd __buildBoost
99124
./b2 link=static toolset=$B2_TOOLSET address-model=64 -j$(nproc) --prefix="$BOOST_ROOT" install
100125
cd ..
101126
rm -r __buildBoost || true
102127
# Requires cmd shell as on windows-2022 with msvc-14.3 'cl' won't be found with bash
103128
- name: Build Boost (Windows)
104129
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows')
105130
shell: cmd
131+
working-directory: __buildBoost
106132
run: |
107-
cd __buildBoost
108-
./b2 link=static toolset=$B2_TOOLSET address-model=64 -j$(nproc) --prefix="$BOOST_ROOT" install
133+
.\b2 link=static toolset=%B2_TOOLSET% address-model=64 -j 3 --prefix="%BOOST_ROOT%" install
134+
if %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
109135
cd ..
110-
rm -r __buildBoost || true
136+
rmdir /s /q __buildBoost
111137
- name: Create standalone
112138
if: matrix.standalone == 'Standalone'
113139
run: |

0 commit comments

Comments
 (0)