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

Ports fail on Windows since Python update #6988

Closed
cskrisz opened this issue Jun 22, 2019 · 3 comments · Fixed by #7051
Closed

Ports fail on Windows since Python update #6988

cskrisz opened this issue Jun 22, 2019 · 3 comments · Fixed by #7051
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@cskrisz
Copy link
Contributor

cskrisz commented Jun 22, 2019

Since Python was updated from 3.5.4 to 3.7.3 (#6383) importing external modules does not work in scripts, e.g.:

-- Found PythonInterp: F:/vcpkg/downloads/tools/python/python3/python.exe (found version "3.7.3") 
-- Constructing LLVMBuild project information
CMake Error at CMakeLists.txt:683 (message):
  Unexpected failure executing llvm-build: Traceback (most recent call last):

    File "F:/vcpkg/buildtrees/llvm/src/llvm-7.0.0.src/utils/llvm-build/llvm-build", line 3, in <module>
      import llvmbuild

  ModuleNotFoundError: No module named 'llvmbuild'

This behavior is unique to the Python embeddable package and it seems to work that way since Python version 3.6.0.

The build works fine when

  • Using the host's Python installation or
  • Adding the module path to vcpkg\downloads\tools\python\python3\python37._pth

Packages that use Python 3 and might be affected: botan, clblas, ctemplate, folly, gl3w, glad, gtk, hyperscan, hyperscan, llvm, open62541, opencl, physx, pybind11, qscintilla, qt5-base, shaderc, shogun, spirv-tools, xmsh

Related issues: #6979, #6984, #7066

Machine setup: Windows 10 1903 x64, VS2019

@MVoz
Copy link
Contributor

MVoz commented Jun 22, 2019

most likely there is not enough module to build
example of use

https://github.com/microsoft/vcpkg/blob/master/ports/duktape/portfile.cmake
https://github.com/microsoft/vcpkg/blob/master/ports/open62541/portfile.cmake

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
if(NOT EXISTS ${PYTHON3_DIR}/easy_install${EXECUTABLE_SUFFIX})
    if(NOT EXISTS ${PYTHON3_DIR}/Scripts/pip${EXECUTABLE_SUFFIX})
        vcpkg_download_distfile(GET_PIP
            URLS "https://bootstrap.pypa.io/get-pip.py"
            FILENAME "tools/python/python3/get-pip.py"
            SHA512 99520d223819708b8f6e4b839d1fa215e4e8adc7fcd0db6c25a0399cf2fa10034b35673cf450609303646d12497f301ef53b7e7cc65c78e7bce4af0c673555ad
        )
        execute_process(COMMAND ${PYTHON3_DIR}/python${EXECUTABLE_SUFFIX} ${PYTHON3_DIR}/get-pip.py)
    endif()
    execute_process(COMMAND ${PYTHON3_DIR}/Scripts/pip${EXECUTABLE_SUFFIX} install six)
else()
    execute_process(COMMAND ${PYTHON3_DIR}/easy_install${EXECUTABLE_SUFFIX} six)
endif()

pip install six)

or manual

F:/vcpkg/downloads/tools/python/python3/python.exe -mpip install -U --force six

although the file python37._pth
can also be the cause, it can be simply removed

@cskrisz
Copy link
Contributor Author

cskrisz commented Jun 22, 2019

Primarily, the problem is with modules located in the same folder as the script being run. (Though pip packages are likely affected as well.)

@wasabinza
Copy link

Removing the vcpkg\downloads\tools\python\python3\python37._pth file appeared to be sufficient for me to build llvm with vcpkg.

@LilyWangL LilyWangL added the category:port-bug The issue is with a library, which is something the port should already support label Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants