Skip to content

Add support for bevy dynamic linking feature #21

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

Closed
monstaflame opened this issue Nov 5, 2024 · 2 comments
Closed

Add support for bevy dynamic linking feature #21

monstaflame opened this issue Nov 5, 2024 · 2 comments

Comments

@monstaflame
Copy link

monstaflame commented Nov 5, 2024

Hello, I would really like to use your crate but there is an issue with the dynamic_linking optional feature of bevy :

$ cargo build
Locking 1 package to latest compatible version
      Adding bevy_dylib v0.14.2
   Compiling bevy_render v0.14.2
   Compiling bevy_core_pipeline v0.14.2
   Compiling bevy_scene v0.14.2
   Compiling bevy_animation v0.14.2
   Compiling bevy_sprite v0.14.2
   Compiling bevy_pbr v0.14.2
   Compiling bevy_text v0.14.2
   Compiling bevy_ui v0.14.2
   Compiling bevy_gizmos v0.14.2
   Compiling bevy_gltf v0.14.2
   Compiling bevy_dev_tools v0.14.2
   Compiling bevy_internal v0.14.2
   Compiling bevy_dylib v0.14.2
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="..."
  = note: /usr/bin/ld: __rust_realloc: undefined version: 
          /usr/bin/ld: __rust_no_alloc_shim_is_unstable: undefined version: 
          /usr/bin/ld: __rust_dealloc: undefined version: 
          /usr/bin/ld: __rust_alloc_zeroed: undefined version: 
          /usr/bin/ld: __rust_alloc_error_handler_should_panic: undefined version: 
          /usr/bin/ld: __rust_alloc_error_handler: undefined version: 
          /usr/bin/ld: __rust_alloc: undefined version: 
          /usr/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status
error: could not compile `bevy_dylib` (lib) due to 1 previous error

I can't just remove this optional feature as it makes compile times 10x faster in my case (~2s instead of ~20s).

In my opinion, a possible fix would be to add the optional feature to your crate's bevy dependency (also as an optional one maybe ?). I could be wrong. I'm not an expert, but I guess it would also make your crate compile faster.

It might be a bug with edges as it also depends on bevy as I can see in your Cargo.toml file.

Can you do something about this please ?
Thanks ! :)

My Cargo.toml :

[package]
name = "bevy-dodge-the-creeps"
version = "0.5.2"
edition = "2021"

[dependencies]
bevy = { version = "0.14.2", default-features = false, features = [
    # The list of bevy features : https://github.com/bevyengine/bevy/blob/main/docs/cargo_features.md
    ##############################
    # Default Bevy functionalities
    ##############################
    "animation", # Animation support
    "bevy_asset", # Assets management
    "bevy_audio", # Builtin audio
    "bevy_color", # Shared color types and operations
    "bevy_core_pipeline", # Cameras and other basic render pipeline features
    "bevy_render", # Rendering framework core
    "bevy_sprite", # 2D (sprites) rendering
    "bevy_state", # Built-in global state machines
    "bevy_text", # Text/font rendering
    "bevy_ui", # UI toolkit
    "bevy_winit", # Window management (cross-platform Winit backend)
    "default_font", # Include a default font, containing only ASCII characters, at the cost of a 20kB binary size increase
    "multi_threaded", # Run with multithreading

    # File formats:
    "png", # PNG image format for simple 2D images
    "vorbis", # Audio: OGG / Vorbis support

    ##################################
    # Non-default Bevy functionalities
    ##################################
    "asset_processor", # Asset processing
    "bevy_dev_tools", # Collection of developer tools

    # Platform-specific:
    "wayland", # (Linux) Support Wayland windowing system

    # Development/Debug features:
    "dynamic_linking", # Dynamic linking for faster compile-times
] }
bevy_collider_gen = { version = "0.2.2", default-features = false, features = ["rapier2d"] }
@salam99823
Copy link
Collaborator

Hi @monstaflame. I think this issue can't be fixed into this crate because it is an issue of bevy. This issue. But I'll be glad if you fix this.

@monstaflame
Copy link
Author

Hi, you're right. I'm too much of a newbie to fix this issue :/ Feel free to close this issue. Thank you :)

@shnewto shnewto closed this as completed Nov 12, 2024
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

No branches or pull requests

3 participants