Skip to content
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

Merged
merged 1 commit into from
Jan 7, 2015

Conversation

alexcrichton
Copy link
Member

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.

@rust-highfive
Copy link
Collaborator

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon

#![crate_type = "rlib"]
#![cfg_attr(not(feature = "cargo-build"), experimental)]
Copy link
Member

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)

Copy link
Member Author

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      
$

@aturon
Copy link
Member

aturon commented Jan 6, 2015

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.
bors added a commit that referenced this pull request Jan 7, 2015
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.
@bors bors merged commit 01ce6ef into rust-lang:master Jan 7, 2015
@alexcrichton alexcrichton deleted the stabilize-libc branch January 20, 2015 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants