Skip to content
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

Streamer cannot compile using musl #28156

Closed
motoras opened this issue Sep 30, 2022 · 6 comments · Fixed by #29369
Closed

Streamer cannot compile using musl #28156

motoras opened this issue Sep 30, 2022 · 6 comments · Fixed by #29369
Labels
community Community contribution question Add this to close an issue with instructions on how to repost as a question on Stack Exchange

Comments

@motoras
Copy link

motoras commented Sep 30, 2022

Problem

Hi guys,
I was trying to compile solana with musl as target and I got the following error:

 --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-streamer-1.14.3/src/recvmmsg.rs:103:70
    |
103 |         unsafe { libc::recvmmsg(sock_fd, &mut hdrs[0], count as u32, MSG_WAITFORONE, &mut ts) };
    |                  --------------                                      ^^^^^^^^^^^^^^ expected `u32`, found `i32`
    |                  |
    |                  arguments to this function are incorrect
    |
note: function defined here
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.134/src/unix/linux_like/linux/musl/mod.rs:702:12
    |
702 |     pub fn recvmmsg(
    |            ^^^^^^^^
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
    |
103 |         unsafe { libc::recvmmsg(sock_fd, &mut hdrs[0], count as u32, MSG_WAITFORONE.try_into().unwrap(), &mut ts) };
    |                                                                                    ++++++++++++++++++++

I used the cargo command cargo build --release --target x86_64-unknown-linux-musl with rust rustc 1.63.0 (4b91a6ea7 2022-08-08) I needed to compile for musl, as I was planing to use solana from an aws lambda function written in rust(aws rust runtime requires to compile your rust function with musl).

@motoras motoras added the community Community contribution label Sep 30, 2022
@steveluscher steveluscher added the question Add this to close an issue with instructions on how to repost as a question on Stack Exchange label Oct 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

Hi @motoras,

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Solana itself.

Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with Solana itself, please post your question to the Solana Stack Exchange using this link: https://solana.stackexchange.com/questions/ask


This automated message is a result of having added the ‘question’ tag.

@github-actions github-actions bot closed this as completed Oct 7, 2022
@arb000r
Copy link

arb000r commented Nov 17, 2022

Did you manage to solve this? Having the same problem

@motoras
Copy link
Author

motoras commented Nov 17, 2022

No. I just avoided using musl, by using a more recent cargo lambda and compiling for arm.

@arb000r
Copy link

arb000r commented Nov 18, 2022

@steveluscher would it be possible to support MUSL rust by implementing the change to use .into() ?

@steveluscher
Copy link
Contributor

I don't know, but feel free to open an issue here, phrased as a feature request!

@billythedummy
Copy link
Contributor

think this is a rust libc issue: rust-lang/libc#2945 . Given their breaking change policy it'll probably take a while before the new versions of libc are release with this fixed. .try_into().unwrap() would probably work as a temporary workaround before then but idk if we should introduce this potential tech debt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution question Add this to close an issue with instructions on how to repost as a question on Stack Exchange
Projects
None yet
4 participants