-
Notifications
You must be signed in to change notification settings - Fork 4
feat(rust): Add high-performance Rust bindings with SIMD acceleration #44
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
Open
LeeGoDamn
wants to merge
30
commits into
main
Choose a base branch
from
feature/rust
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,225
−2
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2c93913
Add rust support
wysaid cd3ffe5
Clean up temporary files and fix core rust binding structure
Copilot 6cd435c
Complete rust bindings refactoring: fix examples, add tests, update V…
Copilot f8046ec
Fix rust compilation errors and add GitHub workflow
Copilot de71868
Fix demo error
wysaid f9c64ad
fix(rust): enable convert module and fix lifetime issues in frame.rs
wysaid 1615698
feat(rust): add build-source feature for distribution
wysaid 2afc385
fix(rust): support both repo and packaged directory structures in bui…
wysaid ebd9343
ci(rust): add comprehensive workflow for static-link and build-source
wysaid 3745092
fix(rust): Address PR review comments and fix critical issues
wysaid 6b901d4
fix(rust): Fix convert module API mismatches with C library
wysaid ffad966
fix: Format code and fix AVX2 compilation in build-source mode
wysaid d0c1e3b
fix: Resolve clippy warnings
wysaid 84bc8d6
fix: Apply cargo fmt to set_pixel_format
wysaid e049718
Merge remote-tracking branch 'origin/main' into feature/rust
wysaid f499ce2
fix: Resolve Rust CI workflow issues
wysaid 351ab6a
fix(rust): Add file playback source files to build-source mode
wysaid b7b2140
fix(rust): Fix cross-platform type compatibility for error codes
wysaid 1f01fe6
fix(rust): Resolve critical build and API issues
wysaid 3dae4bf
fix(rust): Fix Rust bindings compilation on Windows
wysaid 4c758d6
fix(rust): Implement Windows-specific path handling for file operations
wysaid f491794
fix(rust): Fix Windows build issues
wysaid 5f57424
fix(ci): Fix Windows CI and prevent duplicate workflow runs
wysaid d37f746
fix(rust): Build both Debug and Release configs on Windows CI
wysaid 72ad68b
fix(ci): Fix LIBCLANG_PATH escaping in GitHub Actions workflow
wysaid 5e41b23
fix(ci): Add libclang-dev dependency for Ubuntu and remove refreshenv…
wysaid 7fdaebd
ci: fix libclang setup in rust workflow
wysaid 18a6be3
ci: skip camera-dependent rust tests in CI
wysaid 83f93aa
fix(rust,build,core): Align Rust version to 1.5.0, improve build safe…
wysaid e10615d
fix(rust): Address PR review issues
wysaid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| name: Rust CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| paths: | ||
| - 'bindings/rust/**' | ||
| - 'src/**' | ||
| - 'include/**' | ||
| - 'CMakeLists.txt' | ||
| - '.github/workflows/rust.yml' | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
| paths: | ||
| - 'bindings/rust/**' | ||
| - 'src/**' | ||
| - 'include/**' | ||
| - 'CMakeLists.txt' | ||
| - '.github/workflows/rust.yml' | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CCAP_SKIP_CAMERA_TESTS: 1 | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # Job 1: Static Linking (Development Mode) | ||
| # Verifies that the crate links correctly against a pre-built C++ library. | ||
| static-link: | ||
| name: Static Link (Dev) | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install system dependencies (Ubuntu) | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y cmake build-essential pkg-config libclang-dev | ||
|
|
||
| - name: Install system dependencies (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| choco install cmake llvm -y | ||
|
|
||
| - name: Configure LIBCLANG_PATH (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| shell: pwsh | ||
| run: echo "LIBCLANG_PATH=C:\\Program Files\\LLVM\\bin" >> $env:GITHUB_ENV | ||
|
|
||
| - name: Install system dependencies (macOS) | ||
| if: matrix.os == 'macos-latest' | ||
| run: | | ||
| brew install cmake llvm | ||
| echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| components: clippy, rustfmt | ||
| cache: false | ||
|
|
||
| # Build C++ Library (Linux/macOS) | ||
| # We build in build/Debug to match build.rs expectations for Unix Makefiles | ||
| - name: Build C library (Unix) | ||
| if: runner.os != 'Windows' | ||
| run: | | ||
| mkdir -p build/Debug | ||
| cd build/Debug | ||
| cmake -DCMAKE_BUILD_TYPE=Debug -DCCAP_BUILD_EXAMPLES=OFF -DCCAP_BUILD_TESTS=OFF ../.. | ||
| cmake --build . --config Debug --parallel | ||
|
|
||
| # Build C++ Library (Windows) | ||
| # Build both Debug and Release versions | ||
| # MSVC is a multi-config generator, so we build to build/ and specify config at build time | ||
| - name: Build C library (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| mkdir build | ||
| cd build | ||
| cmake -DCCAP_BUILD_EXAMPLES=OFF -DCCAP_BUILD_TESTS=OFF .. | ||
| cmake --build . --config Debug --parallel | ||
| cmake --build . --config Release --parallel | ||
|
|
||
| - name: Check formatting | ||
| if: matrix.os == 'ubuntu-latest' | ||
| working-directory: bindings/rust | ||
| run: cargo fmt -- --check | ||
|
|
||
| - name: Run clippy | ||
| if: matrix.os == 'ubuntu-latest' | ||
| working-directory: bindings/rust | ||
| run: cargo clippy --all-targets --features static-link -- -D warnings | ||
|
|
||
| - name: Build Rust bindings | ||
| working-directory: bindings/rust | ||
| run: cargo build --verbose --features static-link | ||
|
|
||
| - name: Run tests | ||
| working-directory: bindings/rust | ||
| run: cargo test --verbose --features static-link | ||
|
|
||
| # Job 2: Source Build (Distribution Mode) | ||
| # Verifies that the crate builds correctly from source using the cc crate. | ||
| # This is crucial for crates.io distribution. | ||
| build-source: | ||
| name: Build Source (Dist) | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install system dependencies (Ubuntu) | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential pkg-config | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install system dependencies (macOS) | ||
| if: matrix.os == 'macos-latest' | ||
| run: brew install llvm | ||
|
|
||
| - name: Install system dependencies (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| choco install llvm -y | ||
| refreshenv | ||
|
|
||
| - name: Configure LIBCLANG_PATH (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| shell: pwsh | ||
| run: echo "LIBCLANG_PATH=C:\\Program Files\\LLVM\\bin" >> $env:GITHUB_ENV | ||
|
|
||
| - name: Configure LIBCLANG_PATH (macOS) | ||
| if: matrix.os == 'macos-latest' | ||
| run: echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| cache: false | ||
| # The build.rs script should handle it via the 'build-source' feature. | ||
|
|
||
| - name: Build Rust bindings (Source) | ||
| working-directory: bindings/rust | ||
| # Disable default features (static-link) and enable build-source | ||
| run: cargo build --verbose --no-default-features --features build-source | ||
|
|
||
| - name: Run tests (Source) | ||
| working-directory: bindings/rust | ||
| run: cargo test --verbose --no-default-features --features build-source | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| target/ | ||
| image_capture/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.