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

[hyper] Actually compile the C API #4678

Merged
merged 6 commits into from
Mar 24, 2022
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions H/hyper/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
using BinaryBuilder

name = "hyper"
version = v"0.14.17"
version = v"0.14.18"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://github.com/hyperium/hyper/archive/refs/tags/v$(version).tar.gz",
"64420fd550f43af09b0722b3504d4fd919de642d63f01ad54108aa854f5f5470"),
"6095636d02ea5af3ff5f06d80b9466f7b58ba76339f39813b33c3f24c663fdef"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/hyper*/
cargo build --release
sed '21 a [lib]\ncrate-type=["cdylib"]\n' -i Cargo.toml
Copy link
Member

Choose a reason for hiding this comment

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

Isn't there a way to enable building of the library without having to edit the file manually? Also, this sed script doesn't seem very sustainable as it hardcodes a line number, probability it'll bit-rot at some point is very high.

Copy link
Member

Choose a reason for hiding this comment

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

hyperium/hyper@1c66370 seems to suggest you can use --crate-type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would require a nightly version of rust. Do we have that available in the environment?

Copy link
Member

Choose a reason for hiding this comment

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

No 🤦 Why do they do this? 😩

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, we can switch back to v0.14.17 if the sed script appears ugly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think they made the decision because the C API is unstable, so it is supposed to be used with nightly instead of stable rust.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's rollback to 0.14.7 and update once we have a new Rust toolchain with this capability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

RUSTFLAGS="--cfg hyper_unstable_ffi" cargo build --release --features client,http1,http2,ffi
install -Dm 755 target/${rust_target}/release/*hyper.${dlext} "${libdir}/libhyper.${dlext}"
"""

Expand Down