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

Make cdylib opt-in on latest nightly #2770

Merged
merged 3 commits into from
Mar 3, 2022
Merged

Conversation

lqd
Copy link
Contributor

@lqd lqd commented Mar 1, 2022

The latest nightly includes rust-lang/cargo#10388, the fix for rust-lang/cargo#10356. This allows the cdylib to be built on the CLI rather than hyper having to set the crate-type in Cargo.toml, and allows it to participate in cargo's pipelining to improve build times.

This nightly is identified by rustup as nightly-2022-03-02, and cargo's version is cargo 1.61.0-nightly (3d6970d 2022-02-28)

I've tested rust's CI artifacts 6e5a6ffb14fc47051b0a23410c681ad6e4af045f (the PR updating cargo in rust), and nightly-2022-03-02, to build and test hyper with the new command: libhyper.so is built, and the client example successfully compiles.

Here are links to timings of hyper master on nightly, and this PR with cargo 6e5a6ffb14fc47051b0a23410c681ad6e4af045f (release build at j8). The pipelining is now active (and surprisingly effective here, a 29% improvement)

before
after

lqd added 3 commits March 1, 2022 11:33
Remove unconditional building of FFI libraries: now
that nightly supports --crate-type, it can be opted into.
This fixes cargo's pipelining both for dependencies and
for dependent crates, resulting in faster from-scratch builds.
Now that FFI is opt-in using cargo's --crate-type, nightly needs to be used
on CI: this flag is still unstable and requires a nightly to enable -Z unstable options.
Update the command to use `--crate-type`.
@lqd lqd marked this pull request as ready for review March 2, 2022 08:46
@seanmonstar
Copy link
Member

cc #2685

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect, thank you!

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.

None yet

2 participants