Add unistd safe rules#259
Merged
Merged
Conversation
nunoplopes
reviewed
Jul 16, 2026
|
|
||
| [dependencies] | ||
| libc = "0.2" | ||
| nix = { version = "0.30.1", features = ["socket", "net", "fs", "poll", "time", "user", "dir", "term", "event", "hostname"] } |
Contributor
There was a problem hiding this comment.
is this dependency needed here?
nunoplopes
reviewed
Jul 16, 2026
| libcc2rs = { version = "0.1.0", path = "../libcc2rs" } | ||
| brotli-sys = "0.3" | ||
| rustls-ffi = { version = "0.15.3", default-features = false } | ||
| nix = { version = "0.30.1", features = ["socket", "net", "fs", "poll", "time", "user", "dir", "term", "event", "hostname"] } |
nunoplopes
reviewed
Jul 16, 2026
| [dependencies] | ||
| libcc2rs-macros = { path = "../libcc2rs-macros", version = "0.1.0" } | ||
| libc = "0.2" | ||
| nix = { version = "0.30.1", features = ["socket", "net", "fs", "poll", "time", "user", "dir", "term", "event", "hostname"] } |
Contributor
There was a problem hiding this comment.
I meant this one is not needed
Contributor
Author
There was a problem hiding this comment.
Both libcc2rs and libc-dep depend on libc. Adding nix to libc-dep pulls libc with extra traits. This creates a mismatch between the libc version that libcc2rs uses and the one that libc-dep uses.
To unify the libc versions from libcc2rs and libc-dep, I added nix as a dependency in libcc2rs as well.
Without this, weird errors like the following one appear:
error[E0308]: mismatched types
--> main.rs:40:30
|
40 | assert!(((((libc::fileno(libcc2rs::stderr_unsafe())) == (2)) as i32) != 0));
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `FILE`, found `libc::unix::FILE`
| |
| arguments to this function are incorrect
|
note: there are multiple different versions of crate `libc` in the dependency graph
--> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.186/src/macros.rs:259:9
|
259 | pub enum $i { }
| --------------- this is the found type
|
::: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.186/src/macros.rs:259:9
|
259 | pub enum $i { }
| ^^^^^^^^^^^^^^^ this is the expected type
|
::: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.186/src/unix/mod.rs:596:1
|
596 | / extern_ty! {
597 | | pub enum FILE {}
598 | | }
| |_- in this macro invocation
= help: you can use `cargo tree` to explore your dependency tree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.