Skip to content

Commit 119913b

Browse files
authored
Merge pull request RustPython#3802 from youknowone/fix-musl
disable schedparam from musl
2 parents 589363a + 4b59c08 commit 119913b

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ jobs:
8989
with:
9090
target: i686-unknown-linux-gnu
9191

92-
- name: Install gcc-multilib
93-
run: sudo apt-get update && sudo apt-get install gcc-multilib
92+
- name: Install gcc-multilib and musl-tools
93+
run: sudo apt-get update && sudo apt-get install gcc-multilib musl-tools
9494
- name: Check compilation for x86 32bit
9595
uses: actions-rs/cargo@v1
9696
with:
@@ -107,6 +107,16 @@ jobs:
107107
command: check
108108
args: --target aarch64-linux-android
109109

110+
- uses: actions-rs/toolchain@v1
111+
with:
112+
target: i686-unknown-linux-musl
113+
114+
- name: Check compilation for musl
115+
uses: actions-rs/cargo@v1
116+
with:
117+
command: check
118+
args: --target i686-unknown-linux-musl
119+
110120
- uses: actions-rs/toolchain@v1
111121
with:
112122
target: wasm32-unknown-unknown

vm/src/stdlib/posix.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ pub mod module {
556556
target_os = "freebsd",
557557
target_os = "android"
558558
))]
559+
#[cfg(not(target_env = "musl"))]
559560
fn try_to_libc(&self, vm: &VirtualMachine) -> PyResult<libc::sched_param> {
560561
use crate::AsObject;
561562
let priority_class = self.sched_priority.class();
@@ -625,6 +626,7 @@ pub mod module {
625626
target_os = "freebsd",
626627
target_os = "android"
627628
))]
629+
#[cfg(not(target_env = "musl"))]
628630
#[pyfunction]
629631
fn sched_setscheduler(args: SchedSetschedulerArgs, vm: &VirtualMachine) -> PyResult<i32> {
630632
let libc_sched_param = args.sched_param_obj.try_to_libc(vm)?;
@@ -675,6 +677,7 @@ pub mod module {
675677
target_os = "freebsd",
676678
target_os = "android"
677679
))]
680+
#[cfg(not(target_env = "musl"))]
678681
#[pyfunction]
679682
fn sched_setparam(args: SchedSetParamArgs, vm: &VirtualMachine) -> PyResult<i32> {
680683
let libc_sched_param = args.sched_param_obj.try_to_libc(vm)?;

0 commit comments

Comments
 (0)