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

Use a workspace dependency for the top-level uniffi crate. #1859

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

mhammond
Copy link
Member

This is only done for the top-level uniffi crate now, so really only impacts our examples and fixtures. It might be the case that we could extend this to the sub-crates but the versioning for them is less clear.

I can't see a good reason to not do this - is there one I'm missing?

@mhammond mhammond requested a review from a team as a code owner November 20, 2023 19:22
@mhammond mhammond requested review from bendk and removed request for a team November 20, 2023 19:22
@jplatte
Copy link
Collaborator

jplatte commented Nov 20, 2023

Personally, I specifically avoid workspace dependencies for example crates so that they can be copy-pasted to bootstrap a new project.

@mhammond
Copy link
Member Author

Personally, I specifically avoid workspace dependencies for example crates so that they can be copy-pasted to bootstrap a new project.

That makes sense, but doesn't seem to apply here because we aren't referring to the crates copy of UniFFI - ie, a new project can't just copy the existing path = "..." entries either?

@mhammond
Copy link
Member Author

(I was also slightly bothered by the fact that some examples did specify a version and some didn't, and it wasn't clear if this was intentional or actually changed the semantics)

@jplatte
Copy link
Collaborator

jplatte commented Nov 20, 2023

Right, in-workspace example crates generally use path dependencies so it's not exactly as easy as just copy-pasting. I would still argue that removing a path (if the version field is also set) is easier than looking up the version, but it's not like I'm strongly opposed to this change.

W.r.t. semantics of specifying a version for a path dependency or not, AFAIK specifying it means that (a) cargo checks that the version requirement matches the version field of the Cargo.toml at that path and (b) more importantly in most use cases, actually irrelevant here, allows the package to be published (pre-publish tests will be run against the latest crates.io release matching the version specification).

Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Looks good to me, let's get this in before the 0.26 release.

This is only done for the top-level uniffi crate now, so really only
impacts our examples and fixtures. It might be the case that we could
extend this to the sub-crates but the versioning for them is less clear.
@mhammond mhammond merged commit f189433 into mozilla:main Jan 18, 2024
5 checks passed
@mhammond mhammond deleted the uniffi-workspace branch January 18, 2024 16:35
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.

3 participants