File tree 4 files changed +17
-1
lines changed
4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ permissions:
14
14
15
15
env :
16
16
MSRV : 1.69.0
17
+ # Rust's Loongarch support merged in 1.71.0
18
+ MSRV_LOONGARCH : 1.71.0
17
19
RUSTFLAGS : -Dwarnings
18
20
19
21
jobs :
92
94
mips64el-unknown-linux-gnuabi64,
93
95
mipsel-unknown-linux-gnu,
94
96
powerpc64le-unknown-linux-gnu,
97
+ loongarch64-unknown-linux-gnu,
95
98
]
96
99
97
100
steps :
@@ -101,7 +104,8 @@ jobs:
101
104
- name : setup Rust
102
105
uses : dtolnay/rust-toolchain@master
103
106
with :
104
- toolchain : ' ${{ env.MSRV }}'
107
+ # Use a newer version rustc if the target is Loongarch, remove this workaround after MSRV is newer than 1.71.0
108
+ toolchain : " ${{ matrix.target == 'loongarch64-unknown-linux-gnu' && env.MSRV_LOONGARCH || env.MSRV }}"
105
109
components : clippy
106
110
107
111
# cross relies on docker or podman, GitHub Acton already has it installed.
Original file line number Diff line number Diff line change @@ -3,3 +3,6 @@ passthrough = [
3
3
" RUSTFLAGS" ,
4
4
" RUST_TEST_THREADS"
5
5
]
6
+
7
+ [target .loongarch64-unknown-linux-gnu ]
8
+ image = " ghcr.io/cross-rs/loongarch64-unknown-linux-gnu:edge"
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ The following targets are supported by `nix`:
85
85
<li>arm-unknown-linux-musleabi</li>
86
86
<li>armv7-linux-androideabi</li>
87
87
<li>i686-linux-android</li>
88
+ <li>loongarch64-unknown-linux-gnu</li>
88
89
<li>s390x-unknown-linux-gnu</li>
89
90
<li>x86_64-linux-android</li>
90
91
<li>x86_64-unknown-illumos</li>
Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ mod test_prctl {
99
99
prctl:: set_timerslack ( original) . unwrap ( ) ;
100
100
}
101
101
102
+ // Loongarch need to use a newer QEMU that disabled these PRCTL subcodes/methods.
103
+ // https://github.com/qemu/qemu/commit/220717a6f46a99031a5b1af964bbf4dec1310440
104
+ // So we should ignore them when testing in QEMU environments.
105
+ #[ cfg_attr( all( qemu, target_arch = "loongarch64" ) , ignore) ]
102
106
#[ test]
103
107
fn test_disable_enable_perf_events ( ) {
104
108
prctl:: task_perf_events_disable ( ) . unwrap ( ) ;
@@ -112,6 +116,10 @@ mod test_prctl {
112
116
assert ! ( no_new_privs) ;
113
117
}
114
118
119
+ // Loongarch need to use a newer QEMU that disabled these PRCTL subcodes/methods
120
+ // https://github.com/qemu/qemu/commit/220717a6f46a99031a5b1af964bbf4dec1310440
121
+ // So we should ignore them when testing in QEMU environments.
122
+ #[ cfg_attr( all( qemu, target_arch = "loongarch64" ) , ignore) ]
115
123
#[ test]
116
124
fn test_get_set_thp_disable ( ) {
117
125
let original = prctl:: get_thp_disable ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments