Bug 1532645 - Update cubeb-backend to workaround a Rust bug. r=froydnj
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 05 Mar 2019 15:18:58 +0000
changeset 520288 9286348b9c33218e956417ce8675851ddbccaeaa
parent 520287 2b3c223c6e3ed5235501f8c0eb4636396f74eb92
child 520289 ef5481e83972a6844beb356e488283b9cf69f3f8
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1532645, 58881
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1532645 - Update cubeb-backend to workaround a Rust bug. r=froydnj https://github.com/rust-lang/rust/issues/58881 doesn't repro with cubeb-backend v5.0.1, so use that so that other Rust nightly users don't get their builds busted. Differential Revision: https://phabricator.services.mozilla.com/D22092
Cargo.lock
third_party/rust/cubeb-backend/.cargo-checksum.json
third_party/rust/cubeb-backend/Cargo.toml
third_party/rust/cubeb-backend/src/log.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,9 +1,11 @@
-[[package]]
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
 name = "Inflector"
 version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -103,17 +105,17 @@ dependencies = [
  "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "audioipc-client"
 version = "0.4.0"
 dependencies = [
  "audioipc 0.2.4",
- "cubeb-backend 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -672,17 +674,17 @@ name = "cubeb"
 version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "cubeb-backend"
-version = "0.5.0"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "cubeb-core"
 version = "0.5.1"
@@ -691,17 +693,17 @@ dependencies = [
  "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "cubeb-pulse"
 version = "0.2.0"
 dependencies = [
- "cubeb-backend 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "pulse 0.2.0",
  "pulse-ffi 0.1.0",
  "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "cubeb-sys"
 version = "0.5.1"
@@ -3348,17 +3350,17 @@ dependencies = [
 "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
 "checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b"
 "checksum crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "41ee4864f4797060e52044376f7d107429ce1fb43460021b126424b7180ee21a"
 "checksum cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "730363a45c4e248d4f21d3e5c1156d1a9cdec0855056c0d9539e814bc59865c3"
 "checksum cssparser-macros 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a5383ae18dbfdeb569ed62019f5bddb2a95cd2d3833313c475a0d014777805"
 "checksum cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea"
 "checksum cstr-macros 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0472c17c83d3ec1af32fb6ee2b3ad56ae0b6e69355d63d1d30602055c34324a8"
 "checksum cubeb 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8a3502aafa1bf95c524f65d2ba46d8741700c6a8a9543ea52c6da3d8b69a2896"
-"checksum cubeb-backend 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcac95519416d9ec814db2dc40e6293e7da25b906023d93f48b87f0587ab138"
+"checksum cubeb-backend 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0432a0d08c3f9a778a2b0b6214c87ec2eb17e8639eb68baf0686bdafc4fd11f1"
 "checksum cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37f7b20f757a4e4b6aa28863236551bff77682dc6db192eba15af615492b5445"
 "checksum cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "653b9e245d35dbe2a2da7c4586275cee75ff656ddeb02d4a73b4afdfa6d67502"
 "checksum darling 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f593353cad5af2df6d54810de2b61aa8acba5b5fbc70b0d75e7cc5bdd80aca73"
 "checksum darling_core 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "168c246e87e727d58575d9b4595491010627f0cdc910e3e6ea3b36db2b9a9d9a"
 "checksum darling_macro 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "99c4eff4bcbeaf6a22578012ff79c95910338668278d1901e528bd34a22f575d"
 "checksum derive_more 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f57d78cf3bd45270dad4e70c21ec77a960b36c7a841ff9db76aaa775a8fb871"
 "checksum devd-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7c9ac481c38baf400d3b732e4a06850dfaa491d1b6379a249d9d40d14c2434c"
 "checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a"
--- a/third_party/rust/cubeb-backend/.cargo-checksum.json
+++ b/third_party/rust/cubeb-backend/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"4bae03732c4f490b3c7dbc07d2eabccf5d0f6b5ab2c1c74d592cc7609c9d8d8e","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"300e76bd3901de540b21a2cfc8d15dbcd1b2940d5fbb517fc5fe568af2ec2775","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"af1d787754706e34d6b8f4ac88aa89078ae9a16970b168ad8dc17cc4180688c2","src/ops.rs":"55cbf9bdccdd854834eba72e8bde3e59a9a4193e65209769a1a6e0d8a320b8f6","src/traits.rs":"1a6e3401bb25088d355041704bd89099d62b51eda94da177e7e860646c52b955","tests/test_capi.rs":"9d949cbdb1c19e229ce4f652999a058c283cf7d5a882a669dbca08b71ac2fb62"},"package":"fdcac95519416d9ec814db2dc40e6293e7da25b906023d93f48b87f0587ab138"}
\ No newline at end of file
+{"files":{"Cargo.toml":"5009330f8a03fc0cf4b10540514496db0281bb92541f9850217c5de7d12dc8b7","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"300e76bd3901de540b21a2cfc8d15dbcd1b2940d5fbb517fc5fe568af2ec2775","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/ops.rs":"55cbf9bdccdd854834eba72e8bde3e59a9a4193e65209769a1a6e0d8a320b8f6","src/traits.rs":"1a6e3401bb25088d355041704bd89099d62b51eda94da177e7e860646c52b955","tests/test_capi.rs":"9d949cbdb1c19e229ce4f652999a058c283cf7d5a882a669dbca08b71ac2fb62"},"package":"0432a0d08c3f9a778a2b0b6214c87ec2eb17e8639eb68baf0686bdafc4fd11f1"}
\ No newline at end of file
--- a/third_party/rust/cubeb-backend/Cargo.toml
+++ b/third_party/rust/cubeb-backend/Cargo.toml
@@ -7,17 +7,17 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "cubeb-backend"
-version = "0.5.0"
+version = "0.5.1"
 authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
 description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n"
 homepage = "https://github.com/djg/cubeb-rs"
 keywords = ["cubeb"]
 categories = ["api-bindings"]
 license = "ISC"
 repository = "https://github.com/djg/cubeb-rs"
 [dependencies.cubeb-core]
--- a/third_party/rust/cubeb-backend/src/log.rs
+++ b/third_party/rust/cubeb-backend/src/log.rs
@@ -4,54 +4,56 @@
 // accompanying file LICENSE for details.
 
 #[macro_export]
 macro_rules! cubeb_log_internal {
     ($level: expr, $msg: expr) => {
         #[allow(unused_unsafe)]
         unsafe {
             if $level <= $crate::ffi::g_cubeb_log_level.into() {
-                if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback {
-                    let cstr = ::std::ffi::CString::new(concat!("%s:%d: ", $msg, "\n")).unwrap();
-                    log_callback(cstr.as_ptr(), file!(), line!());
-                }
+                cubeb_log_internal!(__INTERNAL__ $msg);
             }
         }
     };
-    ($level: expr, $fmt: expr, $($arg:tt)+) => {
+    ($level: expr, $fmt: expr, $($arg: expr),+) => {
         #[allow(unused_unsafe)]
         unsafe {
             if $level <= $crate::ffi::g_cubeb_log_level.into() {
-                if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback {
-                    let cstr = ::std::ffi::CString::new(concat!("%s:%d: ", $fmt, "\n")).unwrap();
-                    log_callback(cstr.as_ptr(), file!(), line!(), $($arg)+);
-                }
+                cubeb_log_internal!(__INTERNAL__ format!($fmt, $($arg),*));
             }
         }
+    };
+    (__INTERNAL__ $msg: expr) => {
+        if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback {
+            let cstr = ::std::ffi::CString::new(format!("{}:{}: {}\n", file!(), line!(), $msg)).unwrap();
+            log_callback(cstr.as_ptr());
+        }
     }
 }
 
 #[macro_export]
 macro_rules! cubeb_logv {
     ($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Verbose, $msg));
-    ($fmt: expr, $($arg: tt)+) => (cubeb_log_internal!($crate::LogLevel::Verbose, $fmt, $($arg)*));
+    ($fmt: expr, $($arg: expr),+) => (cubeb_log_internal!($crate::LogLevel::Verbose, $fmt, $($arg),*));
 }
 
 #[macro_export]
 macro_rules! cubeb_log {
     ($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Normal, $msg));
-    ($fmt: expr, $($arg: tt)+) => (cubeb_log_internal!($crate::LogLevel::Normal, $fmt, $($arg)*));
+    ($fmt: expr, $($arg: expr),+) => (cubeb_log_internal!($crate::LogLevel::Normal, $fmt, $($arg),*));
 }
 
 #[cfg(test)]
 mod tests {
     #[test]
     fn test_normal_logging() {
         cubeb_log!("This is log at normal level");
-        cubeb_log!("Formatted log %d", 1);
+        cubeb_log!("{} Formatted log", 1);
+        cubeb_log!("{} Formatted {} log {}", 1, 2, 3);
     }
 
     #[test]
     fn test_verbose_logging() {
         cubeb_logv!("This is a log at verbose level");
-        cubeb_logv!("Formatted log %d", 1);
+        cubeb_logv!("{} Formatted log", 1);
+        cubeb_logv!("{} Formatted {} log {}", 1, 2, 3);
     }
 }