Skip to content
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

CI-mingw.yml: use pre-installed MinGW / also use lld and ccache for faster builds #4400

Merged
merged 5 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/CI-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,55 @@ permissions:

defaults:
run:
shell: cmd
shell: msys2 {0}

jobs:
build_mingw:
strategy:
matrix:
os: [windows-2019] # fails to download with "windows-2022"
arch: [x64] # TODO: fix x86 build?
# the MinGW installation in windows-2019 is supposed to be 8.1 but it is 12.2
# the MinGW installation in windows-2022 is not including all necessary packages by default, so just use the older image instead - package versions are he same
os: [windows-2019]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
platform: ${{ matrix.arch }}
release: false # use pre-installed
install: >-
mingw-w64-x86_64-lld
mingw-w64-x86_64-ccache

# MinGW will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
- name: Build all and run test
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}

- name: Build cppcheck
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking

- name: Build test
run: |
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking

- name: Run test
run: |
mingw32-make VERBOSE=1 -j2 check
export PATH="/mingw64/lib/ccache/bin:$PATH"
# set RDYNAMIC to work around broken MinGW detection
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check
env:
LDFLAGS: -fuse-ld=lld # use lld for faster linking
3 changes: 3 additions & 0 deletions lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ bool CheckLeakAutoVar::checkScope(const Token * const startToken,
{
#if ASAN
static const nonneg int recursiveLimit = 300;
#elif defined(__MINGW32__)
// testrunner crashes with stack overflow in CI
static const nonneg int recursiveLimit = 600;
#else
static const nonneg int recursiveLimit = 1000;
#endif
Expand Down
3 changes: 3 additions & 0 deletions test/testleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,10 @@ class TestLeakAutoVarRecursiveCountLimit : public TestFixture {
}
};

#if !defined(__MINGW32__)
// TODO: this crashes with a stack overflow for MinGW in the CI
REGISTER_TEST(TestLeakAutoVarRecursiveCountLimit)
#endif

class TestLeakAutoVarStrcpy : public TestFixture {
public:
Expand Down
Loading