Skip to content

Commit

Permalink
Merge branch 'master' into fix/big-endian-debugid-breakpad
Browse files Browse the repository at this point in the history
* master: (21 commits)
  fix: New nightly clippy lint (#295)
  fix(release): Do not publish examples to crates.io
  release: 8.0.0
  ref(debuginfo): Remove re-exports of error types (#300)
  meta: Update changelog
  ref(debuginfo): Switch to error with kind (#299)
  ref(minidump): Switch to error with kind (#298)
  ref(unreal): Switch to error with kind (#297)
  ref(symcache): Switch to error with kind (#296)
  feat: Rename architecture to wasm32 (#294)
  fix(debuginfo): Prefer DWARF names for Dart functions (#293)
  fix: clippy (#292)
  hack(dwarf): Skip line program sequences at 0 (#291)
  feat(wasm): support for wasm (#166)
  ci: Run rust nighlty on a schedule (#289)
  ref: Updates for rust 1.48 (#288)
  fix(debuginfo): Update dmsort to 1.0.1 to avoid panic due to UB (#287)
  ci: Use GHA instead of zeus (#286)
  ref: Introduce explicit NameMangling and better DemangleOptions (#275)
  meta: Bump all semver-major dependencies (#283)
  ...
  • Loading branch information
jan-auer committed Dec 22, 2020
2 parents fc5a6b7 + b8299c2 commit 8de7e23
Show file tree
Hide file tree
Showing 94 changed files with 3,124 additions and 1,538 deletions.
11 changes: 8 additions & 3 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
---
minVersion: "0.9.0"
minVersion: "0.13.2"
github:
owner: getsentry
repo: symbolic
changelogPolicy: auto

statusProvider:
name: github
artifactProvider:
name: github

preReleaseCommand: bash scripts/bump-version
targets:
- name: crates
- name: pypi
- name: github
changelogPolicy: simple
requireNames:
- /^symbolic-.*-py2.py3-none-macosx_10_15_x86_64.whl$/
- /^symbolic-.*-py2.py3-none-manylinux2010_i686.whl$/
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- "release/**"
pull_request:

env:
RUSTFLAGS: -Dwarnings

jobs:
lints:
name: Style/Linting
Expand All @@ -29,8 +32,6 @@ jobs:
python-version: 3.7

- uses: Swatinem/rust-cache@v1
with:
key: lints

- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -69,8 +70,6 @@ jobs:
override: true

- uses: Swatinem/rust-cache@v1
with:
key: test-rust

- name: Run cargo test
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -106,7 +105,5 @@ jobs:
python-version: 3.7

- uses: Swatinem/rust-cache@v1
with:
key: test-python

- run: make test-python
37 changes: 37 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Nightly CI

on:
schedule:
- cron: '11 7 * * 1,4'

env:
RUSTFLAGS: -Dwarnings

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [nightly, beta]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
components: clippy

- name: Run clipppy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --workspace --tests --examples -- -D clippy::all

- uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features
42 changes: 12 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,10 @@ jobs:

- run: make wheel SYMBOLIC_PYTHON=python2

- uses: actions/setup-node@v1

- name: Upload to Zeus
env:
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
run: |
npm install -D @zeus-ci/cli
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --ref ${{ github.sha }}
npx zeus upload --build ${{ github.run_id }} --job ${{ github.job }} --type "application/zip+wheel" py/dist/*
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --status passed
- uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: py/dist/*

python-wheel-linux:
strategy:
Expand All @@ -61,16 +55,10 @@ jobs:
- name: Build in Docker
run: make wheel-manylinux IMAGE=quay.io/pypa/manylinux2010_${{ matrix.build-arch }}

- uses: actions/setup-node@v1

- name: Upload to Zeus
env:
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
run: |
npm install -D @zeus-ci/cli
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --ref ${{ github.sha }}
npx zeus upload --build ${{ github.run_id }} --job ${{ github.job }} --type "application/zip+wheel" py/dist/*
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --status passed
- uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: py/dist/*

sdist:
name: Python sdist
Expand All @@ -85,13 +73,7 @@ jobs:

- run: make sdist

- uses: actions/setup-node@v1

- name: Upload to Zeus
env:
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
run: |
npm install -D @zeus-ci/cli
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --ref ${{ github.sha }}
npx zeus upload --build ${{ github.run_id }} --job ${{ github.job }} --type "application/zip+wheel" py/dist/*
npx zeus job update --build ${{ github.run_id }} --job ${{ github.job }} --status passed
- uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: py/dist/*
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

## Unreleased
## 8.0.0

**Breaking Changes**:

- Usage of `failure` was removed, and all Error types were changed to only implement `std::error::Error` and related traits.
- Usage of `failure` was removed, and all error types were changed to only implement `std::error::Error` and related traits.
- `symbolic-proguard` was removed in favor of the `proguard` crate. Proguard is still supported via `symbolic-cabi` and the python API however.
- Deprecated APIs have been removed:
- `InstructionInfo`'s fields are no longer public.
Expand All @@ -14,6 +14,20 @@
- `Unreal4ContextRuntimeProperties::misc_primary_cpu_brand` is has been removed.
- Deprecated Python APIs have been removed:
- `CodeModule.id` and `CodeModule.name` Use `debug_id` and `code_file`, respectively.
- `DemangleFormat` and public fields of `DemangleOptions` have been removed in favor of builder methods on `DemangleOptions`.
- `Name::new` now takes both the `NameMangling` state, and the `Language` explicitly.

**Features**:

- Add support for the `wasm32` architecture. ([#166](https://github.com/getsentry/symbolic/pull/166))
- Support demangling for Swift 5.3. ([#282](https://github.com/getsentry/symbolic/pull/282))

**Bug Fixes**:

- Detect mangled anonymous namespaces in PDB inlinees ([#261](https://github.com/getsentry/symbolic/pull/261))
- Fix a panic due to undefined behavior. ([#287](https://github.com/getsentry/symbolic/pull/287))
- Skip line program sequences at 0. ([#291](https://github.com/getsentry/symbolic/pull/291))
- Prefer DWARF names for Dart functions. ([#293](https://github.com/getsentry/symbolic/pull/293))

## 7.5.0

Expand Down
3 changes: 2 additions & 1 deletion examples/addr2line/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "addr2line"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
21 changes: 13 additions & 8 deletions examples/addr2line/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ use std::borrow::Borrow;
use anyhow::{Context, Result};
use clap::{clap_app, ArgMatches};

use symbolic::common::{ByteView, Name};
use symbolic::common::{ByteView, Language, Name, NameMangling};
use symbolic::debuginfo::{Function, Object};
use symbolic::demangle::Demangle;
use symbolic::demangle::{Demangle, DemangleOptions};

fn print_name<'a, N: Borrow<Name<'a>>>(name: Option<N>, matches: &ArgMatches<'_>) {
match name.as_ref().map(Borrow::borrow) {
None => print!("??"),
Some(name) if name.as_str().is_empty() => print!("??"),
Some(name) if matches.is_present("demangle") => {
print!("{}", name.try_demangle(Default::default()));
print!("{}", name.try_demangle(DemangleOptions::name_only()));
}
Some(name) => print!("{}", name),
}
Expand Down Expand Up @@ -76,10 +76,9 @@ fn execute(matches: &ArgMatches<'_>) -> Result<()> {
let symbol_map = object.symbol_map();

'addrs: for addr in matches.values_of("addrs").unwrap_or_default() {
let addr = if addr.starts_with("0x") {
u64::from_str_radix(&addr[2..], 16)
} else {
addr.parse()
let addr = match addr.strip_prefix("0x") {
Some(addr) => u64::from_str_radix(addr, 16),
None => addr.parse(),
}
.context("unable to parse address")?;

Expand All @@ -92,7 +91,13 @@ fn execute(matches: &ArgMatches<'_>) -> Result<()> {

if matches.is_present("functions") {
if let Some(symbol) = symbol_map.lookup(addr) {
print_name(symbol.name.as_ref().map(|n| Name::new(n.as_ref())), matches);
print_name(
symbol
.name
.as_ref()
.map(|n| Name::new(n.as_ref(), NameMangling::Mangled, Language::Unknown)),
matches,
);
print_range(symbol.address, Some(symbol.size), matches);
print!("\n at ");
}
Expand Down
3 changes: 2 additions & 1 deletion examples/dump_cfi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "dump_cfi"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion examples/dump_sources/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "dump_sources"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion examples/minidump_stackwalk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "minidump_stackwalk"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 3 additions & 2 deletions examples/minidump_stackwalk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use walkdir::WalkDir;

use symbolic::common::{Arch, ByteView, InstructionInfo, SelfCell};
use symbolic::debuginfo::{Archive, FileFormat, Object};
use symbolic::demangle::Demangle;
use symbolic::demangle::{Demangle, DemangleOptions};
use symbolic::minidump::cfi::CfiCache;
use symbolic::minidump::processor::{CodeModuleId, FrameInfoMap, ProcessState, StackFrame};
use symbolic::symcache::{LineInfo, SymCache, SymCacheError, SymCacheWriter};
Expand Down Expand Up @@ -204,7 +204,8 @@ fn print_state(
"{:>3} {}!{} [{} : {} + 0x{:x}]",
index,
module.debug_file(),
info.function_name().try_demangle(Default::default()),
info.function_name()
.try_demangle(DemangleOptions::name_only()),
info.filename(),
info.line(),
info.instruction_address() - info.line_address(),
Expand Down
3 changes: 2 additions & 1 deletion examples/object_debug/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "object_debug"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion examples/symcache_debug/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "symcache_debug"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
8 changes: 6 additions & 2 deletions examples/symcache_debug/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use anyhow::{anyhow, Result};
use clap::{App, Arg, ArgMatches};

use symbolic::common::{Arch, ByteView, DSymPathExt, Language};
use symbolic::debuginfo::Archive;
use symbolic::demangle::Demangle;
use symbolic::symcache::{SymCache, SymCacheWriter};
use symbolic::{debuginfo::Archive, demangle::DemangleOptions};

fn execute(matches: &ArgMatches) -> Result<()> {
let buffer;
Expand Down Expand Up @@ -95,7 +95,11 @@ fn execute(matches: &ArgMatches) -> Result<()> {
println!("No match :(");
} else {
for sym in m {
print!("{}", sym.function_name().try_demangle(Default::default()));
print!(
"{}",
sym.function_name()
.try_demangle(DemangleOptions::name_only())
);

let path = sym.path();
let line = sym.line();
Expand Down
3 changes: 2 additions & 1 deletion examples/unreal_engine_crash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "unreal_engine_crash"
version = "0.1.0"
version = "8.0.0"
authors = ["Jan Michael Auer <mail@jauer.org>"]
edition = "2018"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions py/tests/test_demangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

def test_swift_demangle():
mangled = "_TFC12Swift_Tester14ViewController11doSomethingfS0_FT_T_"
expected = "ViewController.doSomething(_:)"
expected = "ViewController.doSomething(ViewController)"
assert demangle_name(mangled, lang="Swift") == expected


def test_swift_demangle_implicit():
mangled = "_TFC12Swift_Tester14ViewController11doSomethingfS0_FT_T_"
expected = "ViewController.doSomething(_:)"
expected = "ViewController.doSomething(ViewController)"
assert demangle_name(mangled) == expected


Expand All @@ -21,7 +21,7 @@ def test_swift_demangle_options():
)
simplified_expected = (
u"protocol witness for static _ObjectiveCBridgeable._"
u"unconditionallyBridgeFromObjectiveC(_:) "
u"unconditionallyBridgeFromObjectiveC(A._ObjectiveCType?) "
u"in conformance UIApplicationLaunchOptionsKey"
)
assert demangle_name(mangled) == simplified_expected
Expand Down
4 changes: 2 additions & 2 deletions symbolic-cabi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "symbolic-cabi"
version = "7.5.0"
version = "8.0.0"
license = "MIT"
authors = [
"Armin Ronacher <armin.ronacher@active-4.com>",
Expand All @@ -22,5 +22,5 @@ crate-type = ["cdylib"]
[dependencies]
serde_json = "1.0.40"
apple-crash-report-parser = { version = "0.4.0", features = ["with_serde"] }
symbolic = { version = "7.5.0", path = "../symbolic", features = ["debuginfo", "demangle", "minidump", "sourcemap", "symcache", "unreal-serde"] }
symbolic = { version = "8.0.0", path = "../symbolic", features = ["debuginfo", "demangle", "minidump", "sourcemap", "symcache", "unreal-serde"] }
proguard = { version = "4.0.1", features = ["uuid"] }
Loading

0 comments on commit 8de7e23

Please sign in to comment.