-
Notifications
You must be signed in to change notification settings - Fork 506
79 lines (68 loc) · 2.31 KB
/
lib.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: lib
on:
pull_request:
push:
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
branches:
- master
env:
RUSTFLAGS: -Dwarnings
jobs:
check:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
- 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@v4
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
}
}