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

Fails to build in a directory that has a parent directory with spaces in the name #30

Open
rukai opened this issue Nov 19, 2018 · 3 comments

Comments

@rukai
Copy link
Contributor

rukai commented Nov 19, 2018

Initially reported here: https://www.reddit.com/r/rust/comments/9ye5s8/vulkano_fails_to_compile_after_implementing/

Doing cargo run --release in the directory /home/rubic/dir with space oh no/shaderc-rs
Results in this compile error.

 97%] Building CXX object shaderc/glslc/CMakeFiles/glslc.dir/src/dependency_info.cc.o
[ 97%] Built target shaderc_shared
[ 98%] Linking CXX executable shaderc-online-compile
[ 98%] Built target shaderc-online-compile
[ 98%] Linking CXX static library libglslc.a
[ 98%] Built target glslc

--- stderr
usr/bin/ar: /home/rubic/dir: No such file or directory
make[2]: *** [shaderc/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/build.make:69: shaderc/libshaderc/libshaderc_combined.a] Error 9
make[1]: *** [CMakeFiles/Makefile2:2984: shaderc/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:130: all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2

build script failed, must exit now', /home/rubic/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.33/src/lib.rs:773:5
stack backtrace:
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:346
   7: cmake::fail
   8: cmake::run
   9: cmake::Config::build
  10: build_script_build::main

This is the important line: usr/bin/ar: /home/rubic/dir: No such file or directory
The path given to ar should be escaped.

@rukai rukai changed the title Fails to build in a directory that has spaces in the name or a parent directory has spaces in the name. Fails to build in a directory that has a parent directory with spaces in the name Nov 19, 2018
@antiagainst
Copy link
Collaborator

Gah, whitespaces in paths, what a beautiful legacy we inherit from the past.

I'm using standard Path and the cmake-rs crate and thought they should have handled that, but it seems not.

Apparently it's quite difficult to come up with an elegant solution. I tried to escape the space, or quote it, all are not working.

I think we may need to fix cmake-rs for this.

@kroppt
Copy link

kroppt commented Sep 11, 2022

The root cause of the problem appears to be:
google/shaderc#473

@kroppt
Copy link

kroppt commented Jan 16, 2024

The fix is available starting in v2023.8. This repository needs to update their sources to get it.

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

3 participants