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 we install the binaries just once to the .cargo/bin/, instead of per project? #34

Closed
Lokathor opened this issue Jan 26, 2019 · 5 comments

Comments

@Lokathor
Copy link

Would it be possible to change the project's general setup so that the C++ binaries go into the .cargo/bin/ directory, instead of having them be built per project and per project profile?

@antiagainst
Copy link
Collaborator

Hey @Lokathor, I intentionally disabled building binary targets from the dependent C++ projects because

  • I think they are irrelevant to the purpose of this project, which is to provide Rust library wrapper.
  • It will speed up the build.

But I'm not exactly sure about your use case. If you can call the C++ binaries instead, then you don't need the Rust library wrapper, which is for integrating with other Rust modules? :)

@Lokathor
Copy link
Author

Maybe I don't understand how the crate works? When I built it on my machine I end up with binaries deep inside my target directory

d:\dev\learn-gfx-hal\target\debug\build\shaderc-0b3a14f59f26d605\out\bin>dir
 Volume in drive D is Data
 Volume Serial Number is B265-51AB

 Directory of d:\dev\learn-gfx-hal\target\debug\build\shaderc-0b3a14f59f26d605\out\bin

2019-01-25  09:07 PM    <DIR>          .
2019-01-25  09:07 PM    <DIR>          ..
2019-01-25  09:06 PM         3,981,312 glslangValidator.exe
2019-01-25  09:06 PM         4,111,360 glslc.exe
2019-01-25  09:07 PM         4,038,144 shaderc_shared.dll
2019-01-15  09:01 AM               866 spirv-lesspipe.sh
2019-01-25  09:07 PM           218,624 spirv-remap.exe
2019-01-25  09:06 PM         1,156,608 SPIRV-Tools-shared.dll

Are those not important to the actual use of the crate? If they're not, why are they there. If they are, do I need to ship them with my program if I want my program to be able to compile GLSL->SPIRV?

Because of their existence, I assumed that the crate is just calling out to them to do the work, but I guess I could be totally wrong.

@antiagainst
Copy link
Collaborator

Hey @Lokathor, sorry for the late reply. The binaries compiled from C++ projects are not needed. (I turned off binary compilation switches in the build script but it seems some are not controlled by those switches, and they are still being compiled.) For those C++ projects, only libshaderc_combined.a is needed, which is linked into libshaderc.rlib for the Rust crate.

@Lokathor
Copy link
Author

Lokathor commented Feb 2, 2019

Ah ha! This explains a lot!

Well, I guess instead you've got a bug where some binaries are being built in error.

@antiagainst
Copy link
Collaborator

Thanks @Lokathor, it would be nice if you can open another issue for the bug of "some binaries are being built in error."

I'll close this one for now. :)

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

2 participants