File tree 6 files changed +44
-2
lines changed
6 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 78
78
- run : cargo test --no-default-features --features "dbghelp std"
79
79
- run : cargo test --no-default-features --features "dbghelp std verify-winapi"
80
80
- run : cargo test --manifest-path crates/cpp_smoke_test/Cargo.toml
81
+ - run : cargo test --manifest-path crates/macos_frames_test/Cargo.toml
81
82
- run : cargo test --features libbacktrace --manifest-path crates/without_debuginfo/Cargo.toml
82
83
- run : cargo test --features "libbacktrace coresymbolication" --manifest-path crates/without_debuginfo/Cargo.toml
83
84
- run : cargo test --features "libbacktrace gimli-symbolize" --manifest-path crates/without_debuginfo/Cargo.toml
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ edition = "2018"
16
16
17
17
[workspace ]
18
18
members = [' crates/cpp_smoke_test' ]
19
- exclude = [' crates/without_debuginfo' ]
19
+ exclude = [' crates/without_debuginfo' , ' crates/macos_frames_test ' ]
20
20
21
21
[dependencies ]
22
22
cfg-if = " 0.1.10"
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ fn main() {
36
36
37
37
// `mmap` does not exist on Windows, so we use
38
38
// the less efficient `read`-based code.
39
- if target. contains ( "windows" ) {
39
+ // Using `mmap` on macOS causes weird isseus - see
40
+ // https://github.com/rust-lang/rust/pull/45866
41
+ if target. contains ( "windows" ) || target. contains ( "darwin" ) {
40
42
build. file ( "src/libbacktrace/read.c" ) ;
41
43
} else {
42
44
build. file ( "src/libbacktrace/mmapio.c" ) ;
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " macos_frames_test"
3
+ version = " 0.1.0"
4
+ authors = [
" Aaron Hill <[email protected] >" ]
5
+ edition = " 2018"
6
+
7
+ [dependencies .backtrace ]
8
+ path = " ../.."
Original file line number Diff line number Diff line change
1
+ // intentionally blank
Original file line number Diff line number Diff line change
1
+ // Based on from https://github.com/rust-lang/rust/blob/2cb0b8582ebbf9784db9cec06fff517badbf4553/src/test/ui/issues/issue-45731.rs
2
+ // This needs to go in a crate by itself, since it modifies the dSYM for the entire test
3
+ // output directory.
4
+ //
5
+ // Note that this crate is *not* part of the overall `backtrace-rs` workspace,
6
+ // so that it gets its own 'target' directory. We manually invoke this test
7
+ // in .github/workflows/main.yml by passing `--manifest-path` to Cargo
8
+ #[ test]
9
+ #[ cfg( target_os = "macos" ) ]
10
+ fn backtrace_no_dsym ( ) {
11
+ use std:: { env, fs, panic} ;
12
+
13
+ // Find our dSYM and replace the DWARF binary with an empty file
14
+ let mut dsym_path = env:: current_exe ( ) . unwrap ( ) ;
15
+ let executable_name = dsym_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
16
+ assert ! ( dsym_path. pop( ) ) ; // Pop executable
17
+ dsym_path. push ( format ! (
18
+ "{}.dSYM/Contents/Resources/DWARF/{0}" ,
19
+ executable_name
20
+ ) ) ;
21
+ let _ = fs:: OpenOptions :: new ( )
22
+ . read ( false )
23
+ . write ( true )
24
+ . truncate ( true )
25
+ . create ( false )
26
+ . open ( & dsym_path)
27
+ . unwrap ( ) ;
28
+
29
+ backtrace:: Backtrace :: new ( ) ;
30
+ }
You can’t perform that action at this time.
0 commit comments