Simplify code gen for functions that don't return a value #744
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lib | |
on: | |
pull_request: | |
push: | |
paths-ignore: | |
- '.github/ISSUE_TEMPLATE/**' | |
branches: | |
- master | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
lib_generation: | |
name: Check | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Fix environment | |
uses: ./.github/actions/fix-environment | |
- name: Build gnu libs | |
shell: cmd | |
run: | | |
set PATH=C:\msys64\mingw64\bin;%PATH% | |
cargo run -p tool_gnu -- all | |
- name: Build i686_msvc | |
shell: cmd | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" x86 | |
cargo run -p tool_msvc | |
- name: Build x86_64_msvc | |
shell: cmd | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64 | |
cargo run -p tool_msvc | |
- name: Build aarch64_msvc | |
shell: cmd | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" amd64_arm64 | |
cargo run -p tool_msvc | |
- name: Upload libs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libs | |
path: crates/targets/*/lib/* | |
- name: Check diff | |
shell: bash | |
run: | | |
git add -N . | |
git diff --exit-code crates/targets || (echo '::error::Generated target libs are out-of-date.'; exit 1) | |
- name: Check dumpbin | |
shell: pwsh | |
run: | | |
$VisualStudioRoot = & vswhere -latest -property installationPath -format value | |
$DumpbinPath = Resolve-Path "$VisualStudioRoot\VC\Tools\MSVC\*\bin\*\x86\dumpbin.exe" | | |
Select -ExpandProperty Path -First 1 | |
$Tests = @( | |
[Tuple]::Create("aarch64_msvc","AA64"), | |
[Tuple]::Create("x86_64_msvc","8664"), | |
[Tuple]::Create("i686_msvc","14C") | |
) | |
foreach($Test in $Tests) { | |
$Target = $Test.Item1 | |
$Magic = $Test.Item2 | |
$Output = [string](& $DumpbinPath /headers crates/targets/$Target/lib/windows.0.52.0.lib) | |
if($Output -match "Machine\s*: $Magic" -ne $True) { | |
Write-Error "Import lib check failed for $Target ($Magic)." | |
Exit 1 | |
} | |
} |