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

[python3:x64-mingw-dynamic] build failure #21186

Closed
nanhuayu opened this issue Nov 4, 2021 · 16 comments
Closed

[python3:x64-mingw-dynamic] build failure #21186

nanhuayu opened this issue Nov 4, 2021 · 16 comments
Assignees
Labels
category:question This issue is a question

Comments

@nanhuayu
Copy link

nanhuayu commented Nov 4, 2021

Host Environment

  • OS: Windows 10 21H1 19043.1288
  • Compiler: visual studio 2019 Community: C/C++ Optimizing Compiler Version 19.29.30136 for x64

To Reproduce
Steps to reproduce the behavior:
./vcpkg install python3:x64-mingw-dynamic

Failure logs
-Cut and past the appropriate build messages from the console output.
-Please attach any additional failure logs mentioned in the console output.

Starting package 1/4: python3:x64-mingw-dynamic
Building package python3[core]:x64-mingw-dynamic...
-- Using community triplet x64-mingw-dynamic. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: D:\vcpkg\triplets\community\x64-mingw-dynamic.cmake
-- Using cached python-cpython-v3.10.0.tar.gz.
-- Cleaning sources at D:/vcpkg/buildtrees/python3/src/v3.10.0-5bd19d8a67.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/vcpkg/downloads/python-cpython-v3.10.0.tar.gz
-- Applying patch 0002-use-vcpkg-zlib.patch
-- Applying patch 0003-devendor-external-dependencies.patch
-- Applying patch 0004-dont-copy-vcruntime.patch
-- Applying patch 0005-only-build-required-projects.patch
-- Using source at D:/vcpkg/buildtrees/python3/src/v3.10.0-5bd19d8a67.clean
-- Building PCbuild/pcbuild.proj for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: msbuild D:/vcpkg/buildtrees/python3/x64-mingw-dynamic-rel/v3.10.0-5bd19d8a67.clean/PCbuild/pcbuild.proj /p:Configuration=Release /p:IncludeExtensions=true /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=false /p:IncludeTests=false /p:ForceImportBeforeCppTargets=D:/vcpkg/buildtrees/python3/src/v3.10.0-5bd19d8a67.clean/PCbuild/python_vcpkg.props /p:IncludeUwp=false /p:_VcpkgPythonLinkage=DynamicLibrary /t:Rebuild /p:Platform=x64 /p:PlatformToolset=external /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion= /p:VcpkgTriplet=x64-mingw-dynamic /p:VcpkgInstalledDir=D:/vcpkg/installed /p:VcpkgManifestInstall=false /p:UseMultiToolTask=true /p:MultiProcMaxCount=9 /p:EnforceProcessCountAcrossBuilds=true /m:9
    Working Directory: D:/vcpkg/buildtrees/python3/x64-mingw-dynamic-rel/v3.10.0-5bd19d8a67.clean
    Error code: 1
    See logs for more information:
      D:\vcpkg\buildtrees\python3\build-x64-mingw-dynamic-rel-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_msbuild.cmake:172 (vcpkg_execute_required_process)
  ports/python3/portfile.cmake:117 (vcpkg_install_msbuild)
  scripts/ports.cmake:142 (include)


Error: Building package python3:x64-mingw-dynamic failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  package: python3[core]:x64-mingw-dynamic -> 3.10.0
  vcpkg version: 2021-11-02-af04ebf6274fd6f7a941bff4662b3955c64f6f42
  vcpkg-tool version: Failed to get HEAD: fatal: not a git repository: 'D:\vcpkg\.git'

Additional context
Add any other context about the problem here, such as what you have already tried to resolve the issue.
build-x64-mingw-dynamic-rel-out.log

@JonLiu1993 JonLiu1993 added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Nov 4, 2021
@irisIsLove
Copy link

I hava this question, too

@term-est
Copy link

term-est commented Apr 3, 2022

I am also having this issue.
OS: Windows 10

vcpkg install python3 --triplet=x64-mingw-static fails with a similar error. From what i understand, vcpkg tries to build python with MSBuild and fails

Here is the error (truncated)

-- Using source at C:/src/vcpkg/buildtrees/python3/src/v3.10.2-c601936d22.clean
-- WARNING: Static builds of Python will not have C extension modules available.
-- Building PCbuild/pcbuild.proj for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message):
    Command failed: msbuild C:/src/vcpkg/buildtrees/python3/x64-mingw-static-rel/v3.10.2-c601936d22.clean/PCbuild/pcbuild.proj /p:Configuration=Release /p:IncludeExtensions=false /p:IncludeExternals=false /p:IncludeTests=false /p:ForceImportBeforeCppTargets=C:/src/vcpkg/buildtrees/python3/src/v3.10.2-c601936d22.clean/PCbuild/python_vcpkg.props /p:IncludeUwp=false /p:_VcpkgPythonLinkage=StaticLibrary /t:Rebuild /p:Platform=x64 /p:PlatformToolset=external /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion= /p:VcpkgTriplet=x64-mingw-static /p:VcpkgInstalledDir=C:/src/vcpkg/installed /p:VcpkgManifestInstall=false /p:UseMultiToolTask=true /p:MultiProcMaxCount=9 /p:EnforceProcessCountAcrossBuilds=true /m:9 /p:WholeProgramOptimization=false
    Working Directory: C:/src/vcpkg/buildtrees/python3/x64-mingw-static-rel/v3.10.2-c601936d22.clean
    Error code: 1
    See logs for more information:
      C:\src\vcpkg\buildtrees\python3\build-x64-mingw-static-rel-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_msbuild.cmake:172 (vcpkg_execute_required_process)
  ports/python3/portfile.cmake:140 (vcpkg_install_msbuild)
  scripts/ports.cmake:145 (include)


error: building python3:x64-mingw-static failed with: BUILD_FAILED

And here is the relevant part from the log file build-x64-mingw-static-rel-out.log:

         Getting build info from git
         git name-rev --name-only HEAD > "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\obj\310amd64_Release\pythoncore\gitbranch.txt"
         git rev-parse --short HEAD > "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\obj\310amd64_Release\pythoncore\gitversion.txt"
         git describe --all --always --dirty > "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\obj\310amd64_Release\pythoncore\gittag.txt"
         Building heads/master:01d6f6ff master
     3>C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj(548,5): warning : Toolset external is not used for official builds. Your build may have errors or incompatibilities.
     3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): error MSB8020: The build tools for external (Platform Toolset = 'external') cannot be found. To build using the external build tools, please install external build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj]
     3>Done Building Project "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj" (Build target(s)) -- FAILED.
     1>Done Building Project "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pcbuild.proj" (Rebuild target(s)) -- FAILED.

Build FAILED.

       "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pcbuild.proj" (Rebuild target) (1) ->
       "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj" (Build target) (3:5) ->
       (_WarnAboutToolset target) -> 
         C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj(548,5): warning : Toolset external is not used for official builds. Your build may have errors or incompatibilities.


       "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pcbuild.proj" (Rebuild target) (1) ->
       "C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj" (Build target) (3:5) ->
       (PrepareForBuild target) -> 
         C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): error MSB8020: The build tools for external (Platform Toolset = 'external') cannot be found. To build using the external build tools, please install external build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\src\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.73

Stacktrace leads to ports/python3/portfile.cmake:140, which is a call to vcpkg_install_msbuild

    vcpkg_install_msbuild(
        SOURCE_PATH "${SOURCE_PATH}"
        PROJECT_SUBPATH "PCbuild/pcbuild.proj"
        OPTIONS ${OPTIONS}
        LICENSE_SUBPATH "LICENSE"
        TARGET_PLATFORM_VERSION "${WINSDK_VERSION}"
        SKIP_CLEAN
    )

Thank you for taking your time to fixing this issue!

@winterz
Copy link
Contributor

winterz commented Apr 5, 2022

looking in VCPKG_ROOT\buildtrees\python3\build-x64-windows-rel-out.log`

everything is building fine and then this:

     3>C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PC\pyconfig.h(59,10): fatal error C1083: Cannot open include file: 'io.h': No such file or directory [C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PCbuild\pythoncore.vcxproj]
     3>C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PC\pyconfig.h(59,10): fatal error C1083: Cannot open include file: 'io.h': No such file or directory [C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PCbuild\pythoncore.vcxproj]
     3>C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PC\pyconfig.h(59,10): fatal error C1083: Cannot open include file: 'io.h': No such file or directory [C:\vcpkg\buildtrees\python3\x64-windows-rel\v3.10.2-a8de38632e.clean\PCbuild\pythoncore.vcxproj]
etc...

@maximeduvey
Copy link

maximeduvey commented Apr 24, 2022

Same problem, trying to use PCL, python3 block, trying to install vcpkg install python3 --triplet=x64-mingw-static as needed :

Host Environment :

  • Windows 10
  • Visual Studio 2019 16.9.4

To Reproduce

Steps to reproduce the behavior:
vcpkg install python3 --triplet=x64-mingw-static

Failure logs :

$ vcpkg install python3 --triplet=x64-mingw-static
Computing installation plan...
The following packages will be built and installed:
  * expat[core]:x64-mingw-static -> 2.4.8#1
    python3[core]:x64-mingw-static -> 3.10.2#1
  * zlib[core]:x64-mingw-static -> 1.2.12
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-mingw-static...
Error: while detecting compiler information:
The log content at H:\vcpkg\buildtrees\detect_compiler\stdout-x64-mingw-static.log is:
-- Found external ninja('1.10.2').
-- Configuring x64-mingw-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message):
    Command failed: ninja -v
    Working Directory: H:/vcpkg/buildtrees/detect_compiler/x64-mingw-static-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      H:\vcpkg\buildtrees\detect_compiler\config-x64-mingw-static-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:370 (vcpkg_execute_required_process)
  scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
  scripts/ports.cmake:145 (include)



Error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.

And in the specified log :

[1/1] cmd /c "cd .. && "H:/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe" "H:/vcpkg/scripts/detect_compiler" "-DCMAKE_MAKE_PROGRAM=F:/Ninja/ninja.exe" "-DCMAKE_SYSTEM_NAME=MinGW" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=H:/vcpkg/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-mingw-static" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=H:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=H:/vcpkg" "-DZ_VCPKG_ROOT_DIR=H:/vcpkg" "-D_VCPKG_INSTALLED_DIR=H:/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=H:/vcpkg/packages/detect_compiler_x64-mingw-static""
FAILED: ../CMakeCache.txt 
cmd /c "cd .. && "H:/vcpkg/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe" "H:/vcpkg/scripts/detect_compiler" "-DCMAKE_MAKE_PROGRAM=F:/Ninja/ninja.exe" "-DCMAKE_SYSTEM_NAME=MinGW" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=H:/vcpkg/scripts/toolchains/mingw.cmake" "-DVCPKG_TARGET_TRIPLET=x64-mingw-static" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=H:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=H:/vcpkg" "-DZ_VCPKG_ROOT_DIR=H:/vcpkg" "-D_VCPKG_INSTALLED_DIR=H:/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=H:/vcpkg/packages/detect_compiler_x64-mingw-static""
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:11 (enable_language):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "H:/vcpkg/buildtrees/detect_compiler/x64-mingw-static-rel/CMakeFiles/CMakeOutput.log".
See also "H:/vcpkg/buildtrees/detect_compiler/x64-mingw-static-rel/CMakeFiles/CMakeError.log".
ninja: build stopped: subcommand failed.

@MasterYC
Copy link

MasterYC commented May 7, 2022

if(NOT _VCPKG_MINGW_TOOLCHAIN)
set(_VCPKG_MINGW_TOOLCHAIN 1)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
    set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
endif()

# Need to override MinGW from VCPKG_CMAKE_SYSTEM_NAME
set(CMAKE_SYSTEM_NAME Windows CACHE STRING "" FORCE)

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
   set(CMAKE_SYSTEM_PROCESSOR i686 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
   set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
   set(CMAKE_SYSTEM_PROCESSOR armv7 CACHE STRING "")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
   set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "")
endif()

foreach(lang C CXX)
  set(CMAKE_${lang}_COMPILER_TARGET "${CMAKE_SYSTEM_PROCESSOR}-windows-gnu" CACHE STRING "")
endforeach()

find_program(CMAKE_C_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc")
find_program(CMAKE_CXX_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++")
find_program(CMAKE_RC_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres")
if(NOT CMAKE_RC_COMPILER)
    find_program(CMAKE_RC_COMPILER "windres")
endif()

get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if(NOT _CMAKE_IN_TRY_COMPILE)
    string(APPEND CMAKE_C_FLAGS_INIT " ${VCPKG_C_FLAGS} ")
    string(APPEND CMAKE_CXX_FLAGS_INIT " ${VCPKG_CXX_FLAGS} ")
    string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
    string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
    string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
    string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")

    string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
    string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
    if(VCPKG_CRT_LINKAGE STREQUAL "static")
        string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ")
        string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ")
    endif()
    string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
    string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
    string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
    string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
endif()
endif()

@MasterYC
Copy link

MasterYC commented May 8, 2022

how to solve?why not anyone can solve?

@JackBoosY
Copy link
Contributor

Please modify

if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)

to

 if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) 

Then try again.

Thanks.

@MasterYC
Copy link

MasterYC commented May 10, 2022 via email

@MasterYC
Copy link

Please modify

if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)

to

 if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) 

Then try again.

Thanks.

@MasterYC
Copy link

MasterYC commented May 10, 2022

this is the err.log

./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c: In function '_PyDebugAllocatorStats':
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c:2872:30: warning: unknown conversion type character 'z' in format [-Wformat=]
 2872 |                   "%d %ss * %zd bytes each",
      |                              ^
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c:2872:19: warning: too many arguments for format [-Wformat-extra-args]
 2872 |                   "%d %ss * %zd bytes each",
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c: In function '_PyObject_DebugMallocStats':
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c:3032:21: warning: unknown conversion type character 'z' in format [-Wformat=]
 3032 |                   "%zu arenas * %d bytes/arena",
      |                     ^
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c:3032:34: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
 3032 |                   "%zu arenas * %d bytes/arena",
      |                                 ~^
      |                                  |
      |                                  int
      |                                 %lld
 3033 |                   narenas, ARENA_SIZE);
      |                   ~~~~~~~         
      |                   |
      |                   size_t {aka long long unsigned int}
./../src/v3.10.2-c601936d22.clean/Objects/obmalloc.c:3032:19: warning: too many arguments for format [-Wformat-extra-args]
 3032 |                   "%zu arenas * %d bytes/arena",
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./../src/v3.10.2-c601936d22.clean/Python/ceval.c:266:
./../src/v3.10.2-c601936d22.clean/Python/ceval_gil.h:136:13: warning: 'recreate_gil' defined but not used [-Wunused-function]
  136 | static void recreate_gil(struct _gil_runtime_state *gil)
      |             ^~~~~~~~~~~~
./../src/v3.10.2-c601936d22.clean/Python/getargs.c: In function 'seterror':
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:455:38: warning: unknown conversion type character 'z' in format [-Wformat=]
  455 |                           "argument %zd", iarg);
      |                                      ^
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:455:27: warning: too many arguments for format [-Wformat-extra-args]
  455 |                           "argument %zd", iarg);
      |                           ^~~~~~~~~~~~~~
./../src/v3.10.2-c601936d22.clean/Python/getargs.c: In function 'converttuple':
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:543:57: warning: unknown conversion type character 'z' in format [-Wformat=]
  543 |                           "expected %d argument%s, not %zd",
      |                                                         ^
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:543:27: warning: too many arguments for format [-Wformat-extra-args]
  543 |                           "expected %d argument%s, not %zd",
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:550:64: warning: unknown conversion type character 'z' in format [-Wformat=]
  550 |                           "must be sequence of length %d, not %zd",
      |                                                                ^
./../src/v3.10.2-c601936d22.clean/Python/getargs.c:550:27: warning: too many arguments for format [-Wformat-extra-args]
  550 |                           "must be sequence of length %d, not %zd",
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./../src/v3.10.2-c601936d22.clean/Python/initconfig.c: In function 'config_init_env_warnoptions':
./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:2423:18: error: too many arguments to function 'wcstok'
 2423 | #  define WCSTOK wcstok
      |                  ^~~~~~
./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:2446:20: note: in expansion of macro 'WCSTOK'
 2446 |     for (warning = WCSTOK(env, L",", &context);
      |                    ^~~~~~
In file included from ./../src/v3.10.2-c601936d22.clean/Include/Python.h:30,
                 from ./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:1:
D:/Programming/msys2/mingw64/include/string.h:147:20: note: declared here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
      |                    ^~~~~~
./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:2423:18: error: too many arguments to function 'wcstok'
 2423 | #  define WCSTOK wcstok
      |                  ^~~~~~
./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:2448:20: note: in expansion of macro 'WCSTOK'
 2448 |          warning = WCSTOK(NULL, L",", &context))
      |                    ^~~~~~
In file included from ./../src/v3.10.2-c601936d22.clean/Include/Python.h:30,
                 from ./../src/v3.10.2-c601936d22.clean/Python/initconfig.c:1:
D:/Programming/msys2/mingw64/include/string.h:147:20: note: declared here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
      |                    ^~~~~~
make: *** [Makefile:845: Python/initconfig.o] Error 1
make: *** Waiting for unfinished jobs....

@JackBoosY
Copy link
Contributor

cc @dg0yt
Do you have any ideas?

@dg0yt
Copy link
Contributor

dg0yt commented May 11, 2022

I think we must either say "supports": "!mingw", or make it an empty port, or fetch patches from https://github.com/msys2-contrib/cpython-mingw.

@MasterYC
Copy link

I think we must either say "supports": "!mingw", or make it an empty port, or fetch patches from https://github.com/msys2-contrib/cpython-mingw.

I don‘t know what you mean

@dg0yt
Copy link
Contributor

dg0yt commented May 11, 2022

I don‘t know what you mean

It is easy: You cannot expect port python3 to build for MinGW soon. It is not a vcpkg problem.

@JackBoosY JackBoosY added category:question This issue is a question and removed category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. labels May 12, 2022
@JackBoosY JackBoosY self-assigned this May 12, 2022
@JackBoosY
Copy link
Contributor

Close this issue as not supported by the upstream.

@manhnt9
Copy link

manhnt9 commented Oct 12, 2022

There is no code to build with MinGW for Python, only MSBuild for MSVC. I'm adding it but there're some issues at last steps. Please send it to Python maintainers that you know: python/cpython#98211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants