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

Remove the bevy_dylib feature #9516

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Remove the bevy_dylib feature #9516

merged 1 commit into from
Aug 21, 2023

Conversation

paul-hansen
Copy link
Contributor

@paul-hansen paul-hansen commented Aug 20, 2023

Objective

There is a bevy_dylib feature that cargo automatically creates due to the bevy_dylib crate being optional.

This can be a footgun as I think we want users to always use the dynamic_linking feature for this. For example bevy_dylib was used in ridiculous_bevy_hot_reloading:lib.rs#L93 and since I was using dynamic_linking it ended up hot reloading with a slightly different configured library causing hot reloading to fail.

Solution

Use "dep:" syntax in the dynamic_linking feature to prevent bevy_dylib automatically becoming a cargo feature. This is documented here: https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies

It will now raise this error when you try to compile with the bevy_dylib feature:

error: Package bevy v0.12.0-dev (C:\Users\Paul\Projects\Rust\bevy) does not have feature bevy_dylib. It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.


Changelog

bevy_dylib is no longer a feature

Migration Guide

If you were using Bevy's bevy_dylib feature, use Bevy's dynamic_linking feature instead.

# 0.11
cargo run --features bevy/bevy_dylib

# 0.12
cargo run --features bevy/dynamic_linking
[dependencies]
# 0.11
bevy = { version = "0.11", features = ["bevy_dylib"] }

# 0.12
bevy = { version = "0.12", features = ["dynamic_linking"] }

Removes a potential footgun as you should use the dynamic_linking feature.
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Meta About the project itself S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Aug 21, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 21, 2023
@alice-i-cecile alice-i-cecile added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Aug 21, 2023
Merged via the queue into bevyengine:main with commit 565316f Aug 21, 2023
28 of 29 checks passed
@paul-hansen paul-hansen deleted the dep-bevy-dylib branch August 21, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Meta About the project itself C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants