-
Notifications
You must be signed in to change notification settings - Fork 64
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
Proposal: Require ninja when building with MSVC #47
Conversation
By default shaderc is built with msbuild when building with MSVC. Unfortunately this often causes the build to fail due to excessively long path names created by the msbuild project generator. This is especially true when shaderc is built as a dependency of another project, since in that case it will build in a nested subdirectory. The best solution to this problem is to build with ninja instead, but this solution is not obvious especially for users of downstream projects, who are unlikely to have read the shaderc README. To avoid this problem, we make ninja a hard requirement when building with MSVC. This causes the build to fail with 'couldn't find required command: "ninja"' when ninja is not available. This at least points the user in the right direction.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
I signed the CLA. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reasonable analysis and solution.
Thanks, @djcsdy! :) |
I just merged this PR. Please update the doc in another PR. Thanks! :) |
Original PR: google#47 To merge master
This PR is a proposal to make ninja a hard requirement when building with MSVC. It remains optional in all other cases.
The motivation for this change is that, if building with MSVC but without ninja, shaderc builds with msbuild, which often causes the build to fail due to the excessively long path names generated by the msbuild project generator. This is especially true when shaderc is built as a dependency of another project, since in that case it will build in a nested subdirectory.
The best solution to this problem is to build with ninja instead, but this solution is not obvious especially for users of downstream projects, who are unlikely to have read the shaderc README, or think of reading it as their first action to try to solve the problem.
With this change, if ninja is not available and the user is compiling with MSVC, the build will fail with:
This at least points the user in the right direction, at the IMHO very minor cost of requiring ninja in some cases where it is not absolutely necessary.
By comparison, if the build fails due to long path names (without this change), the relevant error message looks like:
Although this a very well-written error message and thoroughly describes the underlying problem, it doesn’t do anything to point the user in the right direction and can lead to hours of confused searching and experimentation. I know this because it happened to me :-).
If you like this change and want to merge it then I will also update the documentation to reflect this change.