diff options
author | 2016-12-23 14:04:44 -0800 | |
---|---|---|
committer | 2016-12-23 14:04:44 -0800 | |
commit | 03d0b6c1c5533036a54c4a5366caa629832a02f5 (patch) | |
tree | bad419e754779211bccf85ee62ec10a166420a7a | |
parent | 0ff314b3ec34d6ceb2f01d2ae7439457291001fd (diff) |
Fix: Run buildifier on build files under third_party.
-rw-r--r-- | third_party/common.bzl | 12 | ||||
-rw-r--r-- | third_party/jpeg/jpeg.BUILD | 84 | ||||
-rw-r--r-- | third_party/llvm/llvm.BUILD | 11 |
3 files changed, 55 insertions, 52 deletions
diff --git a/third_party/common.bzl b/third_party/common.bzl index 90bd5e9642..d2b1422227 100644 --- a/third_party/common.bzl +++ b/third_party/common.bzl @@ -28,12 +28,16 @@ def expand_header_template_impl(ctx): ) expand_header_template = rule( - implementation = expand_header_template_impl, attrs = { - "src": attr.label(mandatory=True, allow_files=True, single_file=True), - "substitutions": attr.string_dict(mandatory=True), - "out": attr.output(mandatory=True), + "src": attr.label( + mandatory = True, + allow_files = True, + single_file = True, + ), + "substitutions": attr.string_dict(mandatory = True), + "out": attr.output(mandatory = True), }, # output_to_genfiles is required for header files. output_to_genfiles = True, + implementation = expand_header_template_impl, ) diff --git a/third_party/jpeg/jpeg.BUILD b/third_party/jpeg/jpeg.BUILD index e005a1853d..a8a92cd415 100644 --- a/third_party/jpeg/jpeg.BUILD +++ b/third_party/jpeg/jpeg.BUILD @@ -278,46 +278,46 @@ cc_library( expand_header_template( name = "jconfig_win", + src = "win/jconfig.h.in", out = "jconfig_win.h", substitutions = { - "@JPEG_LIB_VERSION@" : "62", - "@VERSION@" : "1.5.1", - "@LIBJPEG_TURBO_VERSION_NUMBER@" : "1005001", - "cmakedefine" : "define", - "@BITS_IN_JSAMPLE@" : "8", + "@JPEG_LIB_VERSION@": "62", + "@VERSION@": "1.5.1", + "@LIBJPEG_TURBO_VERSION_NUMBER@": "1005001", + "cmakedefine": "define", + "@BITS_IN_JSAMPLE@": "8", }, - src = "win/jconfig.h.in", ) expand_header_template( name = "jconfigint_win", + src = "win/jconfigint.h.in", out = "jconfigint_win.h", substitutions = { - "@VERSION@" : "1.5.1", - "@BUILD@" : "20161115", - "@CMAKE_PROJECT_NAME@" : "libjpeg-turbo", + "@VERSION@": "1.5.1", + "@BUILD@": "20161115", + "@CMAKE_PROJECT_NAME@": "libjpeg-turbo", }, - src = "win/jconfigint.h.in", ) jconfig_nowin_common_substitutions = { - "LIBJPEG_TURBO_VERSION 0" : "LIBJPEG_TURBO_VERSION 1.5.1", - "LIBJPEG_TURBO_VERSION_NUMBER 0" : "LIBJPEG_TURBO_VERSION_NUMBER 1005001", - "#undef C_ARITH_CODING_SUPPORTED" : "#define C_ARITH_CODING_SUPPORTED 1", - "#undef D_ARITH_CODING_SUPPORTED" : "#define D_ARITH_CODING_SUPPORTED 1", - "#undef HAVE_LOCALE_H" : "#define HAVE_LOCALE_H 1", - "#undef HAVE_STDDEF_H" : "#define HAVE_STDDEF_H 1", - "#undef HAVE_STDLIB_H" : "#define HAVE_STDLIB_H 1", - "#undef HAVE_UNSIGNED_CHAR" : "#define HAVE_UNSIGNED_CHAR 1", - "#undef HAVE_UNSIGNED_SHORT" : "#define HAVE_UNSIGNED_SHORT 1", - "#undef INCOMPLETE_TYPES_BROKEN" : "", - "#undef MEM_SRCDST_SUPPORTED" : "#define MEM_SRCDST_SUPPORTED 1", - "#undef NEED_BSD_STRINGS" : "", - "#undef NEED_SYS_TYPES_H" : "#define NEED_SYS_TYPES_H 1", - "#undef __CHAR_UNSIGNED__" : "", - "#undef const" : "", - "#undef size_t" : "", - "#undef RIGHT_SHIFT_IS_UNSIGNED" : "", + "LIBJPEG_TURBO_VERSION 0": "LIBJPEG_TURBO_VERSION 1.5.1", + "LIBJPEG_TURBO_VERSION_NUMBER 0": "LIBJPEG_TURBO_VERSION_NUMBER 1005001", + "#undef C_ARITH_CODING_SUPPORTED": "#define C_ARITH_CODING_SUPPORTED 1", + "#undef D_ARITH_CODING_SUPPORTED": "#define D_ARITH_CODING_SUPPORTED 1", + "#undef HAVE_LOCALE_H": "#define HAVE_LOCALE_H 1", + "#undef HAVE_STDDEF_H": "#define HAVE_STDDEF_H 1", + "#undef HAVE_STDLIB_H": "#define HAVE_STDLIB_H 1", + "#undef HAVE_UNSIGNED_CHAR": "#define HAVE_UNSIGNED_CHAR 1", + "#undef HAVE_UNSIGNED_SHORT": "#define HAVE_UNSIGNED_SHORT 1", + "#undef INCOMPLETE_TYPES_BROKEN": "", + "#undef MEM_SRCDST_SUPPORTED": "#define MEM_SRCDST_SUPPORTED 1", + "#undef NEED_BSD_STRINGS": "", + "#undef NEED_SYS_TYPES_H": "#define NEED_SYS_TYPES_H 1", + "#undef __CHAR_UNSIGNED__": "", + "#undef const": "", + "#undef size_t": "", + "#undef RIGHT_SHIFT_IS_UNSIGNED": "", } jconfig_nowin_simd_substitutions = jconfig_nowin_common_substitutions + { @@ -330,44 +330,44 @@ jconfig_nowin_nosimd_substitutions = jconfig_nowin_common_substitutions + { expand_header_template( name = "jconfig_nowin_nosimd", + src = "jconfig.h.in", out = "jconfig_nowin_nosimd.h", substitutions = jconfig_nowin_nosimd_substitutions, - src = "jconfig.h.in", ) expand_header_template( name = "jconfig_nowin_simd", + src = "jconfig.h.in", out = "jconfig_nowin_simd.h", substitutions = jconfig_nowin_simd_substitutions, - src = "jconfig.h.in", ) expand_header_template( name = "jconfigint_nowin", + src = "jconfigint.h.in", out = "jconfigint_nowin.h", substitutions = { - "#undef BUILD" : "#define BUILD \"20161115\"", - "#undef inline" : "", - "#undef INLINE" : "#define INLINE inline __attribute__((always_inline))", - "#undef PACKAGE_NAME" : "#define PACKAGE_NAME \"libjpeg-turbo\"", - "#undef VERSION" : "#define VERSION \"1.5.1\"", - "#undef SIZEOF_SIZE_T" : "#if (__WORDSIZE==64 && !defined(__native_client__))\n" + - "#define SIZEOF_SIZE_T 8\n" + - "#else\n" + - "#define SIZEOF_SIZE_T 4\n" + - "#endif\n", + "#undef BUILD": "#define BUILD \"20161115\"", + "#undef inline": "", + "#undef INLINE": "#define INLINE inline __attribute__((always_inline))", + "#undef PACKAGE_NAME": "#define PACKAGE_NAME \"libjpeg-turbo\"", + "#undef VERSION": "#define VERSION \"1.5.1\"", + "#undef SIZEOF_SIZE_T": "#if (__WORDSIZE==64 && !defined(__native_client__))\n" + + "#define SIZEOF_SIZE_T 8\n" + + "#else\n" + + "#define SIZEOF_SIZE_T 4\n" + + "#endif\n", }, - src = "jconfigint.h.in", ) genrule( name = "configure", - outs = ["jconfig.h"], srcs = [ "jconfig_win.h", "jconfig_nowin_nosimd.h", "jconfig_nowin_simd.h", ], + outs = ["jconfig.h"], cmd = select({ ":windows": "cp $(location jconfig_win.h) $@", ":k8": "cp $(location jconfig_nowin_simd.h) $@", @@ -379,11 +379,11 @@ genrule( genrule( name = "configure_internal", - outs = ["jconfigint.h"], srcs = [ "jconfigint_win.h", "jconfigint_nowin.h", ], + outs = ["jconfigint.h"], cmd = select({ ":windows": "cp $(location jconfigint_win.h) $@", "//conditions:default": "cp $(location jconfigint_nowin.h) $@", diff --git a/third_party/llvm/llvm.BUILD b/third_party/llvm/llvm.BUILD index d4772a4cfc..5251a05a36 100644 --- a/third_party/llvm/llvm.BUILD +++ b/third_party/llvm/llvm.BUILD @@ -13,11 +13,10 @@ load( "llvm_target_cmake_vars", "cmake_var_string", ) - load( "@//third_party:common.bzl", "expand_header_template", -) +) package(default_visibility = ["@//tensorflow/compiler/xla:internal"]) @@ -182,46 +181,46 @@ expand_cmake_vars( # Performs macro expansions on .def.in files expand_header_template( name = "targets_def_gen", + src = "include/llvm/Config/Targets.def.in", out = "include/llvm/Config/Targets.def", substitutions = { "@LLVM_ENUM_TARGETS@": "\n".join( ["LLVM_TARGET({})".format(t) for t in llvm_targets], ), }, - src = "include/llvm/Config/Targets.def.in", ) expand_header_template( name = "asm_parsers_def_gen", + src = "include/llvm/Config/AsmParsers.def.in", out = "include/llvm/Config/AsmParsers.def", substitutions = { "@LLVM_ENUM_ASM_PARSERS@": "\n".join( ["LLVM_ASM_PARSER({})".format(t) for t in llvm_target_asm_parsers], ), }, - src = "include/llvm/Config/AsmParsers.def.in", ) expand_header_template( name = "asm_printers_def_gen", + src = "include/llvm/Config/AsmPrinters.def.in", out = "include/llvm/Config/AsmPrinters.def", substitutions = { "@LLVM_ENUM_ASM_PRINTERS@": "\n".join( ["LLVM_ASM_PRINTER({})".format(t) for t in llvm_target_asm_printers], ), }, - src = "include/llvm/Config/AsmPrinters.def.in", ) expand_header_template( name = "disassemblers_def_gen", + src = "include/llvm/Config/Disassemblers.def.in", out = "include/llvm/Config/Disassemblers.def", substitutions = { "@LLVM_ENUM_DISASSEMBLERS@": "\n".join( ["LLVM_DISASSEMBLER({})".format(t) for t in llvm_target_disassemblers], ), }, - src = "include/llvm/Config/Disassemblers.def.in", ) # A common library that all LLVM targets depend on. |