Skip to content

Conversation

@XrXr
Copy link
Contributor

@XrXr XrXr commented Oct 8, 2025

I think one fewer runtime dependency is good. How about it?

  • capstone-rs: Remove runtime depdendency on libc

    • C types under core::ffi have been stable since 1.64.0
    • core::ffi::CStr was already in use, so we can use it instead
      of libc::strlen.

    Since libcore has everything we need, remove the dependency on the libc
    crate at runtime.

  • capstone-sys: Remove runtime dependency on libc
    C types under core::ffi have been stable since 1.64.0, below MSRV.

XrXr added 2 commits October 7, 2025 20:44
C types under `core::ffi` have been stable since 1.64.0, below MSRV.
* C types under `core::ffi` have been stable since 1.64.0
* `core::ffi::CStr` was already in use, so we can use it instead
  of `libc::strlen`.

Since libcore has everything we need, remove the dependency on the libc
crate at runtime.
@XrXr XrXr force-pushed the remove-libc-dep branch from 3eeb9e3 to b5550b2 Compare October 8, 2025 00:45
@XrXr XrXr changed the title Remove Remove runtime dependency on libc Oct 8, 2025
@jiegec
Copy link
Contributor

jiegec commented Oct 8, 2025

Good idea!

@jiegec jiegec requested a review from tmfink October 8, 2025 00:55
@tmfink
Copy link
Member

tmfink commented Oct 10, 2025

Thanks for the PR! I'll take a closer look.

I think you mean to say that you removed the "compile-time" dependency on the libc Rust crate.
It looks like this does not remove libc dependency from the workspace's Cargo.lock because of the criterion -> is-terminal -> libc dependency chain, but this is still a good improvement since it could still speed up builds a little for those depending on the our library.

@tmfink tmfink merged commit 4ed86fb into capstone-rust:master Oct 10, 2025
16 checks passed
@XrXr XrXr deleted the remove-libc-dep branch October 10, 2025 15:55
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

Successfully merging this pull request may close these issues.

3 participants