반응형

잘만 되던 VCPKG가 갑자기 OpenCV, VTK 등등을 빌드 할려니 pkgconf를 빌드하는 과정에서 에러가 났다.

결국 하루 동안 계속 문제점을 찾다가 해결 방법을 찾았다..

 

일단 나는 이런 오류가 떴다. 참고로 vcpkg install pkgconf:x64-windows 해서 나온 에러다.

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" install -v
    Working Directory: C:/dev/vcpkg/buildtrees/pkgconf/x64-windows-dbg
    Error code: 1
    See logs for more information:
      C:\dev\vcpkg\buildtrees\pkgconf\package-x64-windows-dbg-out.log
      C:\dev\vcpkg\buildtrees\pkgconf\package-x64-windows-dbg-err.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-tool-meson/vcpkg_install_meson.cmake:33 (vcpkg_execute_required_process)
  ports/pkgconf/portfile.cmake:67 (vcpkg_install_meson)
  scripts/ports.cmake:192 (include)


error: building pkgconf:x64-windows failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle pkgconf:x64-windows: 6.1 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+pkgconf
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=[pkgconf]+Build+error+on+x64-windows&body=Copy+issue+body+from+C%3A%2Fdev%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

 

 

에러난 부분의 문제를 보면 

Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" install -v
Working Directory: C:/dev/vcpkg/buildtrees/pkgconf/x64-windows-dbg

Working Directory에서 위 커맨드를 실행 중 오류가 났다고 한다.

 

그래서 나는 이걸 저 디렉토리에서 똑같이 실행해봤다.

그러더니 이런 오류가 떴다.

Traceback (most recent call last):
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\meson.py", line 27, in <module>
    sys.exit(mesonmain.main())
             ^^^^^^^^^^^^^^^^
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\mesonmain.py", line 291, in main
    return run(sys.argv[1:], launcher)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\mesonmain.py", line 282, in run
    return CommandLineParser().run(args)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\mesonmain.py", line 67, in __init__
    from . import mconf, mdist, minit, minstall, mintro, msetup, mtest, rewriter, msubprojects, munstable_coredata, mcompile, mdevenv, mformat
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\mconf.py", line 20, in <module>
    from . import mintro
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\mintro.py", line 23, in <module>
    from .ast import IntrospectionInterpreter, BUILD_TARGET_FUNCTIONS, AstConditionLevel, AstIDGenerator, AstIndentationGenerator, AstJSONPrinter
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\ast\__init__.py", line 19, in <module>
    from .interpreter import AstInterpreter
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\ast\interpreter.py", line 25, in <module>
    from ..interpreter import (
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\interpreter\__init__.py", line 33, in <module>
    from .interpreter import Interpreter, permitted_dependency_kwargs
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\interpreter\interpreter.py", line 19, in <module>
    from ..wrap import wrap, WrapMode
  File "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\mesonbuild\wrap\wrap.py", line 9, in <module>
    import urllib.request
  File "urllib\request.py", line 88, in <module>
  File "http\client.py", line 71, in <module>
  File "email\parser.py", line 12, in <module>
  File "email\feedparser.py", line 27, in <module>
  File "email\_policybase.py", line 9, in <module>
  File "email\utils.py", line 29, in <module>
  File "socket.py", line 51, in <module>

    ^
ImportError: DLL load failed while importing _socket: 지정된 모듈을 찾을 수 없습니다.
[0/1] "C:\dev\vcpkg\downloads\tools\python\python-3.11.8-x64\python.exe" "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\meson.py" "install" "--no-rebuild"
FAILED: meson-internal__install
"C:\dev\vcpkg\downloads\tools\python\python-3.11.8-x64\python.exe" "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\meson.py" "install" "--no-rebuild"
ninja: build stopped: subcommand failed.

이 오류를 보면 vcpkg에서 다운로드 받는 python-3.11.8에서 meson.py를 실행해서 설치를 하는데 _socket과 관련된 DLL 파일을 찾을 수 없어 발생한 문제이다.

 

일단 뭐 파이썬 홈페이지 가서 3.11.8를 받아서 설치하고 dll 파일을 가져오면 아마도 될 것 같긴 하지만..

혹시 실패할 수도 있고.. 제일 중요한건 그거까지 하기가 귀찮았다.. 내가 기본으로 설치한게 3.12.6이라서.. 저걸 깔면 나중에 또 지워야 하고 해서.. 귀찮았다.

 

그래서 혹시 몰라서 내가 기본으로 깔아둔 3.12.6 버전의 파이썬으로 빌드가 될까 해서 해봤더니..

python "C:\dev\vcpkg\downloads\tools\meson-1.5.2-dd4692\meson.py" "install" "--no-rebuild"
Installing pkgconf-5.dll to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\bin
Installing pkgconf.lib to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\lib
Installing pkgconf-5.pdb to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\bin
Installing pkgconf.exe to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\bin
Installing pkgconf.pdb to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\bin
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\libpkgconf\libpkgconf.h to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\../include\pkgconf/libpkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\libpkgconf\stdinc.h to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\../include\pkgconf/libpkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\libpkgconf\iter.h to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\../include\pkgconf/libpkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\libpkgconf\bsdstubs.h to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\../include\pkgconf/libpkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\libpkgconf\libpkgconf-api.h to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\../include\pkgconf/libpkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\man/pkgconf.1 to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/man\man1
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\man/pkg.m4.7 to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/man\man7
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\man/pc.5 to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/man\man5
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\man/pkgconf-personality.5 to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/man\man5
Installing C:\dev\vcpkg\buildtrees\pkgconf\x64-windows-dbg\meson-private\libpkgconf.pc to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\lib\pkgconfig
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\pkg.m4 to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/aclocal
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\AUTHORS to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/doc/pkgconf
Installing C:\dev\vcpkg\buildtrees\pkgconf\src\conf-2.3.0-07e4a066bf.clean\README.md to C:/dev/vcpkg/packages/pkgconf_x64-windows/debug\share/doc/pkgconf

빌드가 엄청 잘된다;;

 

일단 이 문제는 VCPKG에서 기본으로 설치하는 Python 3.11.8 버전의 어떤 라이브러리의 DLL 모듈이 없어서 에러났다니깐.. 그냥 VCPKG에서 빌드할 때 Python을 다른걸로 바꾸면 되는게 아닌가 하고 생각을 했다.

 

그래서 VCPKG에서 어느쪽에서 파이썬이 있는지 찾고 다운로드 하는지 찾아봤더니.. 한 파일이 나왔다.

C:\dev\vcpkg\scripts\cmake\vcpkg_find_acquire_program(PYTHON3).cmake

if(CMAKE_HOST_WIN32)
    set(program_name python)
    set(program_version 3.11.8)
    if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
        set(build_arch $ENV{PROCESSOR_ARCHITEW6432})
    else()
        set(build_arch $ENV{PROCESSOR_ARCHITECTURE})
    endif()
    if(build_arch MATCHES "^(ARM|arm)64$")
        set(tool_subdirectory "python-${program_version}-arm64")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip")
        set(download_filename "python-${program_version}-embed-arm64.zip")
        set(download_sha512 42b820e34c4a77fe928e0af395292d804dcbf7e1132cf353ce6ce23435a687ec580f03ccbf3cd94d98c9dc5ac951f8ca64dbd65cded7ef1d675a39d63f8ace8d)
    elseif(build_arch MATCHES "(amd|AMD)64")
        set(tool_subdirectory "python-${program_version}-x64")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip")
        set(download_filename "python-${program_version}-embed-amd64.zip")
        set(download_sha512 da5f01e94d3505eebdfd4d2e70d9cf494925199024479cc29ef144567906b2e8ad55a855b199a755318f5fb9a260f21b987a5fc85f31acf631af4b677921251d)
    else()
        set(tool_subdirectory "python-${program_version}-x86")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip")
        set(download_filename "python-${program_version}-embed-win32.zip")
        set(download_sha512 c88ef02f0860000dbc59361cfe051e3e8dc7d208ed39bb5bc20a3e8b8711b578926e281a11941787ea61b2ef05b945ab3133322dcb85b916f79ac4ada57f6309)
    endif()

    set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}")
    vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python311._pth)
else()
    set(program_name python3)
    set(brew_package_name "python")
    set(apt_package_name "python3")
endif()

이 파일이다.

 

여기를 보면 26번 줄에 set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}") 이런 코드가 있는데

이게 파이썬의 폴더를 검색하는 것 같다.

 

그래서 이걸 set(paths_to_search "C:/Users/cheongpark/AppData/Local/Programs/Python/Python312") 이렇게 바꿨다.

python.exe 파일이 있는 폴더까지를 지정해야하는 것 같다.

if(CMAKE_HOST_WIN32)
    set(program_name python)
    set(program_version 3.11.8)
    if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
        set(build_arch $ENV{PROCESSOR_ARCHITEW6432})
    else()
        set(build_arch $ENV{PROCESSOR_ARCHITECTURE})
    endif()
    if(build_arch MATCHES "^(ARM|arm)64$")
        set(tool_subdirectory "python-${program_version}-arm64")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip")
        set(download_filename "python-${program_version}-embed-arm64.zip")
        set(download_sha512 42b820e34c4a77fe928e0af395292d804dcbf7e1132cf353ce6ce23435a687ec580f03ccbf3cd94d98c9dc5ac951f8ca64dbd65cded7ef1d675a39d63f8ace8d)
    elseif(build_arch MATCHES "(amd|AMD)64")
        set(tool_subdirectory "python-${program_version}-x64")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip")
        set(download_filename "python-${program_version}-embed-amd64.zip")
        set(download_sha512 da5f01e94d3505eebdfd4d2e70d9cf494925199024479cc29ef144567906b2e8ad55a855b199a755318f5fb9a260f21b987a5fc85f31acf631af4b677921251d)
    else()
        set(tool_subdirectory "python-${program_version}-x86")
        set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip")
        set(download_filename "python-${program_version}-embed-win32.zip")
        set(download_sha512 c88ef02f0860000dbc59361cfe051e3e8dc7d208ed39bb5bc20a3e8b8711b578926e281a11941787ea61b2ef05b945ab3133322dcb85b916f79ac4ada57f6309)
    endif()

    set(paths_to_search "C:/Users/cheongpark/AppData/Local/Programs/Python/Python312")
    vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python311._pth)
else()
    set(program_name python3)
    set(brew_package_name "python")
    set(apt_package_name "python3")
endif()

 

 

이렇게 한 후에 다시 vcpkg install pkgconf:x64-windows를 해보면?!!

Computing installation plan...
The following packages will be built and installed:
    pkgconf:x64-windows@2.3.0
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\pkdpm\AppData\Local\vcpkg\archives in 91.2 us. Use --debug to see more details.
Installing 1/1 pkgconf:x64-windows@2.3.0...
Building pkgconf:x64-windows@2.3.0...
-- Found Python version '3.12.6 at C:/Users/cheongpark/AppData/Local/Programs/Python/Python312/python.exe'
-- Using meson: C:/dev/vcpkg/downloads/tools/meson-1.5.2-dd4692/meson.py
-- Using cached pkgconf-pkgconf-pkgconf-2.3.0.tar.gz.
-- Cleaning sources at C:/dev/vcpkg/buildtrees/pkgconf/src/conf-2.3.0-07e4a066bf.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/dev/vcpkg/downloads/pkgconf-pkgconf-pkgconf-2.3.0.tar.gz
-- Using source at C:/dev/vcpkg/buildtrees/pkgconf/src/conf-2.3.0-07e4a066bf.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows-dbg
-- Getting CMake variables for x64-windows
-- Configuring x64-windows-dbg done
-- Configuring x64-windows-rel
-- Configuring x64-windows-rel done
-- Package x64-windows-dbg
-- Package x64-windows-rel
-- Fixing pkgconfig file: C:/dev/vcpkg/packages/pkgconf_x64-windows/lib/pkgconfig/libpkgconf.pc
-- Fixing pkgconfig file: C:/dev/vcpkg/packages/pkgconf_x64-windows/debug/lib/pkgconfig/libpkgconf.pc
-- Installing: C:/dev/vcpkg/packages/pkgconf_x64-windows/share/pkgconf/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 125 ms.
Elapsed time to handle pkgconf:x64-windows: 16 s
pkgconf:x64-windows package ABI: 2aa878a6cc6bcbd98fbe97e87caf0270763d6f45acecb8cd2d758d0e269baeab
Total install time: 16 s
pkgconf provides pkg-config modules:

  # a library for accessing and manipulating development framework configuration
  libpkgconf

-- Found Python version '3.12.6 at C:/Users/pkdpm/AppData/Local/Programs/Python/Python312/python.exe' 

이런식으로 바뀌면서 정상적으로 빌드가 된다!!!

 

드디어 잘 수 있다..

반응형

+ Recent posts