-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't merge: Add a GitHub Actions workflow for mingw-w64 with MSYS2 #3319
base: main
Are you sure you want to change the base?
Conversation
jobs: | ||
build: | ||
name: Build | ||
runs-on: windows-latest |
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
- true | ||
- false | ||
env: | ||
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64 |
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.
This environment variable isn't required. It's just for reusing the same value.
- false | ||
env: | ||
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64 | ||
MSYSTEM: UCRT64 |
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.
This environment variable is required. bash -l
(using bash as a login shell) refers this environment variable and setup PATH
and so on.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
-l
(login shell) is important here.
If we don't have -l
, mingw-w64 build environment isn't prepared.
${MINGW_PACKAGE_PREFIX}-cc \ | ||
${MINGW_PACKAGE_PREFIX}-cmake \ | ||
${MINGW_PACKAGE_PREFIX}-curl \ | ||
${MINGW_PACKAGE_PREFIX}-ninja \ | ||
${MINGW_PACKAGE_PREFIX}-openssl \ | ||
${MINGW_PACKAGE_PREFIX}-zlib |
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.
${MINGW_PACKAGE_PREFIX}
is mingw-w64-ucrt-x86_64
.
It means:
mingw-w64-ucrt
: We use mingw-w64 GCC with universal C runtimex86_64
: We use Intel/AMD 64bit CPU (We can useaarch64
for Arm 64bit CPU)
${MINGW_PACKAGE_PREFIX}-ninja \ | ||
${MINGW_PACKAGE_PREFIX}-openssl \ | ||
${MINGW_PACKAGE_PREFIX}-zlib | ||
- name: patch |
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.
This step applies only https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-aws-sdk-cpp/aws-sdk-cpp-pr-1333.patch .
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-aws-sdk-cpp/0001-fix-dll-import-libary-folder.patch isn't applied.
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.
set -x | ||
cmake \ | ||
-B build \ | ||
-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF \ |
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.
There are some warnings with mingw-w64.
cmake \ | ||
-B build \ | ||
-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF \ | ||
-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 comment
The reason will be displayed to describe this comment to others. Learn more.
This is same as the one in simple-build.yml.
-B build \ | ||
-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF \ | ||
-DBUILD_ONLY="s3;s3-crt;dynamodb;logs;kms;sqs;firehose;kinesis;sns;mediastore;mediastore-data;monitoring;secretsmanager;athena;kafka;cognito-idp;rds;ecs" \ | ||
-DBUILD_SHARED_LIBS=OFF \ |
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.
We can't build shared library even with the patch in MSYS2.
-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF \ | ||
-DBUILD_ONLY="s3;s3-crt;dynamodb;logs;kms;sqs;firehose;kinesis;sns;mediastore;mediastore-data;monitoring;secretsmanager;athena;kafka;cognito-idp;rds;ecs" \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
-DENABLE_TESTING=OFF \ |
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.
We can't build tests even with the patch in MSYS2.
Issue #, if available: #3315
Description of changes:
This just shows how to setup mingw-w64 build environment with MSYS2.
This uses GitHub Actions but we'll use internal CI build system instead of GitHub Actions.
The added workflow has 2 jobs. One job applies a patch ( https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-aws-sdk-cpp/aws-sdk-cpp-pr-1333.patch ) in MSYS2 and another job builds aws-sdk-cpp as-is.
Both jobs do the followings:
cmake
I'll add review comments for details.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.