microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.89k stars 6.32k forks source link

[icu] build failure on x64-mingw-static #40154

Closed Colysia closed 3 weeks ago

Colysia commented 2 months ago

Operating system

Windows 11

Compiler

MinGW

Steps to reproduce the behavior

Install with manifest.

{
    "name": "mainly-library",
    "version": "1.0.0",
    "builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1",
    "dependencies": [
        {
            "name": "fmt",
            "features": []
        },
        {
            "name": "icu",
            "features": [ ]
        }
    ]
}

Failure logs

-- Using cached icu4c-74_2-src.tgz.
-- Cleaning sources at E:/DevelopKits/vcpkg/buildtrees/icu/src/c-74_2-src-35bac2c62e.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source E:/DevelopKits/vcpkg/downloads/icu4c-74_2-src.tgz
-- Applying patch disable-escapestr-tool.patch
-- Applying patch remove-MD-from-configure.patch
-- Applying patch fix_parallel_build_on_windows.patch
-- Applying patch fix-extra.patch
-- Applying patch mingw-dll-install.patch
-- Applying patch disable-static-prefix.patch
-- Applying patch fix-win-build.patch
-- Applying patch vcpkg-cross-data.patch
-- Applying patch darwin-rpath.patch
-- Applying patch mingw-strict-ansi.diff
-- Using source at E:/DevelopKits/vcpkg/buildtrees/icu/src/c-74_2-src-35bac2c62e.clean
-- Getting CMake variables for x64-mingw-static
-- Using cached msys2-autoconf-wrapper-20221207-1-any.pkg.tar.zst.
-- Using cached msys2-automake-wrapper-20221207-2-any.pkg.tar.zst.
-- Using cached msys2-binutils-2.42-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libtool-2.4.7-3-x86_64.pkg.tar.zst.
-- Using cached msys2-make-4.4.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-2.1.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-which-2.21-4-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf-archive-2023.02.20-1-any.pkg.tar.zst.
-- Using cached msys2-bash-5.2.026-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.45-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.10-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.5.3-3-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf2.71-2.71-3-any.pkg.tar.zst.
-- Using cached msys2-automake1.16-1.16.5-1-any.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.22.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.3.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-tar-1.35-2-x86_64.pkg.tar.zst.
-- Using cached msys2-findutils-4.10.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-gmp-6.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-13.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.6.2-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.6-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.010-1-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-4-x86_64.pkg.tar.zst.
-- Using cached msys2-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys2-perl-5.38.2-2-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.5-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libxcrypt-4.4.36-1-x86_64.pkg.tar.zst.
-- Using msys root at E:/DevelopKits/vcpkg/downloads/tools/msys2/77af496191246fde
-- Generating configure for x64-mingw-static
-- Finished generating configure for x64-mingw-static
-- Using cached msys2-mingw-w64-x86_64-pkgconf-1~2.2.0-1-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.5.3-3-x86_64.pkg.tar.zst.
-- Using msys root at E:/DevelopKits/vcpkg/downloads/tools/msys2/1e74ca60daa10104
-- Configuring x64-mingw-static-dbg
-- Configuring x64-mingw-static-rel
-- Building x64-mingw-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: E:/DevelopKits/vcpkg/downloads/tools/msys2/77af496191246fde/usr/bin/make.exe -j 13 --trace -f Makefile all
    Working Directory: E:/DevelopKits/vcpkg/buildtrees/icu/x64-mingw-static-dbg/
    See logs for more information:
      E:\DevelopKits\vcpkg\buildtrees\icu\build-x64-mingw-static-dbg-out.log
      E:\DevelopKits\vcpkg\buildtrees\icu\build-x64-mingw-static-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_make.cmake:136 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_make.cmake:2 (vcpkg_build_make)
  buildtrees/versioning_/versions/icu/291bbc492b8f73dea0dbd12051e9b12b21aef900/portfile.cmake:100 (vcpkg_install_make)
  scripts/ports.cmake:192 (include)
E:\DevelopKits\vcpkg\buildtrees\icu\build-x64-mingw-static-dbg-err.log ``` E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating libicudtd.a .././../src/c-74_2-src-35bac2c62e.clean/source/common/locmap.cpp: In function 'uint32_t uprv_convertToLCIDPlatform_74(const char*, UErrorCode*)': .././../src/c-74_2-src-35bac2c62e.clean/source/common/locmap.cpp:1172:13: warning: unused variable 'len' [-Wunused-variable] 1172 | int32_t len; | ^~~ .././../src/c-74_2-src-35bac2c62e.clean/source/common/ubiditransform.cpp: In function 'uint32_t ubiditransform_transform_74(UBiDiTransform*, const char16_t*, int32_t, char16_t*, int32_t, UBiDiLevel, UBiDiOrder, UBiDiLevel, UBiDiOrder, UBiDiMirroring, uint32_t, UErrorCode*)': .././../src/c-74_2-src-35bac2c62e.clean/source/common/ubiditransform.cpp:502:24: warning: comparing the result of pointer addition '(action + 8)' and NULL [-Waddress] 502 | if (action + 1) { | ~~~~~~~^~~ E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuucd.a .././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp: In function 'UBool getSystemTimeInformation(icu_74::TimeZone*, SYSTEMTIME&, SYSTEMTIME&, int32_t&, int32_t&, int32_t&)': .././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp:70:35: warning: comparison is always false due to limited range of data type [-Wtype-limits] 70 | if (standardDate.wDay < 0) { | ~~~~~~~~~~~~~~~~~~^~~ .././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp:91:35: warning: comparison is always false due to limited range of data type [-Wtype-limits] 91 | if (daylightDate.wDay < 0) { | ~~~~~~~~~~~~~~~~~~^~~ E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuind.a E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuiod.a /bin/sh: line 1: ../../bin/genrb: No such file or directory make[2]: *** [Makefile:176: uconvmsg/root.res] Error 127 make[2]: *** Waiting for unfinished jobs.... /bin/sh: line 1: ../../bin/genrb: No such file or directory make[2]: *** [Makefile:176: uconvmsg/fr.res] Error 127 make[1]: *** [Makefile:49: all-recursive] Error 2 make: *** [Makefile:153: all-recursive] Error 2 ```

Additional context

No response

greenozon commented 2 months ago

it is looking for genrb util, check that you have it

genrb - compile a resource bundle

Colysia commented 2 months ago

it is looking for genrb util, check that you have it

genrb - compile a resource bundle

Yes, there is only genrb.exe in my MinGW env and icu:x64-windows tool path instead of genrb util.

greenozon commented 2 months ago

I'd suggest to validate two things: 1) make sure genrb.exe is a valid executable and you could run it by hands 2) validate that path specified in logs towards genrb is valid /bin/sh: line 1: ../../bin/genrb: No such file or directory << this one

greenozon commented 2 months ago

@Colysia what are the steps you used to build icu package? I just gave it a try like

c:\Dev\vcpkg>vcpkg install icu
Computing installation plan...
The following packages will be built and installed:
    icu[core,tools]:x64-windows@74.2#4
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Dev/VS2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\TATO\AppData\Local\vcpkg\archives in 189 us. Use --debug to see more details.
Installing 1/1 icu[core,tools]:x64-windows@74.2#4...
Building icu[core,tools]:x64-windows@74.2#4...
-- Using cached icu4c-74_2-src.tgz.

............

-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-uc.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-uc.pc
-- Installing: C:/Dev/vcpkg/packages/icu_x64-windows/share/icu/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Dev/vcpkg/packages/icu_x64-windows/share/icu/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 8 s.
Elapsed time to handle icu:x64-windows: 6.7 min
icu:x64-windows package ABI: b9f46a861fd5370ba0bd15acaadc8e2b5950668dbc7eaa8d370accf56c10f068
Total install time: 6.7 min
icu provides pkg-config modules:

  # International Components for Unicode: Internationalization library
  icu-i18n

  # International Components for Unicode: Stream and I/O Library
  icu-io

  # International Components for Unicode: Common and Data libraries
  icu-uc

and it was successfully built, see logs above used latest vcpkg from the git repo

Colysia commented 2 months ago

@Colysia what are the steps you used to build icu package?您使用哪些步骤来构建 ICU 包? I just gave it a try like我只是试了一下

c:\Dev\vcpkg>vcpkg install icu
Computing installation plan...
The following packages will be built and installed:
    icu[core,tools]:x64-windows@74.2#4
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Dev/VS2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\TATO\AppData\Local\vcpkg\archives in 189 us. Use --debug to see more details.
Installing 1/1 icu[core,tools]:x64-windows@74.2#4...
Building icu[core,tools]:x64-windows@74.2#4...
-- Using cached icu4c-74_2-src.tgz.

............

-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/lib/pkgconfig/icu-uc.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-i18n.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-io.pc
-- Fixing pkgconfig file: C:/Dev/vcpkg/packages/icu_x64-windows/debug/lib/pkgconfig/icu-uc.pc
-- Installing: C:/Dev/vcpkg/packages/icu_x64-windows/share/icu/vcpkg-cmake-wrapper.cmake
-- Installing: C:/Dev/vcpkg/packages/icu_x64-windows/share/icu/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 8 s.
Elapsed time to handle icu:x64-windows: 6.7 min
icu:x64-windows package ABI: b9f46a861fd5370ba0bd15acaadc8e2b5950668dbc7eaa8d370accf56c10f068
Total install time: 6.7 min
icu provides pkg-config modules:

  # International Components for Unicode: Internationalization library
  icu-i18n

  # International Components for Unicode: Stream and I/O Library
  icu-io

  # International Components for Unicode: Common and Data libraries
  icu-uc

and it was successfully built, see logs above并且它已成功构建,请参阅上面的日志 used latest vcpkg from the git repo使用了 Git 存储库中的最新 vcpkg

In fact, when I installed icu:x64-windows and icu:x64-windows-static-md, it was successful. But when I installed icu:x64-mingw-static, it failed with the logs I mentioned earlier. Directly using vcpkg install icu:x64-mingw-static might be able to reproduce this result.

As for that need to validate, I am indeed unable to confirm where is the current directory when using the command ../../bin/genrb

greenozon commented 2 months ago

when I tried to follow your step I hit another issue:

c:\Dev\vcpkg>vcpkg install icu:x64-mingw-static
Computing installation plan...
The following packages will be built and installed:
    icu:x64-mingw-static@74.2#4
Detecting compiler hash for triplet x64-mingw-static...
error: while detecting compiler information:
The log file content at "C:\Dev\vcpkg\buildtrees\detect_compiler\stdout-x64-mingw-static.log" is:
-- Downloading https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -> ninja-win-1.10.2.zip...
-- Configuring x64-mingw-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: C:/Dev/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe -v
    Working Directory: C:/Dev/vcpkg/buildtrees/detect_compiler/x64-mingw-static-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:\Dev\vcpkg\buildtrees\detect_compiler\config-x64-mingw-static-rel-CMakeCache.txt.log
      C:\Dev\vcpkg\buildtrees\detect_compiler\config-x64-mingw-static-out.log

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

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

the contents of the file C:\Dev\vcpkg\buildtrees\detect_compiler\config-x64-mingw-static-out.log:

[1/1] "C:/Dev/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir ".." "C:/Dev/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/Dev/vcpkg/scripts/detect_compiler" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/Dev/vcpkg/packages/detect_compiler_x64-mingw-static" "-DCMAKE_MAKE_PROGRAM=C:/Dev/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe" "-DCMAKE_SYSTEM_NAME=MinGW" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Dev/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=C:/Dev/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=C:/Dev/vcpkg" "-DZ_VCPKG_ROOT_DIR=C:/Dev/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/Dev/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
FAILED: ../CMakeCache.txt 
"C:/Dev/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir ".." "C:/Dev/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/Dev/vcpkg/scripts/detect_compiler" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/Dev/vcpkg/packages/detect_compiler_x64-mingw-static" "-DCMAKE_MAKE_PROGRAM=C:/Dev/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe" "-DCMAKE_SYSTEM_NAME=MinGW" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Dev/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=C:/Dev/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=C:/Dev/vcpkg" "-DZ_VCPKG_ROOT_DIR=C:/Dev/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/Dev/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
-- 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!
ninja: build stopped: subcommand failed.

question: do you have same issue, if not - how do you instruct vcpkg about C compiler?

dg0yt commented 2 months ago

The following packages will be built and installed: icu[core,tools]:x64-windows@74.2#4

This doesn't say much about mingw build. x64-windows is MSVC, not mingw.

Directly using vcpkg install icu:x64-mingw-static might be able to reproduce this result.

Well, icu:x64-mingw-static builds successful with MSYS2 mingw.

@Colysia Did you (also) set the host triplet to mingw? Vcpkg default is x64-windows, so not setting the host triplet means building host tools (genrb) with MSVC. This mix is at least untested.

Colysia commented 1 month ago

The following packages will be built and installed: icu[core,tools]:x64-windows@74.2#4

This doesn't say much about mingw build. x64-windows is MSVC, not mingw.

Directly using vcpkg install icu:x64-mingw-static might be able to reproduce this result.

Well, icu:x64-mingw-static builds successful with MSYS2 mingw.

@Colysia Did you (also) set the host triplet to mingw? Vcpkg default is x64-windows, so not setting the host triplet means building host tools (genrb) with MSVC. This mix is at least untested.

Yes, I used the triplet, there is the whole content below.

PS C:\Users\Executor> vcpkg install icu:x64-mingw-static
Computing installation plan...
The following packages will be built and installed:
    icu:x64-mingw-static@74.2#4
Detecting compiler hash for triplet x64-mingw-static...
-- Using %HTTP(S)_PROXY% in environment variables.
Compiler found: E:/DevelopKits/msys64/ucrt64/bin/x86_64-w64-mingw32-g++.exe
Restored 0 package(s) from E:\binary-cache in 45.8 ms. Use --debug to see more details.
Installing 1/1 icu:x64-mingw-static@74.2#4...
Building icu:x64-mingw-static@74.2#4...
E:\DevelopKits\vcpkg\triplets\community\x64-mingw-static.cmake: info: loaded community triplet from here. Community triplets are not built in the curated registry and are thus less likely to succeed.
-- Using cached icu4c-74_2-src.tgz.
-- Cleaning sources at E:/DevelopKits/vcpkg/buildtrees/icu/src/c-74_2-src-35bac2c62e.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source E:/DevelopKits/vcpkg/downloads/icu4c-74_2-src.tgz
-- Applying patch disable-escapestr-tool.patch
-- Applying patch remove-MD-from-configure.patch
-- Applying patch fix_parallel_build_on_windows.patch
-- Applying patch fix-extra.patch
-- Applying patch mingw-dll-install.patch
-- Applying patch disable-static-prefix.patch
-- Applying patch fix-win-build.patch
-- Applying patch vcpkg-cross-data.patch
-- Applying patch darwin-rpath.patch
-- Applying patch mingw-strict-ansi.diff
-- Using source at E:/DevelopKits/vcpkg/buildtrees/icu/src/c-74_2-src-35bac2c62e.clean
-- Getting CMake variables for x64-mingw-static
-- Using cached msys2-autoconf-wrapper-20221207-1-any.pkg.tar.zst.
-- Using cached msys2-automake-wrapper-20221207-2-any.pkg.tar.zst.
-- Using cached msys2-binutils-2.42-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libtool-2.4.7-3-x86_64.pkg.tar.zst.
-- Using cached msys2-make-4.4.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-2.1.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-which-2.21-4-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf-archive-2023.02.20-1-any.pkg.tar.zst.
-- Using cached msys2-bash-5.2.026-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.45-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.10-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.5.3-3-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf2.71-2.71-3-any.pkg.tar.zst.
-- Using cached msys2-automake1.16-1.16.5-1-any.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.22.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.3.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-tar-1.35-2-x86_64.pkg.tar.zst.
-- Using cached msys2-findutils-4.10.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-gmp-6.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-13.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.6.2-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.6-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.010-1-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-4-x86_64.pkg.tar.zst.
-- Using cached msys2-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys2-perl-5.38.2-2-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.5-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libxcrypt-4.4.36-1-x86_64.pkg.tar.zst.
-- Using msys root at E:/DevelopKits/vcpkg/downloads/tools/msys2/77af496191246fde
-- Generating configure for x64-mingw-static
-- Finished generating configure for x64-mingw-static
-- Using cached msys2-mingw-w64-x86_64-pkgconf-1~2.2.0-1-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.5.3-3-x86_64.pkg.tar.zst.
-- Using msys root at E:/DevelopKits/vcpkg/downloads/tools/msys2/1e74ca60daa10104
-- Configuring x64-mingw-static-dbg
-- Configuring x64-mingw-static-rel
-- Building x64-mingw-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: E:/DevelopKits/vcpkg/downloads/tools/msys2/77af496191246fde/usr/bin/make.exe -j 13 --trace -f Makefile all
    Working Directory: E:/DevelopKits/vcpkg/buildtrees/icu/x64-mingw-static-dbg/
    See logs for more information:
      E:\DevelopKits\vcpkg\buildtrees\icu\build-x64-mingw-static-dbg-out.log
      E:\DevelopKits\vcpkg\buildtrees\icu\build-x64-mingw-static-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_make.cmake:136 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_make.cmake:2 (vcpkg_build_make)
  ports/icu/portfile.cmake:100 (vcpkg_install_make)
  scripts/ports.cmake:192 (include)

error: building icu:x64-mingw-static failed with: BUILD_FAILED
Elapsed time to handle icu:x64-mingw-static: 4.1 min
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+icu
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=[icu]+Build+error+on+x64-mingw-static&body=Copy+issue+body+from+E%3A%2FDevelopKits%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating libicudtd.a
.././../src/c-74_2-src-35bac2c62e.clean/source/common/locmap.cpp: In function 'uint32_t uprv_convertToLCIDPlatform_74(const char*, UErrorCode*)':
.././../src/c-74_2-src-35bac2c62e.clean/source/common/locmap.cpp:1172:13: warning: unused variable 'len' [-Wunused-variable]
 1172 |     int32_t len;
      |             ^~~
.././../src/c-74_2-src-35bac2c62e.clean/source/common/ubiditransform.cpp: In function 'uint32_t ubiditransform_transform_74(UBiDiTransform*, const char16_t*, int32_t, char16_t*, int32_t, UBiDiLevel, UBiDiOrder, UBiDiLevel, UBiDiOrder, UBiDiMirroring, uint32_t, UErrorCode*)':
.././../src/c-74_2-src-35bac2c62e.clean/source/common/ubiditransform.cpp:502:24: warning: comparing the result of pointer addition '(action + 8)' and NULL [-Waddress]
  502 |             if (action + 1) {
      |                 ~~~~~~~^~~
E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuucd.a
.././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp: In function 'UBool getSystemTimeInformation(icu_74::TimeZone*, SYSTEMTIME&, SYSTEMTIME&, int32_t&, int32_t&, int32_t&)':
.././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp:70:35: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   70 |             if (standardDate.wDay < 0) {
      |                 ~~~~~~~~~~~~~~~~~~^~~
.././../src/c-74_2-src-35bac2c62e.clean/source/i18n/wintzimpl.cpp:91:35: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   91 |             if (daylightDate.wDay < 0) {
      |                 ~~~~~~~~~~~~~~~~~~^~~
E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuind.a
E:\DevelopKits\msys64\ucrt64\bin\ar.exe: creating ../lib/libicuiod.a
/bin/sh: line 1: ../../bin/genrb: No such file or directory
make[2]: *** [Makefile:176: uconvmsg/root.res] Error 127
make[2]: *** Waiting for unfinished jobs....
/bin/sh: line 1: ../../bin/genrb: No such file or directory
make[2]: *** [Makefile:176: uconvmsg/fr.res] Error 127
make[1]: *** [Makefile:49: all-recursive] Error 2
make: *** [Makefile:153: all-recursive] Error 2

And these are the packages in my msys2/ucrt64 env (Or the same error will occur when I change it to msys2/mingw64):

$ pacman -Qs | grep "ucrt"
local/mingw-w64-ucrt-x86_64-binutils 2.42-2 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-brotli 1.1.0-2
local/mingw-w64-ucrt-x86_64-bzip2 1.0.8-3
local/mingw-w64-ucrt-x86_64-clang-libs 18.1.8-1
local/mingw-w64-ucrt-x86_64-crt-git 12.0.0.r81.g90abf784a-1 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-expat 2.6.2-1
local/mingw-w64-ucrt-x86_64-gcc 14.1.0-3 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-gcc-libs 14.1.0-3
local/mingw-w64-ucrt-x86_64-gdb 15.1-1 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-gettext-runtime 0.22.5-2
local/mingw-w64-ucrt-x86_64-gmp 6.3.0-2
local/mingw-w64-ucrt-x86_64-gnutls 3.8.6-1
local/mingw-w64-ucrt-x86_64-headers-git 12.0.0.r81.g90abf784a-1 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-icu 75.1-2
local/mingw-w64-ucrt-x86_64-isl 0.26-1
local/mingw-w64-ucrt-x86_64-libffi 3.4.6-1
local/mingw-w64-ucrt-x86_64-libiconv 1.17-4
local/mingw-w64-ucrt-x86_64-libidn2 2.3.7-2
local/mingw-w64-ucrt-x86_64-libsystre 1.0.1-5
local/mingw-w64-ucrt-x86_64-libtasn1 4.19.0-1
local/mingw-w64-ucrt-x86_64-libtre-git r177.07e66d0-2
local/mingw-w64-ucrt-x86_64-libunistring 1.2-1
local/mingw-w64-ucrt-x86_64-libwinpthread-git 12.0.0.r81.g90abf784a-1 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-libxml2 2.12.9-1
local/mingw-w64-ucrt-x86_64-llvm 18.1.8-1
local/mingw-w64-ucrt-x86_64-llvm-libs 18.1.8-1
local/mingw-w64-ucrt-x86_64-make 4.4.1-2 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-mpc 1.3.1-2
local/mingw-w64-ucrt-x86_64-mpdecimal 4.0.0-1
local/mingw-w64-ucrt-x86_64-mpfr 4.2.1-2
local/mingw-w64-ucrt-x86_64-ncurses 6.4.20231217-1
local/mingw-w64-ucrt-x86_64-nettle 3.10-1
local/mingw-w64-ucrt-x86_64-openssl 3.3.1-1
local/mingw-w64-ucrt-x86_64-p11-kit 0.25.5-1
local/mingw-w64-ucrt-x86_64-pcre2 10.44-1
local/mingw-w64-ucrt-x86_64-python 3.11.9-1
local/mingw-w64-ucrt-x86_64-readline 8.2.010-1
local/mingw-w64-ucrt-x86_64-sqlite3 3.46.0-1
local/mingw-w64-ucrt-x86_64-tcl 8.6.13-1
local/mingw-w64-ucrt-x86_64-termcap 1.3.1-7
local/mingw-w64-ucrt-x86_64-tk 8.6.13-1
local/mingw-w64-ucrt-x86_64-tzdata 2024a-1
local/mingw-w64-ucrt-x86_64-wget 1.24.5-1
local/mingw-w64-ucrt-x86_64-windows-default-manifest 6.4-4
local/mingw-w64-ucrt-x86_64-wineditline 2.206-1
local/mingw-w64-ucrt-x86_64-winpthreads-git 12.0.0.r81.g90abf784a-1 (mingw-w64-ucrt-x86_64-toolchain)
local/mingw-w64-ucrt-x86_64-xxhash 0.8.2-2
local/mingw-w64-ucrt-x86_64-xz 5.6.2-2
local/mingw-w64-ucrt-x86_64-zlib 1.3.1-1
local/mingw-w64-ucrt-x86_64-zstd 1.5.6-2
greenozon commented 1 month ago

@Colysia how did you setup mingw?

in my case vcpkg can't find it:

image

Colysia commented 1 month ago

@Colysia how did you setup mingw?

in my case vcpkg can't find it:

image

  1. Download msys2 and install.
  2. Install gcc, gdb, make and so on in ucrt64 or mingw64 console.
  3. Add ucrt64/bin or mingw64/bin to your EnvPath.
  4. And Then you can use vcpkg to install package with triplet x64-mingw or x64-mingw-static. Or you can configure your mingw env by other way.
greenozon commented 1 month ago

Thank you for the very detailed steps! of course I dont have stand along msys2.. thats why I hit above issue sorry

PS what is the reason to build it using exactly by msys2 and not by VC?

dg0yt commented 1 month ago

@Colysia I can't reproduce it with msys2 ucrt64. In case there is some race, can you try with VCPKG_MAX_CONCURRENCY (enviroment variable) set to less than 13? Other hints might be in the config logs.

nilxbit commented 3 weeks ago

the same problem. vcpkg install icu[core,tools]:x64-mingw-static instead of vcpkg install icu:x64-mingw-static solved the problem

Colysia commented 3 weeks ago

the same problem. vcpkg install icu[core,tools]:x64-mingw-static instead of vcpkg install icu:x64-mingw-static solved the problem

thank you! I have successfully solved my problem through your method.

SantiiRepair commented 3 weeks ago

the same problem. vcpkg install icu[core,tools]:x64-mingw-static instead of vcpkg install icu:x64-mingw-static solved the problem

thank you buddy!!

dg0yt commented 3 weeks ago

So the port problem is not resolved.