Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Streamer cannot compile using musl #28156

@motoras

Description

@motoras

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.1485827954.workers.dev-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.1485827954.workers.dev-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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityCommunity contributionquestionAdd this to close an issue with instructions on how to repost as a question on Stack Exchange

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions