Skip to content

Commit 5f1cdf0

Browse files
committed
Update submodule and include tests for Windows Aarch64
1 parent 6618512 commit 5f1cdf0

File tree

5 files changed

+53
-27
lines changed

5 files changed

+53
-27
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,54 @@ 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+
- os: windows-latest
67+
name: Windows AARCH64
68+
target: aarch64-pc-windows-msvc
69+
cross: true
70+
test: true
71+
72+
# Disabled because u_int is undefined in freebsd headers
6673
# - os: ubuntu-latest
6774
# name: FreeBSD
6875
# target: x86_64-unknown-freebsd
6976
# cross: true
7077
# test: false
7178

72-
- target: aarch64-linux-android
73-
os: ubuntu-latest
79+
- os: ubuntu-latest
7480
name: Android
81+
target: aarch64-linux-android
7582
cross: true
7683
test: true
7784

78-
# - os: ubuntu-latest
79-
# name: OpenWrt
80-
# target: aarch64-unknown-linux-gnu
81-
# cross: true
82-
# test: true
83-
# cargo_args: --features "openwrt"
85+
- os: ubuntu-latest
86+
name: Linux AARCH64
87+
target: aarch64-unknown-linux-gnu
88+
cross: true
89+
test: true
8490

85-
# - target: armv7-unknown-linux-gnueabihf
86-
# os: ubuntu-latest
87-
# name: Linux ARMv7
88-
# cross: true
89-
# test: true
91+
- os: ubuntu-latest
92+
name: Linux ARMv7
93+
target: armv7-unknown-linux-gnueabihf
94+
cross: true
95+
test: true
9096

9197
steps:
9298
- name: Checkout
@@ -100,19 +106,35 @@ jobs:
100106
targets: ${{ matrix.target }}
101107

102108
- name: Install cross
103-
run: cargo install cross
109+
# Install the latest from-source version because the ancient
110+
# v0.2.5 release (>2 years old) doesn't seem to recognize the
111+
# aarch64-pc-windows-msvc target as needing the docker image to
112+
# cross-compile and run tests on.
113+
run: cargo install cross --git https://github.com/cross-rs/cross
104114
if: ${{ matrix.cross }}
105115

116+
- name: Build aarch64-pc-windows-msvc Docker image
117+
# https://github.com/cross-rs/cross-toolchains/issues/32
118+
if: ${{ matrix.target == 'aarch64-pc-windows-msvc' }}
119+
run: |
120+
# https://github.com/cross-rs/cross/pull/1672
121+
git clone https://github.com/cross-rs/cross --recurse-submodules --revision 359863badc32b9b2995d304b8ef74a36a426488f
122+
cd cross
123+
# cargo xtask configure-crosstool ${{ matrix.target }}
124+
cargo build-docker-image --platform windows/amd64 ${{ matrix.target }}-cross --tag local
125+
106126
- name: Build
107-
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }} ${{ matrix.cargo_args }}
127+
run: ${{ env.PROGRAM }} build --target=${{ matrix.target }}
108128

109129
- name: Test
110-
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }} ${{ matrix.cargo_args }}
130+
run: ${{ env.PROGRAM }} test --target=${{ matrix.target }}
111131
if: ${{ matrix.test }}
112132

113133
- name: Run example
134+
if: ${{ !matrix.cross }}
114135
run: cargo run --example info
115136
- uses: actions/upload-artifact@v4
137+
if: ${{ !matrix.cross }}
116138
with:
117139
name: info-${{ matrix.target }}
118-
path: info.txt
140+
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)