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

Error while compiling a workspace #5

Open
Kaendor opened this issue Oct 8, 2022 · 4 comments
Open

Error while compiling a workspace #5

Kaendor opened this issue Oct 8, 2022 · 4 comments

Comments

@Kaendor
Copy link

Kaendor commented Oct 8, 2022

Hello,

I have a workspace with the following structure :

client
| assets
server
| assets

But when I run/build one crate or the other, I have this error :

warning: Could not find the asset folder from the Cargo build directory
warning: Could not find asset folder, please specify its path with $BEVY_ASSET_PATH
error: failed to run custom build command for bevy_embedded_assets v0.4.0

I managed to fix the issue by copying/pasting my asset folders at the root level, but duplicating assets isn't an ideal solution.

This issue appeared right after I split my project into multiple crates.

If you need more information, I would be glad to help!

@mockersf
Copy link
Member

mockersf commented Oct 9, 2022

How are you selecting the correct asset folder with Bevy?

Could you try setting the BEVY_ASSET_PATH environment variable to the path of your asset folder?

@Kaendor
Copy link
Author

Kaendor commented Oct 11, 2022

I use the default asset folder of bevy without tinkering with env vars usually, but I will try to set the BEVY_ASSET_PATH and share the results.

@pietrosophya
Copy link

It works for me if I set the env var, it would be great if it were able to check it depending on the sub crate folder.

Right now I have to export the var like

export BEVY_ASSET_PATH=${PWD}/main-workspace/bevy-crate/assets

while running cargo from ${PWD}/main-workspace.

Is there a way to define this?

@ndavd
Copy link

ndavd commented Sep 10, 2023

I am facing the same issue after publishing my application to crates.io

Upon doing cargo install ncube

   Compiling cargo-emit v0.2.1
   Compiling nohash-hasher v0.2.0
   Compiling bevy_embedded_assets v0.8.0
   Compiling epaint v0.22.0
   Compiling url v2.4.1
   Compiling bevy v0.11.2
   Compiling home v0.5.5
The following warnings were emitted during compilation:

warning: Could not find asset folder, please specify its path with $BEVY_ASSET_PATH

error: failed to run custom build command for `bevy_embedded_assets v0.8.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installtcCLm1/release/build/bevy_embedded_assets-fba8b0b576aee5b2/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed={}
  cargo:rerun-if-env-changed=BEVY_ASSET_PATH
  cargo:warning=Could not find asset folder, please specify its path with $BEVY_ASSET_PATH

  --- stderr
  thread 'main' panicked at 'No asset folder found', /home/ndavd/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_embedded_assets-0.8.0/build.rs:111:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ncube v1.0.0`, intermediate artifacts can be found at `/tmp/cargo-installtcCLm1`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

How should one go about to configure that env on a cargo install? cc @mockersf @pietrosophya

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

4 participants