Replace libc dependency with core::ffi::*

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

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.

Dominant language
Rust
Stars
171
Forks
45
Avg merge
16h 43m
Merged PRs (30d)
18

Getting set up

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.

More from rustls/rustls-ffi

All issues in rustls/rustls-ffi

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.