chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
licenses(["notice"]) # Apache 2.0
exports_files([
"darts_clone.BUILD",
"cppitertools.BUILD",
])
View File
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+43
View File
@@ -0,0 +1,43 @@
diff --git a/absl/BUILD.bazel b/absl/BUILD.bazel
--- a/absl/BUILD.bazel
+++ b/absl/BUILD.bazel
@@ -15,11 +15,26 @@
#
load("@bazel_skylib//lib:selects.bzl", "selects")
+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
+bool_flag(
+ name = "use_dlls",
+ build_setting_default = False,
+ visibility = ["//visibility:public"],
+)
+
+config_setting(
+ name = "config_use_dlls",
+ flag_values = {
+ ":use_dlls": "True",
+ },
+ visibility = [":__subpackages__"],
+)
+
config_setting(
name = "clang_compiler",
flag_values = {
diff --git a/absl/copts/configure_copts.bzl b/absl/copts/configure_copts.bzl
--- a/absl/copts/configure_copts.bzl
+++ b/absl/copts/configure_copts.bzl
@@ -23,6 +23,9 @@ ABSL_DEFAULT_COPTS = select({
"@rules_cc//cc/compiler:clang": ABSL_LLVM_FLAGS,
"@rules_cc//cc/compiler:gcc": ABSL_GCC_FLAGS,
"//conditions:default": [],
+}) + select({
+ "//absl:config_use_dlls": ["/DABSL_BUILD_DLL"],
+ "//conditions:default": [],
})
ABSL_TEST_COPTS = select({
+14
View File
@@ -0,0 +1,14 @@
diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel
--- a/absl/base/BUILD.bazel
+++ b/absl/base/BUILD.bazel
@@ -542,10 +542,6 @@ cc_library(
],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = [
- "//absl:__subpackages__",
- "//absl:friends",
- ],
deps = [
":base",
":config",
View File
+11
View File
@@ -0,0 +1,11 @@
MAYBE_ANDROID_NDK_STARLARK_RULES
"""Set up configurable Android SDK and NDK dependencies."""
def android_workspace():
# String for replacement in Bazel template.
# These will either be replaced by android_sdk_repository if various ENV
# variables are set when `local_config_android` repo_rule is run, or they
# will be replaced by noops otherwise.
MAYBE_ANDROID_SDK_REPOSITORY
MAYBE_ANDROID_NDK_REPOSITORY
View File
+128
View File
@@ -0,0 +1,128 @@
"""Repository rule for Android SDK and NDK autoconfiguration.
`android_configure` depends on the following environment variables:
* `ANDROID_NDK_HOME`: Location of Android NDK root.
* `ANDROID_SDK_HOME`: Location of Android SDK root.
* `ANDROID_SDK_API_LEVEL`: Desired Android SDK API version.
* `ANDROID_NDK_API_LEVEL`: Desired Android NDK API version.
* `ANDROID_BUILD_TOOLS_VERSION`: Desired Android build tools version.
"""
# TODO(mikecase): Move logic for getting default values for the env variables
# from configure.py script into this rule.
_ANDROID_NDK_HOME = "ANDROID_NDK_HOME"
_ANDROID_SDK_HOME = "ANDROID_SDK_HOME"
_ANDROID_NDK_VERSION = "ANDROID_NDK_VERSION"
_ANDROID_NDK_API_LEVEL = "ANDROID_NDK_API_LEVEL"
_ANDROID_SDK_API_LEVEL = "ANDROID_SDK_API_LEVEL"
_ANDROID_BUILD_TOOLS_VERSION = "ANDROID_BUILD_TOOLS_VERSION"
_ANDROID_SDK_REPO_TEMPLATE = """
native.android_sdk_repository(
name="androidsdk",
path="%s",
api_level=%s,
build_tools_version="%s",
)
"""
_ANDROID_NDK_REPO_TEMPLATE_INTERNAL = """
native.android_ndk_repository(
name="androidndk",
path="%s",
api_level=%s,
)
"""
_ANDROID_NDK_REPO_TEMPLATE_STARLARK = """
android_ndk_repository(
name="androidndk",
path="%s",
api_level=%s,
)
# Bind android/crosstool to support legacy select()
# https://github.com/bazelbuild/rules_android_ndk/issues/31#issuecomment-1396182185
native.bind(
name = "android/crosstool",
actual = "@androidndk//:toolchain",
)
"""
_ANDROID_NDK_VERION_FOR_STARLARK_RULES = 25
# Import NDK Starlark rules. Shouldn't have any indentation.
_ANDROID_NDK_STARLARK_RULES = """
load("@rules_android_ndk//:rules.bzl", "android_ndk_repository")
"""
def _android_autoconf_impl(repository_ctx):
"""Implementation of the android_autoconf repository rule."""
sdk_home = repository_ctx.os.environ.get(_ANDROID_SDK_HOME)
sdk_api_level = repository_ctx.os.environ.get(_ANDROID_SDK_API_LEVEL)
build_tools_version = repository_ctx.os.environ.get(
_ANDROID_BUILD_TOOLS_VERSION,
)
ndk_home = repository_ctx.os.environ.get(_ANDROID_NDK_HOME)
ndk_api_level = repository_ctx.os.environ.get(_ANDROID_NDK_API_LEVEL)
ndk_version_str = repository_ctx.os.environ.get(_ANDROID_NDK_VERSION)
ndk_version = int(ndk_version_str) if ndk_version_str else 0
sdk_rule = ""
if all([sdk_home, sdk_api_level, build_tools_version]):
sdk_rule = _ANDROID_SDK_REPO_TEMPLATE % (
sdk_home,
sdk_api_level,
build_tools_version,
)
ndk_rule = ""
ndk_starlark_rules = ""
if all([ndk_home, ndk_api_level]):
if ndk_version >= _ANDROID_NDK_VERION_FOR_STARLARK_RULES:
ndk_starlark_rules = _ANDROID_NDK_STARLARK_RULES
ndk_rule = _ANDROID_NDK_REPO_TEMPLATE_STARLARK % (ndk_home, ndk_api_level)
else:
ndk_rule = _ANDROID_NDK_REPO_TEMPLATE_INTERNAL % (ndk_home, ndk_api_level)
if ndk_rule == "" and sdk_rule == "":
sdk_rule = "pass"
repository_ctx.template(
"BUILD",
Label("//third_party/android:android_configure.BUILD.tpl"),
)
repository_ctx.template(
"android.bzl",
Label("//third_party/android:android.bzl.tpl"),
substitutions = {
"MAYBE_ANDROID_NDK_STARLARK_RULES": ndk_starlark_rules,
"MAYBE_ANDROID_SDK_REPOSITORY": sdk_rule,
"MAYBE_ANDROID_NDK_REPOSITORY": ndk_rule,
},
)
android_configure = repository_rule(
implementation = _android_autoconf_impl,
environ = [
_ANDROID_SDK_API_LEVEL,
_ANDROID_NDK_VERSION,
_ANDROID_NDK_API_LEVEL,
_ANDROID_BUILD_TOOLS_VERSION,
_ANDROID_NDK_HOME,
_ANDROID_SDK_HOME,
],
)
"""Writes Android SDK and NDK rules.
Add the following to your WORKSPACE FILE:
```python
android_configure(name = "local_config_android")
```
Args:
name: A unique name for this workspace rule.
"""
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+16
View File
@@ -0,0 +1,16 @@
# Description:
# NEON2SSE - a header file redefining ARM Neon intrinsics in terms of SSE intrinsics
# allowing neon code to compile and run on x64/x86 workstantions.
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # 3-Clause BSD
exports_files([
"LICENSE",
])
cc_library(
name = "arm_neon_2_x86_sse",
hdrs = ["NEON_2_SSE.h"],
)
+14
View File
@@ -0,0 +1,14 @@
"""Loads the arm_neon_2_x86_sse library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
# LINT.IfChange
tf_http_archive(
name = "arm_neon_2_x86_sse",
build_file = "//third_party/arm_neon_2_x86_sse:arm_neon_2_x86_sse.BUILD",
sha256 = "019fbc7ec25860070a1d90e12686fc160cfb33e22aa063c80f52b363f1361e9d",
strip_prefix = "ARM_NEON_2_x86_SSE-a15b489e1222b2087007546b4912e21293ea86ff",
urls = tf_mirror_urls("https://github.com/intel/ARM_NEON_2_x86_SSE/archive/a15b489e1222b2087007546b4912e21293ea86ff.tar.gz"),
)
# LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/neon2sse.cmake)
View File
+16
View File
@@ -0,0 +1,16 @@
# -*- mode: python; -*-
#
# Description:
# Extension to ast that allow ast -> python code generation.
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # New BSD
exports_files(["LICENSE"])
py_library(
name = "com_github_andreif_codegen",
srcs = glob(["codegen.py"]),
srcs_version = "PY3",
)
+3
View File
@@ -0,0 +1,3 @@
# This empty BUILD file is required to make Bazel treat this directory as a package.
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+13
View File
@@ -0,0 +1,13 @@
diff --git a/BUILD b/BUILD
index ef49b2d..1710abc 100644
--- a/BUILD
+++ b/BUILD
@@ -157,1 +155,5 @@ cc_library(
+ "hwy/highway.h", # public
+ "hwy/foreach_target.h", # public
],
+ include_prefix = "third_party/highway",
+ includes = ["."],
@@ -169,2 +173,0 @@ cc_library(
- "hwy/highway.h", # public
- "hwy/foreach_target.h", # public
+12
View File
@@ -0,0 +1,12 @@
"""Point to the Highway repo on GitHub."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "com_google_highway",
strip_prefix = "highway-1.3.0",
sha256 = "07b3c1ba2c1096878a85a31a5b9b3757427af963b1141ca904db2f9f4afe0bc2",
urls = tf_mirror_urls("https://github.com/google/highway/archive/refs/tags/1.3.0.tar.gz"),
patch_file = ["//third_party/com_google_highway:build.patch"],
)
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+17
View File
@@ -0,0 +1,17 @@
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD
exports_files(["LICENSE.txt"])
proto_library(
name = "mlmodel_proto",
srcs = glob(["mlmodel/format/*.proto"]),
)
cc_proto_library(
name = "mlmodel_cc_proto",
deps = [":mlmodel_proto"],
)
+12
View File
@@ -0,0 +1,12 @@
"""Loads the coremltools library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "coremltools",
sha256 = "37d4d141718c70102f763363a8b018191882a179f4ce5291168d066a84d01c9d",
strip_prefix = "coremltools-8.0",
build_file = "//third_party/coremltools:coremltools.BUILD",
urls = tf_mirror_urls("https://github.com/apple/coremltools/archive/8.0.tar.gz"),
)
+12
View File
@@ -0,0 +1,12 @@
load("//third_party/bazel_rules/rules_cc/cc:cc_library.bzl", "cc_library")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "cppitertools",
hdrs = glob([
"*.hpp",
"internal/*.hpp",
]),
include_prefix = "cppitertools",
)
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+24
View File
@@ -0,0 +1,24 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index 2c6375f..5417d7e 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -137,6 +137,7 @@ cc_library(
":linux_riscv32": COMMON_SRCS + RISCV_SRCS + LINUX_SRCS + LINUX_RISCV_SRCS,
":linux_riscv64": COMMON_SRCS + RISCV_SRCS + LINUX_SRCS + LINUX_RISCV_SRCS,
":linux_s390x": COMMON_SRCS + LINUX_SRCS,
+ ":linux_ppc64le": COMMON_SRCS + LINUX_SRCS,
":macos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS,
":macos_x86_64_legacy": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS,
":macos_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS,
@@ -277,6 +278,11 @@ config_setting(
values = {"cpu": "s390x"},
)
+config_setting(
+ name = "linux_ppc64le",
+ values = {"cpu": "ppc"},
+)
+
config_setting(
name = "macos_x86_64_legacy",
values = {
+15
View File
@@ -0,0 +1,15 @@
# Description: CUB library which is a set of primitives for GPU programming.
package(
default_visibility = ["//visibility:public"],
)
licenses(["notice"]) # BSD
exports_files(["LICENSE.TXT"])
cc_library(
name = "cub",
hdrs = glob(["cub/**"]),
deps = ["@local_config_cuda//cuda:cuda_headers"],
)
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+13
View File
@@ -0,0 +1,13 @@
"""Loads the cython library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "cython",
build_file = "@xla//third_party:cython.BUILD",
sha256 = "da72f94262c8948e04784c3e6b2d14417643703af6b7bd27d6c96ae7f02835f1",
strip_prefix = "cython-3.1.2",
system_build_file = "//third_party/systemlibs:cython.BUILD",
urls = tf_mirror_urls("https://github.com/cython/cython/archive/3.1.2.tar.gz"),
)
+9
View File
@@ -0,0 +1,9 @@
load("//third_party/bazel_rules/rules_cc/cc:cc_library.bzl", "cc_library")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "darts_clone",
hdrs = ["include/darts.h"],
include_prefix = "darts_clone",
)
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+51
View File
@@ -0,0 +1,51 @@
"""
A much simplified version of third_party/py/python_repo.bzl, which generates the "python_version_repo" repo.
This is just to keep the current build compatible with both WORKSPACE and Bzlmod, we may not need this in future.
"""
_PY_VERSION_BZL = """
HERMETIC_PYTHON_VERSION = "{version}"
HERMETIC_PYTHON_VERSION_KIND = "{py_kind}"
USE_PYWRAP_RULES = {use_pywrap_rules}
MACOSX_DEPLOYMENT_TARGET = "{macosx_deployment_target}"
WHEEL_COLLAB = "{wheel_collab}"
WHEEL_NAME = "{wheel_name}"
# TODO(pcloudy): Figure out how to support requirements_lock in Bzlmod.
REQUIREMENTS = "//:requirements.txt"
"""
def _python_version_repo_impl(repository_ctx):
version = repository_ctx.os.environ.get("HERMETIC_PYTHON_VERSION", "3.11")
wheel_name = repository_ctx.os.environ.get("WHEEL_NAME", "tensorflow")
wheel_collab = repository_ctx.os.environ.get("WHEEL_COLLAB", False)
macosx_deployment_target = repository_ctx.os.environ.get("MACOSX_DEPLOYMENT_TARGET", "")
use_pywrap_rules = bool(
repository_ctx.os.environ.get("USE_PYWRAP_RULES", False),
)
repository_ctx.file("BUILD.bazel", "")
repository_ctx.file(
"py_version.bzl",
_PY_VERSION_BZL.format(
version = version,
py_kind = "", # TODO(pcloudy): introduce this value properly.
use_pywrap_rules = use_pywrap_rules,
wheel_name = wheel_name,
wheel_collab = wheel_collab,
macosx_deployment_target = macosx_deployment_target,
),
)
python_version_repo = repository_rule(
implementation = _python_version_repo_impl,
environ = [
"HERMETIC_PYTHON_VERSION",
"HERMETIC_PYTHON_VERSION_KIND",
"USE_PYWRAP_RULES",
],
)
python_version_ext = module_extension(
implementation = lambda mctx: python_version_repo(name = "python_version_repo"),
)
+78
View File
@@ -0,0 +1,78 @@
"""bzlmod extensions for third-party dependencies."""
load("//third_party:java_repos.bzl", java_external_repositories = "repo")
load("//third_party:models_repos.bzl", "models_repositories")
load("//third_party/arm_neon_2_x86_sse:workspace.bzl", arm_neon_2_x86_sse = "repo")
load("//third_party/coremltools:workspace.bzl", coremltools = "repo")
load("//third_party/cython:workspace.bzl", cython = "repo")
load("//third_party/fft2d:workspace.bzl", fft2d = "repo")
load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
load("//third_party/gif:workspace.bzl", gif = "repo")
load("//third_party/googleapis:workspace.bzl", googleapis = "repo")
load("//third_party/hexagon:workspace.bzl", hexagon_nn = "repo")
load("//third_party/icu:workspace.bzl", icu = "repo")
load("//third_party/jpeg:workspace.bzl", jpeg = "repo")
load("//third_party/jpegxl:workspace.bzl", jpegxl = "repo")
load("//third_party/kissfft:workspace.bzl", kissfft = "repo")
load("//third_party/libwebp:workspace.bzl", libwebp = "repo")
load("//third_party/linenoise:workspace.bzl", linenoise = "repo")
load("//third_party/nccl:workspace.bzl", nccl = "repo")
load("//third_party/nvtx:workspace.bzl", nvtx = "repo")
load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
load("//third_party/png:workspace.bzl", png = "repo")
load("//third_party/pprof:workspace.bzl", pprof = "repo")
load("//third_party/py/absl_py:workspace.bzl", absl_py = "repo")
load("//third_party/ruy:workspace.bzl", ruy = "repo")
load("//third_party/six:workspace.bzl", six = "repo")
load("//third_party/skcms:workspace.bzl", skcms = "repo")
load("//third_party/sobol_data:workspace.bzl", sobol_data = "repo")
load("//third_party/sqlite:workspace.bzl", sqlite = "repo")
load("//third_party/tf_gcp_tools:workspace.bzl", tensorflow_gcp_tools = "repo")
load("//third_party/tf_runtime:workspace.bzl", tf_runtime = "repo")
load("//third_party/tflite_mobilenet:workspace.bzl", tflite_mobilenet = "repo")
load("//third_party/tflite_ovic_testdata:workspace.bzl", tflite_ovic_testdata = "repo")
load("//third_party/vulkan_headers:workspace.bzl", vulkan_headers = "repo")
load("//third_party/xctestrunner:workspace.bzl", xctestrunner = "repo")
load("//third_party/xprof:workspace.bzl", xprof = "repo")
def _third_party_ext_impl(mctx): # @unused
# go/keep-sorted start
absl_py()
arm_neon_2_x86_sse()
coremltools()
cython()
fft2d()
flatbuffers()
gif()
googleapis()
hexagon_nn()
icu()
java_external_repositories()
jpeg()
jpegxl()
kissfft()
libwebp()
linenoise()
models_repositories()
nccl()
nvtx()
opencl_headers()
png()
pprof()
ruy()
six()
skcms()
sobol_data()
sqlite()
tensorflow_gcp_tools()
tf_runtime()
tflite_mobilenet()
tflite_ovic_testdata()
vulkan_headers()
xctestrunner()
xprof()
# go/keep-sorted end
third_party_ext = module_extension(
implementation = _third_party_ext_impl,
)
+39
View File
@@ -0,0 +1,39 @@
# Headers for 2D Fast Fourier Transform package
# from http://momonga.t.u-tokyo.ac.jp/~ooura/fft2d.html
# This is a separate package because the original downloaded archive doesn't
# contain any header files.
package(
default_visibility = ["//visibility:public"],
)
# Unrestricted use; can only distribute original package.
# See fft/readme.txt
licenses(["notice"])
exports_files(["LICENSE"])
cc_library(
name = "fft2d_headers",
srcs = [
"fft.h",
"fft2d.h",
],
)
objc_library(
name = "fft2d_headersd_ios",
srcs = [
"fft.h",
"fft2d.h",
],
)
# Export the source code so that it could be compiled for Andoid native apps.
filegroup(
name = "fft2d_headers_srcs",
srcs = [
"fft.h",
"fft2d.h",
],
)
+3
View File
@@ -0,0 +1,3 @@
Copyright(C) 1997,2001 Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp).
You may use, copy, modify this code for any purpose and
without fee. You may distribute this ORIGINAL package.
+36
View File
@@ -0,0 +1,36 @@
/* Copyright 2017 The TensorFlow 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.
==============================================================================*/
// Declarations for 1D FFT routines in third_party/fft2d/fft2d.
#ifndef FFT2D_FFT_H__
#define FFT2D_FFT_H__
#ifdef __cplusplus
extern "C" {
#endif
extern void cdft(int, int, double *, int *, double *);
extern void rdft(int, int, double *, int *, double *);
extern void ddct(int, int, double *, int *, double *);
extern void ddst(int, int, double *, int *, double *);
extern void dfct(int, double *, double *, int *, double *);
extern void dfst(int, double *, double *, int *, double *);
#ifdef __cplusplus
}
#endif
#endif // FFT2D_FFT_H__
+45
View File
@@ -0,0 +1,45 @@
# 2D Fast Fourier Transform package
# from http://momonga.t.u-tokyo.ac.jp/~ooura/fft2d.html
package(
default_visibility = ["//visibility:public"],
)
# Unrestricted use; can only distribute original package.
licenses(["notice"])
exports_files(["readme2d.txt"])
FFT2D_SRCS = [
"fftsg.c",
"fftsg2d.c",
]
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
)
# This is the main 2D FFT library. The 2D FFTs in this library call
# 1D FFTs. In addition, fast DCTs are provided for the special case
# of 8x8 and 16x16. This code in this library is referred to as
# "Version II" on http://momonga.t.u-tokyo.ac.jp/~ooura/fft2d.html.
cc_library(
name = "fft2d",
srcs = FFT2D_SRCS,
linkopts = select({
":windows": [],
"//conditions:default": ["-lm"],
}),
)
objc_library(
name = "fft2d_ios",
srcs = FFT2D_SRCS,
)
# Export the source code so that it could be compiled for Andoid native apps.
filegroup(
name = "fft2d_srcs",
srcs = FFT2D_SRCS,
)
+38
View File
@@ -0,0 +1,38 @@
/* Copyright 2017 The TensorFlow 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.
==============================================================================*/
// Declarations for 2D FFT routines in third_party/fft2d/fft2d.
#ifndef FFT2D_FFT_H__
#define FFT2D_FFT_H__
#ifdef __cplusplus
extern "C" {
#endif
extern void cdft2d(int, int, int, double **, double *, int *, double *);
extern void rdft2d(int, int, int, double **, double *, int *, double *);
extern void ddct2d(int, int, int, double **, double *, int *, double *);
extern void ddst2d(int, int, int, double **, double *, int *, double *);
extern void rdft2dsort(int, int, int, double **);
extern void ddct8x8s(int isgn, double **a);
extern void ddct16x16s(int isgn, double **a);
#ifdef __cplusplus
}
#endif
#endif // FFT2D_FFT_H__
+14
View File
@@ -0,0 +1,14 @@
"""FFT2D"""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
# LINT.IfChange
tf_http_archive(
name = "fft2d",
build_file = "//third_party/fft2d:fft2d.BUILD",
sha256 = "5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb",
strip_prefix = "OouraFFT-1.0",
urls = tf_mirror_urls("https://github.com/petewarden/OouraFFT/archive/v1.0.tar.gz"),
)
# LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/fft2d.cmake)
+3
View File
@@ -0,0 +1,3 @@
# This empty BUILD file is required to make Bazel treat this directory as a package.
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+43
View File
@@ -0,0 +1,43 @@
licenses(["notice"]) # Apache 2.0
filegroup(
name = "LICENSE.txt",
visibility = ["//visibility:public"],
)
# Public flatc library to compile flatbuffer files at runtime.
cc_library(
name = "flatbuffers",
linkopts = ["-lflatbuffers"],
visibility = ["//visibility:public"],
)
# Public flatc compiler library.
cc_library(
name = "flatc_library",
linkopts = ["-lflatbuffers"],
visibility = ["//visibility:public"],
)
genrule(
name = "lnflatc",
outs = ["flatc.bin"],
cmd = "ln -s $$(which flatc) $@",
)
# Public flatc compiler.
sh_binary(
name = "flatc",
srcs = ["flatc.bin"],
visibility = ["//visibility:public"],
)
cc_library(
name = "runtime_cc",
visibility = ["//visibility:public"],
)
py_library(
name = "runtime_py",
visibility = ["//visibility:public"],
)
+649
View File
@@ -0,0 +1,649 @@
"""BUILD rules for generating flatbuffer files."""
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_java//java:defs.bzl", "java_library")
load("@xla//third_party/rules_python/python:defs.bzl", "py_library")
flatc_path = "@flatbuffers//:flatc"
zip_files = "//tensorflow/lite/tools:zip_files"
DEFAULT_INCLUDE_PATHS = [
"./",
"$(GENDIR)",
"$(BINDIR)",
]
DEFAULT_FLATC_ARGS = [
"--no-union-value-namespacing",
"--gen-object-api",
]
def flatbuffer_library_public(
name,
srcs,
outs,
language_flag,
out_prefix = "",
includes = [],
include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS,
reflection_name = "",
reflection_visibility = None,
output_to_bindir = False):
"""Generates code files for reading/writing the given flatbuffers in the requested language using the public compiler.
Outs:
filegroup(name): all generated source files.
Fileset([reflection_name]): (Optional) all generated reflection binaries.
Args:
name: Rule name.
srcs: Source .fbs files. Sent in order to the compiler.
outs: Output files from flatc.
language_flag: Target language flag. One of [-c, -j, -js].
out_prefix: Prepend this path to the front of all generated files except on
single source targets. Usually is a directory name.
includes: Optional, list of filegroups of schemas that the srcs depend on.
include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for.
flatc_args: Optional, list of additional arguments to pass to flatc.
reflection_name: Optional, if set this will generate the flatbuffer
reflection binaries for the schemas.
reflection_visibility: The visibility of the generated reflection Fileset.
output_to_bindir: Passed to genrule for output to bin directory.
"""
include_paths_cmd = ["-I %s" % (s) for s in include_paths]
# '$(@D)' when given a single source target will give the appropriate
# directory. Appending 'out_prefix' is only necessary when given a build
# target with multiple sources.
output_directory = (
("-o $(@D)/%s" % (out_prefix)) if len(srcs) > 1 else ("-o $(@D)")
)
genrule_cmd = " ".join([
"for f in $(SRCS); do",
"$(location %s)" % (flatc_path),
" ".join(flatc_args),
" ".join(include_paths_cmd),
language_flag,
output_directory,
"$$f;",
"done",
])
native.genrule(
name = name,
srcs = srcs,
outs = outs,
output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path],
cmd = genrule_cmd,
message = "Generating flatbuffer files for %s:" % (name),
)
if reflection_name:
reflection_genrule_cmd = " ".join([
"for f in $(SRCS); do",
"$(location %s)" % (flatc_path),
"-b --schema",
" ".join(flatc_args),
" ".join(include_paths_cmd),
language_flag,
output_directory,
"$$f;",
"done",
])
reflection_outs = [
(out_prefix + "%s.bfbs") % (s.replace(".fbs", "").split("/")[-1])
for s in srcs
]
native.genrule(
name = "%s_srcs" % reflection_name,
srcs = srcs,
outs = reflection_outs,
output_to_bindir = output_to_bindir,
compatible_with = compatible_with,
tools = includes + [flatc_path],
cmd = reflection_genrule_cmd,
message = "Generating flatbuffer reflection binary for %s:" % (name),
)
# TODO(b/114456773): Make bazel rules proper and supported by flatbuffer
# Have to comment this since FilesetEntry is not supported in bazel
# skylark.
# native.Fileset(
# name = reflection_name,
# out = "%s_out" % reflection_name,
# entries = [
# native.FilesetEntry(files = reflection_outs),
# ],
# visibility = reflection_visibility,
# compatible_with = compatible_with,
# )
def flatbuffer_cc_library(
name,
srcs,
srcs_filegroup_name = "",
out_prefix = "",
includes = [],
include_paths = [],
compatible_with = [],
flatc_args = DEFAULT_FLATC_ARGS,
visibility = None,
srcs_filegroup_visibility = None,
gen_reflections = False):
'''A cc_library with the generated reader/writers for the given flatbuffer definitions.
Outs:
filegroup([name]_srcs): all generated .h files.
filegroup(srcs_filegroup_name if specified, or [name]_includes if not):
Other flatbuffer_cc_library's can pass this in for their `includes`
parameter, if they depend on the schemas in this library.
Fileset([name]_reflection): (Optional) all generated reflection binaries.
cc_library([name]): library with sources and flatbuffers deps.
Remarks:
** Because the genrule used to call flatc does not have any trivial way of
computing the output list of files transitively generated by includes and
--gen-includes (the default) being defined for flatc, the --gen-includes
flag will not work as expected. The way around this is to add a dependency
to the flatbuffer_cc_library defined alongside the flatc included Fileset.
For example you might define:
flatbuffer_cc_library(
name = "my_fbs",
srcs = [ "schemas/foo.fbs" ],
includes = [ "//third_party/bazz:bazz_fbs_includes" ],
)
In which foo.fbs includes a few files from the Fileset defined at
//third_party/bazz:bazz_fbs_includes. When compiling the library that
includes foo_generated.h, and therefore has my_fbs as a dependency, it
will fail to find any of the bazz *_generated.h files unless you also
add bazz's flatbuffer_cc_library to your own dependency list, e.g.:
cc_library(
name = "my_lib",
deps = [
":my_fbs",
"//third_party/bazz:bazz_fbs"
],
)
Happy dependent Flatbuffering!
Args:
name: Rule name.
srcs: Source .fbs files. Sent in order to the compiler.
srcs_filegroup_name: Name of the output filegroup that holds srcs. Pass this
filegroup into the `includes` parameter of any other
flatbuffer_cc_library that depends on this one's schemas.
out_prefix: Prepend this path to the front of all generated files. Usually
is a directory name.
includes: Optional, list of filegroups of schemas that the srcs depend on.
** SEE REMARKS BELOW **
include_paths: Optional, list of paths the includes files can be found in.
compatible_with: Optional, passed to genrule for environments this rule
can be built for
flatc_args: Optional list of additional arguments to pass to flatc
(e.g. --gen-mutable).
visibility: The visibility of the generated cc_library. By default, use the
default visibility of the project.
srcs_filegroup_visibility: The visibility of the generated srcs filegroup.
By default, use the value of the visibility parameter above.
gen_reflections: Optional, if true this will generate the flatbuffer
reflection binaries for the schemas.
'''
output_headers = [
(out_prefix + "%s_generated.h") % (s.replace(".fbs", "").split("/")[-1].split(":")[-1])
for s in srcs
]
reflection_name = "%s_reflection" % name if gen_reflections else ""
flatbuffer_library_public(
name = "%s_srcs" % (name),
srcs = srcs,
outs = output_headers,
language_flag = "-c",
out_prefix = out_prefix,
includes = includes,
include_paths = include_paths,
compatible_with = compatible_with,
flatc_args = flatc_args,
reflection_name = reflection_name,
reflection_visibility = visibility,
)
cc_library(
name = name,
hdrs = output_headers,
srcs = output_headers,
features = [
"-parse_headers",
],
deps = [
"@flatbuffers//:runtime_cc",
],
includes = ["."],
linkstatic = 1,
visibility = visibility,
compatible_with = compatible_with,
)
# A filegroup for the `srcs`. That is, all the schema files for this
# Flatbuffer set.
native.filegroup(
name = srcs_filegroup_name if srcs_filegroup_name else "%s_includes" % (name),
srcs = srcs,
visibility = srcs_filegroup_visibility if srcs_filegroup_visibility != None else visibility,
compatible_with = compatible_with,
)
# Custom provider to track dependencies transitively.
FlatbufferInfo = provider(
fields = {
"transitive_srcs": "flatbuffer schema definitions.",
},
)
def _flatbuffer_schemas_aspect_impl(target, ctx):
_ignore = [target]
transitive_srcs = depset()
if hasattr(ctx.rule.attr, "deps"):
for dep in ctx.rule.attr.deps:
if FlatbufferInfo in dep:
transitive_srcs = depset(dep[FlatbufferInfo].transitive_srcs, transitive = [transitive_srcs])
if hasattr(ctx.rule.attr, "srcs"):
for src in ctx.rule.attr.srcs:
if FlatbufferInfo in src:
transitive_srcs = depset(src[FlatbufferInfo].transitive_srcs, transitive = [transitive_srcs])
for f in src.files:
if f.extension == "fbs":
transitive_srcs = depset([f], transitive = [transitive_srcs])
return [FlatbufferInfo(transitive_srcs = transitive_srcs)]
# An aspect that runs over all dependencies and transitively collects
# flatbuffer schema files.
_flatbuffer_schemas_aspect = aspect(
attr_aspects = [
"deps",
"srcs",
],
implementation = _flatbuffer_schemas_aspect_impl,
)
# Rule to invoke the flatbuffer compiler.
def _gen_flatbuffer_srcs_impl(ctx):
outputs = ctx.attr.outputs
include_paths = ctx.attr.include_paths
if ctx.attr.no_includes:
no_includes_statement = ["--no-includes"]
else:
no_includes_statement = []
if ctx.attr.language_flag == "--python":
onefile_statement = ["--gen-onefile"]
else:
onefile_statement = []
# Need to generate all files in a directory.
if not outputs:
outputs = [ctx.actions.declare_directory("{}_all".format(ctx.attr.name))]
output_directory = outputs[0].path
else:
outputs = [ctx.actions.declare_file(output) for output in outputs]
output_directory = outputs[0].dirname
deps = depset(ctx.files.srcs + ctx.files.deps, transitive = [
dep[FlatbufferInfo].transitive_srcs
for dep in ctx.attr.deps
if FlatbufferInfo in dep
])
include_paths_cmd_line = []
for s in include_paths:
include_paths_cmd_line.extend(["-I", s])
for src in ctx.files.srcs:
ctx.actions.run(
mnemonic = "GenFlatbufferSrcs",
inputs = deps,
outputs = outputs,
executable = ctx.executable._flatc,
arguments = [
ctx.attr.language_flag,
"-o",
output_directory,
# Allow for absolute imports and referencing of generated files.
"-I",
"./",
"-I",
ctx.genfiles_dir.path,
"-I",
ctx.bin_dir.path,
] + no_includes_statement +
onefile_statement +
include_paths_cmd_line + [
"--no-union-value-namespacing",
"--gen-object-api",
src.path,
],
progress_message = "Generating flatbuffer files for {}:".format(src),
use_default_shell_env = True,
)
return [
DefaultInfo(files = depset(outputs)),
]
_gen_flatbuffer_srcs = rule(
_gen_flatbuffer_srcs_impl,
attrs = {
"srcs": attr.label_list(
allow_files = [".fbs"],
mandatory = True,
),
"outputs": attr.string_list(
default = [],
mandatory = False,
),
"deps": attr.label_list(
default = [],
mandatory = False,
aspects = [_flatbuffer_schemas_aspect],
),
"include_paths": attr.string_list(
default = [],
mandatory = False,
),
"language_flag": attr.string(
mandatory = True,
),
"no_includes": attr.bool(
default = False,
mandatory = False,
),
"_flatc": attr.label(
default = Label("@flatbuffers//:flatc"),
executable = True,
cfg = "exec",
),
},
)
def flatbuffer_py_strip_prefix_srcs(name, srcs = [], strip_prefix = ""):
"""Strips path prefix.
Args:
name: Rule name. (required)
srcs: Source .py files. (required)
strip_prefix: Path that needs to be stripped from the srcs filepaths. (required)
"""
for src in srcs:
native.genrule(
name = name + "_" + src.replace(".", "_").replace("/", "_"),
srcs = [src],
outs = [src.replace(strip_prefix, "")],
cmd = "cp $< $@",
)
def _concat_flatbuffer_py_srcs_impl(ctx):
# Merge all generated python files. The files are concatenated and import
# statements are removed. Finally we import the flatbuffer runtime library.
# IMPORTANT: Our Windows shell does not support "find ... -exec" properly.
# If you're changing the commandline below, please build wheels and run smoke
# tests on all the three operating systems.
command = "echo 'import flatbuffers\n' > %s; "
command += "for f in $(find %s -name '*.py' | sort); do cat $f | sed '/import flatbuffers/d' >> %s; done "
ctx.actions.run_shell(
mnemonic = "ConcatFlatbufferPySrcs",
inputs = ctx.attr.deps[0].files,
outputs = [ctx.outputs.out],
command = command % (
ctx.outputs.out.path,
ctx.attr.deps[0].files.to_list()[0].path,
ctx.outputs.out.path,
),
use_default_shell_env = True,
)
_concat_flatbuffer_py_srcs = rule(
_concat_flatbuffer_py_srcs_impl,
attrs = {
"deps": attr.label_list(mandatory = True),
},
outputs = {"out": "%{name}.py"},
)
def flatbuffer_py_library(
name,
srcs,
deps = [],
visibility = None,
include_paths = []):
"""A py_library with the generated reader/writers for the given schema.
This rule assumes that the schema files define non-conflicting names, so that
they can be merged in a single file. This is e.g. the case if only a single
namespace is used.
The rule call the flatbuffer compiler for all schema files and merges the
generated python files into a single file that is wrapped in a py_library.
Args:
name: Rule name. (required)
srcs: List of source .fbs files. (required)
deps: List of dependencies.
include_paths: Optional, list of paths the includes files can be found in.
"""
all_srcs = "{}_srcs".format(name)
_gen_flatbuffer_srcs(
name = all_srcs,
srcs = srcs,
language_flag = "--python",
deps = deps,
include_paths = include_paths,
)
# TODO(b/235550563): Remove the concatnation rule with 2.0.6 update.
all_srcs_no_include = "{}_srcs_no_include".format(name)
_gen_flatbuffer_srcs(
name = all_srcs_no_include,
srcs = srcs,
language_flag = "--python",
deps = deps,
no_includes = True,
include_paths = include_paths,
)
concat_py_srcs = "{}_generated".format(name)
_concat_flatbuffer_py_srcs(
name = concat_py_srcs,
deps = [
":{}".format(all_srcs_no_include),
],
)
py_library(
name = name,
srcs = [
":{}".format(concat_py_srcs),
],
srcs_version = "PY3",
deps = deps + [
"@flatbuffers//:runtime_py",
],
visibility = visibility,
)
def flatbuffer_java_library(
name,
srcs,
custom_package = "",
package_prefix = "",
include_paths = DEFAULT_INCLUDE_PATHS,
flatc_args = DEFAULT_FLATC_ARGS,
visibility = None):
"""A java library with the generated reader/writers for the given flatbuffer definitions.
Args:
name: Rule name. (required)
srcs: List of source .fbs files including all includes. (required)
custom_package: Package name of generated Java files. If not specified
namespace in the schema files will be used. (optional)
package_prefix: like custom_package, but prefixes to the existing
namespace. (optional)
include_paths: List of paths that includes files can be found in. (optional)
flatc_args: List of additional arguments to pass to flatc. (optional)
visibility: Visibility setting for the java_library rule. (optional)
"""
out_srcjar = "java_%s_all.srcjar" % name
flatbuffer_java_srcjar(
name = "%s_srcjar" % name,
srcs = srcs,
out = out_srcjar,
custom_package = custom_package,
flatc_args = flatc_args,
include_paths = include_paths,
package_prefix = package_prefix,
)
native.filegroup(
name = "%s.srcjar" % name,
srcs = [out_srcjar],
)
java_library(
name = name,
srcs = [out_srcjar],
deps = [
"@flatbuffers//:runtime_java",
],
visibility = visibility,
)
def flatbuffer_java_srcjar(
name,
srcs,
out,
custom_package = "",
package_prefix = "",
include_paths = DEFAULT_INCLUDE_PATHS,
flatc_args = DEFAULT_FLATC_ARGS):
"""Generate flatbuffer Java source files.
Args:
name: Rule name. (required)
srcs: List of source .fbs files including all includes. (required)
out: Output file name. (required)
custom_package: Package name of generated Java files. If not specified
namespace in the schema files will be used. (optional)
package_prefix: like custom_package, but prefixes to the existing
namespace. (optional)
include_paths: List of paths that includes files can be found in. (optional)
flatc_args: List of additional arguments to pass to flatc. (optional)
"""
command_fmt = """set -e
tmpdir=$(@D)
schemas=$$tmpdir/schemas
java_root=$$tmpdir/java
rm -rf $$schemas
rm -rf $$java_root
mkdir -p $$schemas
mkdir -p $$java_root
for src in $(SRCS); do
dest=$$schemas/$$src
rm -rf $$(dirname $$dest)
mkdir -p $$(dirname $$dest)
if [ -z "{custom_package}" ] && [ -z "{package_prefix}" ]; then
cp -f $$src $$dest
else
if [ -z "{package_prefix}" ]; then
sed -e "s/namespace\\s.*/namespace {custom_package};/" $$src > $$dest
else
sed -e "s/namespace \\([^;]\\+\\);/namespace {package_prefix}.\\1;/" $$src > $$dest
fi
fi
done
flatc_arg_I="-I $$tmpdir/schemas"
for include_path in {include_paths}; do
flatc_arg_I="$$flatc_arg_I -I $$schemas/$$include_path"
done
flatc_additional_args=
for arg in {flatc_args}; do
flatc_additional_args="$$flatc_additional_args $$arg"
done
for src in $(SRCS); do
$(location {flatc_path}) $$flatc_arg_I --java $$flatc_additional_args -o $$java_root $$schemas/$$src
done
$(location {zip_files}) -export_zip_path=$@ -file_directory=$$java_root
"""
genrule_cmd = command_fmt.format(
package_name = native.package_name(),
custom_package = custom_package,
package_prefix = package_prefix,
flatc_path = flatc_path,
zip_files = zip_files,
include_paths = " ".join(include_paths),
flatc_args = " ".join(flatc_args),
)
native.genrule(
name = name,
srcs = srcs,
outs = [out],
tools = [flatc_path, zip_files],
cmd = genrule_cmd,
)
def flatbuffer_android_library(
name,
srcs,
custom_package = "",
package_prefix = "",
include_paths = DEFAULT_INCLUDE_PATHS,
flatc_args = DEFAULT_FLATC_ARGS,
visibility = None):
"""An android_library with the generated reader/writers for the given flatbuffer definitions.
Args:
name: Rule name. (required)
srcs: List of source .fbs files including all includes. (required)
custom_package: Package name of generated Java files. If not specified
namespace in the schema files will be used. (optional)
package_prefix: like custom_package, but prefixes to the existing
namespace. (optional)
include_paths: List of paths that includes files can be found in. (optional)
flatc_args: List of additional arguments to pass to flatc. (optional)
visibility: Visibility setting for the android_library rule. (optional)
"""
out_srcjar = "android_%s_all.srcjar" % name
flatbuffer_java_srcjar(
name = "%s_srcjar" % name,
srcs = srcs,
out = out_srcjar,
custom_package = custom_package,
flatc_args = flatc_args,
include_paths = include_paths,
package_prefix = package_prefix,
)
native.filegroup(
name = "%s.srcjar" % name,
srcs = [out_srcjar],
)
# To support org.checkerframework.dataflow.qual.Pure.
checkerframework_annotations = [
"@org_checkerframework_qual",
] if "--java-checkerframework" in flatc_args else []
android_library(
name = name,
srcs = [out_srcjar],
visibility = visibility,
deps = [
"@flatbuffers//:runtime_android",
] + checkerframework_annotations,
)
+194
View File
@@ -0,0 +1,194 @@
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load(":build_defs.bzl", "flatbuffer_py_strip_prefix_srcs")
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
config_setting(
name = "platform_freebsd",
values = {"cpu": "freebsd"},
)
config_setting(
name = "platform_openbsd",
values = {"cpu": "openbsd"},
)
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
)
# Public flatc library to compile flatbuffer files at runtime.
cc_library(
name = "flatbuffers",
hdrs = ["//:public_headers"],
linkstatic = 1,
strip_include_prefix = "/include",
visibility = ["//visibility:public"],
deps = ["//src:flatbuffers"],
)
# Public C++ headers for the Flatbuffers library.
filegroup(
name = "public_headers",
srcs = [
"include/flatbuffers/allocator.h",
"include/flatbuffers/array.h",
"include/flatbuffers/base.h",
"include/flatbuffers/buffer.h",
"include/flatbuffers/buffer_ref.h",
"include/flatbuffers/code_generator.h",
"include/flatbuffers/code_generators.h",
"include/flatbuffers/default_allocator.h",
"include/flatbuffers/detached_buffer.h",
"include/flatbuffers/file_manager.h",
"include/flatbuffers/flatbuffer_builder.h",
"include/flatbuffers/flatbuffers.h",
"include/flatbuffers/flex_flat_util.h",
"include/flatbuffers/flexbuffers.h",
"include/flatbuffers/grpc.h",
"include/flatbuffers/hash.h",
"include/flatbuffers/idl.h",
"include/flatbuffers/minireflect.h",
"include/flatbuffers/reflection.h",
"include/flatbuffers/reflection_generated.h",
"include/flatbuffers/registry.h",
"include/flatbuffers/stl_emulation.h",
"include/flatbuffers/string.h",
"include/flatbuffers/struct.h",
"include/flatbuffers/table.h",
"include/flatbuffers/util.h",
"include/flatbuffers/vector.h",
"include/flatbuffers/vector_downward.h",
"include/flatbuffers/verifier.h",
],
visibility = ["//visibility:public"],
)
# Public flatc compiler library.
cc_library(
name = "flatc_library",
linkstatic = 1,
visibility = ["//visibility:public"],
deps = [
"@flatbuffers//src:flatc_library",
],
)
# Public flatc compiler.
cc_binary(
name = "flatc",
linkopts = select({
":platform_freebsd": [
"-lm",
],
# If Visual Studio 2022 developers facing linking errors,
# change the line below as ":windows": ["/DEFAULTLIB:msvcrt.lib"],
":windows": [],
"//conditions:default": [
"-lm",
"-ldl",
],
}),
visibility = ["//visibility:public"],
deps = [
"@flatbuffers//src:flatc",
],
)
filegroup(
name = "flatc_headers",
srcs = [
"include/flatbuffers/flatc.h",
],
visibility = ["//visibility:public"],
)
# Library used by flatbuffer_cc_library rules.
cc_library(
name = "runtime_cc",
hdrs = [
"include/flatbuffers/allocator.h",
"include/flatbuffers/array.h",
"include/flatbuffers/base.h",
"include/flatbuffers/buffer.h",
"include/flatbuffers/buffer_ref.h",
"include/flatbuffers/default_allocator.h",
"include/flatbuffers/detached_buffer.h",
"include/flatbuffers/flatbuffer_builder.h",
"include/flatbuffers/flatbuffers.h",
"include/flatbuffers/flexbuffers.h",
"include/flatbuffers/stl_emulation.h",
"include/flatbuffers/string.h",
"include/flatbuffers/struct.h",
"include/flatbuffers/table.h",
"include/flatbuffers/util.h",
"include/flatbuffers/vector.h",
"include/flatbuffers/vector_downward.h",
"include/flatbuffers/verifier.h",
],
linkstatic = 1,
strip_include_prefix = "/include",
visibility = ["//visibility:public"],
)
flatbuffer_py_strip_prefix_srcs(
name = "flatbuffer_py_strip_prefix",
srcs = [
"python/flatbuffers/__init__.py",
"python/flatbuffers/_version.py",
"python/flatbuffers/builder.py",
"python/flatbuffers/compat.py",
"python/flatbuffers/encode.py",
"python/flatbuffers/flexbuffers.py",
"python/flatbuffers/number_types.py",
"python/flatbuffers/packer.py",
"python/flatbuffers/table.py",
"python/flatbuffers/util.py",
],
strip_prefix = "python/flatbuffers/",
)
filegroup(
name = "runtime_py_srcs",
srcs = [
"__init__.py",
"_version.py",
"builder.py",
"compat.py",
"encode.py",
"flexbuffers.py",
"number_types.py",
"packer.py",
"table.py",
"util.py",
],
)
py_library(
name = "runtime_py",
srcs = [":runtime_py_srcs"],
visibility = ["//visibility:public"],
)
filegroup(
name = "runtime_java_srcs",
srcs = glob(["java/src/main/java/com/google/flatbuffers/**/*.java"]),
)
java_library(
name = "runtime_java",
srcs = [":runtime_java_srcs"],
visibility = ["//visibility:public"],
)
android_library(
name = "runtime_android",
srcs = [":runtime_java_srcs"],
visibility = ["//visibility:public"],
)
+21
View File
@@ -0,0 +1,21 @@
"""Loads the Flatbuffers library, used by TF Lite."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
_FLATBUFFERS_VERSION = "25.9.23"
# curl -L https://github.com/google/flatbuffers/archive/v<_FLATBUFFERS_VERSION>.tar.gz | shasum -a 256
_FLATBUFFERS_SHA256 = "9102253214dea6ae10c2ac966ea1ed2155d22202390b532d1dea64935c518ada"
def repo():
tf_http_archive(
name = "flatbuffers",
strip_prefix = "flatbuffers-%s" % _FLATBUFFERS_VERSION,
sha256 = _FLATBUFFERS_SHA256,
urls = tf_mirror_urls("https://github.com/google/flatbuffers/archive/v%s.tar.gz" % _FLATBUFFERS_VERSION),
build_file = "//third_party/flatbuffers:flatbuffers.BUILD",
system_build_file = "//third_party/flatbuffers:BUILD.system",
link_files = {
"//third_party/flatbuffers:build_defs.bzl": "build_defs.bzl",
},
)
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+59
View File
@@ -0,0 +1,59 @@
# Description:
# A library for decoding and encoding GIF images
licenses(["notice"]) # MIT
exports_files(["COPYING"])
cc_library(
name = "gif",
srcs = [
"dgif_lib.c",
"egif_lib.c",
"gif_err.c",
"gif_font.c",
"gif_hash.c",
"gif_hash.h",
"gif_lib_private.h",
"gifalloc.c",
"openbsd-reallocarray.c",
"quantize.c",
],
hdrs = ["gif_lib.h"],
defines = select({
":android": [
"S_IREAD=S_IRUSR",
"S_IWRITE=S_IWUSR",
"S_IEXEC=S_IXUSR",
],
"//conditions:default": [],
}),
includes = ["."],
visibility = ["//visibility:public"],
deps = select({
":windows": [":windows_polyfill"],
"//conditions:default": [],
}),
)
cc_library(
name = "windows_polyfill",
hdrs = ["windows/unistd.h"],
includes = ["windows"],
)
genrule(
name = "windows_unistd_h",
outs = ["windows/unistd.h"],
cmd = "touch $@",
)
config_setting(
name = "windows",
constraint_values = ["@platforms//os:windows"],
)
config_setting(
name = "android",
values = {"crosstool_top": "//external:android/crosstool"},
)
+89
View File
@@ -0,0 +1,89 @@
diff --git a/dgif_lib.c b/dgif_lib.c
index 82fc097..214a0e7 100644
--- a/dgif_lib.c
+++ b/dgif_lib.c
@@ -810,7 +810,8 @@ DGifSetupDecompress(GifFileType *GifFile)
/* coverity[check_return] */
if (InternalRead(GifFile, &CodeSize, 1) < 1) { /* Read Code size from file. */
- return GIF_ERROR; /* Failed to read Code size. */
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR; /* Failed to read Code size. */
}
BitsPerPixel = CodeSize;
@@ -1118,6 +1119,31 @@ DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte)
return GIF_OK;
}
+/******************************************************************************
+ This routine is called in case of error during parsing image. We need to
+ decrease image counter and reallocate memory for saved images. Not decreasing
+ ImageCount may lead to null pointer dereference, because the last element in
+ SavedImages may point to the spoilt image and null pointer buffers.
+*******************************************************************************/
+void
+DGifDecreaseImageCounter(GifFileType *GifFile)
+{
+ GifFile->ImageCount--;
+ if (GifFile->SavedImages[GifFile->ImageCount].RasterBits != NULL) {
+ free(GifFile->SavedImages[GifFile->ImageCount].RasterBits);
+ }
+ if (GifFile->SavedImages[GifFile->ImageCount].ImageDesc.ColorMap != NULL) {
+ GifFreeMapObject(GifFile->SavedImages[GifFile->ImageCount].ImageDesc.ColorMap);
+ }
+
+ // Realloc array according to the new image counter.
+ SavedImage *correct_saved_images = (SavedImage *)reallocarray(
+ GifFile->SavedImages, GifFile->ImageCount, sizeof(SavedImage));
+ if (correct_saved_images != NULL) {
+ GifFile->SavedImages = correct_saved_images;
+ }
+}
+
/******************************************************************************
This routine reads an entire GIF into core, hanging all its state info off
the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle()
@@ -1148,17 +1174,20 @@ DGifSlurp(GifFileType *GifFile)
/* Allocate memory for the image */
if (sp->ImageDesc.Width <= 0 || sp->ImageDesc.Height <= 0 ||
sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
+ DGifDecreaseImageCounter(GifFile);
return GIF_ERROR;
}
ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
+ DGifDecreaseImageCounter(GifFile);
return GIF_ERROR;
}
sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize,
sizeof(GifPixelType));
if (sp->RasterBits == NULL) {
+ DGifDecreaseImageCounter(GifFile);
return GIF_ERROR;
}
@@ -1177,13 +1206,17 @@ DGifSlurp(GifFileType *GifFile)
j += InterlacedJumps[i]) {
if (DGifGetLine(GifFile,
sp->RasterBits+j*sp->ImageDesc.Width,
- sp->ImageDesc.Width) == GIF_ERROR)
- return GIF_ERROR;
+ sp->ImageDesc.Width) == GIF_ERROR) {
+ DGifDecreaseImageCounter(GifFile);
+ return GIF_ERROR;
+ }
}
}
else {
- if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR)
- return (GIF_ERROR);
+ if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR) {
+ DGifDecreaseImageCounter(GifFile);
+ return GIF_ERROR;
+ }
}
if (GifFile->ExtensionBlocks) {
+15
View File
@@ -0,0 +1,15 @@
diff -r -u ./fixed_gif_font.c ./gif_font.c
--- ./fixed_gif_font.c 2019-09-05 11:05:25.009598262 -0700
+++ ./gif_font.c 2019-09-05 10:52:45.308389085 -0700
@@ -11,6 +11,11 @@
#include "gif_lib.h"
+// Windows doesn't have strtok_r.
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
+#define strtok_r strtok_s
+#endif
+
/*****************************************************************************
Ascii 8 by 8 regular font - only first 128 characters are supported.
*****************************************************************************/
+17
View File
@@ -0,0 +1,17 @@
"""Loads the gif library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "gif",
build_file = "//third_party/gif:gif.BUILD",
patch_file = [
"//third_party/gif:gif_fix_strtok_r.patch",
"//third_party/gif:gif_fix_image_counter.patch",
],
sha256 = "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd",
strip_prefix = "giflib-5.2.1",
system_build_file = "//third_party/systemlibs:gif.BUILD",
urls = tf_mirror_urls("https://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz"),
)
View File
+10
View File
@@ -0,0 +1,10 @@
# Description:
# Exports generated files used to generate tensorflow/core/util/version_info.cc
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
exports_files(
glob(["gen/*"]),
)
+71
View File
@@ -0,0 +1,71 @@
"""Repository rule for Git autoconfiguration.
`git_configure` depends on the following environment variables:
* `PYTHON_BIN_PATH`: location of python binary.
"""
_PYTHON_BIN_PATH = "PYTHON_BIN_PATH"
def _fail(msg):
"""Output failure message when auto configuration fails."""
red = "\033[0;31m"
no_color = "\033[0m"
fail("%sGit Configuration Error:%s %s\n" % (red, no_color, msg))
def _get_python_bin(repository_ctx):
"""Gets the python bin path."""
python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH)
if python_bin != None:
return python_bin
python_bin_path = repository_ctx.which("python3")
if python_bin_path != None:
return str(python_bin_path)
python_bin_path = repository_ctx.which("python")
if python_bin_path != None:
return str(python_bin_path)
_fail("Cannot find python in PATH, please make sure " +
"python is installed and add its directory in PATH, or --define " +
"%s='/something/else'.\nPATH=%s" % (
_PYTHON_BIN_PATH,
repository_ctx.os.environ.get("PATH", ""),
))
def _git_conf_impl(repository_ctx):
repository_ctx.template(
"BUILD",
Label("//third_party/git:BUILD.tpl"),
)
tensorflow_root_path = str(repository_ctx.path(
Label("//:BUILD"),
))[:-len("BUILD")]
python_script_path = repository_ctx.path(
Label("//tensorflow/tools/git:gen_git_source.py"),
)
generated_files_path = repository_ctx.path("gen")
r = repository_ctx.execute(
["test", "-f", "%s/.git/logs/HEAD" % tensorflow_root_path],
)
if r.return_code == 0:
unused_var = repository_ctx.path(Label("//:.git/HEAD")) # pylint: disable=unused-variable
result = repository_ctx.execute([
_get_python_bin(repository_ctx),
python_script_path,
"--configure",
tensorflow_root_path,
"--gen_root_path",
generated_files_path,
], quiet = False)
if not result.return_code == 0:
_fail(result.stderr)
git_configure = repository_rule(
implementation = _git_conf_impl,
environ = [
_PYTHON_BIN_PATH,
],
)
+39
View File
@@ -0,0 +1,39 @@
# Copyright 2020 The TensorFlow 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.
licenses(["notice"])
cc_library(
name = "grpc_all_cc",
visibility = ["//tensorflow/core/platform/cloud:__pkg__"],
deps = [
"@com_google_googleapis//google/monitoring/v3:monitoring_cc_grpc",
],
)
cc_library(
name = "protos_all_cc",
visibility = ["//tensorflow/core/platform/cloud:__pkg__"],
deps = [
"@com_google_googleapis//google/monitoring/v3:monitoring_cc_proto_headers_only",
],
)
cc_library(
name = "protos_all_cc_impl",
visibility = ["//tensorflow/core/platform/cloud:__pkg__"],
deps = [
"@com_google_googleapis//google/monitoring/v3:monitoring_cc_proto",
],
)
+90
View File
@@ -0,0 +1,90 @@
# Copyright 2020 The TensorFlow 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.
"""
Utilities for building grpc and proto libraries from googleapis.
"""
load("@com_github_grpc_grpc//bazel:generate_cc.bzl", "generate_cc")
load("@rules_cc//cc:defs.bzl", native_cc_proto_library = "cc_proto_library")
def _tf_cc_headers(ctx):
if len(ctx.attr.deps) != 1:
fail("deps must have exactly 1 photo_library")
return [
CcInfo(
compilation_context = ctx.attr.deps[0][CcInfo].compilation_context,
),
DefaultInfo(
files = ctx.attr.deps[0][CcInfo].compilation_context.headers,
),
]
tf_cc_headers = rule(
implementation = _tf_cc_headers,
attrs = {
"deps": attr.label_list(providers = [CcInfo]),
},
)
def cc_proto_library(name, deps):
"""Generates a cc library and a header only cc library from a proto library
Args:
name: the name of the cc_library
deps: a list that contains exactly one proto_library
"""
native_cc_proto_library(
name = name,
deps = deps,
visibility = ["//visibility:public"],
)
tf_cc_headers(
name = name + "_headers_only",
deps = [":" + name],
visibility = ["//visibility:public"],
)
def cc_grpc_library(name, srcs, deps, service_namespace = "grpc", **kwargs):
"""Generates a cc library with grpc implementation and cc proto headers
Args:
name: the name of the cc_grpc_library to be created
srcs: the proto_libraries used to generate the cc_grpc_library
deps: the dependencies used to link into this cc_grpc_library, defined by
cc_proto_library
**kwargs: other args not used, for compatibility only
"""
if len(srcs) != 1:
fail("srcs must have exactly 1 photo_library", "srcs")
codegen_grpc_target = "_" + name + "_grpc_codegen"
generate_cc(
name = codegen_grpc_target,
srcs = srcs,
flags = [
"services_namespace=" + service_namespace,
],
plugin = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin",
well_known_protos = True,
generate_mocks = True,
)
grpc_proto_dep = "@com_github_grpc_grpc//:grpc++_codegen_proto"
native.cc_library(
name = name,
srcs = [":" + codegen_grpc_target],
hdrs = [":" + codegen_grpc_target],
deps = [dep + "_headers_only" for dep in deps] + [grpc_proto_dep],
visibility = ["//visibility:public"],
)
+19
View File
@@ -0,0 +1,19 @@
# Copyright 2018 Google LLC
#
# 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.
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
+47
View File
@@ -0,0 +1,47 @@
# Copyright 2020 The TensorFlow 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.
"""
Utilities for configuring googleapis in workspace external dependency.
"""
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
def config_googleapis():
"""Configures external dependency googleapis to use Google's C++ gRPC APIs
To avoid ODR violation, the cc proto libraries (*.pb.cc) must be
statically linked to libtensorflow_framework.so, whereas cc grpc libraries
(*.grpc.pb.cc) must be statically linked to _pywrap_tensorflow.so.
To achieve this, Bazel rules are overridden to
(1) generate headers-only proto library, and
(2) build grpc library depending on the cc headers instead of the cc proto
library.
"""
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
grpc = True,
rules_override = {
"cc_proto_library": [
"@org_tensorflow//third_party/googleapis:build_rules.bzl",
"",
],
"cc_grpc_library": [
"@org_tensorflow//third_party/googleapis:build_rules.bzl",
"",
],
},
)
+12
View File
@@ -0,0 +1,12 @@
"""Loads the googleapis library, used by TF."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "com_google_googleapis",
build_file = "//third_party/googleapis:googleapis.BUILD",
sha256 = "249d83abc5d50bf372c35c49d77f900bff022b2c21eb73aa8da1458b6ac401fc",
strip_prefix = "googleapis-6b3fdcea8bc5398be4e7e9930c693f0ea09316a0",
urls = tf_mirror_urls("https://github.com/googleapis/googleapis/archive/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz"),
)
+128
View File
@@ -0,0 +1,128 @@
diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl
--- a/bazel/cc_grpc_library.bzl
+++ b/bazel/cc_grpc_library.bzl
@@ -28,6 +28,7 @@ def cc_grpc_library(
allow_deprecated = False,
use_external = False, # @unused
grpc_only = False,
+ plugin_flags = [],
**kwargs):
"""Generates C++ grpc classes for services defined in a proto file.
@@ -109,6 +110,7 @@ def cc_grpc_library(
well_known_protos = well_known_protos,
generate_mocks = generate_mocks,
allow_deprecated = allow_deprecated,
+ flags = plugin_flags,
**kwargs
)
diff --git a/src/core/lib/promise/party.h b/src/core/lib/promise/party.h
--- a/src/core/lib/promise/party.h
+++ b/src/core/lib/promise/party.h
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <atomic>
+#include <cinttypes>
#include <limits>
#include <string>
#include <utility>
@@ -685,7 +686,7 @@ class Party : public Activity, private Wakeable {
DebugLocation loc = {}) {
GRPC_TRACE_LOG(party_state, INFO).AtLocation(loc.file(), loc.line())
<< this << " " << op << " "
- << absl::StrFormat("%016" PRIx64 " -> %016" PRIx64, prev_state,
+ << absl::StrFormat("%016lx -> %016lx", prev_state,
new_state);
}
diff --git a/src/python/grpcio/grpc/BUILD.bazel b/src/python/grpcio/grpc/BUILD.bazel
--- a/src/python/grpcio/grpc/BUILD.bazel
+++ b/src/python/grpcio/grpc/BUILD.bazel
@@ -104,9 +104,9 @@ py_library(
py_library(
name = "grpcio",
srcs = ["__init__.py"],
- data = [
- "//:grpc",
- ],
+# data = [
+# "//:grpc",
+# ],
imports = ["../"],
deps = [
":_observability",
diff --git a/MODULE.bazel b/MODULE.bazel
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -60,7 +60,7 @@ bazel_dep(name = "rules_shell", version = "0.4.0", dev_dependency = True)
# Python dependencies
# ===================
-bazel_dep(name = "rules_python", version = "1.5.4")
+bazel_dep(name = "rules_python", version = "1.6.3")
PYTHON_VERSIONS = [
"3.9",
@@ -68,7 +68,7 @@ PYTHON_VERSIONS = [
"3.11",
"3.12",
"3.13",
- "3.14.0b2",
+ "3.14",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
diff --git a/bazel/cython_library.bzl b/bazel/cython_library.bzl
--- a/bazel/cython_library.bzl
+++ b/bazel/cython_library.bzl
@@ -69,5 +69,6 @@ def pyx_library(name, deps = [], py_deps
shared_objects = []
defines = kwargs.pop("defines", [])
+ copts = kwargs.pop("copts", [])
for src in pyx_srcs:
stem = src.split(".")[0]
@@ -81,9 +81,16 @@ def pyx_library(name, deps = [], py_deps
defines = defines,
+ copts = copts,
+ features = kwargs.get("features", []),
linkshared = 1,
- linkopts = select({
- # The "-undefined dynamic_lookup" flag allows the shared library to use symbols
- # that are not defined at link time but will be resolved at runtime.
- # This is necessary for Python extensions on macOS to access Python C API symbols.
- "@platforms//os:macos": ["-undefined", "dynamic_lookup"],
- "//conditions:default": [],
- }),
+ linkopts = select({
+ # The "-undefined dynamic_lookup" flag allows the shared library to use symbols
+ # that are not defined at link time but will be resolved at runtime.
+ # This is necessary for Python extensions on macOS to access Python C API symbols.
+ "@platforms//os:macos": ["-undefined", "dynamic_lookup"],
+ "@platforms//os:windows": [
+ "/NODEFAULTLIB:python3.lib",
+ "/OPT:REF",
+ "/OPT:ICF",
+ ],
+ "//conditions:default": [],
+ }),
)
shared_objects.append(shared_object_name)
diff --git a/src/python/grpcio/grpc/_cython/BUILD.bazel b/src/python/grpcio/grpc/_cython/BUILD.bazel
--- a/src/python/grpcio/grpc/_cython/BUILD.bazel
+++ b/src/python/grpcio/grpc/_cython/BUILD.bazel
@@ -35,1 +35,10 @@
defines = ["GRPC_PYTHON_BUILD=1"],
+ # -Wno-unused-result is needed because Cython generated code triggers unused result warnings.
+ copts = select({
+ "@platforms//os:windows": [],
+ "//conditions:default": ["-Wno-unused-result"],
+ }),
+ features = select({
+ "@platforms//os:windows": ["-layering_check", "force_no_whole_archive"],
+ "//conditions:default": ["-layering_check"],
+ }),
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+137
View File
@@ -0,0 +1,137 @@
# Copyright 2019 The TensorFlow 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.
# ==============================================================================
package(default_visibility = [
"//visibility:public",
])
licenses([
"notice", # BSD-3-Clause-Clear
])
exports_files(glob(["hexagon/**/*.so"]))
#Just header file, needed for data types in the interface.
cc_library(
name = "hexagon_nn_header",
hdrs = [
"@hexagon_nn//:hexagon/hexagon_nn.h",
],
tags = [
"manual",
"nobuilder",
],
)
cc_library(
name = "hexagon_nn_ops",
hdrs = [
"@hexagon_nn//:hexagon/hexagon_nn_ops.h",
"@hexagon_nn//:hexagon/ops.def",
],
tags = [
"manual",
"nobuilder",
],
)
cc_library(
name = "remote",
hdrs = [
"@hexagon_nn//:hexagon/remote.h",
"@hexagon_nn//:hexagon/remote64.h",
],
tags = [
"manual",
"nobuilder",
],
)
cc_library(
name = "rpcmem",
srcs = [
"@hexagon_nn//:hexagon/rpcmem_stub.c",
],
hdrs = [
"@hexagon_nn//:hexagon/rpcmem.h",
],
deps = [
":AEEStdDef",
],
)
cc_library(
name = "hexagon_soc",
hdrs = [
"@hexagon_nn//:hexagon/hexnn_soc_defines.h",
],
tags = [
"manual",
"nobuilder",
],
)
cc_library(
name = "AEEStdDef",
hdrs = [
"@hexagon_nn//:hexagon/AEEStdDef.h",
],
tags = [
"manual",
"nobuilder",
],
)
cc_library(
name = "AEEStdErr",
hdrs = [
"@hexagon_nn//:hexagon/AEEStdErr.h",
],
)
# The files are included in another .c files, so we add the src files as textual_hdrs
# to avoid compiling them and have linking errors for multiple symbols.
cc_library(
name = "hexagon_stub",
textual_hdrs = [
"@hexagon_nn//:hexagon/hexagon_nn_domains_stub.c",
"@hexagon_nn//:hexagon/hexagon_nn_stub.c",
],
)
# This rule uses the smart/graph wrapper interfaces.
cc_library(
name = "hexagon_nn",
srcs = [
"@hexagon_nn//:hexagon/hexagon_nn.h",
"@hexagon_nn//:hexagon/hexnn_dsp_api.h",
"@hexagon_nn//:hexagon/hexnn_dsp_api_impl.c",
"@hexagon_nn//:hexagon/hexnn_dsp_domains_api.h",
"@hexagon_nn//:hexagon/hexnn_dsp_domains_api_impl.c",
"@hexagon_nn//:hexagon/hexnn_dsp_smart_wrapper_api.c",
"@hexagon_nn//:hexagon/hexnn_dsp_smart_wrapper_api.h",
"@hexagon_nn//:hexagon/hexnn_graph_wrapper.cpp",
"@hexagon_nn//:hexagon/hexnn_graph_wrapper.hpp",
"@hexagon_nn//:hexagon/hexnn_graph_wrapper_interface.h",
"@hexagon_nn//:hexagon/hexnn_soc_defines.h",
],
deps = [
":AEEStdErr",
":hexagon_stub",
":remote",
":rpcmem",
],
alwayslink = 1,
)
+17
View File
@@ -0,0 +1,17 @@
"""Loads the Hexagon NN Header files library, used by TF Lite."""
load("//third_party:repo.bzl", "tf_http_archive")
# Note: Use libhexagon_nn_skel version 1.20.0.1 Only with the current version.
# This comment will be updated with compatible version.
def repo():
tf_http_archive(
name = "hexagon_nn",
sha256 = "f577b4c150b72e11e9dfb3f9d14f9772ba8fe460f7d65c84a7327ea9bef44d8e",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/storage.cloud.google.com/download.tensorflow.org/tflite/hexagon_nn_headers_v1.20.0.9.tgz",
# Repeated to bypass 'at least two urls' check. TODO(karimnosseir): add original source of this package.
"https://storage.googleapis.com/mirror.tensorflow.org/storage.cloud.google.com/download.tensorflow.org/tflite/hexagon_nn_headers_v1.20.0.9.tgz",
],
build_file = "//third_party/hexagon:hexagon.BUILD",
)
+3
View File
@@ -0,0 +1,3 @@
# This empty BUILD file is required to make Bazel treat this directory as a package.
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+30
View File
@@ -0,0 +1,30 @@
package(
default_visibility = ["//visibility:public"],
)
licenses(["notice"]) # Apache 2.0
filegroup(
name = "icu4c/LICENSE",
)
filegroup(
name = "icu4j/main/shared/licenses/LICENSE",
)
cc_library(
name = "headers",
)
cc_library(
name = "common",
deps = [
":icuuc",
],
)
cc_library(
name = "icuuc",
linkopts = ["-licuuc"],
visibility = ["//visibility:private"],
)
+63
View File
@@ -0,0 +1,63 @@
package(
default_visibility = ["//visibility:public"],
)
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
# Data for core MIME/Unix/Windows encodings:
# ISO 8859-2..9, 15; Windows-125x; EUC-CN; GBK (Windows cp936); GB 18030;
# Big5 (Windows cp950); SJIS (Windows cp932); EUC-JP; EUC-KR, KS C 5601;
# Windows cp949. Data is pre-processed for little-endian platforms. To replicate
# this pre-processing (if you want additional encodings, for example), do the
# following:
#
# First, download, build, and install ICU. This installs tools such as makeconv.
# Then, run the following from your icu4c/source directory:
# $ cp [path to filters.json] .
# $ ICU_DATA_FILTER_FILE=filters.json ./runConfigureICU Linux
# $ make clean && make
# $ cd data/out/tmp
# $ genccode icudt70l.dat # Note: this number must match version, and below too!
# $ echo 'U_CAPI const void * U_EXPORT2 uprv_getICUData_conversion() { return icudt70l_dat.bytes; }' >> icudt70l_dat.c
#
# This creates icudt70l_dat.c, which you can move, rename, gzip, then split,
# for example (but you can change to other numbers):
# $ cp icudt70l_dat.c icu_conversion_data.c
# $ gzip icu_conversion_data.c
# # Note: make sure you don't forget the last . below!
# $ split -a 3 -b 100000 icu_conversion_data.c.gz icu_conversion_data.c.gz.
#
# Then, copy the generated files to this directory, removing existing ones.
#
# The current files have been generated by this filter (in filters.json):
# {
# "localeFilter": {
# "filterType": "language",
# "includelist": [
# "en"
# ]
# }
# }
# Please make sure to keep this updated if you change the data files.
filegroup(
name = "conversion_files",
srcs = glob(["icu_conversion_data.c.gz.*"]),
)
# Data files are compressed and split to work around git performance degradation
# around large files.
genrule(
name = "merge_conversion_data",
srcs = [":conversion_files"],
outs = ["conversion_data.c"],
cmd = "cat $(locations :conversion_files) | gunzip > $@",
)
cc_library(
name = "conversion_data",
srcs = [":conversion_data.c"],
deps = ["@icu//:headers"],
alwayslink = 1,
)
+414
View File
@@ -0,0 +1,414 @@
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
Copyright © 1991-2018 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
---------------------
Third-Party Software Licenses
This section contains third-party software notices and/or additional
terms for licensed third-party software components included within ICU
libraries.
1. ICU License - ICU 1.8.1 to ICU 57.1
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1995-2016 International Business Machines Corporation and others
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
All trademarks and registered trademarks mentioned herein are the
property of their respective owners.
2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
# The Google Chrome software developed by Google is licensed under
# the BSD license. Other software included in this distribution is
# provided under other licenses, as set forth below.
#
# The BSD License
# http://opensource.org/licenses/bsd-license.php
# Copyright (C) 2006-2008, Google Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with
# the distribution.
# Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# The word list in cjdict.txt are generated by combining three word lists
# listed below with further processing for compound word breaking. The
# frequency is generated with an iterative training against Google web
# corpora.
#
# * Libtabe (Chinese)
# - https://sourceforge.net/project/?group_id=1519
# - Its license terms and conditions are shown below.
#
# * IPADIC (Japanese)
# - http://chasen.aist-nara.ac.jp/chasen/distribution.html
# - Its license terms and conditions are shown below.
#
# ---------COPYING.libtabe ---- BEGIN--------------------
#
# /*
# * Copyright (c) 1999 TaBE Project.
# * Copyright (c) 1999 Pai-Hsiang Hsiao.
# * All rights reserved.
# *
# * Redistribution and use in source and binary forms, with or without
# * modification, are permitted provided that the following conditions
# * are met:
# *
# * . Redistributions of source code must retain the above copyright
# * notice, this list of conditions and the following disclaimer.
# * . Redistributions in binary form must reproduce the above copyright
# * notice, this list of conditions and the following disclaimer in
# * the documentation and/or other materials provided with the
# * distribution.
# * . Neither the name of the TaBE Project nor the names of its
# * contributors may be used to endorse or promote products derived
# * from this software without specific prior written permission.
# *
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# * OF THE POSSIBILITY OF SUCH DAMAGE.
# */
#
# /*
# * Copyright (c) 1999 Computer Systems and Communication Lab,
# * Institute of Information Science, Academia
# * Sinica. All rights reserved.
# *
# * Redistribution and use in source and binary forms, with or without
# * modification, are permitted provided that the following conditions
# * are met:
# *
# * . Redistributions of source code must retain the above copyright
# * notice, this list of conditions and the following disclaimer.
# * . Redistributions in binary form must reproduce the above copyright
# * notice, this list of conditions and the following disclaimer in
# * the documentation and/or other materials provided with the
# * distribution.
# * . Neither the name of the Computer Systems and Communication Lab
# * nor the names of its contributors may be used to endorse or
# * promote products derived from this software without specific
# * prior written permission.
# *
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# * OF THE POSSIBILITY OF SUCH DAMAGE.
# */
#
# Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
# University of Illinois
# c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4
#
# ---------------COPYING.libtabe-----END--------------------------------
#
#
# ---------------COPYING.ipadic-----BEGIN-------------------------------
#
# Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
# and Technology. All Rights Reserved.
#
# Use, reproduction, and distribution of this software is permitted.
# Any copy of this software, whether in its original form or modified,
# must include both the above copyright notice and the following
# paragraphs.
#
# Nara Institute of Science and Technology (NAIST),
# the copyright holders, disclaims all warranties with regard to this
# software, including all implied warranties of merchantability and
# fitness, in no event shall NAIST be liable for
# any special, indirect or consequential damages or any damages
# whatsoever resulting from loss of use, data or profits, whether in an
# action of contract, negligence or other tortuous action, arising out
# of or in connection with the use or performance of this software.
#
# A large portion of the dictionary entries
# originate from ICOT Free Software. The following conditions for ICOT
# Free Software applies to the current dictionary as well.
#
# Each User may also freely distribute the Program, whether in its
# original form or modified, to any third party or parties, PROVIDED
# that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
# on, or be attached to, the Program, which is distributed substantially
# in the same form as set out herein and that such intended
# distribution, if actually made, will neither violate or otherwise
# contravene any of the laws and regulations of the countries having
# jurisdiction over the User or the intended distribution itself.
#
# NO WARRANTY
#
# The program was produced on an experimental basis in the course of the
# research and development conducted during the project and is provided
# to users as so produced on an experimental basis. Accordingly, the
# program is provided without any warranty whatsoever, whether express,
# implied, statutory or otherwise. The term "warranty" used herein
# includes, but is not limited to, any warranty of the quality,
# performance, merchantability and fitness for a particular purpose of
# the program and the nonexistence of any infringement or violation of
# any right of any third party.
#
# Each user of the program will agree and understand, and be deemed to
# have agreed and understood, that there is no warranty whatsoever for
# the program and, accordingly, the entire risk arising from or
# otherwise connected with the program is assumed by the user.
#
# Therefore, neither ICOT, the copyright holder, or any other
# organization that participated in or was otherwise related to the
# development of the program and their respective officials, directors,
# officers and other employees shall be held liable for any and all
# damages, including, without limitation, general, special, incidental
# and consequential damages, arising out of or otherwise in connection
# with the use or inability to use the program or any product, material
# or result produced or otherwise obtained by using the program,
# regardless of whether they have been advised of, or otherwise had
# knowledge of, the possibility of such damages at any time during the
# project or thereafter. Each user will be deemed to have agreed to the
# foregoing by his or her commencement of use of the program. The term
# "use" as used herein includes, but is not limited to, the use,
# modification, copying and distribution of the program and the
# production of secondary products from the program.
#
# In the case where the program, whether in its original form or
# modified, was distributed or delivered to or received by a user from
# any person, organization or entity other than ICOT, unless it makes or
# grants independently of ICOT any specific warranty to the user in
# writing, such person, organization or entity, will also be exempted
# from and not be held liable to the user for any such damages as noted
# above as far as the program is concerned.
#
# ---------------COPYING.ipadic-----END----------------------------------
3. Lao Word Break Dictionary Data (laodict.txt)
# Copyright (c) 2013 International Business Machines Corporation
# and others. All Rights Reserved.
#
# Project: http://code.google.com/p/lao-dictionary/
# Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
# License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
# (copied below)
#
# This file is derived from the above dictionary, with slight
# modifications.
# ----------------------------------------------------------------------
# Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,
# are permitted provided that the following conditions are met:
#
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer. Redistributions in
# binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------------
4. Burmese Word Break Dictionary Data (burmesedict.txt)
# Copyright (c) 2014 International Business Machines Corporation
# and others. All Rights Reserved.
#
# This list is part of a project hosted at:
# github.com/kanyawtech/myanmar-karen-word-lists
#
# --------------------------------------------------------------------------
# Copyright (c) 2013, LeRoy Benjamin Sharon
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer. Redistributions in binary form must reproduce the
# above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# Neither the name Myanmar Karen Word Lists, nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# --------------------------------------------------------------------------
5. Time Zone Database
ICU uses the public domain data and code derived from Time Zone
Database for its time zone support. The ownership of the TZ database
is explained in BCP 175: Procedure for Maintaining the Time Zone
Database section 7.
# 7. Database Ownership
#
# The TZ database itself is not an IETF Contribution or an IETF
# document. Rather it is a pre-existing and regularly updated work
# that is in the public domain, and is intended to remain in the
# public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
# not apply to the TZ Database or contributions that individuals make
# to it. Should any claims be made and substantiated against the TZ
# Database, the organization that is providing the IANA
# Considerations defined in this RFC, under the memorandum of
# understanding with the IETF, currently ICANN, may act in accordance
# with all competent court orders. No ownership claims will be made
# by ICANN or the IETF Trust on the database or the code. Any person
# making a contribution to the database or code waives all rights to
# future claims in that contribution or in the TZ Database.
6. Google double-conversion
Copyright 2006-2011, the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More