Conversation
…dependency Co-authored-by: ZR233 <34859362+ZR233@users.noreply.github.com>
armv7a-none-eabihf by making aarch64-cpu a target-conditional dependency
|
@copilot ci 中增加 armv7a-none-eabihf 编译测试 |
Co-authored-by: ZR233 <34859362+ZR233@users.noreply.github.com>
Done in 81c55a2. Added |
|
@copilot ci armv7 只 cargo build 测试,不进行clippy |
Co-authored-by: ZR233 <34859362+ZR233@users.noreply.github.com>
|
@copilot armv7 只验证 clippy build -p arm-gic-driver crate, 忽略测试 |
Co-authored-by: ZR233 <34859362+ZR233@users.noreply.github.com>
|
@copilot 修复至 cargo build -p arm-gic-driver --target armv7a-none-eabihf --all-features 可以通过 |
Co-authored-by: ZR233 <34859362+ZR233@users.noreply.github.com>
Fixed in dca795a. The root cause was that |
There was a problem hiding this comment.
Pull request overview
This PR aims to make the arm-gic-driver workspace compile for armv7a-none-eabihf by making AArch64-only code and dependencies conditional, and by expanding CI to include an armv7 build job.
Changes:
- Make
aarch64-cpua target-conditional dependency and gate AArch64-only modules/impls with#[cfg(target_arch = "aarch64")]. - Update the
v3module’s compilation gate and adjust documentation to reflect AArch64-only availability. - Extend CI matrix to include
armv7a-none-eabihf, with AArch64-only steps/tests gated accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| gic-driver/src/version/rdif.rs | Gate GICv3 rdif trait impls to avoid referencing v3 on non-aarch64. |
| gic-driver/src/version/mod.rs | Change v3 module cfg gate from pointer-width-based to target_arch = "aarch64". |
| gic-driver/src/sys_reg/mod.rs | Gate ich module and re-exports to AArch64 only. |
| gic-driver/src/lib.rs | Update crate-level docs to state v3 is AArch64-only. |
| gic-driver/Cargo.toml | Make aarch64-cpu a target-conditional dependency on AArch64. |
| .github/workflows/ci.yml | Add armv7a-none-eabihf to CI matrix; gate AArch64-only steps and use crate-scoped build for armv7. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| pub mod v2; | ||
| #[cfg(any(target_pointer_width = "64", doc))] | ||
| #[cfg(any(target_arch = "aarch64", doc))] |
There was a problem hiding this comment.
Changing the v3 gate from target_pointer_width = "64" to target_arch = "aarch64" means version::v3 no longer exists on non-aarch64 64-bit targets (e.g. x86_64). This breaks at least cargo test on such hosts because gic-driver/src/tests.rs imports version::v3::* unconditionally under cfg(test). It can also break cargo doc on non-aarch64 because cfg(doc) still enables v3 but aarch64-cpu is now a target-conditional dependency. Either (a) gate v3 (and the tests/docs) consistently so non-aarch64 builds don’t reference it, or (b) reconsider whether v3 really needs to be target_arch = "aarch64" rather than “any 64-bit target” for host-side compilation/testing.
| #[cfg(any(target_arch = "aarch64", doc))] | |
| #[cfg(target_arch = "aarch64")] |
| - name: Check rust version | ||
| run: rustc --version --verbose | ||
| - name: Check code format | ||
| run: cargo fmt --all -- --check |
There was a problem hiding this comment.
The matrix now runs the full job twice (one per target), so cargo fmt also runs twice even though it is target-independent. Consider gating the fmt step to a single matrix entry or splitting formatting into a separate non-matrix job to reduce CI time.
| run: cargo fmt --all -- --check | |
| run: cargo fmt --all -- --check | |
| if: ${{ matrix.targets == 'aarch64-unknown-none-softfloat' }} |
| - name: Build | ||
| run: cargo build --target aarch64-unknown-none-softfloat --all-features | ||
| run: cargo build --target ${{ matrix.targets }} --all-features | ||
| if: ${{ matrix.targets == 'aarch64-unknown-none-softfloat' }} | ||
| - name: Build | ||
| run: cargo build -p arm-gic-driver --target ${{ matrix.targets }} --all-features | ||
| if: ${{ matrix.targets == 'armv7a-none-eabihf' }} |
There was a problem hiding this comment.
There are two different build steps that both have the name "Build". Giving them distinct names (e.g., indicating the target) will make CI logs and failure triage clearer.
aarch64-cpua target-conditional dependency inCargo.tomlv3module gate totarget_arch = "aarch64"sys_reg/ichsubmodule with#[cfg(target_arch = "aarch64")]armv7a-none-eabihfto CI matrix targetsif: matrix.targets == 'aarch64-unknown-none-softfloat'cargo buildonlycargo build -p arm-gic-driverto scope to crate only (tests excluded)v3rdif trait impls with#[cfg(target_arch = "aarch64")]socargo build -p arm-gic-driver --target armv7a-none-eabihf --all-featurescompiles successfullyOriginal prompt
armv7a-none-eabihf#19🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.