diff --git a/.github/actions/build-with-patched-std/action.yml b/.github/actions/build-with-patched-std/action.yml index 5466a2289..bdd127a38 100644 --- a/.github/actions/build-with-patched-std/action.yml +++ b/.github/actions/build-with-patched-std/action.yml @@ -41,7 +41,7 @@ runs: python3 x.py build library --stage 0 TEMP_BUILD_OUTPUT=$(mktemp test-binary-XXXXXXXX) - "$RUSTC_BUILD_DIR/stage0-sysroot/bin/rustc" $RUSTC_FLAGS "${{ inputs.main-rs }}" -o "$TEMP_BUILD_OUTPUT" + "$RUSTC_BUILD_DIR/stage0/bin/rustc" $RUSTC_FLAGS "${{ inputs.main-rs }}" -o "$TEMP_BUILD_OUTPUT" BINARY_SIZE=$(stat -c '%s' "$TEMP_BUILD_OUTPUT") rm "$TEMP_BUILD_OUTPUT" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e28c55a97..ba83f75c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,14 +26,13 @@ jobs: rust: stable - os: macos-latest rust: nightly - # Note that these are on nightly due to rust-lang/rust#63700 not being - # on stable yet + # HACK(jubilee): 1.77 broke backtraces on Windows lol - os: windows-latest - rust: stable-x86_64-msvc + rust: 1.76.0-x86_64-msvc - os: windows-latest - rust: stable-i686-msvc + rust: 1.76.0-i686-msvc - os: windows-latest - rust: stable-x86_64-gnu + rust: 1.76.0-x86_64-gnu steps: - uses: actions/checkout@v3 with: @@ -49,7 +48,7 @@ jobs: - name: Force frame pointers run: echo RUSTFLAGS="-Cforce-frame-pointers $RUSTFLAGS" >> $GITHUB_ENV shell: bash - if: matrix.rust == 'stable-i686-msvc' + if: contains(matrix.rust, 'i686') - run: cargo build - run: cargo test @@ -234,7 +233,13 @@ jobs: msrv: name: MSRV - runs-on: ubuntu-20.04 + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-20.04 + - os: windows-latest steps: - uses: actions/checkout@v3 with: diff --git a/Cargo.lock b/Cargo.lock index 88f853ab9..ba8c53f4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.70" +version = "0.3.71" dependencies = [ "addr2line", "cc", @@ -51,12 +51,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-if" diff --git a/Cargo.toml b/Cargo.toml index 7fe05d818..e1ee1c371 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "backtrace" -version = "0.3.70" +version = "0.3.71" authors = ["The Rust Project Developers"] build = "build.rs" license = "MIT OR Apache-2.0" @@ -54,7 +54,7 @@ winapi = { version = "0.3.9", optional = true } [build-dependencies] # Only needed for Android, but cannot be target dependent # https://github.com/rust-lang/cargo/issues/4932 -cc = "1.0.67" +cc = "1.0.90" [dev-dependencies] dylib-dep = { path = "crates/dylib-dep" } diff --git a/crates/as-if-std/Cargo.toml b/crates/as-if-std/Cargo.toml index 7f12cfb56..1618058de 100644 --- a/crates/as-if-std/Cargo.toml +++ b/crates/as-if-std/Cargo.toml @@ -28,7 +28,7 @@ features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive'] [build-dependencies] # Dependency of the `backtrace` crate -cc = "1.0.67" +cc = "1.0.90" [features] default = ['backtrace'] diff --git a/src/backtrace/mod.rs b/src/backtrace/mod.rs index df9f536a4..169f645c0 100644 --- a/src/backtrace/mod.rs +++ b/src/backtrace/mod.rs @@ -125,7 +125,7 @@ impl fmt::Debug for Frame { } } -#[cfg(all(target_env = "sgx", target_vendor = "fortanix", not(miri)))] +#[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] mod sgx_image_base { #[cfg(not(feature = "std"))] @@ -160,12 +160,7 @@ mod sgx_image_base { pub(crate) use imp::get_image_base; } -#[cfg(all( - target_env = "sgx", - target_vendor = "fortanix", - not(feature = "std"), - not(miri) -))] +#[cfg(all(target_env = "sgx", target_vendor = "fortanix", not(feature = "std")))] pub use sgx_image_base::imp::set_image_base; cfg_if::cfg_if! { diff --git a/src/symbolize/dbghelp.rs b/src/symbolize/dbghelp.rs index 7969f9ff2..50d5384f0 100644 --- a/src/symbolize/dbghelp.rs +++ b/src/symbolize/dbghelp.rs @@ -26,6 +26,13 @@ use core::mem; use core::ptr; use core::slice; +// FIXME: replace with ptr::from_ref once MSRV is high enough +#[inline(always)] +#[must_use] +const fn ptr_from_ref(r: &T) -> *const T { + r +} + // Store an OsString on std so we can provide the symbol name and filename. pub struct Symbol<'a> { name: *const [u8], @@ -257,7 +264,7 @@ unsafe fn do_resolve( let len = len as usize; - filename = Some(ptr::from_ref(slice::from_raw_parts(base, len))); + filename = Some(ptr_from_ref(slice::from_raw_parts(base, len))); } cb(&super::Symbol {