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

Building library pkgconfig_tool_msvc_build_ fails on Windows #1359

Open
mauricelos opened this issue Jan 23, 2025 · 0 comments
Open

Building library pkgconfig_tool_msvc_build_ fails on Windows #1359

mauricelos opened this issue Jan 23, 2025 · 0 comments

Comments

@mauricelos
Copy link

Hi there,

I'm currently stuck with the following issue. The pkgconfig_tool_msvc_build_ step fails under Windows. I'm using this version of rules_foreign_cc:

bazel_dep(name = "rules_foreign_cc", version = "0.13.0")

Here is the output for the build:

_____ BEGIN BUILD LOGS _____

Bazel external C/C++ Rules. Building library pkgconfig_tool_msvc_build_

Environment:______________
BUILD_SCRIPT=bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build__foreign_cc/build_script.sh
EXT_BUILD_ROOT=C:/_bzl/ymhm7ayi/execroot/_main
BUILD_LOG=bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build__foreign_cc/Make.log
PWD=/c/_bzl/ymhm7ayi/execroot/_main
VSLANG=1033
MSYS_NO_PATHCONV=1
HOME=/home/me
BUILD_WRAPPER_SCRIPT=bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build__foreign_cc/wrapper_build_script.sh
EXT_BUILD_DEPS=C:/_bzl/ymhm7ayi/execroot/_main/bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build_.ext_build_deps
SYSTEMROOT=C:\Windows
TERM=xterm-256color
TEMP=C:\msys64\tmp
BUILD_TMPDIR=C:/_bzl/ymhm7ayi/execroot/_main/bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build_.build_tmpdir
INCLUDE=C:/_bzl/ymhm7ayi/execroot/_main/external/glib_src;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt
SHLVL=2
RUNFILES_MANIFEST_ONLY=1
MSYS2_ARG_CONV_EXCL=*
INSTALLDIR=C:/_bzl/ymhm7ayi/execroot/_main/bazel-out/x64_windows-opt-exec-ST-9a407f9186b5/bin/external/rules_foreign_cc+/toolchains/private/pkgconfig_tool_msvc_build_
TMP=C:\msys64\tmp
PATH=/C/_bzl/ymhm7ayi/execroot/_main:/C/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64:/C/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64:/usr/bin:/bin:/c/Windows:/c/Windows/System32:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Users/me/AppData/Local/bazelisk/downloads/bazelbuild/bazel-8.0.1-windows-x86_64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/c/Users/me/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/mingw64/bin:/usr/bin:/c/Users/me/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files/dotnet:/c/ProgramData/chocolatey/bin:/c/Program Files/CMake/bin:/c/Program Files/Meld:/cmd:/c/Users/me/.cargo/bin:/c/Users/me/AppData/Local/Microsoft/WindowsApps:/c/Users/me/AppData/Local/Programs/Microsoft VS Code/bin:/usr/bin/vendor_perl:/usr/bin/core_perl:/c/Program Files/Git/bin:/C/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64:/C/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0//x64:/C/Program Files (x86)/Windows Kits/10/bin//x64:/C/Program Files/Microsoft Visual Studio/2022/Community//MSBuild/Current/Bin/amd64:/C/Windows/Microsoft.NET/Framework64/v4.0.30319:/C/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/:/C/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/:/:/C/Windows/system32:/C/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64:/C/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0//x64:/C/Program Files (x86)/Windows Kits/10/bin//x64:/C/Program Files/Microsoft Visual Studio/2022/Community//MSBuild/Current/Bin/amd64:/C/Windows/Microsoft.NET/Framework64/v4.0.30319:/C/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/:/C/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/:/:/C/Windows/system32
WINDIR=C:\Windows
LIB=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\um\x64
SYSTEMDRIVE=C:
_=/usr/bin/env
__________________________
Can not copy C:/_bzl/ymhm7ayi/execroot/_main/nmake.exe
+ ARFLAGS='-nologo -MACHINE:X64 -ignore:4221'
+ AR_FLAGS='-nologo -MACHINE:X64 -ignore:4221'
+ ASFLAGS='-nologo -DCOMPILER_MSVC -DNOMINMAX -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -bigobj -Zm500 -EHsc -wd4351 -wd4291 -wd4250 -wd4996'
+ CFLAGS='-nologo -DCOMPILER_MSVC -DNOMINMAX -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -bigobj -Zm500 -EHsc -wd4351 -wd4291 -wd4250 -wd4996 -showIncludes -MD -O2 -Oy- -DNDEBUG -wd4117 -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Gy -Gw -Zc:inline'
+ CXXFLAGS='-nologo -DCOMPILER_MSVC -DNOMINMAX -D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -bigobj -Zm500 -EHsc -wd4351 -wd4291 -wd4250 -wd4996 -showIncludes -MD -O2 -Oy- -DNDEBUG -wd4117 -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -Gy -Gw -Zc:inline'
+ LDFLAGS='-nologo -SUBSYSTEM:CONSOLE -MACHINE:X64 -DEFAULTLIB:msvcrt.lib -OPT:ICF -OPT:REF -LIBPATH:C:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_runtime/bin -LIBPATH:C:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+gettext_runtime/bin'
+ AR='"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/lib.exe"'
+ CC='"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe"'
+ CXX='"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe"'
+ LD='"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/link.exe"'
+ RANLIB=:
+ CPPFLAGS='-IC:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_dev/include/glib-2.0/gio -IC:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_dev/include/glib-2.0 -IC:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_dev/include/glib-2.0/glib -IC:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_dev/include/glib-2.0/gobject -IC:/_bzl/ymhm7ayi/execroot/_main/external/rules_foreign_cc++tools+glib_src'
+ nmake.exe -f Makefile.vc CFG=release GLIB_PREFIX=C:/_bzl/ymhm7ayi/execroot/_main/external/glib_dev PREFIX=INSTALLDIR591

Microsoft (R) Program Maintenance Utility Version 14.42.34435.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        1 file(s) copied.
        "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" /MD /O2 /GL /W3 /Zi /FImsvc_recommended_pragmas.h /I.                 /IC:/_bzl/ymhm7ayi/execroot/_main/external/glib_dev\include\glib-2.0                       
/IC:/_bzl/ymhm7ayi/execroot/_main/external/glib_dev\lib\glib-2.0\include                                 /DHAVE_CONFIG_H                                 /DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"\""         /DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"\"" /Forelease\x64\pkg-config\ /c @C:\msys64\tmp\nmD62C.tmp
Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34435 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl .\pkg.c .\parse.c .\rpmvercmp.c .\main.c

pkg.c
.\pkg.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
parse.c
.\parse.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
rpmvercmp.c
.\rpmvercmp.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
main.c
.\main.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" /MD /O2 /GL /W3 /Zi /FImsvc_recommended_pragmas.h /I.             /IC:/_bzl/ymhm7ayi/execroot/_main/external/glib_dev\include\glib-2.0       /IC:/_bzl/ymhm7ayi/execroot/_main/external/glib_dev\lib\glib-2.0\include                                 /DHAVE_CONFIG_H                                 /DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"\""         /DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"\"" /Forelease\x64\pkg-config\ /c @C:\msys64\tmp\nmD62C.tmp' : return code '0x2'
Stop.
_____ END BUILD LOGS _____

Any help to fix this would be much appreciated! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant