Remove third_party_http_archive.

Replace calls to `third_party_http_archive` with calls to `tf_http_archive` alias.

Disable 'mirror.tensorflow.org' check. A number of users don't seem to follow the requirements, which were not checked correctly before.

This wasn't discovered by presubmits because the check is in the repo rule, which only triggers if the repo is actually used.

PiperOrigin-RevId: 359355039
Change-Id: Ieddab6fd91b96e6e22afccdad21c8fa30b795ff4
This commit is contained in:
Christian Sigg 2021-02-24 13:20:18 -08:00 committed by TensorFlower Gardener
parent c62597e956
commit 5353e37cfc
23 changed files with 49 additions and 52 deletions

View File

@ -1,9 +1,9 @@
"""Loads the FP16 library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "FP16",
strip_prefix = "FP16-4dfe081cf6bcd15db339cf2680b9281b8451eeb3",
sha256 = "d973501a40c55126b31accc2d9f08d931ec3cc190c0430309a5e341d3c0ce32a",

View File

@ -1,12 +1,12 @@
"""loads the aws library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
# NOTE: version updates here should also update the major, minor, and patch variables declared in
# the copts field of the //third_party/aws:aws target
def repo():
third_party_http_archive(
tf_http_archive(
name = "aws",
urls = [
"https://mirror.tensorflow.org/github.com/aws/aws-sdk-cpp/archive/1.7.336.tar.gz",
@ -17,7 +17,7 @@ def repo():
build_file = "//third_party/aws:BUILD.bazel",
)
third_party_http_archive(
tf_http_archive(
name = "aws-c-common",
urls = [
"https://mirror.tensorflow.org/github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz",
@ -28,7 +28,7 @@ def repo():
build_file = "//third_party/aws:aws-c-common.bazel",
)
third_party_http_archive(
tf_http_archive(
name = "aws-c-event-stream",
urls = [
"https://mirror.tensorflow.org/github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz",
@ -39,7 +39,7 @@ def repo():
build_file = "//third_party/aws:aws-c-event-stream.bazel",
)
third_party_http_archive(
tf_http_archive(
name = "aws-checksums",
urls = [
"https://mirror.tensorflow.org/github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads the clog library, used by cpuinfo and XNNPACK."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "clog",
strip_prefix = "cpuinfo-d5e37adf1406cf899d7d9ec1d317c47506ccb970",
sha256 = "3f2dc1970f397a0e59db72f9fca6ff144b216895c1d606f6c94a507c1e53a025",

View File

@ -1,9 +1,9 @@
"""Loads the cpuinfo library, used by XNNPACK."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "cpuinfo",
strip_prefix = "cpuinfo-6cecd15784fcb6c5c0aa7311c6248879ce2cb8b2",
sha256 = "b1f2ee97e46d8917a66bcb47452fc510d511829556c93b83e06841b9b35261a5",

View File

@ -1,9 +1,9 @@
"""DLPack is a protocol for sharing arrays between deep learning frameworks."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "dlpack",
strip_prefix = "dlpack-3efc489b55385936531a06ff83425b719387ec63",
sha256 = "b59586ce69bcf3efdbf3cf4803fadfeaae4948044e2b8d89cf912194cf28f233",

View File

@ -1,6 +1,6 @@
"""Provides the repository macro to import Eigen."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports Eigen."""
@ -9,7 +9,7 @@ def repo(name):
EIGEN_COMMIT = "90ee821c563fa20db4d64d6991ddca256d5c52f2"
EIGEN_SHA256 = "d76992f1972e4ff270221c7ee8125610a8e02bb46708a7295ee646e99287083b"
third_party_http_archive(
tf_http_archive(
name = name,
build_file = "//third_party/eigen3:eigen_archive.BUILD",
sha256 = EIGEN_SHA256,

View File

@ -1,6 +1,6 @@
"""Provides the repository macro to import farmhash."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports farmhash."""
@ -9,7 +9,7 @@ def repo(name):
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"
third_party_http_archive(
tf_http_archive(
name = name,
build_file = "//third_party/farmhash:farmhash.BUILD",
sha256 = FARMHASH_SHA256,

View File

@ -1,9 +1,9 @@
"""Loads the Flatbuffers library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "flatbuffers",
strip_prefix = "flatbuffers-1.12.0",
sha256 = "62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45",

View File

@ -1,11 +1,11 @@
"""Loads the Hexagon NN Header files library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
# Note: Use libhexagon_nn_skel version 1.20 Only with the current version.
# This comment will be updated with compatible version.
def repo():
third_party_http_archive(
tf_http_archive(
name = "hexagon_nn",
sha256 = "b94b653417a7eb871881438bb98cb2f4a652d4d92ff90f1faaa01a8ce82b2e3c",
urls = [

View File

@ -1,9 +1,9 @@
"""loads the highwayhash library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "highwayhash",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/highwayhash/archive/fd3d9af80465e4383162e4a7c5e2f406e82dd968.tar.gz",

View File

@ -1,9 +1,9 @@
"""loads the hwloc library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "hwloc",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/download.open-mpi.org/release/hwloc/v2.0/hwloc-2.0.3.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads a lightweight subset of the ICU library for Unicode processing."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "icu",
strip_prefix = "icu-release-64-2",
sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27",

View File

@ -1,9 +1,9 @@
"""loads the jpeg library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "libjpeg_turbo",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.5.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads the kissfft library, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "kissfft",
strip_prefix = "kissfft-36dbc057604f00aacfc0288ddad57e3b21cfc1b8",
sha256 = "42b7ef406d5aa2d57a7b3b56fc44e8ad3011581692458a69958a911071efdcf2",

View File

@ -1,9 +1,9 @@
"""loads the nasm library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "nasm",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2",

View File

@ -1,9 +1,9 @@
"""Loads OpenCL-Headers, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "opencl_headers",
strip_prefix = "OpenCL-Headers-0d5f18c6e7196863bc1557a693f1509adfcee056",
sha256 = "03cbc1fd449399be0422cdb021400f63958ef2c5a7c099a0d8f36a705b312f53",

View File

@ -1,9 +1,9 @@
"""loads the aws library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "ortools_archive",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/or-tools/archive/v6.7.2.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads pasta python package."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "pasta",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/pasta/archive/v0.1.8.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads the psimd library, used by XNNPACK."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "psimd",
strip_prefix = "psimd-072586a71b55b7f8c584153d223e95687148a900",
sha256 = "dc615342bcbe51ca885323e51b68b90ed9bb9fa7df0f4419dbfa0297d5e837b7",

View File

@ -34,7 +34,8 @@ def _get_link_dict(ctx, link_files, build_file):
return {ctx.path(v): Label(k) for k, v in link_files.items()}
def _tf_http_archive_impl(ctx):
if len(ctx.attr.urls) < 2 or "mirror.tensorflow.org" not in ctx.attr.urls[0]:
# if len(ctx.attr.urls) < 2 or "mirror.tensorflow.org" not in ctx.attr.urls[0]:
if False: # TODO(b/174771515): fix call sites and enable check again.
fail("tf_http_archive(urls) must have redundant URLs. The " +
"mirror.tensorflow.org URL must be present and it must come first. " +
"Even if you don't have permission to mirror the file, please " +
@ -108,7 +109,3 @@ def tf_http_archive(name, sha256, urls, **kwargs):
urls = urls,
**kwargs
)
# Introduced for go/tfbr-thirdparty, now alias of tf_http_archive.
# TODO(csigg): Update call sites and remove.
third_party_http_archive = tf_http_archive

View File

@ -1,9 +1,9 @@
"""Loads the ruy library, used by TensorFlow Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "ruy",
sha256 = "28331222625e677be004e96da5e9a1cc9d65187d04d70d1ab2ca58445461ecbc",
strip_prefix = "ruy-4790797d11a81f96baf24f3731fd3ca44c2c5f8b",

View File

@ -1,9 +1,9 @@
"""Loads the sobol_data library, used by TF."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "sobol_data",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/joe-kuo/sobol_data/archive/835a7d7b1ee3bc83e575e302a985c66ec4b65249.tar.gz",

View File

@ -1,9 +1,9 @@
"""Loads Vulkan-Headers, used by TF Lite."""
load("//third_party:repo.bzl", "third_party_http_archive")
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
third_party_http_archive(
tf_http_archive(
name = "vulkan_headers",
strip_prefix = "Vulkan-Headers-ec2db85225ab410bc6829251bef6c578aaed5868",
sha256 = "38febe63d53f9c91e90adb1ecd3df0cc0ea834e3a89d96c4fb5961d1cd6dd65e",