microsoft / vcpkg

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

[libjpeg-turbo] Build error on x64-windows-static #40294

Closed ANB5Dev closed 1 month ago

ANB5Dev commented 1 month ago

Package: libjpeg-turbo:x64-windows-static@3.0.3

Host Environment

To Reproduce

vcpkg install libjpeg-turbo:x64-windows-static

Failure logs

-- Using cached libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz.
-- Cleaning sources at C:/vcpkg/buildtrees/libjpeg-turbo/src/3.0.3-5cdf18c9fe.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkg/downloads/libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz
-- Applying patch add-options-for-exes-docs-headers.patch
-- Applying patch workaround_cmake_system_processor.patch
-- Using source at C:/vcpkg/buildtrees/libjpeg-turbo/src/3.0.3-5cdf18c9fe.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: C:/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j5
    Working Directory: C:/vcpkg/buildtrees/libjpeg-turbo/x64-windows-static-dbg
    See logs for more information:
      C:\vcpkg\buildtrees\libjpeg-turbo\install-x64-windows-static-dbg-out.log

Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/libjpeg-turbo/portfile.cmake:58 (vcpkg_cmake_install)
  scripts/ports.cmake:192 (include)
C:\vcpkg\buildtrees\libjpeg-turbo\install-x64-windows-static-dbg-out.log ``` Change Dir: 'C:/vcpkg/buildtrees/libjpeg-turbo/x64-windows-static-dbg' Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v -v -j5 install [1/216] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcapistd.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcapistd.c FAILED: CMakeFiles/jpeg12-static.dir/jcapistd.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcapistd.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcapistd.c C:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h(32): fatal error C1017: invalid integer constant expression [2/216] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jccolor.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jccolor.c FAILED: CMakeFiles/jpeg12-static.dir/jccolor.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jccolor.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jccolor.c C:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h(32): fatal error C1017: invalid integer constant expression [3/216] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcdiffct.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcdiffct.c FAILED: CMakeFiles/jpeg12-static.dir/jcdiffct.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcdiffct.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcdiffct.c C:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h(32): fatal error C1017: invalid integer constant expression [4/216] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jclossls.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jclossls.c FAILED: CMakeFiles/jpeg12-static.dir/jclossls.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jclossls.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jclossls.c C:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h(32): fatal error C1017: invalid integer constant expression [5/216] C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcmainct.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcmainct.c FAILED: CMakeFiles/jpeg12-static.dir/jcmainct.c.obj C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe -D_CRT_NONSTDC_NO_WARNINGS -IC:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg -IC:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean /nologo /DWIN32 /D_WINDOWS /utf-8 /MP /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 -MTd -DBITS_IN_JSAMPLE=12 /showIncludes /FoCMakeFiles\jpeg12-static.dir\jcmainct.c.obj /FdCMakeFiles\jpeg12-static.dir\ /FS -c C:\vcpkg\buildtrees\libjpeg-turbo\src\3.0.3-5cdf18c9fe.clean\jcmainct.c C:\vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h(32): fatal error C1017: invalid integer constant expression ninja: build stopped: subcommand failed. ```

jconfigint.h.txt

MonicaLiu0311 commented 1 month ago

Sorry I didn't repro your issue.

PS G:\vcpkg> ./vcpkg install libjpeg-turbo:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
    libjpeg-turbo:x64-windows-static@3.0.3
Detecting compiler hash for triplet x64-windows-static...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\monica\AppData\Local\vcpkg\archives in 684 us. Use --debug to see more details.
Installing 1/1 libjpeg-turbo:x64-windows-static@3.0.3...
Building libjpeg-turbo:x64-windows-static@3.0.3...
-- Downloading https://github.com/libjpeg-turbo/libjpeg-turbo/archive/3.0.3.tar.gz -> libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz...
-- Extracting source G:/vcpkg/downloads/libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz
-- Applying patch add-options-for-exes-docs-headers.patch
-- Applying patch workaround_cmake_system_processor.patch
-- Using source at G:/vcpkg/buildtrees/libjpeg-turbo/src/3.0.3-5cdf18c9fe.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
-- Building x64-windows-static-rel
-- Fixing pkgconfig file: G:/vcpkg/packages/libjpeg-turbo_x64-windows-static/lib/pkgconfig/libjpeg.pc
-- Fixing pkgconfig file: G:/vcpkg/packages/libjpeg-turbo_x64-windows-static/lib/pkgconfig/libturbojpeg.pc
-- 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 G:/vcpkg/downloads/tools/msys2/1e74ca60daa10104
-- Fixing pkgconfig file: G:/vcpkg/packages/libjpeg-turbo_x64-windows-static/debug/lib/pkgconfig/libjpeg.pc
-- Fixing pkgconfig file: G:/vcpkg/packages/libjpeg-turbo_x64-windows-static/debug/lib/pkgconfig/libturbojpeg.pc
-- Installing: G:/vcpkg/packages/libjpeg-turbo_x64-windows-static/share/libjpeg-turbo/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 904 ms.
Elapsed time to handle libjpeg-turbo:x64-windows-static: 51 s
libjpeg-turbo:x64-windows-static package ABI: 9d52dd8d4e71e96b030f885fb8800a4ae3a7cb8e44f879379a35e069bc30a43a
Total install time: 51 s
libjpeg-turbo is compatible with built-in implementation-agnostic CMake targets:

    find_package(JPEG REQUIRED)
    target_include_directories(main PRIVATE JPEG::JPEG)

libjpeg-turbo provides CMake targets for the TurboJPEG C API:

    find_package(libjpeg-turbo CONFIG REQUIRED)
    target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:libjpeg-turbo::turbojpeg>,libjpeg-turbo::turbojpeg,libjpeg-turbo::turbojpeg-static>)
ANB5Dev commented 1 month ago

@MonicaLiu0311 Could you please share your vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h and the output of ./vcpkg install libjpeg-turbo:x64-windows-static --debug?

./vcpkg install libjpeg-turbo:x64-windows-static --debug ``` PS C:\vcpkg> ./vcpkg install libjpeg-turbo:x64-windows-static --debug [DEBUG] To include the environment variables in debug output, pass --debug-env [DEBUG] Trying to load bundleconfig from C:\vcpkg\vcpkg-bundle.json [DEBUG] Failed to open: C:\vcpkg\vcpkg-bundle.json [DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt [DEBUG] Metrics enabled. [DEBUG] Feature flag 'binarycaching' unset [DEBUG] Feature flag 'compilertracking' unset [DEBUG] Feature flag 'registries' unset [DEBUG] Feature flag 'versions' unset [DEBUG] Feature flag 'dependencygraph' unset [DEBUG] Using scripts-root: C:\vcpkg\scripts [DEBUG] Using builtin-ports: C:\vcpkg\ports [DEBUG] Using installed-root: C:\vcpkg\installed [DEBUG] Using buildtrees-root: C:\vcpkg\buildtrees [DEBUG] Using packages-root: C:\vcpkg\packages [DEBUG] Using vcpkg-root: C:\vcpkg [DEBUG] Using builtin-registry: C:\vcpkg\versions [DEBUG] Using downloads-root: C:\vcpkg\downloads [DEBUG] External asset downloads are allowed (x-block-origin is disabled)... [DEBUG] Asset cache is not configured. [DEBUG] Detecting host with IsWow64Process2 [DEBUG] Detecting host with IsWow64Process2 Computing installation plan... [DEBUG] 1000: CreateProcessW("C:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" --version) [DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after 47635 us [DEBUG] 1001: CreateProcessW("C:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=C:/vcpkg -DPACKAGES_DIR=C:/vcpkg/packages -DBUILDTREES_DIR=C:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=C:/vcpkg/installed -DDOWNLOADS=C:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\vcpkg\buildtrees\0.vcpkg_tags.cmake") [DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after 33093 us The following packages will be built and installed: libjpeg-turbo:x64-windows-static@3.0.3 [DEBUG] 1002: CreateProcessW("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products * -format xml) [DEBUG] 1002: cmd_execute_and_stream_data() returned 0 after 73446 us [DEBUG] Trying to hash C:\vcpkg\scripts\toolchains/windows.cmake [DEBUG] C:\vcpkg\scripts\toolchains/windows.cmake has hash 0433e2303d8e9448dd9cf29d3052811cb89f6324bfd45703cfd4ec1e4134228d [DEBUG] Trying to hash C:\vcpkg\triplets\x64-windows-static.cmake [DEBUG] C:\vcpkg\triplets\x64-windows-static.cmake has hash e3cd9820386c639b8cbf844d43853cbc838f75a1488bfd4add98d5646c716538 Detecting compiler hash for triplet x64-windows-static... [DEBUG] Found path: C:\Program Files\Git\cmd\git.exe [DEBUG] 1003: CreateProcessW("C:\Program Files\Git\cmd\git.exe" --version) [DEBUG] 1003: cmd_execute_and_stream_data() returned 0 after 53958 us [DEBUG] Detecting host with IsWow64Process2 [DEBUG] 1004: CreateProcessW("C:\vcpkg\downloads\tools\powershell-core-7.2.21-windows\pwsh.exe" --version) [DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after 225045 us [DEBUG] command line: cmd /d /c "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary/Build\vcvarsall.bat" -vcvars_ver=14.39.33519 amd64 2>&1 &1 [DEBUG] add-options-for-exes-docs-headers.patch|5c93ee62645786820dcca65d7158d39a355c3c7ac31f1d07e0a52d26e7875598 [DEBUG] cmake|3.29.2 [DEBUG] features|core [DEBUG] portfile.cmake|1a7b8c646c6ba9d4aa1ad90d6ef7cec98727a8003cc15013ca7334842b193386 [DEBUG] ports.cmake|3855df80ecd84038296b7ae73271a6190f21c4af0bb1a0ca0be752a308aaa53d [DEBUG] post_build_checks|2 [DEBUG] powershell|7.2.21 [DEBUG] triplet|x64-windows-static [DEBUG] triplet_abi|e3cd9820386c639b8cbf844d43853cbc838f75a1488bfd4add98d5646c716538-0433e2303d8e9448dd9cf29d3052811cb89f6324bfd45703cfd4ec1e4134228d-a41098bfc8f2dcdabbf2868e41798eb284581174 [DEBUG] usage|f6ff243d0aba5bc85904527de17fc8a341a3568b0b19e3ac63b95029125b9e68 [DEBUG] vcpkg-cmake|68ce40480e8397cec4f038a4a70e8422cef5c67e6bd70f2fb8430c92cd085242 [DEBUG] vcpkg-cmake-config|5787703a91d3b4e5f38e0713d0b97623f124bda10c32a4f4841bf9c648ca3613 [DEBUG] vcpkg-cmake-wrapper.cmake|d257c0a541dd60c4b6eb6f46a5e9f128a64a6ec40f3b8b5bc8ab753e7a935c61 [DEBUG] vcpkg.json|72c77395fe1daceda5b6d67f1b465b49c007ae99b73257e1f69d50cb35aa2589 [DEBUG] vcpkg_check_features|943b217e0968d64cf2cb9c272608e6a0b497377e792034f819809a79e1502c2b [DEBUG] vcpkg_copy_pdbs|d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c [DEBUG] vcpkg_find_acquire_program|96d9ee675798a3bddb54340d404b814be45a35c624b2eab5465cd45eaf18b6d3 [DEBUG] vcpkg_find_acquire_program(NASM)|b6fcd010dcc70cec5e2472dde5a5b794c11ed63a433215d0e4f8ab11620cde0a [DEBUG] vcpkg_fixup_pkgconfig|1a15f6c6d8e2b244d83a7514a0412d339127d2217d1df60ad1388b546c85f777 [DEBUG] vcpkg_from_git|96ed81968f76354c00096dd8cd4e63c6a235fa969334a11ab18d11c0c512ff58 [DEBUG] vcpkg_from_github|b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f [DEBUG] vcpkg_install_copyright|ba6c169ab4e59fa05682e530cdeb883767de22c8391f023d4e6844a7ec5dd3d2 [DEBUG] vcpkg_replace_string|b450deb79207478b37119743e00808ebc42de0628e7b98c14ab24728bd5c78b8 [DEBUG] workaround_cmake_system_processor.patch|1fd13c06d27a2fcef233fe209ba0c856ed76311be59ae72e15d1c58fe36eab04 [DEBUG] [DEBUG] Default binary cache path is: C:\Users\Gebruiker\AppData\Local\vcpkg\archives Restored 0 package(s) from C:\Users\Gebruiker\AppData\Local\vcpkg\archives in 165 us. Use --debug to see more details. Installing 1/1 libjpeg-turbo:x64-windows-static@3.0.3... Building libjpeg-turbo:x64-windows-static@3.0.3... [DEBUG] Detecting host with IsWow64Process2 [DEBUG] 1007: CreateProcessW("C:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" "-DALL_FEATURES=jpeg7;jpeg8;" -DCURRENT_PORT_DIR=C:/vcpkg/ports/libjpeg-turbo -D_HOST_TRIPLET=x64-windows -DFEATURES=core -DPORT=libjpeg-turbo -DVERSION=3.0.3 -DVCPKG_USE_HEAD_VERSION=0 -D_VCPKG_DOWNLOAD_TOOL=BUILT_IN -D_VCPKG_EDITABLE=0 -D_VCPKG_NO_DOWNLOADS=0 -DZ_VCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/vcpkg/scripts/toolchains/windows.cmake -DZ_VCPKG_POST_PORTFILE_INCLUDES= -DCMD=BUILD -DDOWNLOADS=C:/vcpkg/downloads -DTARGET_TRIPLET=x64-windows-static -DTARGET_TRIPLET_FILE=C:/vcpkg/triplets/x64-windows-static.cmake -DVCPKG_BASE_VERSION=2024-08-01 -DVCPKG_CONCURRENCY=5 -DVCPKG_PLATFORM_TOOLSET=v143 "-DGIT=C:/Program Files/Git/cmd/git.exe" "-DVCPKG_PORT_CONFIGS=C:\vcpkg\installed\x64-windows\share\vcpkg-cmake\vcpkg-port-config.cmake;C:\vcpkg\installed\x64-windows\share\vcpkg-cmake-config\vcpkg-port-config.cmake" -DVCPKG_ROOT_DIR=C:/vcpkg -DPACKAGES_DIR=C:/vcpkg/packages -DBUILDTREES_DIR=C:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=C:/vcpkg/installed -DDOWNLOADS=C:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\vcpkg\scripts\ports.cmake") -- Using cached libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz. -- Cleaning sources at C:/vcpkg/buildtrees/libjpeg-turbo/src/3.0.3-5cdf18c9fe.clean. Use --editable to skip cleaning for the packages you specify. -- Extracting source C:/vcpkg/downloads/libjpeg-turbo-libjpeg-turbo-3.0.3.tar.gz -- Applying patch add-options-for-exes-docs-headers.patch -- Applying patch workaround_cmake_system_processor.patch -- Using source at C:/vcpkg/buildtrees/libjpeg-turbo/src/3.0.3-5cdf18c9fe.clean -- Found external ninja('1.11.0'). -- Configuring x64-windows-static -- Building x64-windows-static-dbg CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message): Command failed: C:/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe --build . --config Debug --target install -- -v -j5 Working Directory: C:/vcpkg/buildtrees/libjpeg-turbo/x64-windows-static-dbg See logs for more information: C:\vcpkg\buildtrees\libjpeg-turbo\install-x64-windows-static-dbg-out.log Call Stack (most recent call first): installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process) installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build) ports/libjpeg-turbo/portfile.cmake:58 (vcpkg_cmake_install) scripts/ports.cmake:192 (include) [DEBUG] 1007: cmd_execute_and_stream_data() returned 1 after 17736466 us error: building libjpeg-turbo:x64-windows-static 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 libjpeg-turbo:x64-windows-static: 18 s [DEBUG] Detecting host with IsWow64Process2 [DEBUG] 1008: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\vcpkg\.git" "--work-tree=C:\vcpkg\.git" -c core.autocrlf=false show "--pretty=format:%h %cd (%cr)" -s --date=short HEAD) [DEBUG] 1008: cmd_execute_and_stream_data() returned 0 after 59448 us 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+libjpeg-turbo You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?title=[libjpeg-turbo]+Build+error+on+x64-windows-static&body=Copy+issue+body+from+C%3A%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md [DEBUG] D:\a\_work\1\s\src\vcpkg\commands.install.cpp(616): [DEBUG] Time in subprocesses: 22443431us [DEBUG] Time in parsing JSON: 83us [DEBUG] Time in JSON reader: 199us [DEBUG] Time in filesystem: 30133us [DEBUG] Time in loading ports: 2495us [DEBUG] Exiting after 23 s (22700277us) ```

The problem for me seems to be that SIZEOF_SIZE_T in jconfigint.h(.in) doesn't get populated with a value: jconfigint.h.in:22-23

/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T  @SIZE_T@

jconfigint.h:22-23

/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T  

Building vcpkg install libjpeg-turbo:x64-windows (non-static) works, and results in jconfigint.h:22-23:

/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T  8
MonicaLiu0311 commented 1 month ago

Could you please share your vcpkg\buildtrees\libjpeg-turbo\x64-windows-static-dbg\jconfigint.h

/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T  8

and the output of ./vcpkg install libjpeg-turbo:x64-windows-static --debug?

./vcpkg install libjpeg-turbo:x64-windows-static --debug
PS G:\vcpkg> ./vcpkg install libjpeg-turbo:x64-windows-static --debug
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from G:\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: G:\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: G:\vcpkg\scripts
[DEBUG] Using builtin-ports: G:\vcpkg\ports
[DEBUG] Using installed-root: G:\vcpkg\installed
[DEBUG] Using buildtrees-root: G:\vcpkg\buildtrees
[DEBUG] Using packages-root: G:\vcpkg\packages
[DEBUG] Using vcpkg-root: G:\vcpkg
[DEBUG] Using builtin-registry: G:\vcpkg\versions
[DEBUG] Using downloads-root: G:\vcpkg\downloads
[DEBUG] External asset downloads are allowed (x-block-origin is disabled)...
[DEBUG] Asset cache is not configured.
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Detecting host with IsWow64Process2
Computing installation plan...
[DEBUG] Failed to open: G:\vcpkg\ports\boost-vcpkg-helpers\vcpkg.json
[DEBUG] Failed to open: G:\vcpkg\ports\boost-vcpkg-helpers\CONTROL
[DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe
[DEBUG] 1000: CreateProcessW("G:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after   245690 us
[DEBUG] 1001: CreateProcessW("G:\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386/bin/cmake.exe" -DVCPKG_ROOT_DIR=G:/vcpkg -DPACKAGES_DIR=G:/vcpkg/packages -DBUILDTREES_DIR=G:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=G:/vcpkg/installed -DDOWNLOADS=G:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "G:\vcpkg\buildtrees\0.vcpkg_tags.cmake")
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after    30833 us
The following packages will be built and installed:
    libjpeg-turbo:x64-windows-static@3.0.3
[DEBUG] 1002: CreateProcessW("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products * -format xml)
[DEBUG] 1002: cmd_execute_and_stream_data() returned 0 after    47181 us
[DEBUG] Trying to hash G:\vcpkg\scripts\toolchains/windows.cmake
[DEBUG] G:\vcpkg\scripts\toolchains/windows.cmake has hash 0433e2303d8e9448dd9cf29d3052811cb89f6324bfd45703cfd4ec1e4134228d
[DEBUG] Trying to hash G:\vcpkg\triplets\x64-windows-static.cmake
[DEBUG] G:\vcpkg\triplets\x64-windows-static.cmake has hash e3cd9820386c639b8cbf844d43853cbc838f75a1488bfd4add98d5646c716538
Detecting compiler hash for triplet x64-windows-static...
[DEBUG] Found path: C:\Program Files\Git\cmd\git.exe
[DEBUG] 1003: CreateProcessW("C:\Program Files\Git\cmd\git.exe" --version)
[DEBUG] 1003: cmd_execute_and_stream_data() returned 0 after   120754 us
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] 1004: CreateProcessW("G:\vcpkg\downloads\tools\powershell-core-7.2.21-windows\pwsh.exe" --version)
[DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after  2067720 us
[DEBUG] command line: cmd /d /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary/Build\vcvarsall.bat" -vcvars_ver=14.40.33807 amd64   2>&1 &1 
[DEBUG]   add-options-for-exes-docs-headers.patch|5c93ee62645786820dcca65d7158d39a355c3c7ac31f1d07e0a52d26e7875598
[DEBUG]   cmake|3.29.2
[DEBUG]   features|core
[DEBUG]   portfile.cmake|1a7b8c646c6ba9d4aa1ad90d6ef7cec98727a8003cc15013ca7334842b193386
[DEBUG]   ports.cmake|3855df80ecd84038296b7ae73271a6190f21c4af0bb1a0ca0be752a308aaa53d
[DEBUG]   post_build_checks|2
[DEBUG]   powershell|7.2.21
[DEBUG]   triplet|x64-windows-static
[DEBUG]   triplet_abi|e3cd9820386c639b8cbf844d43853cbc838f75a1488bfd4add98d5646c716538-0433e2303d8e9448dd9cf29d3052811cb89f6324bfd45703cfd4ec1e4134228d-0d6c67bb905400c980de9c1cd893e6cceaa88150
[DEBUG]   usage|f6ff243d0aba5bc85904527de17fc8a341a3568b0b19e3ac63b95029125b9e68
[DEBUG]   vcpkg-cmake|4cf998e07900f62b72b898968e661a4d443a68f8227054c726a46d1ebbfb1a76
[DEBUG]   vcpkg-cmake-config|fe0c8bdeea31a45eb3b9d612635d3a9d481e6d31225fbd2be87622b60fc476a2
[DEBUG]   vcpkg-cmake-wrapper.cmake|d257c0a541dd60c4b6eb6f46a5e9f128a64a6ec40f3b8b5bc8ab753e7a935c61
[DEBUG]   vcpkg.json|72c77395fe1daceda5b6d67f1b465b49c007ae99b73257e1f69d50cb35aa2589
[DEBUG]   vcpkg_check_features|943b217e0968d64cf2cb9c272608e6a0b497377e792034f819809a79e1502c2b
[DEBUG]   vcpkg_copy_pdbs|d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c
[DEBUG]   vcpkg_find_acquire_program|96d9ee675798a3bddb54340d404b814be45a35c624b2eab5465cd45eaf18b6d3
[DEBUG]   vcpkg_find_acquire_program(NASM)|b6fcd010dcc70cec5e2472dde5a5b794c11ed63a433215d0e4f8ab11620cde0a
[DEBUG]   vcpkg_fixup_pkgconfig|1a15f6c6d8e2b244d83a7514a0412d339127d2217d1df60ad1388b546c85f777
[DEBUG]   vcpkg_from_git|96ed81968f76354c00096dd8cd4e63c6a235fa969334a11ab18d11c0c512ff58
[DEBUG]   vcpkg_from_github|b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f
[DEBUG]   vcpkg_install_copyright|ba6c169ab4e59fa05682e530cdeb883767de22c8391f023d4e6844a7ec5dd3d2
[DEBUG]   vcpkg_replace_string|b450deb79207478b37119743e00808ebc42de0628e7b98c14ab24728bd5c78b8
[DEBUG]   workaround_cmake_system_processor.patch|1fd13c06d27a2fcef233fe209ba0c856ed76311be59ae72e15d1c58fe36eab04
[DEBUG] 
[DEBUG] Default binary cache path is: C:\Users\monica\AppData\Local\vcpkg\archives
[DEBUG] 1007: CreateProcessW("G:\vcpkg\downloads\tools\7zip-24.06-windows\7za.exe" x "C:\Users\monica\AppData\Local\vcpkg\archives\9d\9d52dd8d4e71e96b030f885fb8800a4ae3a7cb8e44f879379a35e069bc30a43a.zip" "-oG:\vcpkg\packages\libjpeg-turbo_x64-windows-static" -y)
[DEBUG] 1007: cmd_execute_and_stream_data() returned 0 after   322928 us
[DEBUG] 1008: CreateProcessW("G:\vcpkg\downloads\tools\7zip-24.06-windows\7za.exe" x "C:\Users\monica\AppData\Local\vcpkg\archives\9d\9d52dd8d4e71e96b030f885fb8800a4ae3a7cb8e44f879379a35e069bc30a43a.zip" "-oG:\vcpkg\packages\libjpeg-turbo_x64-windows-static" -y)
[DEBUG] 1008: cmd_execute_and_stream_data() returned 0 after   204472 us
[DEBUG] Restored C:\Users\monica\AppData\Local\vcpkg\archives\9d\9d52dd8d4e71e96b030f885fb8800a4ae3a7cb8e44f879379a35e069bc30a43a.zip
Restored 1 package(s) from C:\Users\monica\AppData\Local\vcpkg\archives in 531 ms. Use --debug to see more details.
Installing 1/1 libjpeg-turbo:x64-windows-static@3.0.3...
Elapsed time to handle libjpeg-turbo:x64-windows-static: 3.7 s
libjpeg-turbo:x64-windows-static package ABI: 9d52dd8d4e71e96b030f885fb8800a4ae3a7cb8e44f879379a35e069bc30a43a
Total install time: 3.7 s
libjpeg-turbo is compatible with built-in implementation-agnostic CMake targets:

    find_package(JPEG REQUIRED)
    target_include_directories(main PRIVATE JPEG::JPEG)

libjpeg-turbo provides CMake targets for the TurboJPEG C API:

    find_package(libjpeg-turbo CONFIG REQUIRED)
    target_link_libraries(main PRIVATE $,libjpeg-turbo::turbojpeg,libjpeg-turbo::turbojpeg-static>)

[DEBUG] D:\a\_work\1\s\src\vcpkg\commands.install.cpp(1413):
[DEBUG] Time in subprocesses: 11101631us
[DEBUG] Time in parsing JSON: 21720us
[DEBUG] Time in JSON reader: 19193us
[DEBUG] Time in filesystem: 6534289us
[DEBUG] Time in loading ports: 2897850us
[DEBUG] Exiting after 18 s (18290566us)
ANB5Dev commented 1 month ago

@MonicaLiu0311 Thank you for posting the working debug log; it showed me I was using an outdated Microsoft Visual Studio, and updating it fixed the issue ☺️ (vcvars_ver=14.39.33519 to vcvars_ver=14.40.33807)