Skip to content

Use external uniffi-bindgen if no root package is configured#1797

Merged
messense merged 1 commit intoPyO3:mainfrom
badboy:uniffi-handle-no-root-package
Oct 4, 2023
Merged

Use external uniffi-bindgen if no root package is configured#1797
messense merged 1 commit intoPyO3:mainfrom
badboy:uniffi-handle-no-root-package

Conversation

@badboy
Copy link
Copy Markdown
Contributor

@badboy badboy commented Oct 4, 2023

A "root package" in Cargo exists in a workspace if the workspace Cargo.toml also has a [package] section.
In that case maturin tries to find a binary target called uniffi-bindgen to use.

But if there's no root package to begin with it should fall back to an external uniffi-bindgen instead of panicking.

Fixes #1796


Note that this new behavior does not seem to be documented yet.
I'm not sure how common a root package is really.

A "root package" in Cargo exists in a workspace if the workspace
Cargo.toml also has a `[package]` section.
In that case maturin tries to find a binary target called
`uniffi-bindgen` to use.

But if there's no root package to begin with it should fall back to an
external `uniffi-bindgen` instead of panicking.
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 4, 2023

Deploy Preview for maturin-guide ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2e2d99c
🔍 Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/651d3234c7104a000826800d
😎 Deploy Preview https://deploy-preview-1797--maturin-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@messense messense merged commit 189852c into PyO3:main Oct 4, 2023
@badboy badboy deleted the uniffi-handle-no-root-package branch October 5, 2023 10:09
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Nov 7, 2023
https://build.opensuse.org/request/show/1123696
by user mia + anag+factory
- Update to 1.3.1
  * Use external uniffi-bindgen if no root package is configured
    gh#PyO3/maturin#1797
  * Add trusted publishing section to the user guide
    gh#PyO3/maturin#1800
  * Fix wheel filename for GraalPy
    gh#PyO3/maturin#1802
  * Pytest skeleton in mixed template
    gh#PyO3/maturin#1807
  * Keep trailing newlines from templates
    gh#PyO3/maturin#1808
  * Bump rustix from 0.37.23 to 0.37.25
    gh#PyO3/maturin#1809
  * Auto detect Python 3.13
    gh#PyO3/maturin#1810
  * Fix missing workspace.members in sdist
    gh#PyO3/maturin#1811
  * Don't set MACOSX_DEPLOYMENT_TARGET for editable builds
    gh#PyO3/maturin#1815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maturin 1.3.0 panics on develop with 'called Option::unwrap() on a None value'

2 participants