Skip to content

Commit 57d2fb6

Browse files
authored
build: Update dependencies (#183)
1 parent b657c15 commit 57d2fb6

File tree

18 files changed

+125
-91
lines changed

18 files changed

+125
-91
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ matrix:
2828

2929
# Minimum Rust
3030
- env: SUITE=checkfast
31-
rust: "1.36.0"
31+
rust: "1.40.0"
3232
- env: SUITE=testfast
33-
rust: "1.36.0"
33+
rust: "1.40.0"
3434

3535
# Build Docs
3636
- env: SUITE=travis-push-docs

Cargo.toml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ autoexamples = true
1818
all-features = true
1919

2020
[features]
21-
default = ["with_client_implementation", "with_default_transport", "with_panic", "with_failure", "with_log", "with_env_logger", "with_device_info", "with_rust_info", "with_native_tls"]
21+
default = ["with_client_implementation", "with_default_transport", "with_panic", "with_failure", "with_device_info", "with_rust_info"]
2222
with_reqwest_transport = ["reqwest", "httpdate", "with_client_implementation"]
2323
with_curl_transport = ["curl", "httpdate", "serde_json", "with_client_implementation"]
24-
with_default_transport = ["with_reqwest_transport"]
25-
with_client_implementation = ["im", "url", "with_backtrace"]
24+
with_default_transport = ["with_reqwest_transport", "with_native_tls"]
25+
with_client_implementation = ["im", "url", "with_backtrace", "rand"]
2626
with_backtrace = ["backtrace", "regex"]
2727
with_panic = ["with_backtrace"]
2828
with_failure = ["failure", "with_backtrace"]
@@ -32,49 +32,53 @@ with_env_logger = ["with_log", "env_logger"]
3232
with_error_chain = ["error-chain", "with_backtrace"]
3333
with_device_info = ["libc", "hostname", "uname", "with_client_implementation"]
3434
with_rust_info = ["rustc_version", "with_client_implementation"]
35-
with_debug_meta = ["findshlibs", "goblin", "memmap", "with_client_implementation"]
35+
with_debug_meta = ["findshlibs", "with_client_implementation"]
3636
with_test_support = []
3737
with_rustls = ["reqwest/rustls-tls"]
3838
with_native_tls = ["reqwest/default-tls"]
3939

4040
[dependencies]
41-
backtrace = { version = "0.3.15", optional = true }
42-
url = { version = "1.7.2", optional = true }
43-
failure = { version = "0.1.5", optional = true }
44-
log = { version = "0.4.6", optional = true, features = ["std"] }
45-
sentry-types = "0.11.0"
46-
env_logger = { version = "0.6.1", optional = true }
47-
reqwest = { version = "0.9.15", optional = true, default-features = false }
48-
lazy_static = "1.3.0"
49-
regex = { version = "1.1.6", optional = true }
50-
error-chain = { version = "0.12.0", optional = true }
51-
im = { version = "13.0.0", optional = true }
52-
libc = { version = "0.2.51", optional = true }
41+
backtrace = { version = "0.3.44", optional = true }
42+
url = { version = "2.1.1", optional = true }
43+
failure = { version = "0.1.6", optional = true }
44+
log = { version = "0.4.8", optional = true, features = ["std"] }
45+
sentry-types = "0.14.1"
46+
env_logger = { version = "0.7.1", optional = true }
47+
reqwest = { version = "0.10.1", optional = true, features = ["blocking", "json"], default-features = false }
48+
lazy_static = "1.4.0"
49+
regex = { version = "1.3.4", optional = true }
50+
error-chain = { version = "0.12.1", optional = true }
51+
im = { version = "14.2.0", optional = true }
52+
libc = { version = "0.2.66", optional = true }
5353
hostname = { version = "0.3.0", optional = true }
5454
findshlibs = { version = "0.5.0", optional = true }
55-
rand = "0.7.3"
55+
rand = { version = "0.7.3", optional = true }
5656
httpdate = { version = "0.3.2", optional = true }
57-
curl = { version = "0.4.21", optional = true }
58-
serde_json = { version = "1.0.39", optional = true }
57+
curl = { version = "0.4.25", optional = true }
58+
serde_json = { version = "1.0.48", optional = true }
5959

6060
[target."cfg(not(windows))".dependencies]
6161
uname = { version = "0.1.1", optional = true }
6262

63-
[target."cfg(unix)".dependencies]
64-
goblin = { version = "0.0.22", default-features = false, features = ["elf32", "elf64", "endian_fd", "std"], optional = true }
65-
memmap = { version = "0.7.0", optional = true }
66-
6763
[build-dependencies]
6864
rustc_version = { version = "0.2.3", optional = true }
6965

7066
[dev-dependencies]
71-
failure_derive = "0.1.5"
72-
pretty_env_logger = "0.3.0"
67+
failure_derive = "0.1.6"
68+
pretty_env_logger = "0.4.0"
7369
actix-web = { version = "0.7.19", default-features = false }
7470

7571
[[example]]
7672
name = "error-chain-demo"
7773
required-features = ["with_error_chain"]
7874

75+
[[example]]
76+
name = "log-demo"
77+
required-features = ["with_env_logger"]
78+
79+
[[example]]
80+
name = "thread-demo"
81+
required-features = ["with_env_logger"]
82+
7983
[workspace]
8084
members = [".", "integrations/sentry-actix"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ We currently only verify this crate against a recent version of Sentry hosted on
2525
[sentry.io](https://sentry.io/) but it should work with on-prem Sentry versions
2626
8.20 and later.
2727

28-
Additionally, the lowest Rust version we target is _1.36.0_.
28+
Additionally, the lowest Rust version we target is _1.40.0_.
2929

3030
## Resources
3131

build.rs

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@ fn main() {
1717
#[cfg(feature = "with_rust_info")]
1818
{
1919
use rustc_version::{version, version_meta, Channel};
20-
write!(
20+
writeln!(
2121
f,
22-
"/// The rustc version that was used to compile this crate\n"
22+
"/// The rustc version that was used to compile this crate"
2323
)
2424
.ok();
2525
if let Ok(version) = version() {
26-
write!(f, "#[allow(dead_code)] pub const RUSTC_VERSION: Option<&'static str> = Some(\"{}\");\n", version).ok();
26+
writeln!(
27+
f,
28+
"#[allow(dead_code)] pub const RUSTC_VERSION: Option<&'static str> = Some(\"{}\");",
29+
version
30+
)
31+
.ok();
2732
} else {
28-
write!(
33+
writeln!(
2934
f,
30-
"#[allow(dead_code)] pub const RUSTC_VERSION: Option<&'static str> = None;\n"
35+
"#[allow(dead_code)] pub const RUSTC_VERSION: Option<&'static str> = None;"
3136
)
3237
.ok();
3338
}
@@ -38,30 +43,35 @@ fn main() {
3843
Channel::Beta => "beta",
3944
Channel::Stable => "stable",
4045
};
41-
write!(f, "#[allow(dead_code)] pub const RUSTC_CHANNEL: Option<&'static str> = Some(\"{}\");\n", chan).ok();
46+
writeln!(
47+
f,
48+
"#[allow(dead_code)] pub const RUSTC_CHANNEL: Option<&'static str> = Some(\"{}\");",
49+
chan
50+
)
51+
.ok();
4252
} else {
43-
write!(
53+
writeln!(
4454
f,
45-
"#[allow(dead_code)] pub const RUSTC_CHANNEL: Option<&'static str> = None;\n"
55+
"#[allow(dead_code)] pub const RUSTC_CHANNEL: Option<&'static str> = None;"
4656
)
4757
.ok();
4858
}
4959
}
5060

51-
write!(f, "/// The platform identifier\n").ok();
52-
write!(
61+
writeln!(f, "/// The platform identifier").ok();
62+
writeln!(
5363
f,
54-
"#[allow(dead_code)] pub const PLATFORM: &str = \"{}\";\n",
64+
"#[allow(dead_code)] pub const PLATFORM: &str = \"{}\";",
5565
platform
5666
)
5767
.ok();
58-
write!(f, "/// The CPU architecture identifier\n").ok();
59-
write!(
68+
writeln!(f, "/// The CPU architecture identifier").ok();
69+
writeln!(
6070
f,
61-
"#[allow(dead_code)] pub const ARCH: &str = \"{}\";\n",
71+
"#[allow(dead_code)] pub const ARCH: &str = \"{}\";",
6272
arch
6373
)
6474
.ok();
65-
println!("cargo:rerun-if-changed=build.rs\n");
66-
println!("cargo:rerun-if-changed=Cargo.toml\n");
75+
println!("cargo:rerun-if-changed=build.rs");
76+
println!("cargo:rerun-if-changed=Cargo.toml");
6777
}

integrations/sentry-actix/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We currently only verify this crate against a recent version of Sentry hosted on
1818
[sentry.io](https://sentry.io/) but it should work with on-prem Sentry versions
1919
8.20 and later.
2020

21-
Additionally, the lowest Rust version we target is _1.36.0_.
21+
Additionally, the lowest Rust version we target is _1.40.0_.
2222

2323
## Resources
2424

integrations/sentry-actix/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
//! To get the request specific one you need to use the `ActixWebHubExt` trait:
4242
//!
4343
//! ```
44-
//! # extern crate sentry;
45-
//! # extern crate sentry_actix;
46-
//! # extern crate actix_web;
4744
//! # fn test(req: &actix_web::HttpRequest) {
4845
//! use sentry::{Hub, Level};
4946
//! use sentry_actix::ActixWebHubExt;
@@ -56,9 +53,6 @@
5653
//! The hub can also be made current:
5754
//!
5855
//! ```
59-
//! # extern crate sentry;
60-
//! # extern crate sentry_actix;
61-
//! # extern crate actix_web;
6256
//! # fn test(req: &actix_web::HttpRequest) {
6357
//! use sentry::{Hub, Level};
6458
//! use sentry_actix::ActixWebHubExt;

src/backtrace_support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn demangle_symbol(s: &str) -> String {
116116
#[allow(unused)]
117117
pub fn error_typename<D: fmt::Debug>(error: D) -> String {
118118
format!("{:?}", error)
119-
.split(&['(', '{'][..])
119+
.split(&[' ', '(', '{', '\r', '\n'][..])
120120
.next()
121121
.unwrap()
122122
.trim()

src/client.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use regex::Regex;
1212
use crate::backtrace_support::{function_starts_with, is_sys_function, trim_stacktrace};
1313
use crate::constants::{SDK_INFO, USER_AGENT};
1414
use crate::hub::Hub;
15-
use crate::internals::{Dsn, DsnParseError, Uuid};
15+
use crate::internals::{Dsn, ParseDsnError, Uuid};
1616
use crate::protocol::{Breadcrumb, DebugMeta, Event};
1717
use crate::scope::Scope;
1818
use crate::transport::{DefaultTransportFactory, Transport, TransportFactory};
@@ -236,7 +236,7 @@ fn parse_crate_name(func_name: &str) -> Option<String> {
236236
/// null values result in no DSN being parsed.
237237
pub trait IntoDsn {
238238
/// Converts the value into a `Result<Option<Dsn>, E>`.
239-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError>;
239+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError>;
240240
}
241241

242242
impl<T: Into<ClientOptions>> From<T> for Client {
@@ -262,7 +262,7 @@ impl<T: IntoDsn> From<T> for ClientOptions {
262262
}
263263

264264
impl<I: IntoDsn> IntoDsn for Option<I> {
265-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
265+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
266266
match self {
267267
Some(into_dsn) => into_dsn.into_dsn(),
268268
None => Ok(None),
@@ -271,13 +271,13 @@ impl<I: IntoDsn> IntoDsn for Option<I> {
271271
}
272272

273273
impl IntoDsn for () {
274-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
274+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
275275
Ok(None)
276276
}
277277
}
278278

279279
impl<'a> IntoDsn for &'a str {
280-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
280+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
281281
if self.is_empty() {
282282
Ok(None)
283283
} else {
@@ -287,38 +287,38 @@ impl<'a> IntoDsn for &'a str {
287287
}
288288

289289
impl<'a> IntoDsn for Cow<'a, str> {
290-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
290+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
291291
let x: &str = &self;
292292
x.into_dsn()
293293
}
294294
}
295295

296296
impl<'a> IntoDsn for &'a OsStr {
297-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
297+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
298298
self.to_string_lossy().into_dsn()
299299
}
300300
}
301301

302302
impl IntoDsn for OsString {
303-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
303+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
304304
self.as_os_str().into_dsn()
305305
}
306306
}
307307

308308
impl IntoDsn for String {
309-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
309+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
310310
self.as_str().into_dsn()
311311
}
312312
}
313313

314314
impl<'a> IntoDsn for &'a Dsn {
315-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
315+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
316316
Ok(Some(self.clone()))
317317
}
318318
}
319319

320320
impl IntoDsn for Dsn {
321-
fn into_dsn(self) -> Result<Option<Dsn>, DsnParseError> {
321+
fn into_dsn(self) -> Result<Option<Dsn>, ParseDsnError> {
322322
Ok(Some(self))
323323
}
324324
}

src/integrations/env_logger.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//! from `env_logger` and pass `None` as logger:
99
//!
1010
//! ```no_run
11-
//! # extern crate sentry;
1211
//! sentry::integrations::env_logger::init(None, Default::default());
1312
//! ```
1413
//!
@@ -17,10 +16,8 @@
1716
//! accordingly:
1817
//!
1918
//! ```no_run
20-
//! # extern crate sentry;
21-
//! # extern crate pretty_env_logger;
2219
//! let mut log_builder = pretty_env_logger::formatted_builder();
23-
//! log_builder.parse("info,foo=debug");
20+
//! log_builder.parse_filters("info,foo=debug");
2421
//! sentry::integrations::env_logger::init(Some(log_builder.build()), Default::default());
2522
//! ```
2623
use crate::integrations::log::{self as sentry_log, LoggerOptions};

src/integrations/failure.rs

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
//! # Example
1111
//!
1212
//! ```no_run
13-
//! # extern crate sentry;
14-
//! # extern crate failure;
1513
//! # fn function_that_might_fail() -> Result<(), failure::Error> { Ok(()) }
1614
//! use sentry::integrations::failure::capture_error;
1715
//! # fn test() -> Result<(), failure::Error> {
@@ -134,7 +132,8 @@ pub fn exception_from_single_fail<F: Fail + ?Sized>(
134132
module,
135133
value: Some(f.to_string()),
136134
stacktrace: bt
137-
.map(failure::Backtrace::to_string)
135+
// format the stack trace with alternate debug to get addresses
136+
.map(|bt| format!("{:#?}", bt))
138137
.and_then(|x| parse_stacktrace(&x)),
139138
..Default::default()
140139
}
@@ -274,3 +273,45 @@ fn test_parse_stacktrace() {
274273
Some(Addr(0x55a1_2174_de62))
275274
);
276275
}
276+
277+
#[test]
278+
fn test_parse_stacktrace_alternate() {
279+
use crate::protocol::Addr;
280+
281+
let backtrace = r#"
282+
1: 0x104f87e23 - backtrace::backtrace::trace::he6b6038e0eef17f8
283+
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:53
284+
2: 0x104f7a6f7 - backtrace::capture::Backtrace::create::h10a127635da03d41
285+
at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/capture.rs:164
286+
3: 0x104fb9f4f - __rust_maybe_catch_panic
287+
at src/libpanic_unwind/lib.rs:78
288+
4: 0x104fb784e - std::panicking::try::h989c79f60ffdf02a
289+
at src/libstd/panicking.rs:270
290+
std::panic::catch_unwind::hd3f56528916c87b0
291+
at src/libstd/panic.rs:394
292+
std::rt::lang_start_internal::h3d261fac4b6382f2
293+
at src/libstd/rt.rs:51
294+
5: 0x1046a06a2 - std::rt::lang_start::h8baa07060377e0b8
295+
at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/libstd/rt.rs:67
296+
6: 0x10469fb62 - main
297+
"#;
298+
299+
let stacktrace = parse_stacktrace(backtrace).expect("stacktrace");
300+
assert_eq!(stacktrace.frames.len(), 8);
301+
302+
assert_eq!(stacktrace.frames[0].function, Some("main".into()));
303+
assert_eq!(
304+
stacktrace.frames[0].instruction_addr,
305+
Some(Addr(0x1_0469_fb62))
306+
);
307+
308+
// Inlined frame, inherits address from parent
309+
assert_eq!(
310+
stacktrace.frames[3].function,
311+
Some("std::panic::catch_unwind".into())
312+
);
313+
assert_eq!(
314+
stacktrace.frames[1].instruction_addr,
315+
Some(Addr(0x1_046a_06a2))
316+
);
317+
}

0 commit comments

Comments
 (0)