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 compiling with Ninja #45

Closed
aszecsei opened this issue Mar 26, 2019 · 11 comments
Closed

Error compiling with Ninja #45

aszecsei opened this issue Mar 26, 2019 · 11 comments

Comments

@aszecsei
Copy link

aszecsei commented Mar 26, 2019

I'm running this with vulkano_shaders, and running into an issue with the CMake command:

   Compiling shaderc v0.3.16
error: failed to run custom build command for `shaderc v0.3.16`
process didn't exit successfully: `C:\dev\oceanic\target\debug\build\shaderc-083ecb82f454c8e1\build-script-
build` (exit code: 101)
--- stdout
running: "cmake" "C:\\Users\\Alic Szecsei\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\shaderc-0.3.
16\\build" "-G" "Ninja" "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" "-DSPIRV_SKIP_EXECUTABLES=ON" "-DSPIRV_WERRO
R=OFF" "-DSHADERC_SKIP_TESTS=ON" "-DCMAKE_C_FLAGS= /nologo /EHsc" "-DCMAKE_CXX_FLAGS= /nologo /EHsc" "-DCMA
KE_C_FLAGS_RELEASE= /nologo /EHsc" "-DCMAKE_CXX_FLAGS_RELEASE= /nologo /EHsc" "-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_PREFIX=C:\\dev\\oceanic\\target\\debug\\build\\shaderc-934afc85cbc7abde\\out" "-DCMAKE_C_C
OMPILER=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64
/x64/cl.exe" "-DCMAKE_CXX_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/M
SVC/14.16.27023/bin/HostX64/x64/cl.exe" "-DCMAKE_BUILD_TYPE=Release"
-- Building SPIRV-Header examples
-- SPIRV-Tools: nosetests found - python support code will be tested
-- Google Mock was not found - tests based on that will not build
-- optimizer enabled
-- Shaderc: build type is "Release".
-- Configuring Shaderc to avoid building tests.
-- asciidoctor was not found - no documentation will be generated
-- Configuring done
-- Generating done
-- Build files have been written to: C:/dev/oceanic/target/debug/build/shaderc-934afc85cbc7abde/out/build
running: "cmake" "-j4" "--build" "." "--target" "install" "--config" "Release" "--"

--- stderr
CMake Error: The source directory "C:/dev/oceanic/target/debug/build/shaderc-934afc85cbc7abde/out/build/--"
 does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', C:\Users\Alic Szecsei\.cargo\registry\src\github.com-1ecc6299db9ec823\
cmake-0.1.36\src\lib.rs:813:5

Obviously "--" is getting appended to the build directory, but I have no idea how to fix this - any suggestions?

=========

EDIT: Removing Ninja from your path should fix this error; it would be nice if there were a feature to disable Ninja so I could continue to use it for other projects without having it be automatically detected and used in this one.

@aszecsei
Copy link
Author

It looks like this is due to Ninja being used as the build system; not sure if this is related #41 or not, but at least it's a workaround for now. Is it possible to get a feature to disable Ninja support so I can re-add it to my path?

@JoshuaBatty
Copy link

I'm also getting the same error on MacOS 10.14.... have you had any success getting this to build yet?

@aszecsei
Copy link
Author

Yes, I removed ninja from my path and it worked.

@hodasemi
Copy link
Contributor

I can confirm that I get the same error on Linux, removing ninja also worked here.

@aszecsei aszecsei changed the title Error compiling on Windows Error compiling with Ninja Mar 27, 2019
@ntgraff
Copy link

ntgraff commented Mar 28, 2019

I am getting the same error on Linux, but only when not compiling in a git repository. The same exact code compiles fine while inside of a git repository.

Edit: Nvm, see below

@rukai
Copy link
Contributor

rukai commented Mar 28, 2019

@ntgraff Oooh Thats it, I just hit this and didn't understand why i wasn't getting it in other crates.
I do have ninja installed as well.

Edit: Wait no, thats incorrect sorry. :(
I was still running into this issue even when I initiated git and made a single commit for my broken project.

However I ran cargo update on my working project which updated these crates:

    Updating crates.io index
    Updating approx v0.3.1 -> v0.3.2
    Updating cc v1.0.30 -> v1.0.32
    Updating cmake v0.1.35 -> v0.1.36
    Updating objc v0.2.5 -> v0.2.6
    Updating ordered-float v1.0.1 -> v1.0.2

After doing so I got this issue on that project.

@rukai
Copy link
Contributor

rukai commented Mar 28, 2019

The problem is with cmake_rs I will file an issue upstream.
In the mean time a workaround is to add cmake = "=0.1.35" to your Cargo.toml

@antiagainst
Copy link
Collaborator

Thanks for the investigation and solution! :) And sorry about the Ninja hassle. I'll add a cargo feature to disable using Ninja.

@cedric-h
Copy link

I'm... still getting this. How am I to go without ninja, if I need to compile for msvc and msvc requires it?

@antiagainst
Copy link
Collaborator

Hey @DefecateRainbows, sorry to hear about that. Are you using the newest version and still seeing this issue?

Right now the build options for shaderc-sys is already quite complicated. I'm reluctant to make it even more so by throwing in another option / feature to work around MSBuild bugs. IMHO, using ninja is just ... better. Even Visual Studio itself now ships with Ninja (in c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/). So is there a compelling reason preventing you from using it or downloading ninja if you don't have VS installed? Please let me know. :)

@ElhamAryanpur
Copy link

I had same issue but a workaround I found after reading and trying around was:

Ninja is needed for windows platform but optional elsewhere, so what I did was get Ninja binary and make a folder on root and add it there. Then make a build.rs and add that folder to path. This worked like a charm for me!

Hope it helps for people who are stuck!

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

8 participants