Skip to content

Missing SO_INCOMING_CPU compiling with armv7-unknown-linux-musleabi #213

Description

@zonyitoo
Compiling socket2 v0.3.19
Running `rustc --crate-name socket2 --edition=2018 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.19/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C codegen-units=1 -C metadata=9516879405a31528 -C extra-filename=-9516879405a31528 --out-dir /tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps --target armv7-unknown-linux-musleabi -C linker=armv6-linux-musleabi-gcc -L dependency=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps -L dependency=/tmp/cargo-installQyepjN/release/deps --extern cfg_if=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps/libcfg_if-a21588f9f01fd146.rmeta --extern libc=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps/liblibc-2305531b0b6bff17.rmeta --cap-lints allow -C relocation-model=pic -C prefer-dynamic=off -C target-feature=+crt-static,-vfp2,-vfp3`
Compiling socket2 v0.4.0
Running `rustc --crate-name socket2 --edition=2018 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="all"' -C metadata=4b78b189cd4beac3 -C extra-filename=-4b78b189cd4beac3 --out-dir /tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps --target armv7-unknown-linux-musleabi -C linker=armv6-linux-musleabi-gcc -L dependency=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps -L dependency=/tmp/cargo-installQyepjN/release/deps --extern libc=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps/liblibc-2305531b0b6bff17.rmeta --cap-lints allow -C relocation-model=pic -C prefer-dynamic=off -C target-feature=+crt-static,-vfp2,-vfp3`
error[E0425]: cannot find value `SO_INCOMING_CPU` in crate `libc` --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/sys/unix.rs:1201:69 | 1201 | getsockopt::<c_int>(self.inner, libc::SOL_SOCKET, libc::SO_INCOMING_CPU) | ^^^^^^^^^^^^^^^ not found in `libc`
error[E0425]: cannot find value `SO_INCOMING_CPU` in crate `libc` --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/sys/unix.rs:1217:23 | 1217 | libc::SO_INCOMING_CPU, | ^^^^^^^^^^^^^^^ not found in `libc`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0425`.
error: could not compile `socket2` Caused by:
process didn't exit successfully: `rustc --crate-name socket2 --edition=2018 /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="all"' -C metadata=4b78b189cd4beac3 -C extra-filename=-4b78b189cd4beac3 --out-dir /tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps --target armv7-unknown-linux-musleabi -C linker=armv6-linux-musleabi-gcc -L dependency=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps -L dependency=/tmp/cargo-installQyepjN/release/deps --extern libc=/tmp/cargo-installQyepjN/armv7-unknown-linux-musleabi/release/deps/liblibc-2305531b0b6bff17.rmeta --cap-lints allow -C relocation-model=pic -C prefer-dynamic=off -C target-feature=+crt-static,-vfp2,-vfp3` (exit code: 1) warning: build failed, waiting for other jobs to finish...
error

This was originally found in shadowsocks/shadowsocks-rust#459 .

Activity

  1. added a commit that references this issue on Mar 17, 2021
    801487e
  2. zonyitoo commented on Mar 17, 2021

    @zonyitoo
    Author

    Changed in libc is already merged. Consider fixed the lowest libc version in the next release.

  3. Thomasdezeeuw commented on Mar 17, 2021

    @Thomasdezeeuw
    Collaborator

    Thanks for finding and solving the problem @zonyitoo.

  4. oherrala commented on Mar 19, 2021

    @oherrala
    Contributor

    Sorry to borrow this issue, but I found out aarch64-unknown-linux-musl and x86_64-unknown-linux-musl targets are also broken the same way and made a pull request to libc crate to get SO_INCOMING_CPU implemented there.

    PR: rust-lang/libc#2119

  5. added a commit that references this issue on Mar 22, 2021
  6. fbecart commented on Mar 26, 2021

    @fbecart

    Until the next version of libc is released, is there a known workaround, such as pinning a specific version of libc or socket2?

  7. Thomasdezeeuw commented on Mar 26, 2021

    @Thomasdezeeuw
    Collaborator

    @fbecart can you run cargo update, updating the libc crate? That should resolve this issue.

  8. fbecart commented on Mar 26, 2021

    @fbecart

    Thank you @Thomasdezeeuw for pointing me in the right direction. I realize the problem is currently fixed for a specific set of architectures only. I'm building for i686-unknown-linux-musl, for which an issue likely still exists. I'll redirect my attention to libc.

  9. added 2 commits that reference this issue on Mar 26, 2021
  10. zonyitoo commented on Mar 31, 2021

    @zonyitoo
    Author

    There are still many architectures missing SO_INCOMING_CPU in the libc crate. Could @Thomasdezeeuw make sure that all Linux-like platforms have this definition in libc?

  11. zonyitoo commented on Mar 31, 2021

    @zonyitoo
    Author

    I am not sure that target-env = "uclibc" has SO_INCOMING_CPU definition. It is left for others to make patches. :)

  12. Thomasdezeeuw commented on Mar 31, 2021

    @Thomasdezeeuw
    Collaborator

    I think this issue is really with libc, not with socket2.

  13. added 2 commits that reference this issue on Apr 1, 2021
  14. JinAirsOs commented on Apr 2, 2021

    @JinAirsOs

    I meet this issue too.

    error[E0425]: cannot find value `SO_INCOMING_CPU` in crate `libc`
        --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/sys/unix.rs:1201:69
         |
    1201 |             getsockopt::<c_int>(self.inner, libc::SOL_SOCKET, libc::SO_INCOMING_CPU)
         |                                                                     ^^^^^^^^^^^^^^^ not found in `libc`
    
    error[E0425]: cannot find value `SO_INCOMING_CPU` in crate `libc`
        --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.4.0/src/sys/unix.rs:1217:23
         |
    1217 |                 libc::SO_INCOMING_CPU,
         |                       ^^^^^^^^^^^^^^^ not found in `libc`
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0425`.
    error: could not compile `socket2`
    
    To learn more, run the command again with --verbose.
    
  15. JinAirsOs commented on Apr 2, 2021

    @JinAirsOs

    how to work around?

  16. Thomasdezeeuw commented on Apr 2, 2021

    @Thomasdezeeuw
    Collaborator

    @JinAirsOs you can disable the all feature for now to work around it. Otherwise I think rust-lang/libc#2135 would fix this issue.

  17. added 8 commits that reference this issue on Apr 2, 2021
  18. added a commit that references this issue on Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions