bevyengine / bevy-website

The source files for the official Bevy website
https://bevyengine.org
MIT License
198 stars 344 forks source link

Getting Started: Dynamic Linking doesn't suggest adding `bevy_dylib` #1591

Closed NotStirred closed 3 months ago

NotStirred commented 3 months ago

For dynamic linking bevy_dylib seems to be required as of 0.14 but isn't noted in the docs. (cargo add bevy_dylib)

Creating a new project and following the getting started steps for dynamic linking gives this error:

error: failed to select a version for the requirement `bevy_dylib = "^0.14.1"`
candidate versions found which didn't match: 0.13.2, 0.13.1, 0.13.0, ...
location searched: crates.io index
required by package `bevy v0.14.1`
    ... which satisfies dependency `bevy = "^0.14.1"` (locked to 0.14.1) of package `the_project v0.1.0 (/tmp/the_project)`
perhaps a crate was updated and forgotten to be re-vendored?
SkiFire13 commented 3 months ago

I tried reproducing this and I got a similar error (note though the versions of bevy_dylib that were found are different)

error: failed to select a version for the requirement `bevy_dylib = "^0.14.1"`
candidate versions found which didn't match: 0.14.0-rc.4, 0.14.0-rc.3, 0.14.0-rc.2, ...
location searched: crates.io index
required by package `bevy v0.14.1`
    ... which satisfies dependency `bevy = "^0.14.1"` (locked to 0.14.1) of package `rust-bevy-snake v0.1.0 (E:\WorkSpace\rust-bevy-snake)`
if you are looking for the prerelease package it needs to be specified explicitly
    bevy_dylib = { version = "0.14.0-rc.4" }

I then tried to delete the Cargo.lock file and it worked. What's most interesting however is that after doing this operation it started working even for newly created projects. The conclusion to me seems to be that this is a problem with cargo somehow not refreshing its crates.io cache.