bevyengine / bevyengine/bevy

The dynamic feature causes issues since dyld cannot load libstd when debugging on macOS within CLion

Open
#3,856 9 comments 6 reactions 0 assignees View on GitHub
C-Docs O-MacOS
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.6

## Operating system & version

macOS 12.1 running on M1 Pro

## What you did

Create a new binary with cargo and the bevy dependency using `bevy = { version = "0.6", features = ["dynamic"] }`. Then change the code within `main.rs` to the following:

```rust
use bevy::prelude::*;

fn main() {
App::new().add_plugins(DefaultPlugins).run();
}
```

Start the application in Debug mode from within CLion.

## What you expected to happen

The app would start without issues.

## What actually happened

The debugger halts with the following error in the console:

```
dyld[53483]: Library not loaded: @rpath/libstd-834e42ded129b20e.dylib
Referenced from: /Users/near/Code/Personal/bevy_dynamic_issue/target/debug/bevy_dynamic_issue
Reason: tried: '/usr/local/lib/libstd-834e42ded129b20e.dylib' (no such file), '/usr/lib/libstd-834e42ded129b20e.dylib' (no such file)
Signal: SIGABRT (signal SIGABRT)

Process finished with exit code 9
```

## Additional information

Weirdly enough just running the application instead of debugging it, works without issues. Presumably there is an erroneous interaction between lldb that is used by CLion and the executable.

Contributor guide

Open the contributing guide

Research direction

Start with the dynamic Bevy dependency configuration and the minimal main.rs example, then reproduce the failure by launching the application in Debug mode from CLion. Compare the debugger launch with a normal run and investigate the reported dyld and lldb interaction; done means the example starts successfully under the CLion debugger without the missing libstd error.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.