Skip to content

Commit

Permalink
Add support for uniffi library mode
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Oct 30, 2023
1 parent fa76bc6 commit 3296ea1
Show file tree
Hide file tree
Showing 17 changed files with 1,850 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ macos_arm64_task:
- cat Cargo.lock
install_script:
- brew install python3
- python3 -m pip install uniffi-bindgen==0.24.1
- python3 -m pip install uniffi-bindgen==0.25.0
<<: *BUILD_AND_TEST

linux_aarch64_task:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
if: ${{ !contains(matrix.python-version, 'pypy') }}
run: pip install cffi
- name: Install python packages
run: pip install virtualenv ziglang~=0.10.0 twine uniffi-bindgen==0.24.1
run: pip install virtualenv ziglang~=0.10.0 twine uniffi-bindgen==0.25.0
- uses: dtolnay/rust-toolchain@stable
id: rustup
with:
Expand Down
7 changes: 0 additions & 7 deletions src/module_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,13 +921,6 @@ fn generate_uniffi_bindings(
false
};

// Disallow library mode without UDL files for now
// Should be removed in https://github.com/PyO3/maturin/pull/1729
// once uniffi release a new version
if is_library {
bail!("No UDL files found in {}", crate_dir.join("src").display());
}

let mut cmd = uniffi_bindgen_command(crate_dir)?;
cmd.current_dir(crate_dir);
cmd.args([
Expand Down
4 changes: 2 additions & 2 deletions src/templates/Cargo.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pyo3 = "0.19.0"
{% elif bindings == "rust-cpython" -%}
cpython = "0.7.1"
{% elif bindings == "uniffi" -%}
uniffi = "0.24.1"
uniffi = "0.25.0"

[build-dependencies]
uniffi = { version = "0.24.1", features = ["build"] }
uniffi = { version = "0.25.0", features = ["build"] }
{% endif -%}
Loading

0 comments on commit 3296ea1

Please sign in to comment.