How to specify a private repository for one library like libc?

The issue can be reproduced with the offical git repo when build it for x86_64:

$ git clone https://github.com/rust-lang/rust.git

$ git clone https://github.com/rust-lang/libc.git

$ cd rust

$ # edit Cargo.toml in rust to contain this line in field [patch.crates-io]:

libc = {path = “…/libc” }

$ ./x.py build

Then the erros appear:

error: the feature cfg_target_vendor has been stable since 1.33.0 and no longer requires an attribute to enable –> /home/bpang/rust_ref/libc/src/lib.rs:22:13 | 22 | feature(cfg_target_vendor, link_cfg, no_core) | ^^^^^^^^^^^^^^^^^ | = note: -D stable-features implied by -D warnings

error: unused attribute –> /home/bpang/rust_ref/libc/src/lib.rs:27:1 | 27 | #![no_std] | ^^^^^^^^^^ | = note: -D unused-attributes implied by -D warnings

error: crate-level attribute should be in the root module –> /home/bpang/rust_ref/libc/src/lib.rs:27:1 | 27 | #![no_std] | ^^^^^^^^^^

error: aborting due to 3 previous errors

1 Like