Skip to content

The binding.rs that is resolved in the upstream crate still causes failure in the downstream crate #2879

@xmh0511

Description

@xmh0511

Crate name

tun-rs

Build failure link

https://docs.rs/crate/tun-rs/2.5.5/builds/2364143/x86_64-apple-darwin.txt

Additional details

The upstream crate route_manager has adopted the following way to resolve the failure of building on doc.rs

#![allow(warnings)]
#[cfg(not(docsrs))]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[cfg(all(target_os = "freebsd", docsrs))]
include!("freebsd_bindings.rs");

#[cfg(all(target_os = "openbsd", docsrs))]
include!("openbsd_bindings.rs");

#[cfg(all(target_os = "macos", docsrs))]
include!("macos_bindings.rs");

It does work for route_manager itself, see https://docs.rs/crate/route_manager/0.2.3/builds/2364099/x86_64-apple-darwin.txt. However, the downstream crate tun-rs uses the route_manager; it still has a failure when building on doc.rs

[INFO] [stderr] error: couldn't read `/opt/rustwide/target/x86_64-apple-darwin/debug/build/route_manager-0a8d6cd0a193af04/out/bindings.rs`: No such file or directory (os error 2)
[INFO] [stderr]  --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/route_manager-0.2.3/src/unix_bsd/bind.rs:3:1
[INFO] [stderr]   |
[INFO] [stderr] 3 | include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
[INFO] [stderr]   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr] 

It looks like tun-rs don't pass docsrs to route_manager such that #[cfg(doscrs)] can work on the side of route_manager when building docs for tun-rs,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions