rustls / rustls/rustls-ffi

Replace libc dependency with core::ffi::*

Open
#377 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
170
Forks
43
Avg merge
1d 1h
Merged PRs (30d)
10

Description

Presently rustls-ffi takes a dependency on the libc crate for the following imports:

  • size_t
  • c_void
  • c_char
  • c_uint
  • c_int
  • EINVAL
  • EIO

It looks like the core::ffi module has many of these same defines, and could potentially let us drop an external dependency.

Blockers:

I propose we wait for c_size_t to stablize and then replace libc with core::ffi::* and manually defined EINVAL/EIO.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by reviewing rustls-ffi's current libc imports and the stabilization status of core::ffi::c_size_t. Check how platform-gated EINVAL and EIO constants would be defined, and confirm libc can be removed without changing the FFI types or error behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.