-
Notifications
You must be signed in to change notification settings - Fork 116
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
ndk-build unable to build shaderc on Windows due to outdated Python version #25
Comments
Got the machine and tried with the repo and it seems to be ok -- the python coming with NDK is sufficient to get the samples built and run on device. Here is what I did from this fresh machine ( nothing installed, no python at all. ):
it built through without problem.
Also tried to get the latest shaderc code to this windows machine and build is fine too:
it built fine too. Thank you for raising the issue
Question for you: may you clarify your error coming from which point? thank you! |
@pumexx One thing, seems ndk 19 beta has some problem building shaderc, so use ndk-r18 instead for now ( internal ticket b/122414666) |
Thank you for performing the test. Earlier I wrote that I was able to build shaderc when I removed python*.exe from NDK ( it means that I was able to build shaderc with my own Python 2.7.15 ) Now I was also able to build shaderc with Python shipped with Android NDK ( Python 2.7.5 ) simply by setting these environment variables : set PATH=c:\Windows\System32 set PYTHONPATH= set PYTHONHOME= So the problem is that NDK mixed different Python versions due to existing environment variables. Otherwise documentation should mention something like "Ensure that no other Python version is able to run while building shaderc". |
would like to see it happen before make a note to doc team, what is your installed python version, besides NDK? The detailed steps to see it would be good. |
Oh, NDK-r19 formal release will fix the issue noted above, please refer to Thank you for raising this issue: it helped making a better NDK :-) |
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32 |
Thank you so much! may you kindly confirm win32 or win64 for your OS? thank you! |
OK, so I ran a command and got shaderc_err.txt file ( file is attached ): ......\ndk-build.cmd NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk APP_STL:=c++_static APP_ABI=all libshaderc_combined -j16 2> shaderc_err.txt System : Windows 7 SP1, 64-bit Environment variables: |
thank you again for the update! Unfortunately I could not see the failure after installing 2.7.15, and manually setting up the environment variables ( including PATH ). Mine is Windows 10 64 bit version. I am running out of the ways to see it, hope you could do further to debug it on your system, please kindly let us know what you findings. Thank you! |
ndk-build calls into our own shipped Python, and if the user has their own conflicting Python install referred to by PYTHONHOME or PYTHONPATH that can cause issues. Test: ./checkbuild.py Bug: android/ndk#904 Bug: googlesamples/vulkan-basic-samples#25 Change-Id: I1e0c3091e67c866e5e908c054fd2b5e45e80e58b
The latest Vulkan API samples switched to pre-compiled shaders, the compiling of the shaderc inside NDK is not that necessary anymore: check out https:/LunarG/VulkanSamples/blob/master/BUILD.md#building-on-android |
It looks like ndk-build ignores python from PATH / PYTHONPATH / PYTHONHOME environment variables and uses python 2.7.5 from ndk-bundle\prebuilt\windows-x86_64\bin directory
( that's a really outdated python version, to be honest )
As a result - shaderc compilation fails with message "ImportError: No module named _struct".
When I remove python*.exe from ndk-bundle\prebuilt\windows-x86_64\bin directory and use my own python 2.7.15 - shaderc is able to compile.
The text was updated successfully, but these errors were encountered: