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

sysinfo build failing with latest libc v0.2.165 #1392

Closed
lalitb opened this issue Nov 26, 2024 · 11 comments · Fixed by #1393
Closed

sysinfo build failing with latest libc v0.2.165 #1392

lalitb opened this issue Nov 26, 2024 · 11 comments · Fixed by #1393
Labels

Comments

@lalitb
Copy link

lalitb commented Nov 26, 2024

Error in our CI - https://github.com/open-telemetry/opentelemetry-rust/actions/runs/12021048084/job/33510807110?pr=2342

   Compiling sysinfo v0.30.13
error[E0599]: no method named `len` found for type `i8` in the current scope
   --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.30.13/src/unix/apple/macos/process.rs:436:53
    |
436 |         Some(node.vip_path.len() * node.vip_path[0].len()),
    |                                                     ^^^
    |
help: there is a method `le` with a similar name, but with different arguments
   --> /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/cmp.rs:1196:5

For more information about this error, try `rustc --explain E0599`.
error: could not compile `sysinfo` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

This worked fine with libc v0.2.164 - https://github.com/open-telemetry/opentelemetry-rust/actions/runs/12017744786/job/33500761123?pr=2339

@lalitb
Copy link
Author

lalitb commented Nov 26, 2024

Just to add - also tested with latest sysinfo v0.32.0, and still the same error.

@jonthn
Copy link

jonthn commented Nov 26, 2024

Maybe it's due to rust-lang/libc@f4bbbc8

diff --git i/src/unix/apple/macos/process.rs w/src/unix/apple/macos/process.rs
index 08a33dd..7783681 100644
--- i/src/unix/apple/macos/process.rs
+++ w/src/unix/apple/macos/process.rs
@@ -433,7 +433,7 @@ unsafe fn convert_node_path_info(node: &libc::vnode_info_path) -> Option<PathBuf
     }
     cstr_to_rust_with_size(
         node.vip_path.as_ptr() as _,
-        Some(node.vip_path.len() * node.vip_path[0].len()),
+        Some(node.vip_path.len() * node.vip_path.len()),
     )
     .map(PathBuf::from)
 }

@alice-i-cecile
Copy link

Bevy users seem to be hitting this too.

   Compiling sysinfo v0.31.4
error[E0599]: no method named `len` found for type `i8` in the current scope
    --> /Users/wentao/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.31.4/src/unix/apple/macos/process.rs:432:53
     |
432  |         Some(node.vip_path.len() * node.vip_path[0].len()),
     |                                                     ^^^
     |
help: there is a method `le` with a similar name, but with different arguments
    --> /Users/wentao/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:1196:5
     |
1196 |     fn le(&self, other: &Rhs) -> bool {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@yuchenlin
Copy link

yuchenlin commented Nov 26, 2024

got the same issue with libc 0.2.162~164

@Millione
Copy link

Volo users is hitting this too.

error[E0599]: no method named `len` found for type `i8` in the current scope
    --> /Users/roger/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/sysinfo-0.32.0/src/unix/apple/macos/process.rs:436:53
     |
436  |         Some(node.vip_path.len() * node.vip_path[0].len()),
     |                                                     ^^^
     |
help: there is a method `le` with a similar name, but with different arguments
    --> /Users/roger/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:1353:5
     |
1353 |     fn le(&self, other: &Rhs) -> bool {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@GuillaumeGomez
Copy link
Owner

Published 0.32.1 version.

matthme added a commit to holochain/hc-spin-rust-utils that referenced this issue Nov 26, 2024
@workingjubilee
Copy link

yanking the broken libc version ASAP

@emostov
Copy link

emostov commented Nov 26, 2024

Just in case it quickly helps anyone landing here, you can pin libc to the previous version

 cargo update -p [email protected] --precise 0.2.164`

@ultamatt
Copy link

FYI bumping into this myself right now. Thanks to everyone who's on the hunt to resolve this.

Adding my error from my pipeline in case it assists. Running on a macos-12 runner

error: failed to select a version for the requirement `libc = "^0.2.165"`
candidate versions found which didn't match: 0.2.164, 0.2.163, 0.2.162, ...
location searched: crates.io index
required by package `sysinfo v0.32.1`
    ... which satisfies dependency `sysinfo = "^0.32.1"` of package `ditty v0.2.9 (/Users/runner/work/ditty/ditty/src-tauri)`
       Error failed to build app: failed to build app
error Command failed with exit code 1.

@tgross35
Copy link

libc 0.2.165 was yanked, 0.2.166 just released with a fix for this https://github.com/rust-lang/libc/releases/tag/0.2.166

@Noratrieb
Copy link

Thanks for taking swift action to fix that mistake in libc! And for everyone else here: please complain to libc next time instead of just silently patching around the bug :)

chenrui333 added a commit to chenrui333/pipelight that referenced this issue Dec 21, 2024
relates to GuillaumeGomez/sysinfo#1392

error build log

```
error[E0599]: no method named `len` found for type `i8` in the current scope
   --> /Users/rui/Library/Caches/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.31.4/src/unix/apple/macos/process.rs:432:53
    |
432 |         Some(node.vip_path.len() * node.vip_path[0].len()),
    |                                                     ^^^
    |
help: there is a method `le` with a similar name, but with different arguments
   --> /private/tmp/rust-20241128-8064-v5d6qj/rustc-1.83.0-src/library/core/src/cmp.rs:1353:5
```

Signed-off-by: Rui Chen <[email protected]>
chenrui333 added a commit to chenrui333/pipelight that referenced this issue Dec 21, 2024
relates to GuillaumeGomez/sysinfo#1392

error build log

```
error[E0599]: no method named `len` found for type `i8` in the current scope
   --> /Users/rui/Library/Caches/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.31.4/src/unix/apple/macos/process.rs:432:53
    |
432 |         Some(node.vip_path.len() * node.vip_path[0].len()),
    |                                                     ^^^
    |
help: there is a method `le` with a similar name, but with different arguments
   --> /private/tmp/rust-20241128-8064-v5d6qj/rustc-1.83.0-src/library/core/src/cmp.rs:1353:5
```

Signed-off-by: Rui Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet