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

Add bitcode support #739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tbillington
Copy link

This pr adds support for bitcode, commonly used by bevy games for it's more compact representation.

@KodrAus
Copy link
Member

KodrAus commented Mar 3, 2024

Thanks for the PR @tbillington.

Since the bitcode library is unstable we can't add support to uuid without also requiring the uuid_unstable rustflag be set too. The zerocopy support has an example of how to do this. Needing to set a flag at build-time makes these unstable features largely unsuitable for libraries, but can be used by applications that are willing to opt-in to it.

Would you be happy to add the extra uuid_unstable cfg to this?

@tbillington
Copy link
Author

Oh interesting, I can look into that 👍

When you say the library in unstable, what exactly do you mean?

@KodrAus
Copy link
Member

KodrAus commented Mar 4, 2024

Ah I just mean that the library is pre-1.0, so breaking changes are still expected. If the library does make breaking changes then we'll either need to make a breaking change in uuid too to adopt it, or create another feature to support it. Having the unstable opt-in RUSTFLAG is a balance between adding support for new libraries, and insulating uuid from breaking changes in its dependencies.

@caibear
Copy link

caibear commented Apr 28, 2024

Another solution is to specify bitcode = { version = "0", features = ["derive"], default-features = false, optional = true } and only use #[derive(Encode, Decode)]. These apis are considered a stable subset of bitcode. Then users of uuid can choose the major version of bitcode.

@tbillington
Copy link
Author

Happy to make the change caibear suggested, would that still require uuid_unstable?

@KodrAus
Copy link
Member

KodrAus commented May 6, 2024

Hmm, I wouldn't be comfortable taking on this kind of stability policy in uuid. I'd be more than happy to accept this under the same unstable policy as zerocopy though.

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.

None yet

3 participants