-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Build failure when dynamic_linking
feature is used
#9747
Comments
The issue occurs with nightly rust ( |
I could reproduce this problem with GNU ld, but the examples all compile smoothly with the mold linker https://github.com/rui314/mold. |
Build fails with lld ( Command: Error message:
|
Works as expected with mold for me as well. |
One more observation: If I remove |
Reproed on debian sid linux with lld 14.0.6. I think I take dynamic linking over CowArc, but the fact that something like that can break us makes me extremely uncomfortable. |
# Objective Fix #9747 ## Solution Linkers don't like what we're doing with CowArc (I'm guessing it has something to do with `?Sized`). Weirdly the `Reflect` derive on `AssetPath` doesn't fail, despite `CowArc` not implementing `Reflect`. To resolve this, we manually implement "reflect value" for `AssetPath<'static>`. It sadly cannot use `impl_reflect_value` because that macro doesn't support static lifetimes. --------- Co-authored-by: Martin Dickopp <[email protected]>
…ine#9752) # Objective Fix bevyengine#9747 ## Solution Linkers don't like what we're doing with CowArc (I'm guessing it has something to do with `?Sized`). Weirdly the `Reflect` derive on `AssetPath` doesn't fail, despite `CowArc` not implementing `Reflect`. To resolve this, we manually implement "reflect value" for `AssetPath<'static>`. It sadly cannot use `impl_reflect_value` because that macro doesn't support static lifetimes. --------- Co-authored-by: Martin Dickopp <[email protected]>
…#12596) # Objective * Adopted #12025 to fix merge conflicts * In some cases we used manual impls for certain types, though they are (at least, now) unnecessary. ## Solution * Use macros and reflecting-by-value to avoid this clutter. * Though there were linker issues with Reflect and the CowArc in AssetPath (see #9747), I checked these are resolved by using #[reflect_value]. --------- Co-authored-by: soqb <[email protected]> Co-authored-by: Alice Cecile <[email protected]> Co-authored-by: James Liu <[email protected]>
Reproduced this (roughly similar error) on Ubuntu Server 24.04 LTS. Rust toolchain version 1.81.0.
Cargo.toml[dependencies]
bevy = { version = "0.14.2", features = ["exr", "jpeg", "flac", "file_watcher", "dynamic_linking", "detailed_trace", "bmp", "dds", "bevy_dev_tools", "meshlet", "mp3", "pnm", "serialize", "shader_format_glsl", "asset_processor", "async-io"] }
diesel = { version = "2.2.4", features = ["mysql", "chrono", "postgres", "serde_json", "time", "uuid", "numeric", "network-address", "large-tables", "huge-tables", "extras"] }
tokio = { version = "1.40.0", features = ["full"] } |
Bevy version
main
branch, commit 17edf4fThe issue does not occur with the previous commit.
Relevant system information
What you did
Run command
cargo run --example hello_world --features dynamic_linking
in checked out bevy repository.What went wrong
Expected behavior
The command should build and run the
hello_world
example, i.e., printhello world
.Actual behavior
The command fails with the following output:
The text was updated successfully, but these errors were encountered: