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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-03-05 15:18:58 +00:00
Родитель 5f9d2acd17
Коммит 669bc06ddd
4 изменённых файлов: 23 добавлений и 19 удалений

10
Cargo.lock сгенерированный
Просмотреть файл

@ -1,3 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]] [[package]]
name = "Inflector" name = "Inflector"
version = "0.11.2" version = "0.11.2"
@ -108,7 +110,7 @@ name = "audioipc-client"
version = "0.4.0" version = "0.4.0"
dependencies = [ dependencies = [
"audioipc 0.2.4", "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)", "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 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)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -677,7 +679,7 @@ dependencies = [
[[package]] [[package]]
name = "cubeb-backend" name = "cubeb-backend"
version = "0.5.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "cubeb-core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -696,7 +698,7 @@ dependencies = [
name = "cubeb-pulse" name = "cubeb-pulse"
version = "0.2.0" version = "0.2.0"
dependencies = [ 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 0.2.0",
"pulse-ffi 0.1.0", "pulse-ffi 0.1.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3353,7 +3355,7 @@ dependencies = [
"checksum cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b6557bdb1dc9647eae1cf7f5601b14cd45fc3c7ccf2df618387416fe542da6ea" "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 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 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-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 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 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f593353cad5af2df6d54810de2b61aa8acba5b5fbc70b0d75e7cc5bdd80aca73"

Просмотреть файл

@ -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"} {"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"}

2
third_party/rust/cubeb-backend/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package] [package]
name = "cubeb-backend" name = "cubeb-backend"
version = "0.5.0" version = "0.5.1"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"] authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n" description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n"
homepage = "https://github.com/djg/cubeb-rs" homepage = "https://github.com/djg/cubeb-rs"

28
third_party/rust/cubeb-backend/src/log.rs поставляемый
Просмотреть файл

@ -9,36 +9,36 @@ macro_rules! cubeb_log_internal {
#[allow(unused_unsafe)] #[allow(unused_unsafe)]
unsafe { unsafe {
if $level <= $crate::ffi::g_cubeb_log_level.into() { if $level <= $crate::ffi::g_cubeb_log_level.into() {
if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback { cubeb_log_internal!(__INTERNAL__ $msg);
let cstr = ::std::ffi::CString::new(concat!("%s:%d: ", $msg, "\n")).unwrap();
log_callback(cstr.as_ptr(), file!(), line!());
}
} }
} }
}; };
($level: expr, $fmt: expr, $($arg:tt)+) => { ($level: expr, $fmt: expr, $($arg: expr),+) => {
#[allow(unused_unsafe)] #[allow(unused_unsafe)]
unsafe { unsafe {
if $level <= $crate::ffi::g_cubeb_log_level.into() { if $level <= $crate::ffi::g_cubeb_log_level.into() {
if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback { cubeb_log_internal!(__INTERNAL__ format!($fmt, $($arg),*));
let cstr = ::std::ffi::CString::new(concat!("%s:%d: ", $fmt, "\n")).unwrap();
log_callback(cstr.as_ptr(), file!(), line!(), $($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_export]
macro_rules! cubeb_logv { macro_rules! cubeb_logv {
($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Verbose, $msg)); ($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_export]
macro_rules! cubeb_log { macro_rules! cubeb_log {
($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Normal, $msg)); ($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)] #[cfg(test)]
@ -46,12 +46,14 @@ mod tests {
#[test] #[test]
fn test_normal_logging() { fn test_normal_logging() {
cubeb_log!("This is log at normal level"); 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] #[test]
fn test_verbose_logging() { fn test_verbose_logging() {
cubeb_logv!("This is a log at verbose level"); 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);
} }
} }