Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust bindings refactor #6309

Open
wants to merge 75 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
eab64f3
Cleanup rust api
emesare Dec 22, 2024
e419b93
More rust cleanup
emesare Dec 22, 2024
5ab10d5
More rust cleanup
emesare Dec 24, 2024
5b4199d
More rust cleanup
emesare Dec 28, 2024
09719bf
More rust cleanup
emesare Dec 30, 2024
384854b
Fix leak in DebugInfo::AddType
emesare Dec 30, 2024
b032217
Add more HLIL related functions to rust
rbran May 27, 2024
6446d7a
More rust cleanup
emesare Dec 31, 2024
92808bc
improve the CustomBinaryView init process
rbran May 6, 2024
a5cdded
Canonicalize path in `create_delete_empty` test
emesare Jul 29, 2024
32b58ea
Link core in rust
emesare Jul 29, 2024
69b4790
Remove vendored pdb crate
emesare Dec 31, 2024
eb557f4
Fix misc rustdoc warnings
emesare Dec 31, 2024
981b8c9
Move actual plugins out of `rust/examples` and into `plugins`
emesare Dec 31, 2024
2175cb1
More rust cleanup
emesare Dec 31, 2024
af19ac3
Move under_construction.png to assets directory
emesare Dec 31, 2024
51a25a3
Remove unneeded `extern crate bindgen`
emesare Dec 31, 2024
9f0c305
Replace nop'd log::info with println
emesare Dec 31, 2024
e105d27
Move inline tests into tests directory
emesare Dec 31, 2024
268747a
Format rust code
emesare Dec 31, 2024
8b87d99
Update rust ci
emesare Dec 31, 2024
ace9ba8
More rust cleanup
emesare Jan 2, 2025
47d55c7
Generate binaryninjacore-sys documentation
emesare Jan 2, 2025
1b6b9a3
More rust cleanup
emesare Jan 2, 2025
43e5fb7
Remove unneeded script helper in rust api
emesare Jan 3, 2025
e3d59cc
More rust cleanup
emesare Jan 4, 2025
8c098d2
More rust cleanup
emesare Jan 5, 2025
5239db6
Implement rust TypeParser
rbran Jun 12, 2024
e3919ef
fix Platform TypeParser related functions
rbran Jun 14, 2024
70d0429
separate User and System implementations of TypeParserResult
rbran Jun 14, 2024
9131cb5
Implement rust TypeContainer
rbran Jun 24, 2024
44a1415
More rust cleanup
emesare Jan 10, 2025
22a4b3c
Oh your suppose to do this
emesare Jan 10, 2025
0f4cff2
Add workflow_dispatch trigger to rust.yml
emesare Jan 10, 2025
8817d93
More rust fixes
emesare Jan 11, 2025
12fe44d
Misc formatting changes
emesare Jan 12, 2025
807526d
More rust cleanup
emesare Jan 13, 2025
3ea9c4e
Misc clippy lints and clippy CI
emesare Jan 13, 2025
3edc540
Fix typo in rust CI
emesare Jan 13, 2025
449809f
Misc rust formatting
emesare Jan 13, 2025
ab0607b
Fix misc typos and add typos to rust CI
emesare Jan 13, 2025
840c95c
Add cargo workspace
emesare Jan 13, 2025
5b974d7
More rust cleanup
emesare Jan 14, 2025
059baa5
Run rust tests in CI
emesare Jan 14, 2025
bc8cdca
Install missing wayland dependency in github CI
emesare Jan 14, 2025
f35517d
Set the BINARYNINJADIR so rust can find binaryninjacore in CI
emesare Jan 14, 2025
8b677e7
Misc remove unused dependency
emesare Jan 14, 2025
3d1cfff
Rust misc formatting fixes
emesare Jan 14, 2025
5b36220
Improve initialization in rust headless scripts
emesare Jan 14, 2025
6de52a2
Add BN_LICENSE environment variable to rust CI
emesare Jan 14, 2025
098c507
Fix typo
emesare Jan 14, 2025
556918b
More rust cleanup
emesare Jan 14, 2025
d282bde
Update readme and include that directly in the rustdocs
emesare Jan 15, 2025
606b584
More rust documentation changes
emesare Jan 15, 2025
097ac62
Add format comment to InitializationOptions::with_license
emesare Jan 15, 2025
e470e44
Misc formatting and clippy lint allow
emesare Jan 15, 2025
9f4b673
More rust cleanup
emesare Jan 15, 2025
9adf6a6
More rust cleanup
emesare Jan 15, 2025
93cc92e
More rust cleanup
emesare Jan 15, 2025
f9099a6
Misc rust formatting
emesare Jan 16, 2025
2b7557d
More rust cleanup
emesare Jan 17, 2025
02f6be8
Fix typos
emesare Jan 17, 2025
6405576
Misc clippy fixes
emesare Jan 17, 2025
6341003
More rust cleanup
emesare Jan 18, 2025
fd9f230
Update some tests and examples
emesare Jan 18, 2025
90e925a
Fix background task tests colliding
emesare Jan 18, 2025
f741ac9
More rust cleanup
emesare Jan 18, 2025
03b8ae7
Move binary view initialization into function body for LLIL test
emesare Jan 18, 2025
72c98dc
Normalize test file names
emesare Jan 18, 2025
05b7a18
More rust cleanup
emesare Jan 19, 2025
fc17319
Update workflow test to new settings api
emesare Jan 19, 2025
b2e4cc5
More rust cleanup
emesare Jan 19, 2025
3f1533e
Misc clippy lints
emesare Jan 19, 2025
2a7195f
More rust cleanup
emesare Jan 19, 2025
da1b04d
More rust cleanup
emesare Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 63 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,78 @@
name: Rust PR Checks
name: Rust CI

on:
workflow_dispatch:
push:
paths:
- 'rust/**'
pull_request:
paths:
- 'rust/**'

jobs:
build_and_lint:
name: cargo check & cargo clippy
# Check that code compiles and tests pass
test:
# The testing environment is used to access the BN_SERIAL secret.
environment: testing
name: cargo test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v4
# We need to add wayland as it's used for file picker in the WARP integration
- name: Install system dependencies
run: sudo apt-get install libwayland-dev
# Pull in Binary Ninja
- name: Setup Binary Ninja
id: setup-binja
uses: Vector35/setup-binary-ninja@v1-beta
with:
submodules: true

- name: Install Clang
run: |
sudo apt update
sudo apt install clang -y
license: '${{ secrets.BN_SERIAL }}'
python-support: 'false'
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Test
# For now, we run the tests single threaded, there are some data races in core around platform types
run: cargo test --all-features -- --test-threads=1
env:
BINARYNINJADIR: ${{ steps.setup-binja.outputs.install-path }}
BN_LICENSE: ${{ secrets.BN_LICENSE }}

- name: Install Rust
uses: actions-rs/toolchain@v1
# Check lints with clippy
clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Ensure clippy is installed
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.83.0
profile: minimal
override: true
components: clippy
- name: Clippy Check
uses: clechasseur/rs-clippy-check@v4
with:
# We do not run clippy on plugins.
working-directory: ./rust
args: --all-features

- name: cargo check
working-directory: ./rust
run: cargo check --workspace --all-features

- name: cargo doc test
working-directory: ./rust
run: cargo test --doc -- --show-output
# Check formatting with rustfmt
formatting:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Ensure rustfmt is installed
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1

- name: cargo clippy
working-directory: ./rust
run: cargo clippy -- -D warnings
continue-on-error: true
# If this step fails, it will warn (?)
# Check spelling with typos
spelling:
name: typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Typo Check
uses: crate-ci/[email protected]
with:
files: ./rust
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@
[submodule "arch/x86/mbuild"]
path = arch/x86/mbuild
url = https://github.com/intelxed/mbuild.git
[submodule "rust/examples/pdb-ng/pdb-0.8.0-patched"]
path = rust/examples/pdb-ng/pdb-0.8.0-patched
url = https://github.com/Vector35/pdb-rs.git
Loading
Loading