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

[tensorflow-cc] build failure(BAZEL_VC/BAZEL_VS does not work when vs2019 and vs2022 exist on windows 11.) #21246

Closed
shelllet opened this issue Nov 8, 2021 · 16 comments · Fixed by #24861
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@shelllet
Copy link

shelllet commented Nov 8, 2021

Host Environment

  • OS: [e.g. Windows 11.]
  • Compiler: msvc 2019

To Reproduce
Steps to reproduce the behavior:

install vs2019 and then install vs2022 rc,

add tensorflow to vcpkg.json

build

error log:

Auto-Configuration Error: Couldn't find undname.exe under C:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Analysis of target '//tensorflow:tensorflow_cc.dll' failed; build aborted: Analysis failed

when i build tensorflow,
BAZEL awaly use Visual Studio 2022, even if i set BAZEL_VC BAZEL_VC_FULL_VERSION to vs 2019。

image

Auto-Configuration Error: Couldn't find undname.exe under C:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Analysis of target '//tensorflow:tensorflow_cc.dll' failed; build aborted: Analysis failed
INFO: Elapsed time: 6.906s

when i uninstall vs2022, and rebuild, everything is ok.

@JackBoosY JackBoosY self-assigned this Nov 8, 2021
@shelllet
Copy link
Author

shelllet commented Nov 8, 2021

After i tried many times, i found set VCPKG_VISUAL_STUDIO_PATH can resove this problem, now i don't know this is a bug or not.

@JackBoosY JackBoosY changed the title [tensorflow] build failure(BAZEL_VC/BAZEL_VS does not work when vs2019 and vs2022 exist on windows 11.) [tensorflow-cc] build failure(BAZEL_VC/BAZEL_VS does not work when vs2019 and vs2022 exist on windows 11.) Nov 8, 2021
@JackBoosY
Copy link
Contributor

I think that's a bazel bug. undname exists in the following directory but bazel doesn't find them:
MicrosoftTeams-image

Related: bazelbuild/bazel#14232 bazelbuild/bazel#10772

@JackBoosY JackBoosY added the depends:upstream-changes Waiting on a change to the upstream project label Nov 8, 2021
@LiuPeiqiCN
Copy link
Contributor

LiuPeiqiCN commented Nov 21, 2021

I only install vs2022 and failed to install tensorflow, maybe bazel-4.1.0 is too old?

bazel 4.1.0~4.2.2 windows_cc_configure.bzl:

def _is_vs_2017_or_2019(vc_path):
    """Check if the installed VS version is Visual Studio 2017."""

    # In VS 2017 and 2019, the location of VC is like:
    # C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\
    # In VS 2015 or older version, it is like:
    # C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
    return vc_path.find("2017") != -1 or vc_path.find("2019") != -1

bazel latest 6.0 pre-release windows_cc_configure.bzl:

def _is_vs_2017_or_2019(repository_ctx, vc_path):
    """Check if the installed VS version is Visual Studio 2017 or 2019."""

    # The layout of VC folder in VS 2017 and 2019 is different from that in VS 2015 and older versions.
    # In VS 2017 and 2019, it contains only three directories:
    # "Auxiliary", "Redist", "Tools"

    vc_2017_or_2019_contents = ["auxiliary", "redist", "tools"]
    vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
    vc_path_contents = sorted(vc_path_contents)
    return vc_path_contents == vc_2017_or_2019_contents

@ugvfpdcuwfnh
Copy link

I have the same error , I install VS2022 and bazel 4.2.2 .
Is there any solution except uninstalling VS 2022 ?

@OgreTransporter
Copy link
Contributor

I hope this information can help you. I build TF without vcpkg directly with bazel. VS2022 does not work. VS2019 works. I also installed both VS in parallel. However, I had to set BAZEL_VC global before building and run bazel as administrator.

BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC

I am not a fan of bazel. A build process in CMake is much easier to debug, plus it's easier to switch compilers.

@Zhaopudark
Copy link

Zhaopudark commented Jan 8, 2022

I think there is no need to install both vs2022 and vs2019, since by vs2022 installer we can also install old tools sets like msvc v142 v141 .etc.
So my solution is using soft link on windows.
bazelbuild/bazel#14232 (comment)

@JackBoosY
Copy link
Contributor

Since bazel was updated in vcpkg, this issue should be fixed.
Please ping me if anyone meet this issue again.

Thanks.

@JackBoosY JackBoosY added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed depends:upstream-changes Waiting on a change to the upstream project labels Jul 29, 2022
@linjiahao962889027
Copy link

linjiahao962889027 commented Aug 4, 2022

Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python.exe
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc:
  'build' options: --define framework_shared_object=true --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python3.exe --action_env PYTHON_LIB_PATH=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/lib/python3.8/site-packages --python_path=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python3.exe --define=with_xla_support=false --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/fallback,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:windows in file d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file d:\vcpkg\buildtrees\tensorflow\x64-windows-dbg\.bazelrc: --define framework_shared_object=false
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: tensorflow
Analyzing: 2 targets (1 packages loaded, 0 targets configured)
Analyzing: 2 targets (24 packages loaded, 32 targets configured)
Analyzing: 2 targets (75 packages loaded, 2302 targets configured)
INFO: Repository local_config_def_file_filter instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/WORKSPACE:15:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:1079:19: in workspace
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:105:30: in _tf_toolchains
Repository rule def_file_filter_configure defined at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl:55:44: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_def_file_filter':
   Traceback (most recent call last):
	File "D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl", line 37, column 28, in _def_file_filter_configure_impl
		auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
	File "D:/vcpkg/buildtrees/tensorflow/.bzl/57u5iwxm/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
		fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Error fetching repository: Traceback (most recent call last):
	File "D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl", line 37, column 28, in _def_file_filter_configure_impl
		auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
	File "D:/vcpkg/buildtrees/tensorflow/.bzl/57u5iwxm/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
		fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
INFO: Repository eigen_archive instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/WORKSPACE:15:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:1082:28: in workspace
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:63:11: in _initialize_third_party
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/third_party/eigen3/workspace.bzl:14:20: in repo
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/third_party/repo.bzl:113:21: in tf_http_archive
Repository rule _tf_http_archive defined at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/third_party/repo.bzl:66:35: in <toplevel>
INFO: Repository com_googlesource_code_re2 instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/WORKSPACE:15:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:1089:21: in workspace
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/workspace2.bzl:280:20: in _tf_repositories
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/third_party/repo.bzl:113:21: in tf_http_archive
Repository rule _tf_http_archive defined at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/third_party/repo.bzl:66:35: in <toplevel>
ERROR: D:/vcpkg/buildtrees/tensorflow/x64-windows-dbg/tensorflow/BUILD:1102:8: //tensorflow:tensorflow_filtered_def_file depends on @local_config_def_file_filter//:def_file_filter in repository @local_config_def_file_filter which failed to fetch. no such package '@local_config_def_file_filter//': 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Analysis of target '//tensorflow:tensorflow.dll' failed; build aborted: Analysis failed
INFO: Elapsed time: 5.993s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (97 packages loaded, 2524 targets configured)
FAILED: Build did NOT complete successfully (97 packages loaded, 2524 targets configured)

@JackBoosY

@JackBoosY
Copy link
Contributor

@linjiahao962889027 Please provide the full output and your VS version.

@linjiahao962889027
Copy link

@linjiahao962889027 Please provide the full output and your VS version.
Visual Studio 2022 (17.2.6)MSVC 143
image

@JackBoosY
Copy link
Contributor

JackBoosY commented Aug 17, 2022

@linjiahao962889027 Did you only install one version of Visual Studio? Please provide the log mentioned in the output first.

@linjiahao962889027
Copy link

I installed visual studio build tools 2019 and visual studio 2022.
@JackBoosY

@JackBoosY
Copy link
Contributor

Trying to reproduce this issue now.

@JackBoosY
Copy link
Contributor

I can confirm that the problem persists even though I only have Visual Studio 2022 installed.

@JackBoosY JackBoosY reopened this Aug 18, 2022
@linjiahao962889027
Copy link

linjiahao962889027 commented Aug 18, 2022

Trying to reproduce this issue now.

These are my visual studio config and error log, which may help you reproduce the problem.
visual studio build tools 2019 config:

{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Component.Roslyn.Compiler",
    "Microsoft.Component.MSBuild",
    "Microsoft.VisualStudio.Component.CoreBuildTools",
    "Microsoft.VisualStudio.Workload.MSBuildTools",
    "Microsoft.VisualStudio.Component.Windows10SDK",
    "Microsoft.VisualStudio.Component.VC.CoreBuildTools",
    "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
    "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
    "Microsoft.VisualStudio.Component.Windows10SDK.19041",
    "Microsoft.VisualStudio.Component.VC.CMake.Project",
    "Microsoft.VisualStudio.Component.TestTools.BuildTools",
    "Microsoft.Net.Component.4.8.SDK",
    "Microsoft.Net.Component.4.6.1.TargetingPack",
    "Microsoft.VisualStudio.Component.VC.ASAN",
    "Microsoft.VisualStudio.Component.TextTemplating",
    "Microsoft.VisualStudio.Component.VC.CoreIde",
    "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
    "Microsoft.Component.VC.Runtime.UCRTSDK",
    "Microsoft.VisualStudio.Component.VC.140",
    "Microsoft.VisualStudio.Workload.VCTools",
    "Microsoft.VisualStudio.Component.NuGet.BuildTools",
    "Microsoft.VisualStudio.Component.TypeScript.4.3",
    "Microsoft.Net.Component.4.TargetingPack",
    "Microsoft.Net.Component.4.5.TargetingPack",
    "Microsoft.Net.Component.4.5.1.TargetingPack",
    "Microsoft.Net.Component.4.5.2.TargetingPack",
    "Microsoft.Net.Component.4.6.TargetingPack",
    "Microsoft.Net.ComponentGroup.TargetingPacks.Common",
    "Microsoft.NetCore.Component.Runtime.3.1",
    "Microsoft.NetCore.Component.Runtime.6.0",
    "Microsoft.NetCore.Component.SDK",
    "Microsoft.Component.ClickOnce.MSBuild",
    "Microsoft.VisualStudio.Wcf.BuildTools.ComponentGroup",
    "Microsoft.VisualStudio.Component.Node.Build",
    "Microsoft.VisualStudio.Workload.NodeBuildTools",
    "Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
    "Microsoft.NetCore.Component.Runtime.5.0"
  ]
}

visual studio 2022 config:

{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Component.ClassDesigner",
    "Microsoft.VisualStudio.Component.CoreEditor",
    "Microsoft.VisualStudio.Workload.CoreEditor",
    "Microsoft.Net.Component.4.8.SDK",
    "Microsoft.Net.Component.4.7.2.TargetingPack",
    "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
    "Microsoft.VisualStudio.Component.TypeScript.TSServer",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
    "Microsoft.VisualStudio.Component.JavaScript.TypeScript",
    "Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
    "Microsoft.VisualStudio.Component.Roslyn.Compiler",
    "Microsoft.Component.MSBuild",
    "Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
    "Microsoft.VisualStudio.Component.TextTemplating",
    "Component.Microsoft.VisualStudio.RazorExtension",
    "Microsoft.VisualStudio.Component.IISExpress",
    "Microsoft.VisualStudio.Component.NuGet",
    "Microsoft.VisualStudio.Component.MSODBC.SQL",
    "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime",
    "Microsoft.VisualStudio.Component.Common.Azure.Tools",
    "Microsoft.VisualStudio.Component.SQL.CLR",
    "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils",
    "Microsoft.Component.ClickOnce",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Core",
    "Microsoft.VisualStudio.Component.SQL.SSDT",
    "Microsoft.VisualStudio.Component.SQL.DataSources",
    "Component.Microsoft.Web.LibraryManager",
    "Component.Microsoft.WebTools.BrowserLink.WebLivePreview",
    "Microsoft.VisualStudio.ComponentGroup.Web",
    "Microsoft.NetCore.Component.Runtime.6.0",
    "Microsoft.NetCore.Component.SDK",
    "Microsoft.VisualStudio.Component.FSharp",
    "Microsoft.ComponentGroup.ClickOnce.Publish",
    "Microsoft.NetCore.Component.DevelopmentTools",
    "Microsoft.VisualStudio.Component.FSharp.WebTemplates",
    "Microsoft.VisualStudio.Component.DockerTools",
    "Microsoft.NetCore.Component.Web",
    "Microsoft.VisualStudio.Component.WebDeploy",
    "Microsoft.VisualStudio.Component.AppInsights.Tools",
    "Microsoft.VisualStudio.Component.Web",
    "Microsoft.Net.Component.4.8.TargetingPack",
    "Microsoft.Net.ComponentGroup.4.8.DeveloperTools",
    "Component.Microsoft.VisualStudio.Web.AzureFunctions",
    "Microsoft.VisualStudio.ComponentGroup.AzureFunctions",
    "Microsoft.VisualStudio.ComponentGroup.Web.CloudTools",
    "Microsoft.VisualStudio.Component.DiagnosticTools",
    "Microsoft.VisualStudio.Component.EntityFramework",
    "Microsoft.VisualStudio.Component.Debugger.JustInTime",
    "Component.Microsoft.VisualStudio.LiveShare.2022",
    "Microsoft.VisualStudio.Component.WslDebugging",
    "Microsoft.VisualStudio.Component.IntelliCode",
    "Microsoft.VisualStudio.Workload.NetWeb",
    "Microsoft.VisualStudio.Component.VC.CoreIde",
    "Microsoft.VisualStudio.Component.Windows10SDK",
    "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
    "Microsoft.VisualStudio.Component.Graphics.Tools",
    "Microsoft.VisualStudio.Component.VC.DiagnosticTools",
    "Microsoft.VisualStudio.Component.Windows10SDK.19041",
    "Microsoft.VisualStudio.Component.Node.Tools",
    "Microsoft.VisualStudio.Workload.Node",
    "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
    "Microsoft.VisualStudio.Component.DotNetModelBuilder",
    "Microsoft.ComponentGroup.Blend",
    "Microsoft.VisualStudio.Workload.ManagedDesktop",
    "Microsoft.VisualStudio.Component.VC.ATL",
    "Microsoft.VisualStudio.Component.VC.ATLMFC",
    "Microsoft.VisualStudio.Component.VC.Tools.ARM64",
    "Microsoft.VisualStudio.Component.UWP.VC.ARM64",
    "Microsoft.VisualStudio.Component.VC.Tools.ARM",
    "Microsoft.VisualStudio.ComponentGroup.UWP.VC",
    "Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
    "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
    "Microsoft.VisualStudio.Component.VC.CMake.Project",
    "Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest",
    "Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest",
    "Microsoft.VisualStudio.Component.VC.CLI.Support",
    "Microsoft.VisualStudio.Component.VC.ASAN",
    "Microsoft.VisualStudio.Workload.NativeDesktop",
    "Microsoft.Component.NetFX.Native",
    "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard",
    "Microsoft.VisualStudio.Component.Graphics",
    "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin",
    "Microsoft.VisualStudio.ComponentGroup.UWP.Support",
    "Microsoft.VisualStudio.Workload.Universal",
    "Component.MDD.Linux",
    "Component.Linux.CMake",
    "Microsoft.VisualStudio.Workload.NativeCrossPlat",
    "Microsoft.Net.Component.3.5.DeveloperTools",
    "Microsoft.NetCore.Component.Runtime.3.1",
    "Microsoft.VisualStudio.Component.VisualStudioData",
    "Microsoft.VisualStudio.Component.VC.14.31.17.1.ATL",
    "Microsoft.VisualStudio.Component.VC.14.31.17.1.MFC",
    "Microsoft.VisualStudio.Component.VC.CoreBuildTools"
  ]
}
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python.exe
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc:
  'build' options: --define framework_shared_object=true --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python3.exe --action_env PYTHON_LIB_PATH=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/lib/python3.8/site-packages --python_path=D:/vcpkg/downloads/tools/msys2/70289b324bc026d6/mingw64/bin/python3.exe --define=with_xla_support=false --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Reading rc options for 'build' from d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/fallback,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:windows in file d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file d:\vcpkg\buildtrees\tensorflow\x64-windows-static-dbg\.bazelrc: --define framework_shared_object=false
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: tensorflow
Analyzing: 2 targets (1 packages loaded, 0 targets configured)
Analyzing: 2 targets (23 packages loaded, 32 targets configured)
Analyzing: 2 targets (23 packages loaded, 32 targets configured)
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1596824487 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/WORKSPACE:23:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/workspace0.bzl:108:34: in workspace
  D:/vcpkg/buildtrees/tensorflow/.bzl/g6hwewud/external/bazel_toolchains/repositories/repositories.bzl:35:23: in repositories
Repository rule git_repository defined at:
  D:/vcpkg/buildtrees/tensorflow/.bzl/g6hwewud/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
INFO: Repository local_config_def_file_filter instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/WORKSPACE:15:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/workspace2.bzl:1079:19: in workspace
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/workspace2.bzl:105:30: in _tf_toolchains
Repository rule def_file_filter_configure defined at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl:55:44: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_def_file_filter':
   Traceback (most recent call last):
	File "D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl", line 37, column 28, in _def_file_filter_configure_impl
		auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
	File "D:/vcpkg/buildtrees/tensorflow/.bzl/g6hwewud/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
		fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Error fetching repository: Traceback (most recent call last):
	File "D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/tools/def_file_filter/def_file_filter_configure.bzl", line 37, column 28, in _def_file_filter_configure_impl
		auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
	File "D:/vcpkg/buildtrees/tensorflow/.bzl/g6hwewud/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 112, column 9, in auto_configure_fail
		fail("\n%sAuto-Configuration Error:%s %s\n" % (red, no_color, msg))
Error in fail: 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
INFO: Repository eigen_archive instantiated at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/WORKSPACE:15:14: in <toplevel>
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/workspace2.bzl:1082:28: in workspace
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/workspace2.bzl:63:11: in _initialize_third_party
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/third_party/eigen3/workspace.bzl:14:20: in repo
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/third_party/repo.bzl:113:21: in tf_http_archive
Repository rule _tf_http_archive defined at:
  D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/third_party/repo.bzl:66:35: in <toplevel>
ERROR: D:/vcpkg/buildtrees/tensorflow/x64-windows-static-dbg/tensorflow/BUILD:1102:8: //tensorflow:tensorflow_filtered_def_file depends on @local_config_def_file_filter//:def_file_filter in repository @local_config_def_file_filter which failed to fetch. no such package '@local_config_def_file_filter//': 
Auto-Configuration Error: Couldn't find undname.exe under D:\Program Files\Microsoft Visual Studio\2022\Community\VC, please check your VC installation and set BAZEL_VC environment variable correctly.
ERROR: Analysis of target '//tensorflow:tensorflow.dll' failed; build aborted: Analysis failed
INFO: Elapsed time: 16.375s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (78 packages loaded, 1742 targets configured)
FAILED: Build did NOT complete successfully (78 packages loaded, 1742 targets configured)

@JackBoosY
Copy link
Contributor

I can confirm #24861 can fix this.

@JackBoosY JackBoosY linked a pull request Aug 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants