Skip to content

Commit 25a32f0

Browse files
committed
Merge remote-tracking branch 'origin/dev' into homegrown_powerpc
2 parents 7831fbd + 8127c87 commit 25a32f0

File tree

481 files changed

+76976
-24511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+76976
-24511
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ If applicable, please add screenshots/video recording here to help explain your
3232
**Binary:**
3333
If applicable, please provide us with the binary to help us work with the issue faster. Here are a few options:
3434

35-
1. Directly attach it to this issue in a ZIP archive
36-
2. Share a publicly accessible link to it (For malware samples, we do not have access to VirusTotal; [Malshare](https://malshare.com/) is an option)
37-
3. Email it to binaryninja at vector35.com, or join our [slack](https://slack.binary.ninja/) and share with us in private
38-
4. We understand sometimes it is not possible to share the binary -- sure, no worries, we can still work with it!
39-
5. If your issue is general and not related to a specific binary, then there is no need to attach the binary as well
35+
1. Upload it privately using the [Binary Ninja Portal file uploader](https://portal.binary.ninja/upload) and add the provided reference phrase here
36+
2. Directly attach it to this issue in a ZIP archive
37+
3. Share a publicly accessible link to it (For malware samples, we do not have access to VirusTotal; [Malshare](https://malshare.com/) is an option)
38+
4. Email it to binaryninja at vector35.com, or join our [Slack](https://slack.binary.ninja/) and share it with us in private
39+
5. We understand sometimes it is not possible to share the binary -- sure, no worries, we can still work with it!
40+
6. If your issue is general and not related to a specific binary, then there is no need to attach the binary as well
4041

4142
**Additional Information:**
4243
Please add any other context about the problem here.

.github/workflows/rust.yml

Lines changed: 60 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,75 @@
1-
name: Rust PR Checks
1+
name: Rust CI
22

33
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- '**'
8+
paths:
9+
- '**.rs'
10+
- '**.toml'
11+
- 'rust/**'
412
pull_request:
513
paths:
614
- 'rust/**'
715

816
jobs:
9-
build_and_lint:
10-
name: cargo check & cargo clippy
17+
# Check lints with clippy
18+
clippy:
19+
name: cargo clippy
1120
runs-on: ubuntu-latest
12-
1321
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v3
16-
with:
17-
submodules: true
18-
19-
- name: Install Clang
20-
run: |
21-
sudo apt update
22-
sudo apt install clang -y
23-
24-
- name: Install Rust
25-
uses: actions-rs/toolchain@v1
22+
- uses: actions/checkout@v4
23+
# Ensure clippy is installed
24+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2625
with:
2726
toolchain: 1.83.0
28-
profile: minimal
29-
override: true
3027
components: clippy
28+
- name: Clippy Check
29+
uses: clechasseur/rs-clippy-check@v4
30+
with:
31+
# We do not run clippy on plugins.
32+
args: -p binaryninja --all-features
3133

32-
- name: cargo check
33-
working-directory: ./rust
34-
run: cargo check --workspace --all-features
34+
# Check formatting with rustfmt
35+
formatting:
36+
name: cargo fmt
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
# Ensure rustfmt is installed
41+
- uses: actions-rust-lang/setup-rust-toolchain@v1
42+
with:
43+
toolchain: 1.83.0
44+
components: rustfmt
45+
- name: Rustfmt Check
46+
uses: actions-rust-lang/rustfmt@v1
3547

36-
- name: cargo doc test
37-
working-directory: ./rust
38-
run: cargo test --doc -- --show-output
48+
# Check spelling with typos
49+
spelling:
50+
name: typos
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Typo Check
55+
uses: crate-ci/[email protected]
56+
with:
57+
files: ./rust
3958

40-
- name: cargo clippy
41-
working-directory: ./rust
42-
run: cargo clippy -- -D warnings
43-
continue-on-error: true
44-
# If this step fails, it will warn (?)
59+
# Check licensing and produce a list of licenses
60+
licensing:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Install cargo-about
65+
uses: baptiste0928/cargo-install@v3
66+
with:
67+
crate: cargo-about
68+
version: "0.6.6"
69+
- name: Run license check
70+
run: cargo about generate about.hbs > license.html
71+
- name: Archive license file
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: license
75+
path: license.html

.github/workflows/rust_testing.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Rust Testing
2+
3+
# This workflow will have access to two secrets, `BN_SERIAL` and `BN_LICENSE`, they are exposed only for the test job
4+
# and only if workflow has been approved to run. If there is no approval they workflow won't run.
5+
# What security issues arise from this? If a person makes a PR that leaks the `BN_SERIAL` or `BN_LICENSE` and a maintainer
6+
# approves it than the those secrets would leak.
7+
8+
on:
9+
workflow_dispatch:
10+
# Pull request target allows us to use the bn license and serial for PR's
11+
# to insure we do not leak the license the workflow is required to be approved manually.
12+
pull_request_target:
13+
paths:
14+
- '**.rs'
15+
- '**.toml'
16+
- 'rust/**'
17+
18+
jobs:
19+
# Check that code compiles and tests pass
20+
test:
21+
# Using the testing environment gives us the needed secrets, it also requires a maintainer to approve it to run.
22+
environment: testing
23+
name: cargo test
24+
runs-on: ubuntu-latest
25+
permissions:
26+
issues: read
27+
steps:
28+
- uses: actions/checkout@v4
29+
# We need to add wayland as it's used for file picker in the WARP integration
30+
- name: Install system dependencies
31+
run: sudo apt-get install libwayland-dev
32+
# Pull in Binary Ninja
33+
- name: Setup Binary Ninja
34+
id: setup-binja
35+
uses: Vector35/setup-binary-ninja@v1-beta
36+
with:
37+
license: '${{ secrets.BN_SERIAL }}'
38+
python-support: 'false'
39+
dev-branch: 'true'
40+
- uses: actions-rust-lang/setup-rust-toolchain@v1
41+
- name: Test
42+
# For now, we run the tests single threaded, there are some data races in core around platform types
43+
run: cargo test --all-features -- --test-threads=1
44+
env:
45+
BINARYNINJADIR: ${{ steps.setup-binja.outputs.install-path }}
46+
BN_LICENSE: ${{ secrets.BN_LICENSE }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ python/generator.log
3333
python/generator.tlog
3434
.cache/
3535
target/
36+
view/sharedcache/api/python/_sharedcachecore.py
3637

3738
# Unit Tests
3839
suite/unit.py
@@ -84,6 +85,8 @@ rust/target/
8485
rust/binaryninjacore-sys/target/
8586
rust/examples/*/target/
8687
rust/examples/dwarf/*/target/
88+
# Allow the test binaries
89+
!/rust/fixtures/bin/**
8790

8891
# Debugger docs
8992
docs/img/debugger

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@
1616
[submodule "arch/x86/mbuild"]
1717
path = arch/x86/mbuild
1818
url = https://github.com/intelxed/mbuild.git
19-
[submodule "rust/examples/pdb-ng/pdb-0.8.0-patched"]
20-
path = rust/examples/pdb-ng/pdb-0.8.0-patched
21-
url = https://github.com/Vector35/pdb-rs.git

0 commit comments

Comments
 (0)