diff --git a/.gitmodules b/.gitmodules index ec150a4..ba87f5a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "aeron_driver-sys/aeron"] - path = aeron_driver-sys/aeron - url = https://github.com/real-logic/aeron +[submodule "aeron-driver-sys/aeron"] + path = aeron-driver-sys/aeron + url = https://github.com/real-logic/aeron.git diff --git a/.travis.yml b/.travis.yml index 9387eea..4cfc268 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,38 @@ language: rust -rust: - - stable -os: - - linux - - osx - - windows + +jobs: + include: + - rust: stable + os: linux + - rust: 1.34.0 + os: linux + - rust: stable + os: osx + - rust: stable-msvc + os: windows cache: - cargo before_script: - - rustup set profile minimal - - rustup update + - rustup show + # CMake doesn't like the `sh.exe` provided by Git being in PATH + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then rm "C:/Program Files/Git/usr/bin/sh.exe"; fi - rustup component add clippy - rustup component add rustfmt script: + - cargo clippy --all + - cargo fmt --all -- --check + - cargo test --no-run - cargo test - cargo test --release --no-run - cargo test --release - - cd aeron_driver-sys/ + - cd aeron-driver-sys/ - cargo test --features "static" - - cd .. - - cargo clippy --all - - cargo fmt --all -- --check - branches: only: - master diff --git a/Cargo.toml b/Cargo.toml index 31811c5..23cbb54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] members = [ - "aeron_driver-sys", + "aeron-driver-sys", "aeron-rs" ] diff --git a/aeron_driver-sys/.gitignore b/aeron-driver-sys/.gitignore similarity index 100% rename from aeron_driver-sys/.gitignore rename to aeron-driver-sys/.gitignore diff --git a/aeron_driver-sys/Cargo.toml b/aeron-driver-sys/Cargo.toml similarity index 81% rename from aeron_driver-sys/Cargo.toml rename to aeron-driver-sys/Cargo.toml index a3c2f78..eee96aa 100644 --- a/aeron_driver-sys/Cargo.toml +++ b/aeron-driver-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "aeron_driver-sys" -version = "0.1.0+1.22.0" +name = "aeron-driver-sys" +version = "1.0.0+1.25.0" authors = ["Bradlee Speice "] edition = "2018" links = "aeron_driver" diff --git a/aeron-driver-sys/aeron b/aeron-driver-sys/aeron new file mode 160000 index 0000000..977bda6 --- /dev/null +++ b/aeron-driver-sys/aeron @@ -0,0 +1 @@ +Subproject commit 977bda6f9e9ef3c5b502c8a8c741262147d7f464 diff --git a/aeron_driver-sys/bindings.h b/aeron-driver-sys/bindings.h similarity index 100% rename from aeron_driver-sys/bindings.h rename to aeron-driver-sys/bindings.h diff --git a/aeron_driver-sys/build.rs b/aeron-driver-sys/build.rs similarity index 93% rename from aeron_driver-sys/build.rs rename to aeron-driver-sys/build.rs index 451b4b2..0942e0b 100644 --- a/aeron_driver-sys/build.rs +++ b/aeron-driver-sys/build.rs @@ -93,12 +93,15 @@ pub fn main() { println!("cargo:include={}", header_path.display()); let bindings = bindgen::Builder::default() - .clang_arg(&format!("-I{}", header_path.display())) + .clang_arg(format!("-I{}", header_path.display())) .header("bindings.h") .whitelist_function("aeron_.*") .whitelist_type("aeron_.*") .whitelist_var("AERON_.*") .constified_enum_module("aeron_.*_enum") + // Some padding structures use arrays > 120 elements, + // so we can't derive Debug implementations + .derive_debug(false) .generate() .expect("Unable to generate aeron_driver bindings"); diff --git a/aeron_driver-sys/src/lib.rs b/aeron-driver-sys/src/lib.rs similarity index 88% rename from aeron_driver-sys/src/lib.rs rename to aeron-driver-sys/src/lib.rs index 2d82dff..7b4c8ae 100644 --- a/aeron_driver-sys/src/lib.rs +++ b/aeron-driver-sys/src/lib.rs @@ -13,7 +13,7 @@ mod tests { let minor = unsafe { crate::aeron_version_minor() }; let patch = unsafe { crate::aeron_version_patch() }; assert_eq!(major, 1); - assert_eq!(minor, 23); - assert_eq!(patch, 1); + assert_eq!(minor, 25); + assert_eq!(patch, 0); } } diff --git a/aeron-rs/Cargo.toml b/aeron-rs/Cargo.toml index 63ae711..3932017 100644 --- a/aeron-rs/Cargo.toml +++ b/aeron-rs/Cargo.toml @@ -12,7 +12,7 @@ travis-ci = { repository = "bspeice/aeron-rs", branch = "master" } maintenance = { status = "actively-developed" } [dependencies] -aeron_driver-sys = { path = "../aeron_driver-sys" } +aeron-driver-sys = { path = "../aeron-driver-sys" } memmap = "0.7" [dev-dependencies] diff --git a/aeron-rs/src/cnc_descriptor.rs b/aeron-rs/src/cnc_descriptor.rs index 400bdf0..cbec0ea 100644 --- a/aeron-rs/src/cnc_descriptor.rs +++ b/aeron-rs/src/cnc_descriptor.rs @@ -103,7 +103,8 @@ mod tests { .expect("Unable to memory map CnC file") }; - let metadata: &MetaDataDefinition = unsafe { &*(mmap.as_ptr().cast()) }; + let metadata: &MetaDataDefinition = + unsafe { &*(mmap.as_ptr() as *const MetaDataDefinition) }; assert_eq!(metadata.cnc_version, CNC_VERSION); } } diff --git a/aeron-rs/src/driver.rs b/aeron-rs/src/driver.rs index a616f0d..2a54e3a 100644 --- a/aeron-rs/src/driver.rs +++ b/aeron-rs/src/driver.rs @@ -190,12 +190,7 @@ mod tests { // cause an issue because the new media driver must wait for a heartbeat timeout. let driver_res = DriverContext::default().set_aeron_dir(&dir).build(); - // TODO: Why is the error message behavior different on Windows? - let expected_message = if cfg!(target_os = "windows") { - String::new() - } else { - format!("could not recreate aeron dir {}: ", dir.display()) - }; + let expected_message = format!("could not recreate aeron dir {}: ", dir.display()); assert!(driver_res.is_err()); assert_eq!( diff --git a/aeron_driver-sys/aeron b/aeron_driver-sys/aeron deleted file mode 160000 index 02c5015..0000000 --- a/aeron_driver-sys/aeron +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02c5015f2c72c232b9cd840ca4726dca7bfe0d0e