-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libc: Prepare for movement to crates.io #20606
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
#![crate_type = "rlib"] | ||
#![cfg_attr(not(feature = "cargo-build"), experimental)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe cfg_attr does anything at the crate level atm (#19372)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I fixed this bug awhile back, but I forget when:
$ cat foo.rs
#![cfg_attr(foo, experimental)]
$ cat bar.rs
#![deny(experimental)]
extern crate foo;
$ rustc foo.rs --cfg foo --crate-type lib && rustc bar.rs -L. --crate-type lib
bar.rs:3:1: 3:18 error: use of experimental item
bar.rs:3 extern crate foo;
^~~~~~~~~~~~~~~~~
bar.rs:1:9: 1:21 note: lint level defined here
bar.rs:1 #![deny(experimental)]
^~~~~~~~~~~~
error: aborting due to previous error
$ rustc foo.rs --crate-type lib && rustc bar.rs -L. --crate-type lib
$
LGTM. @brson? |
This commit prepares the liblibc library to be moved to crates.io. Unlike the log, serialize, term, etc crates, the source for this crate will *not* be duplicated out-of-tree. Instead a new rust-lang/libc repository will be created with a submodule to this repository and it will use the source directly. In order to compile within the stable ecosystem of Rust, this crate cannot link to libcore, and it also needs some tweaks for the other attributes that it has. As a result this commit tweaks the source of the crate to link to libcore when built in tree but link to libstd when built via cargo. Note that the rust-lang/libc crate isn't quite prepared just yet, there's a Cargo bug or two that I'd like to iron out before publishing it. This is simply preparing the in-tree source.
5fe1d51
to
01ce6ef
Compare
This commit prepares the liblibc library to be moved to crates.io. Unlike the log, serialize, term, etc crates, the source for this crate will *not* be duplicated out-of-tree. Instead a new rust-lang/libc repository will be created with a submodule to this repository and it will use the source directly. In order to compile within the stable ecosystem of Rust, this crate cannot link to libcore, and it also needs some tweaks for the other attributes that it has. As a result this commit tweaks the source of the crate to link to libcore when built in tree but link to libstd when built via cargo. Note that the rust-lang/libc crate isn't quite prepared just yet, there's a Cargo bug or two that I'd like to iron out before publishing it. This is simply preparing the in-tree source.
This commit prepares the liblibc library to be moved to crates.io. Unlike the
log, serialize, term, etc crates, the source for this crate will not be
duplicated out-of-tree. Instead a new rust-lang/libc repository will be created
with a submodule to this repository and it will use the source directly.
In order to compile within the stable ecosystem of Rust, this crate cannot link
to libcore, and it also needs some tweaks for the other attributes that it has.
As a result this commit tweaks the source of the crate to link to libcore when
built in tree but link to libstd when built via cargo.
Note that the rust-lang/libc crate isn't quite prepared just yet, there's a
Cargo bug or two that I'd like to iron out before publishing it. This is simply
preparing the in-tree source.