-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Don't merge: Add a GitHub Actions workflow for mingw-w64 with MSYS2 #3319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: mingw-w64 | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
with-patch: | ||
- true | ||
- false | ||
env: | ||
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This environment variable isn't required. It's just for reusing the same value. |
||
MSYSTEM: UCRT64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This environment variable is required. |
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: dependencies | ||
shell: c:\msys64\usr\bin\bash.exe -e -l {0} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If we don't have |
||
run: | | ||
pacman \ | ||
--needed \ | ||
--noconfirm \ | ||
--sync \ | ||
${MINGW_PACKAGE_PREFIX}-cc \ | ||
${MINGW_PACKAGE_PREFIX}-cmake \ | ||
${MINGW_PACKAGE_PREFIX}-curl \ | ||
${MINGW_PACKAGE_PREFIX}-ninja \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use |
||
${MINGW_PACKAGE_PREFIX}-openssl \ | ||
${MINGW_PACKAGE_PREFIX}-zlib | ||
Comment on lines
+32
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It means:
|
||
- name: patch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step applies only https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-aws-sdk-cpp/aws-sdk-cpp-pr-1333.patch . Because we need only the former for passing build. The latter is for fixing install location for shared library. For now, the former patch is for static build. We can't build aws-sdk-cpp for shared library with the former patch. So we don't need the latter patch yet. |
||
if: matrix.with-patch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is used by one job. For example: https://github.com/kou/aws-sdk-cpp/actions/runs/13583720209/job/37974163071 |
||
shell: c:\msys64\usr\bin\bash.exe -e -l {0} | ||
run: | | ||
pacman \ | ||
--needed \ | ||
--noconfirm \ | ||
--sync \ | ||
patch | ||
cd ${GITHUB_WORKSPACE} | ||
curl https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-aws-sdk-cpp/aws-sdk-cpp-pr-1333.patch | \ | ||
patch -p1 | ||
- name: configure | ||
shell: c:\msys64\usr\bin\bash.exe -e -l {0} | ||
run: | | ||
set -x | ||
cmake \ | ||
-B build \ | ||
-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are some warnings with mingw-w64. |
||
-DBUILD_ONLY="s3;s3-crt;dynamodb;logs;kms;sqs;firehose;kinesis;sns;mediastore;mediastore-data;monitoring;secretsmanager;athena;kafka;cognito-idp;rds;ecs" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is same as the one in simple-build.yml. |
||
-DBUILD_SHARED_LIBS=OFF \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't build shared library even with the patch in MSYS2. |
||
-DENABLE_TESTING=OFF \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't build tests even with the patch in MSYS2. |
||
-GNinja \ | ||
-S ${GITHUB_WORKSPACE} | ||
- name: build | ||
shell: c:\msys64\usr\bin\bash.exe -e -l {0} | ||
run: | | ||
cmake --build build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uses Windows 2022. GitHub Actions runner for Windows 2022 has MSYS2: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#msys2
So, this doesn't install MSYS2 explicitly.
We can install MSYS2 via command line: https://www.msys2.org/docs/installer/#cli-usage-examples