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

can't find crate for vulkano_shaders #2559

Open
nulvinge opened this issue Aug 23, 2024 · 3 comments
Open

can't find crate for vulkano_shaders #2559

nulvinge opened this issue Aug 23, 2024 · 3 comments

Comments

@nulvinge
Copy link

  • Version of vulkano: 0.34.0, and latest master
  • OS: ubuntu linux
  • GPU (the selected PhysicalDevice): Intel UHD
  • GPU Driver: Mesa
  • Rust version: 1.75 and latest 1.80

Issue

I'm trying to run one of the examples. I have the repo checked out and run:
SHADERC_LIB_DIR=/home/nik/prj/shaderc/install/lib cargo run -v --bin triangle

Which results in this:

     Running `rustc --crate-name triangle --edition=2021 examples/triangle/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=105 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=5a98d40c8cfda99c -C extra-filename=-5a98d40c8cfda99c --out-dir /home/nik/prj/vulkano/target/release/deps -L dependency=/home/nik/prj/vulkano/target/release/deps --extern vulkano=/home/nik/prj/vulkano/target/release/deps/libvulkano-6ff585a2bb4978f9.rlib --extern vulkano_shaders=/home/nik/prj/vulkano/target/release/deps/libvulkano_shaders-db6fd8155ed47d7b.so --extern winit=/home/nik/prj/vulkano/target/release/deps/libwinit-83039023fbbc3866.rlib`

error[E0463]: can't find crate for `vulkano_shaders`
   --> examples/triangle/main.rs:306:9
    |
306 |         vulkano_shaders::shader! {
    |         ^^^^^^^^^^^^^^^ can't find crate

I've tried many things, but nothing seems to work.
Does anyone know what is going wrong?

@marc0246
Copy link
Contributor

I suggest making a fresh crate and running it like this:

cargo new shaderc-test && cd shaderc-test && cargo add shaderc && cargo build

Because you aren't going to go far with that diagnostic that Rust outputs when a linker error happens when building a proc macro dependency.

@nulvinge
Copy link
Author

Thanks for being so quick to answer, sorry for being so slow.

That succeeded:

cargo new shaderc-test && cd shaderc-test && cargo add shaderc && cargo build
     Created binary (application) `shaderc-test` package
    Updating crates.io index
      Adding shaderc v0.8.3 to dependencies.
             Features:
             - build-from-source
             - prefer-static-linking
    Updating crates.io index
   Compiling shlex v1.3.0
   Compiling xmlparser v0.13.6
   Compiling libc v0.2.158
   Compiling cc v1.1.14
   Compiling roxmltree v0.14.1
   Compiling cmake v0.1.51
   Compiling shaderc-sys v0.8.3
   Compiling shaderc v0.8.3
   Compiling shaderc-test v0.1.0 (/home/nik/prj/shaderc-test)
    Finished dev [unoptimized + debuginfo] target(s) in 2.36s

I'm quite new at rust, so I'm unsure of what exactly is going wrong.
But I guess looking into shaderc is a good start?

@marc0246
Copy link
Contributor

I was expecting that to fail, actually, and show you the errors (which Rust doesn't display when compiling the proc macro). I don't know what to do now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants