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

Panic when Bevy app with Blenvy is packaged as a macOS .app #214

Open
rparrett opened this issue Aug 3, 2024 · 2 comments
Open

Panic when Bevy app with Blenvy is packaged as a macOS .app #214

rparrett opened this issue Aug 3, 2024 · 2 comments

Comments

@rparrett
Copy link

rparrett commented Aug 3, 2024

Noticed this during Bevy Jam 5 where the native mac builds of a few separate games utilizing blenvy failed to launch in a particular way.

https://phlimy.itch.io/way-of-the-sand
https://github.com/Azorlogh/Bevy-Jam-5/blob/main/Cargo.toml

https://chrisbiscardi.itch.io/wash-cycle
https://github.com/ChristopherBiscardi/bevy-jam-5/blob/main/Cargo.toml

This behavior depends on how the app is launched:

method result
open way_of_the_sand.app or double click icon app "opens" but closes before window is created
cd way_of_the_sand.app/Contents/MacOS; ./way_of_the_sand works fine
open way_of_the_sand.app/Contents/MacOS/way_of_the_sand terminal opens with blenvy panic (see below)

The panic:

thread 'main' panicked at /Users/runner/.cargo/git/checkouts/blenvy-b36e3bfafcd31d12/aff11cc/crates/blenvy/src/registry/export_types.rs:17:51:
should have created schema file: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `blenvy::registry::export_types::export_types`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
@rparrett
Copy link
Author

rparrett commented Aug 3, 2024

It was suggested that setting export_registry to false for release builds is "proper" and also works around this issue, so this might be considered "user error."

I'm not familiar withBlenvy, but a quick glance around the docs and examples didn't turn up anything related, so at the very least this seems like a documentation issue.

However, maybe export_registry should not be the default behavior, or should be behind a feature flag or something? It looks like there's also some code to prevent registry export from happening on Wasm where it also can't work.

@rparrett
Copy link
Author

rparrett commented Aug 3, 2024

It does seem like the actual underlying issue is something like "AssetRoot somehow does not point to the right place when launching on macOS." or "The current directory isn't what we think it is when launching on macOS."

It looks like Blenvy is just snagging the configured relative path from AssetPlugin, but I believe the proper thing to do would be to use FileAssetReader::get_base_path(). At least, that's what this bevy example does.

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

1 participant