Skip to content

Conversation

@alphastrata
Copy link
Contributor

Objective

Explicitly and exactly know what of the environment variables (if any) are being used/not-used/found-not-found by the bevy_asset::io::file::get_base_path().

  • Describe the objective or issue this PR addresses:
    In a sufficiently complex project, with enough crates and such it can be hard to know what the Asset Server is using as, what in the bevy parlance is its 'base path', this change seems to be the lowest effort to discovering that.

Solution

  • Added debug! logging to the FileAssetReader::new() call.

Testing

See output by making a project and trying something like RUST_LOG=bevy_asset::io::file=debug cargo run

  • Ran Bevy's tests.

  • How can other people (reviewers) test your changes?: Intentionally mess with your env variables (BEVY_ASSET_ROOT and CARGO_MANIFEST_DIR, scatter assets about and attempt to (without this change) locate where it's going wrong.

  • Is there anything specific they need to know?: I encountered this issue in a rather large workspace with many many crates with multiple nested asset directories.

  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test? Linux.


@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jun 12, 2024
@alphastrata alphastrata marked this pull request as ready for review June 13, 2024 06:26
@alice-i-cecile alice-i-cecile changed the title add debug logging to ascertain the base bath the asset server is using add debug logging to ascertain the base path the asset server is using Jun 13, 2024
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jun 13, 2024
@alphastrata
Copy link
Contributor Author

@alice-i-cecile presumably this one's pretty uncontroversial yeah?

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Jul 6, 2024
@alice-i-cecile alice-i-cecile added the X-Uncontroversial This work is generally agreed upon label Jul 6, 2024
@alice-i-cecile alice-i-cecile added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 6, 2024
Copy link
Contributor

@torsteingrindvik torsteingrindvik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asset root path can indeed be confusing so this is a nice log statement to have.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 14, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 15, 2024
Merged via the queue into bevyengine:main with commit 4340f7b Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants