Skip to content

Unable to compile against target i686-unknown-linux-musl #3800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wizzardx opened this issue Jun 19, 2022 · 1 comment · Fixed by #3802
Closed

Unable to compile against target i686-unknown-linux-musl #3800

wizzardx opened this issue Jun 19, 2022 · 1 comment · Fixed by #3802

Comments

@wizzardx
Copy link

wizzardx commented Jun 19, 2022

I'm using rustc 1.61.0, and RustPython on git devel (currently f84b289). I'm running on Debian Unstable, on an amd64.

Was prompted by the compile to install musl-related compile utilities, so I have these versions installed from the Debian Unstable repo:

  1. musl-dev 1.2.3-1
  2. musl-tools 1.2.3-1

This command works as demonstrated:

cargo run --release demo.py

This command fails during compilation:

cargo run --target=i686-unknown-linux-musl --release demo.py

The error is during this compile step:

Compiling rustpython-compiler v0.1.2 (/home/david/dev/misc/github/RustPython/compiler/porcelain)

And there are a bunch of warnings like this:

warning: use of deprecated type alias `libc::time_t`: This type is changed to 64-bit in musl 1.2.0, we'll follow that change in the future release. See #1848 for more info.
   --> vm/src/stdlib/time.rs:499:48
    |
499 |             tv_sec: time / (SEC_TO_NS as libc::time_t),

But the actual error which terminates the compilation is this:

error[E0063]: missing fields `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field in initializer of `sched_param`
   --> vm/src/stdlib/posix.rs:571:16
    |
571 |             Ok(libc::sched_param { sched_priority })
    |                ^^^^^^^^^^^^^^^^^ missing `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field

For more information about this error, try `rustc --explain E0063`.
warning: `rustpython-vm` (lib) generated 9 warnings

...

For further context / background:

What I'm attempting to do is to get a recent python version over on the really ancient debian4 environment, which is also running in a 32-bit environment. The python version shipping there is 2.4.

At the moment I'm attempting to find a more recent alternative. I've seen that basic rust "hello world" cross-compiles work. But most other languages and ecosystems I've tested, no longer target or compile that really ancient environment. Even go-lang binaries targeting linux 32-bit fail with runtime panics on the environment, probably due to needing underlying linux system calls to be present, even though there is no actual libc dependency and the target binary is static. Target platform linux version is 2.6.30-1-686, and gcc version is 4.1.1

@youknowone
Copy link
Member

We'd better to add musl build to CI to prevent this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants