Skip to content

Commit

Permalink
rdkafka-sys: upgrade to librdkafka v1.4.2
Browse files Browse the repository at this point in the history
Also allow rdkafka and rdkafka-sys to be versioned independently by
making rdkafka-sys follow SemVer. This will fix future scenarios like
the one described in issue fede1024#211.
  • Loading branch information
benesch committed May 6, 2020
1 parent 7059333 commit 4c48d01
Show file tree
Hide file tree
Showing 13 changed files with 641 additions and 539 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["api-bindings"]
edition = "2018"

[dependencies]
rdkafka-sys = { path = "rdkafka-sys", version = "1.3.1", default-features = false }
rdkafka-sys = { path = "rdkafka-sys", version = "2.0.0", default-features = false }
futures = "0.3.0"
libc = "0.2.0"
log = "0.4.8"
Expand Down
16 changes: 16 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

See also the [rdkafka-sys changelog](rdkafka-sys/changelog.md).

<a name="0.24.0"></a>
## 0.24.0 (Unreleased)

* Decouple versioning of rdkafka-sys from rdkafka. rdkafka-sys now has its
own [changelog](rdkafka-sys/changelog.md) and will follow SemVer conventions.
([#211])

[#211]: https://github.com/fede1024/rust-rdkafka/issues/211

<a name="0.23.1"></a>
## 0.23.1 (2020-01-13)

* Fix build on docs.rs.

<a name="0.23.0"></a>
## 0.23.0 (2019-12-31)

Expand Down
2 changes: 1 addition & 1 deletion rdkafka-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rdkafka-sys"
version = "1.3.1"
version = "2.0.0+1.4.2"
authors = ["Federico Giraud <[email protected]>"]
build = "build.rs"
links = "rdkafka"
Expand Down
9 changes: 6 additions & 3 deletions rdkafka-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ cargo install bindgen

## Version

The rdkafka-sys version number is in the format `X.Y.Z-P`, where `X.Y.Z`
corresponds to the librdkafka version, and `P` indicates the version of the
rust bindings.
The rdkafka-sys version number is in the format `X.Y.Z+RX.RY.RZ`, where `X.Y.Z`
is the version of this crate and follows SemVer conventions, while `RX.RY.RZ`
is the version of the bundled librdkafka.

Note that versions before v2.0.0+1.4.2 did not follow this convention, and
instead directly corresponded to the bundled librdkafka version.

## Build

Expand Down
15 changes: 10 additions & 5 deletions rdkafka-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ where
}

fn main() {
let librdkafka_version = env!("CARGO_PKG_VERSION")
.split('-')
.next()
.expect("Crate version is not valid");

if env::var("DEP_OPENSSL_VENDORED").is_ok() {
let openssl_root = env::var("DEP_OPENSSL_ROOT").expect("DEP_OPENSSL_ROOT is not set");
env::set_var("CFLAGS", format!("-I{}/include", openssl_root));
Expand All @@ -51,6 +46,16 @@ fn main() {

if env::var("CARGO_FEATURE_DYNAMIC_LINKING").is_ok() {
eprintln!("librdkafka will be linked dynamically");

let librdkafka_version = match env!("CARGO_PKG_VERSION")
.split('+')
.collect::<Vec<_>>()
.as_slice()
{
[_rdsys_version, librdkafka_version] => *librdkafka_version,
_ => panic!("Version format is not valid"),
};

let pkg_probe = pkg_config::Config::new()
.cargo_metadata(true)
.atleast_version(librdkafka_version)
Expand Down
10 changes: 10 additions & 0 deletions rdkafka-sys/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

<a name="2.0.0+1.4.2"></a>
## v2.0.0+1.4.2 (Unreleased)

* Start separate changelog for rdkafka-sys.

* Upgrade to librdkafka v1.4.2.

* Correct several references to `usize` in the generated bindings to `size_t`.
2 changes: 1 addition & 1 deletion rdkafka-sys/librdkafka
Loading

0 comments on commit 4c48d01

Please sign in to comment.