Skip to content

Commit

Permalink
ci: Use DbgHelp version to 10.0.18362.1.
Browse files Browse the repository at this point in the history
So that it works on Windows 7, as DbgHelp 10.0.19041.685 which is present
on GitHub Actions windows image does not work on Windows 7.

Fixes #55
  • Loading branch information
jrfonseca committed Apr 30, 2021
1 parent 5c8d860 commit 7f8a701
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/cache@v2
with:
path: downloads/*.7z
key: ${{ runner.os }}-${{ matrix.target }}-mingw-10.2.0
key: ${{ runner.os }}-${{ matrix.target }}-mingw-10.2.0-dbghelp-10.0.18362.1
- run: Get-Host | Select-Object Version
- run: python -m pip install gcovr codecov
- name: Build
Expand Down
35 changes: 27 additions & 8 deletions ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,25 @@ $MINGW_32_URL = 'https://sourceforge.net/projects/mingw-w64/files/Toolchains%20t
$MINGW_64_SUM = '5c3fc254494bc24eb201870f4b781d401cf7279bd03ea1aba6f2ffae771ded44'
$MINGW_32_SUM = '767fa9ed3d5b236aacca96e7e510d09af5f30ad37376a5258e5a875523ca45c3'

$DBGHELP_64_URL = 'https://drive.google.com/uc?export=download&id=1yPSATmwkmmgoGQRA2ot2EHLlocHWhFlA'
$DBGHELP_32_URL = 'https://drive.google.com/uc?export=download&id=1n60EvRKDKXaGCRLztwwiJacobgnuI-rb'
$DBGHELP_64_SUM = '9bdc77e09a9ebdc8f810c46ed2b1171c048d6ebbe1b9ea1f927bfac66220dae5'
$DBGHELP_32_SUM = 'dfdf39857b76533adb0bffd9ef9d1bc7516280f810ecea6dd5c1b5ca97809706'

#
# Download and extract MinGW-w64 toolchain
#
New-Item -ItemType Directory -Force -Path downloads | Out-Null
if ($target -eq 'mingw64') {
$MINGW_URL = $MINGW_64_URL
$MINGW_SUM = $MINGW_64_SUM
$DBGHELP_URL = $DBGHELP_64_URL
$DBGHELP_SUM = $DBGHELP_64_SUM
} else {
$MINGW_URL = $MINGW_32_URL
$MINGW_SUM = $MINGW_32_SUM
$DBGHELP_URL = $DBGHELP_32_URL
$DBGHELP_SUM = $DBGHELP_32_SUM
}
$MINGW_ARCHIVE = Split-Path -leaf $MINGW_URL
$MINGW_ARCHIVE = "downloads\$MINGW_ARCHIVE"
Expand All @@ -56,6 +65,21 @@ $Env:Path = "$toolchain\bin;$Env:Path"
(Get-Command 'g++.exe').Source
Exec { g++ --version }

$DBGHELP_ARCHIVE = 'downloads\dbghelp-$target.7z'
$DBGHELP_DIR = 'downloads\dbghelp\$target'
if (!(Test-Path $DBGHELP_DIR -PathType Container)) {
if (!(Test-Path $DBGHELP_ARCHIVE -PathType Leaf)) {
Invoke-WebRequest -Uri $DBGHELP_URL -OutFile $DBGHELP_ARCHIVE -UserAgent NativeHost
$hash = (Get-FileHash $DBGHELP_ARCHIVE -Algorithm SHA256).Hash
if ($hash -ne $DBGHELP_SUM) {
echo "error: ${DBGHELP_ARCHIVE}: wrong hash: ${hash}"
exit 1
}
}
Exec { 7z x -y "-o$DBGHELP_DIR" $DBGHELP_ARCHIVE | Out-Null }
}


#
# Setup environment
#
Expand All @@ -79,12 +103,7 @@ try {

Exec { cmake --version }

if ($target -eq 'mingw64') {
$WINDBG_DIR = "${Env:ProgramFiles(x86)}\Windows Kits\10\Debuggers\x64"
} else {
$WINDBG_DIR = "${Env:ProgramFiles(x86)}\Windows Kits\10\Debuggers\x86"
}
(Get-Item "$WINDBG_DIR\dbghelp.dll").VersionInfo.FileVersion
(Get-Item "$DBGHELP_DIR\dbghelp.dll").VersionInfo.FileVersion

#
# Configure
Expand All @@ -95,7 +114,7 @@ if ($Env:GITHUB_EVENT_NAME -eq "push" -And $Env:GITHUB_REF.StartsWith('refs/tags
$coverage = $false
}
$buildDir = "$buildRoot\$target"
Exec { cmake "-S." "-B$buildDir" -G $generator "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DENABLE_COVERAGE=$coverage" "-DWINDBG_DIR=$WINDBG_DIR" }
Exec { cmake "-S." "-B$buildDir" -G $generator "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DENABLE_COVERAGE=$coverage" "-DWINDBG_DIR=$DBGHELP_DIR" }

#
# Build
Expand All @@ -105,7 +124,7 @@ Exec { cmake --build $buildDir --use-stderr --target all }
#
# Test
#
$Env:Path = "$WINDBG_DIR;$Env:Path"
$Env:Path = "$DBGHELP_DIR;$Env:Path"
$Env:CTEST_OUTPUT_ON_FAILURE = '1'
Exec { cmake --build $buildDir --use-stderr --target test }

Expand Down

0 comments on commit 7f8a701

Please sign in to comment.