Skip to content

Commit

Permalink
Add Win 2022 config.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 702368570
  • Loading branch information
belitskiy authored and copybara-github committed Dec 20, 2024
1 parent 6a6aae2 commit a359454
Show file tree
Hide file tree
Showing 8 changed files with 2,249 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -451,19 +451,37 @@ build:avx_linux --copt=-mavx
build:avx_linux --host_copt=-mavx
build:avx_win --copt=/arch:AVX

# TODO(belitskiy): Consolidate into windows_x86_cpu once Win2019 is gone.
# Use Clang-cl compiler on Windows
build:win_clang --copt=/clang:-Weverything
build:win_clang --host_copt=/clang:-Weverything
build:win_clang --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:win_clang --extra_execution_platforms=//tensorflow/tools/toolchains/win:x64_windows-clang-cl
build:win_clang --host_platform=//tensorflow/tools/toolchains/win:x64_windows-clang-cl
build:win_clang --copt=/clang:-Weverything
build:win_clang --host_copt=/clang:-Weverything
build:win_clang --compiler=clang-cl
build:win_clang --linkopt=/FORCE:MULTIPLE
build:win_clang --host_linkopt=/FORCE:MULTIPLE
test:win_clang --linkopt=/FORCE:MULTIPLE
test:win_clang --host_linkopt=/FORCE:MULTIPLE
test:win_clang --action_env=PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW

# build:windows_x86_cpu --extra_toolchains="//tensorflow/tools/toolchains/win2022/20241118:cc-toolchain-x64_windows-clang-cl"
# build:windows_x86_cpu --extra_execution_platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang"
# build:windows_x86_cpu --host_platform="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang"
build:windows_x86_cpu --crosstool_top="//tensorflow/tools/toolchains/win2022/20241118:toolchain"
build:windows_x86_cpu --extra_toolchains="//tensorflow/tools/toolchains/win2022/20241118:cc-toolchain-x64_windows-clang-cl"
build:windows_x86_cpu --extra_execution_platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang"
build:windows_x86_cpu --host_platform="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang"
build:windows_x86_cpu --platforms="//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang"
build:windows_x86_cpu --copt=/clang:-Weverything
build:windows_x86_cpu --host_copt=/clang:-Weverything
build:windows_x86_cpu --compiler=clang-cl
build:windows_x86_cpu --linkopt=/FORCE:MULTIPLE
build:windows_x86_cpu --host_linkopt=/FORCE:MULTIPLE
test:windows_x86_cpu --linkopt=/FORCE:MULTIPLE
test:windows_x86_cpu --host_linkopt=/FORCE:MULTIPLE
test:windows_x86_cpu --action_env=PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW

# Options to build TensorFlow 1.x or 2.x.
# TODO(kanglan): Change v2's define to default behavior
build:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
Expand Down Expand Up @@ -762,6 +780,11 @@ test:macos_x86_wheel_test_filters --test_tag_filters=-no_oss,-oss_excluded,-oss_
test:macos_x86_wheel_test_filters --build_tag_filters=-no_oss,-oss_excluded,-oss_serial,-no_oss_py38,-no_oss_py39,-no_oss_py310,-nomac,-no_mac,-mac_excluded,-v1only,-gpu,-tpu,-benchmark-test
test:macos_x86_wheel_test_filters --test_lang_filters=py --test_size_filters=small,medium
test:macos_x86_wheel_test --@tsl//third_party/py:wheel_dependency=true --config=macos_x86_wheel_test_filters -- //tensorflow/... //tensorflow/tools/pip_package:prebuilt_wheel_import_api_packages_test_cpu -//tensorflow/compiler/tf2tensorrt/... -//tensorflow/core/tpu/... -//tensorflow/lite/... -//tensorflow/tools/toolchains/... -//tensorflow/go/... -//tensorflow/java/... -//tensorflow/compiler/aot/...
# WINDOWS X86 WHEEL
test:windows_x86_cpu_wheel_test_filters --test_tag_filters=-no_windows,-windows_excluded,-no_oss,-oss_excluded,-gpu,-tpu,-benchmark-test
test:windows_x86_cpu_wheel_test_filters --build_tag_filters=-no_windows,-windows_excluded,-no_oss,-oss_excluded,-benchmark-test
test:windows_x86_cpu_wheel_test_filters --test_lang_filters=cc,py --test_size_filters=small,medium --test_timeout="300,450,1200,3600"
test:windows_x86_cpu_wheel_test --config=windows_x86_cpu_pycpp_test_filters -- //tensorflow/... -//tensorflow/java/... -//tensorflow/lite/... -//tensorflow/compiler/...

# PYCPP TESTS run a suite of Python and C++ tests to verify general correctness over
# the whole TF code base. These are usually run continuously or upon presubmit.
Expand Down
2 changes: 2 additions & 0 deletions opensource_only.files
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,7 @@ tools/toolchains/win/20240424/BUILD:
tools/toolchains/win/BUILD:
tools/toolchains/win/bazel_211/BUILD:
tools/toolchains/win/tf_win_05022023/BUILD:
tools/toolchains/win2022/20241118/BUILD:
tools/toolchains/win2022/BUILD:
tools/toolchains/win_1803/py38/BUILD:
tools/toolchains/win_1803/py39/BUILD:
647 changes: 647 additions & 0 deletions tools/toolchains/win2022/20241118/BUILD

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions tools/toolchains/win2022/20241118/armeabi_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""A Starlark cc_toolchain configuration rule"""

load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)

def _impl(ctx):
toolchain_identifier = "stub_armeabi-v7a"
host_system_name = "armeabi-v7a"
target_system_name = "armeabi-v7a"
target_cpu = "armeabi-v7a"
target_libc = "armeabi-v7a"
compiler = "compiler"
abi_version = "armeabi-v7a"
abi_libc_version = "armeabi-v7a"
cc_target_os = None
builtin_sysroot = None
action_configs = []

supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]

cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []

tool_paths = [
tool_path(name = "ar", path = "/bin/false"),
tool_path(name = "cpp", path = "/bin/false"),
tool_path(name = "dwp", path = "/bin/false"),
tool_path(name = "gcc", path = "/bin/false"),
tool_path(name = "gcov", path = "/bin/false"),
tool_path(name = "ld", path = "/bin/false"),
tool_path(name = "llvm-profdata", path = "/bin/false"),
tool_path(name = "nm", path = "/bin/false"),
tool_path(name = "objcopy", path = "/bin/false"),
tool_path(name = "objdump", path = "/bin/false"),
tool_path(name = "strip", path = "/bin/false"),
]

return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)

armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that clang-cl reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.


Loading

0 comments on commit a359454

Please sign in to comment.