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

Can't build socket2 with musl using this github action. #1

Open
iddm opened this issue Sep 14, 2021 · 0 comments
Open

Can't build socket2 with musl using this github action. #1

iddm opened this issue Sep 14, 2021 · 0 comments

Comments

@iddm
Copy link

iddm commented Sep 14, 2021

Mentioning rust-lang/socket2#264 explicitly.

I am using the github action the way it is described in the marketplace:

      - name: Build static
        uses: stevenleadbeater/rust-musl-builder@master
        with:
            args: /bin/bash -c "cargo build --locked --release --target=x86_64-unknown-linux-musl -v"

However, it leads to build errors:

Running `rustc --crate-name socket2 --edition=2018 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=aa246bf64056a547 -C extra-filename=-aa246bf64056a547 --out-dir /github/workspace/target/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/github/workspace/target/x86_64-unknown-linux-musl/release/deps -L dependency=/github/workspace/target/release/deps --extern libc=/github/workspace/target/x86_64-unknown-linux-musl/release/deps/liblibc-d416f6c85e8305e1.rmeta --cap-lints allow`
error: attributes are not yet allowed on `if` expressions
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.1/src/sys/unix.rs:878:5
    |
878 |     #[cfg(not(any(target_os = "haiku", target_os = "openbsd")))]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `match` is not allowed in a `const fn`
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.1/src/lib.rs:156:9
    |
156 | /         match address {
157 | |             SocketAddr::V4(_) => Domain::IPV4,
158 | |             SocketAddr::V6(_) => Domain::IPV6,
159 | |         }
    | |_________^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/49146

error[E0599]: no associated item named `MAX` found for type `i32` in the current scope
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.1/src/sys/unix.rs:763:46
    |
763 |     msg.msg_iovlen = min(bufs.len(), IovLen::MAX as usize) as IovLen;
    |                                              ^^^ associated item not found in `i32`

error[E0599]: no associated item named `MAX` found for type `i32` in the current scope
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.1/src/sys/unix.rs:823:46
    |
823 |     msg.msg_iovlen = min(bufs.len(), IovLen::MAX as usize) as IovLen;
    |                                              ^^^ associated item not found in `i32`

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0599, E0658.
For more information about an error, try `rustc --explain E0599`.
error: could not compile `socket2`.

How to fix this? I suspect the docker image hasn't been update for quite a while and so this action is outdated and uses old cargo/rustc versions.

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

No branches or pull requests

1 participant