Skip to content

Commit 97cdb61

Browse files
committed
Update submodule and include tests for Windows Aarch64
1 parent 6618512 commit 97cdb61

File tree

5 files changed

+61
-27
lines changed

5 files changed

+61
-27
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,62 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
include:
48-
- target: x86_64-unknown-linux-gnu
49-
os: ubuntu-latest
50-
name: Linux
48+
- os: ubuntu-latest
49+
name: Linux AMD64
50+
target: x86_64-unknown-linux-gnu
5151
cross: false
5252
test: true
5353

54-
- target: x86_64-apple-darwin
55-
os: macos-latest
54+
- os: macos-latest
5655
name: macOS
56+
target: x86_64-apple-darwin
5757
cross: false
5858
test: true
5959

6060
- os: windows-latest
61-
name: Windows
61+
name: Windows AMD64
6262
target: x86_64-pc-windows-msvc
6363
cross: false
6464
test: true
6565

66+
# Build on Linux because:
67+
# 1. cargo-cross doesn't ship MSRV images;
68+
# 2. Manually building this image with cross-toolchain instructions
69+
# results in a failure because `docker buildx build --platform ...`
70+
# doesn't recognize `--platform`, though the printed help text
71+
# indicates that it has no clue what `buildx` is in the first place
72+
# (not installed on GitHub runner-images?).
73+
- os: ubuntu-latest
74+
name: Windows AARCH64
75+
target: aarch64-pc-windows-msvc
76+
cross: true
77+
test: true
78+
# test: false # cargo-cross fails to do what it says on the tin: Run this in Docker+Qemu...
79+
80+
# Disabled because u_int is undefined in freebsd headers
6681
# - os: ubuntu-latest
6782
# name: FreeBSD
6883
# target: x86_64-unknown-freebsd
6984
# cross: true
7085
# test: false
7186

72-
- target: aarch64-linux-android
73-
os: ubuntu-latest
87+
- os: ubuntu-latest
7488
name: Android
89+
target: aarch64-linux-android
7590
cross: true
7691
test: true
7792

78-
# - os: ubuntu-latest
79-
# name: OpenWrt
80-
# target: aarch64-unknown-linux-gnu
81-
# cross: true
82-
# test: true
83-
# cargo_args: --features "openwrt"
93+
- os: ubuntu-latest
94+
name: Linux AARCH64
95+
target: aarch64-unknown-linux-gnu
96+
cross: true
97+
test: true
8498

85-
# - target: armv7-unknown-linux-gnueabihf
86-
# os: ubuntu-latest
87-
# name: Linux ARMv7
88-
# cross: true
89-
# test: true
99+
- os: ubuntu-latest
100+
name: Linux ARMv7
101+
target: armv7-unknown-linux-gnueabihf
102+
cross: true
103+
test: true
90104

91105
steps:
92106
- name: Checkout
@@ -100,19 +114,35 @@ jobs:
100114
targets: ${{ matrix.target }}
101115

102116
- name: Install cross
103-
run: cargo install cross
117+
# Install the latest from-source version because the ancient
118+
# v0.2.5 release (>2 years old) doesn't seem to recognize the
119+
# aarch64-pc-windows-msvc target as needing the docker image to
120+
# cross-compile and run tests on.
121+
run: cargo install cross --git https://github.com/cross-rs/cross
104122
if: ${{ matrix.cross }}
105123

124+
- name: Build aarch64-pc-windows-msvc Docker image
125+
# https://github.com/cross-rs/cross-toolchains/issues/32
126+
if: ${{ matrix.target == 'aarch64-pc-windows-msvc' }}
127+
run: |
128+
# https://github.com/cross-rs/cross/pull/1672
129+
git clone https://github.com/cross-rs/cross --recurse-submodules --revision 359863badc32b9b2995d304b8ef74a36a426488f
130+
cd cross
131+
cargo xtask configure-crosstool ${{ matrix.target }}
132+
cargo build-docker-image --platform windows/amd64 ${{ matrix.target }}-cross --tag local
133+
106134
- name: Build
107-
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }} ${{ matrix.cargo_args }}
135+
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }}
108136

109137
- name: Test
110-
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }} ${{ matrix.cargo_args }}
138+
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }}
111139
if: ${{ matrix.test }}
112140

113141
- name: Run example
142+
if: ${{ !matrix.cross }}
114143
run: cargo run --example info
115144
- uses: actions/upload-artifact@v4
145+
if: ${{ !matrix.cross }}
116146
with:
117147
name: info-${{ matrix.target }}
118-
path: info.txt
148+
path: info.txt

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/target
22
/Cargo.lock
3-
/info.txt
3+
/info.txt

Cross.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[target.aarch64-linux-android]
22
# Workaround for https://github.com/cross-rs/cross/issues/1128
33
# and https://github.com/rust-lang/rust/issues/103673
4-
image = "ghcr.io/cross-rs/aarch64-linux-android:edge"
4+
image = "ghcr.io/cross-rs/aarch64-linux-android:edge"
5+
6+
[target.aarch64-pc-windows-msvc]
7+
# Cannot be hosted, must be built locally: https://github.com/cross-rs/cross-toolchains/issues/32
8+
image = "ghcr.io/cross-rs/aarch64-pc-windows-msvc-cross:local"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cpuinfo-rs title
1+
# cpuinfo-rs
22

33
[![Actions Status](https://github.com/Traverse-Research/cpuinfo-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/Traverse-Research/cpuinfo-rs/actions)
44
[![Latest version](https://img.shields.io/crates/v/cpuinfo-rs.svg?logo=rust)](https://crates.io/crates/cpuinfo-rs)

0 commit comments

Comments
 (0)