From c29236959744be4d5ca47ac0b8fc4c454a04b852 Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Mon, 4 May 2020 19:50:45 +0200 Subject: [PATCH] Fix Buildifier warnings (#395) * Run buildifier formatter * Fix buildifier warnings Ran: `buildifier --lint=fix -r .` --- WORKSPACE | 3 +- cc_configure_make/def.bzl | 41 ++++-- examples/apache_httpd/BUILD | 32 ++-- examples/boost/BUILD | 2 +- examples/cc_configure_make/BUILD | 14 +- examples/cmake_crosstool/BUILD | 4 +- examples/cmake_crosstool/static/BUILD | 6 +- .../cmake_crosstool/tools/arm_compiler/BUILD | 4 +- examples/cmake_hello_world_lib/binary/BUILD | 3 +- examples/cmake_hello_world_lib/shared/BUILD | 4 +- examples/cmake_hello_world_lib/static/BUILD | 10 +- examples/cmake_synthetic/BUILD | 9 +- examples/cmake_working_dir/BUILD | 5 +- examples/examples_repositories.bzl | 2 +- for_workspace/install_ws_dependency.bzl | 12 +- test/cmake_text_tests.bzl | 139 ++++++++++++++---- test/convert_shell_script_test.bzl | 1 - test/standard_cxx_flags_test/WORKSPACE | 2 +- test/standard_cxx_flags_test/tests.bzl | 2 +- test/utils_test.bzl | 6 +- .../fancy_platform_commands.bzl | 10 +- tools/build_defs/cc_toolchain_util.bzl | 9 +- tools/build_defs/cmake.bzl | 2 +- tools/build_defs/cmake_script.bzl | 8 +- tools/build_defs/configure_script.bzl | 26 ++-- tools/build_defs/framework.bzl | 38 ++--- tools/build_defs/native_tools/tool_access.bzl | 2 +- .../polymorphism/generate_overloads.bzl | 18 +-- .../shell_toolchain/toolchains/access.bzl | 1 - .../toolchains/impl/default_commands.bzl | 12 +- .../toolchains/impl/linux_commands.bzl | 12 +- .../toolchains/impl/osx_commands.bzl | 11 +- .../toolchains/impl/windows_commands.bzl | 12 +- workspace_definitions.bzl | 6 +- 34 files changed, 281 insertions(+), 187 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index e3c5b09c..df852471 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -25,12 +25,13 @@ android_ndk_repository( # TODO(jin): replace legacy gmaven_rules targets with `maven_install` from the new rules_jvm_external RULES_JVM_EXTERNAL_TAG = "1.0" + RULES_JVM_EXTERNAL_SHA = "48e0f1aab74fabba98feb8825459ef08dcc75618d381dff63ec9d4dd9860deaa" http_archive( name = "gmaven_rules", - strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, sha256 = RULES_JVM_EXTERNAL_SHA, + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, ) diff --git a/cc_configure_make/def.bzl b/cc_configure_make/def.bzl index 020fe854..a3602c08 100644 --- a/cc_configure_make/def.bzl +++ b/cc_configure_make/def.bzl @@ -18,20 +18,20 @@ def _cc_configure_make_impl(ctx): outputs = [out_includes, out_lib] cpp_fragment = ctx.fragments.cpp - compiler_options = [] # cpp_fragment.compiler_options(ctx.features) + compiler_options = [] # cpp_fragment.compiler_options(ctx.features) c_options = compiler_options + cpp_fragment.c_options cxx_options = compiler_options + cpp_fragment.cxx_options(ctx.features) - CFLAGS = "\"{}\"".format(' '.join(c_options)) - CXXFLAGS = "\"{}\"".format(' '.join(cxx_options)) + CFLAGS = "\"{}\"".format(" ".join(c_options)) + CXXFLAGS = "\"{}\"".format(" ".join(cxx_options)) # Run ./configure && make from a temporary directory, and install into another temporary directory. # Finally, copy the results into the directory artifact declared in out_includes. ctx.actions.run_shell( - mnemonic="ConfigureMake", + mnemonic = "ConfigureMake", inputs = ctx.attr.src.files, outputs = outputs, - command = '\n'.join([ + command = "\n".join([ "set -e", "P=$(pwd)", "tmpdir=$(mktemp -d)", @@ -39,16 +39,25 @@ def _cc_configure_make_impl(ctx): "trap \"{ rm -rf $tmpdir $tmpinstalldir; }\" EXIT", "pushd $tmpdir", "CFLAGS={} CXXFLAGS={} $P/{}/configure --prefix=$tmpinstalldir {}".format( - CFLAGS, CXXFLAGS, ctx.attr.src.label.workspace_root, ' '.join(ctx.attr.configure_flags)), + CFLAGS, + CXXFLAGS, + ctx.attr.src.label.workspace_root, + " ".join(ctx.attr.configure_flags), + ), "CFLAGS={} CXXFLAGS={} make install".format(CFLAGS, CXXFLAGS), "popd", "cp $tmpinstalldir/{} {}".format(ctx.attr.out_lib_path, out_lib.path), - "cp -R $tmpinstalldir/include/ {}".format(out_includes.path)]), - execution_requirements = {"block-network": ""} + "cp -R $tmpinstalldir/include/ {}".format(out_includes.path), + ]), + execution_requirements = {"block-network": ""}, ) - return [DefaultInfo(files = depset(direct=outputs)), - OutputGroupInfo(headers = depset([out_includes]), - libfile = depset([out_lib]))] + return [ + DefaultInfo(files = depset(direct = outputs)), + OutputGroupInfo( + headers = depset([out_includes]), + libfile = depset([out_lib]), + ), + ] _cc_configure_make_rule = rule( attrs = { @@ -62,28 +71,28 @@ _cc_configure_make_rule = rule( ) def cc_configure_make(name, configure_flags, src, out_lib_path): - name_cmr = '_{}_cc_configure_make_rule'.format(name) + name_cmr = "_{}_cc_configure_make_rule".format(name) _cc_configure_make_rule( name = name_cmr, configure_flags = configure_flags, src = src, - out_lib_path = out_lib_path + out_lib_path = out_lib_path, ) - name_libfile_fg = '_{}_libfile_fg'.format(name) + name_libfile_fg = "_{}_libfile_fg".format(name) native.filegroup( name = name_libfile_fg, srcs = [name_cmr], output_group = "libfile", ) - name_libfile_import = '_{}_libfile_import'.format(name) + name_libfile_import = "_{}_libfile_import".format(name) native.cc_import( name = name_libfile_import, static_library = name_libfile_fg, ) - name_headers_fg = '_{}_headers_fg'.format(name) + name_headers_fg = "_{}_headers_fg".format(name) native.filegroup( name = name_headers_fg, srcs = [name_cmr], diff --git a/examples/apache_httpd/BUILD b/examples/apache_httpd/BUILD index e4a3e93e..0f50f251 100644 --- a/examples/apache_httpd/BUILD +++ b/examples/apache_httpd/BUILD @@ -3,30 +3,33 @@ load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make") configure_make( name = "apr", lib_source = "@apr//:all", - static_libraries = ["libapr-1.a"], shared_libraries = ["libapr-1.so"], + static_libraries = ["libapr-1.a"], ) configure_make( name = "apr_util", - lib_source = "@apr_util//:all", - deps = [":apr"], configure_options = [ "--with-apr=$$EXT_BUILD_DEPS$$/apr", - ], - static_libraries = ["libaprutil-1.a"], + ], + lib_source = "@apr_util//:all", shared_libraries = ["libaprutil-1.so"], + static_libraries = ["libaprutil-1.a"], + deps = [":apr"], ) configure_make( name = "pcre", lib_source = "@pcre//:all", - static_libraries = ["libpcre.a"], shared_libraries = ["libpcre.so.1"], + static_libraries = ["libpcre.a"], ) configure_make( name = "apache_httpd", + binaries = [ + "httpd", + ], configure_options = [ "--with-apr=$$EXT_BUILD_DEPS$$/apr", "--with-apr-util=$$EXT_BUILD_DEPS$$/apr_util", @@ -34,17 +37,14 @@ configure_make( "CFLAGS='-Dredacted=\"redacted\"'", ], lib_source = "@apache_httpd//:all", - binaries = [ - "httpd", + visibility = [ + "//visibility:public", ], deps = [ ":apr", ":apr_util", ":pcre", ], - visibility = [ - "//visibility:public" - ], ) filegroup( @@ -52,7 +52,7 @@ filegroup( srcs = [ ":apache_httpd", ], - output_group = "gen_dir" + output_group = "gen_dir", ) filegroup( @@ -60,7 +60,7 @@ filegroup( srcs = [ ":pcre", ], - output_group = "gen_dir" + output_group = "gen_dir", ) filegroup( @@ -68,7 +68,7 @@ filegroup( srcs = [ ":apr", ], - output_group = "gen_dir" + output_group = "gen_dir", ) filegroup( @@ -76,7 +76,7 @@ filegroup( srcs = [ ":apr_util", ], - output_group = "gen_dir" + output_group = "gen_dir", ) sh_test( @@ -86,9 +86,9 @@ sh_test( ], args = ["$(location httpd_dir)/bin/httpd $(location pcre_dir)/lib $(location apr_dir)/lib $(location apr_util_dir)/lib"], data = [ - ":httpd_dir", ":apr_dir", ":apr_util_dir", + ":httpd_dir", ":pcre_dir", ], ) diff --git a/examples/boost/BUILD b/examples/boost/BUILD index 0150883e..96dfd3ed 100644 --- a/examples/boost/BUILD +++ b/examples/boost/BUILD @@ -2,10 +2,10 @@ load("@rules_foreign_cc//tools/build_defs:boost_build.bzl", "boost_build") boost_build( name = "boost_regex", + bootstrap_options = ["--with-toolchain=clang"], lib_source = "@boost//:all", shared_libraries = ["libboost_regex.so.1.68.0"], static_libraries = ["libboost_regex.a"], - bootstrap_options = ["--with-toolchain=clang"], user_options = ["--with-regex"], ) diff --git a/examples/cc_configure_make/BUILD b/examples/cc_configure_make/BUILD index 126871e0..55ee7f23 100644 --- a/examples/cc_configure_make/BUILD +++ b/examples/cc_configure_make/BUILD @@ -2,13 +2,6 @@ load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make") configure_make( name = "libevent", - configure_options = [ - "--enable-shared=no", - "--disable-libevent-regress", - "--disable-openssl", - ], - lib_source = "@libevent//:all", - out_lib_dir = "lib", # libevent script uses it's own libtool for linking; # so do not specify linker tool for it # (otherwise, if the libtool from bazel's toolchain is supplied, @@ -17,6 +10,13 @@ configure_make( configure_env_vars = { "AR": "", }, + configure_options = [ + "--enable-shared=no", + "--disable-libevent-regress", + "--disable-openssl", + ], + lib_source = "@libevent//:all", + out_lib_dir = "lib", ) cc_test( diff --git a/examples/cmake_crosstool/BUILD b/examples/cmake_crosstool/BUILD index 75157a37..fbbdc68c 100644 --- a/examples/cmake_crosstool/BUILD +++ b/examples/cmake_crosstool/BUILD @@ -13,10 +13,10 @@ cc_library( cmake_external( name = "hello_cmake", - lib_source = "//static:srcs", generate_crosstool_file = True, - static_libraries = ["libhello.a"], + lib_source = "//static:srcs", out_include_dir = "include/version123", + static_libraries = ["libhello.a"], ) # I do not make it a test, since it is a cross-compilation example, diff --git a/examples/cmake_crosstool/static/BUILD b/examples/cmake_crosstool/static/BUILD index c443033c..2b2be752 100644 --- a/examples/cmake_crosstool/static/BUILD +++ b/examples/cmake_crosstool/static/BUILD @@ -1,6 +1,8 @@ # example code is taken from https://github.com/Akagi201/learning-cmake/tree/master/hello-world-lib # for test only +load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") + filegroup( name = "srcs", srcs = glob(["**"]), @@ -8,11 +10,9 @@ filegroup( ) exports_files([ - "hello_client.c" + "hello_client.c", ]) -load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") - cmake_external( name = "libhello", lib_source = ":srcs", diff --git a/examples/cmake_crosstool/tools/arm_compiler/BUILD b/examples/cmake_crosstool/tools/arm_compiler/BUILD index f188e7b7..db762e5f 100644 --- a/examples/cmake_crosstool/tools/arm_compiler/BUILD +++ b/examples/cmake_crosstool/tools/arm_compiler/BUILD @@ -72,7 +72,6 @@ filegroup( cc_toolchain( name = "cc-compiler-armeabi-v7a", - toolchain_identifier = "armeabi-v7a", all_files = ":linaro_linux_all_files", ar_files = "//tools/arm_compiler/linaro_linux_gcc:ar", as_files = "//tools/arm_compiler/linaro_linux_gcc:as", @@ -85,12 +84,12 @@ cc_toolchain( static_runtime_libs = [":empty"], strip_files = "//tools/arm_compiler/linaro_linux_gcc:strip", supports_param_files = 1, + toolchain_identifier = "armeabi-v7a", visibility = ["//visibility:public"], ) cc_toolchain( name = "cc-compiler-k8", - toolchain_identifier = "local", all_files = ":empty", ar_files = ":empty", as_files = ":empty", @@ -103,5 +102,6 @@ cc_toolchain( static_runtime_libs = [":empty"], strip_files = ":empty", supports_param_files = 1, + toolchain_identifier = "local", visibility = ["//visibility:public"], ) diff --git a/examples/cmake_hello_world_lib/binary/BUILD b/examples/cmake_hello_world_lib/binary/BUILD index b894a826..5eedad9b 100644 --- a/examples/cmake_hello_world_lib/binary/BUILD +++ b/examples/cmake_hello_world_lib/binary/BUILD @@ -1,6 +1,7 @@ # example code is taken from https://github.com/Akagi201/learning-cmake/tree/master/hello-world-lib # for test only load("@bazel_tools//tools/build_rules:test_rules.bzl", "file_test") +load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") filegroup( name = "srcs", @@ -8,8 +9,6 @@ filegroup( visibility = ["//visibility:public"], ) -load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") - cmake_external( name = "libhello", binaries = select({ diff --git a/examples/cmake_hello_world_lib/shared/BUILD b/examples/cmake_hello_world_lib/shared/BUILD index 1bb69d28..61fe3391 100644 --- a/examples/cmake_hello_world_lib/shared/BUILD +++ b/examples/cmake_hello_world_lib/shared/BUILD @@ -1,14 +1,14 @@ # example code is taken from https://github.com/Akagi201/learning-cmake/tree/master/hello-world-lib # for test only +load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") + filegroup( name = "srcs", srcs = glob(["**"]), visibility = ["//visibility:public"], ) -load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") - cmake_external( name = "libhello", # Probably this variable should be set by default. diff --git a/examples/cmake_hello_world_lib/static/BUILD b/examples/cmake_hello_world_lib/static/BUILD index 156cf78d..db4469e8 100644 --- a/examples/cmake_hello_world_lib/static/BUILD +++ b/examples/cmake_hello_world_lib/static/BUILD @@ -1,14 +1,14 @@ # example code is taken from https://github.com/Akagi201/learning-cmake/tree/master/hello-world-lib # for test only +load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") + filegroup( name = "srcs", srcs = glob(["**"]), visibility = ["//visibility:public"], ) -load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") - cmake_external( name = "libhello", lib_source = ":srcs", @@ -91,9 +91,9 @@ sh_test( srcs = ["test_hello.sh"], args = ["$(location libhello_example)"], data = [":libhello_example"], - deps = ["@bazel_tools//tools/bash/runfiles"], tags = ["windows"], visibility = ["//:__pkg__"], + deps = ["@bazel_tools//tools/bash/runfiles"], ) sh_test( @@ -101,9 +101,9 @@ sh_test( srcs = ["test_hello.sh"], args = ["$(location libhello_example_ninja)"], data = [":libhello_example_ninja"], - deps = ["@bazel_tools//tools/bash/runfiles"], tags = ["windows"], visibility = ["//:__pkg__"], + deps = ["@bazel_tools//tools/bash/runfiles"], ) sh_test( @@ -111,9 +111,9 @@ sh_test( srcs = ["test_hello.sh"], args = ["$(location libhello_example_nmake)"], data = [":libhello_example_nmake"], - deps = ["@bazel_tools//tools/bash/runfiles"], tags = ["windows"], visibility = ["//:__pkg__"], + deps = ["@bazel_tools//tools/bash/runfiles"], ) cmake_external( diff --git a/examples/cmake_synthetic/BUILD b/examples/cmake_synthetic/BUILD index 8ab2f623..093fcdb3 100644 --- a/examples/cmake_synthetic/BUILD +++ b/examples/cmake_synthetic/BUILD @@ -34,19 +34,22 @@ cmake_external( cmake_external( name = "lib_with_duplicate_transitive_bazel_deps", - lib_name = "libc", - cmake_options = ["-GNinja"], cache_entries = { "LIBA_DIR": "$$EXT_BUILD_DEPS$$", "LIBB_DIR": "$$EXT_BUILD_DEPS$$", }, + cmake_options = ["-GNinja"], generate_crosstool_file = generate_crosstool, + lib_name = "libc", lib_source = "//cmake_synthetic/libc:c_srcs", make_commands = [ "ninja", "ninja install", ], - deps = ["//cmake_synthetic/liba:lib_a_bazel", "//cmake_synthetic/libb:lib_b_bazel"], + deps = [ + "//cmake_synthetic/liba:lib_a_bazel", + "//cmake_synthetic/libb:lib_b_bazel", + ], ) build_test( diff --git a/examples/cmake_working_dir/BUILD b/examples/cmake_working_dir/BUILD index 0b6e9bf8..920f2df8 100644 --- a/examples/cmake_working_dir/BUILD +++ b/examples/cmake_working_dir/BUILD @@ -2,7 +2,10 @@ load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") filegroup( name = "sources", - srcs = glob(["source_root/**"], exclude_directories = 0), + srcs = glob( + ["source_root/**"], + exclude_directories = 0, + ), ) cmake_external( diff --git a/examples/examples_repositories.bzl b/examples/examples_repositories.bzl index cf2c20d2..f12709a6 100644 --- a/examples/examples_repositories.bzl +++ b/examples/examples_repositories.bzl @@ -82,7 +82,7 @@ def include_examples_repositories(): name = "nghttp2", build_file_content = all_content, patch_args = ["-p1"], - patch_cmds = ["find . -name '*.sh' -exec sed -i.orig '1s|#!/usr/bin/env sh\$|/bin/sh\$|' {} +"], + patch_cmds = ["find . -name '*.sh' -exec sed -i.orig '1s|#!/usr/bin/env sh\\$|/bin/sh\\$|' {} +"], patches = ["@rules_foreign_cc_tests//:nghttp2.patch"], strip_prefix = "nghttp2-e5b3f9addd49bca27e2f99c5c65a564eb5c0cf6d", urls = [ diff --git a/for_workspace/install_ws_dependency.bzl b/for_workspace/install_ws_dependency.bzl index 75d87786..e3d888e9 100644 --- a/for_workspace/install_ws_dependency.bzl +++ b/for_workspace/install_ws_dependency.bzl @@ -7,10 +7,12 @@ def _generate_install_rule_impl(rctx): text = """workspace(name='{ws_name}') load("{init_file}", "{init_function}") {init_expression} -""".format(ws_name = rctx.attr.name, - init_file = rctx.attr.init_file, - init_function = rctx.attr.init_function, - init_expression = rctx.attr.init_expression) +""".format( + ws_name = rctx.attr.name, + init_file = rctx.attr.init_file, + init_function = rctx.attr.init_function, + init_expression = rctx.attr.init_expression, + ) rctx.file("WORKSPACE", text) rctx.file("BUILD", "") @@ -35,5 +37,5 @@ def install_ws_dependency(repo_name, url, strip_prefix, init_file, init_function stripPrefix = strip_prefix, init_file = init_file, init_function = init_function, - init_expression = init_expression + init_expression = init_expression, ) diff --git a/test/cmake_text_tests.bzl b/test/cmake_text_tests.bzl index 0223b9a8..5f6bbcd2 100644 --- a/test/cmake_text_tests.bzl +++ b/test/cmake_text_tests.bzl @@ -131,10 +131,16 @@ def _move_dict_values_test(ctx): "CMAKE_CXX_LINK_EXECUTABLE": "became", "CUSTOM": "YES", } - export_for_test.move_dict_values(target, source_env, - export_for_test.CMAKE_ENV_VARS_FOR_CROSSTOOL) - export_for_test.move_dict_values(target, source_cache, - export_for_test.CMAKE_CACHE_ENTRIES_CROSSTOOL) + export_for_test.move_dict_values( + target, + source_env, + export_for_test.CMAKE_ENV_VARS_FOR_CROSSTOOL, + ) + export_for_test.move_dict_values( + target, + source_cache, + export_for_test.CMAKE_CACHE_ENTRIES_CROSSTOOL, + ) expected_target = { "CMAKE_C_COMPILER": "sink-cc-value", @@ -164,10 +170,14 @@ def _reverse_descriptor_dict_test(ctx): "CMAKE_C_FLAGS_INIT": struct(value = "CMAKE_C_FLAGS", replace = False), "CMAKE_CXX_FLAGS_INIT": struct(value = "CMAKE_CXX_FLAGS", replace = False), "CMAKE_ASM_FLAGS_INIT": struct(value = "CMAKE_ASM_FLAGS", replace = False), - "CMAKE_STATIC_LINKER_FLAGS_INIT": struct(value = "CMAKE_STATIC_LINKER_FLAGS", - replace = False), - "CMAKE_SHARED_LINKER_FLAGS_INIT": struct(value = "CMAKE_SHARED_LINKER_FLAGS", - replace = False), + "CMAKE_STATIC_LINKER_FLAGS_INIT": struct( + value = "CMAKE_STATIC_LINKER_FLAGS", + replace = False, + ), + "CMAKE_SHARED_LINKER_FLAGS_INIT": struct( + value = "CMAKE_SHARED_LINKER_FLAGS", + replace = False, + ), "CMAKE_EXE_LINKER_FLAGS_INIT": struct(value = "CMAKE_EXE_LINKER_FLAGS", replace = False), } @@ -193,8 +203,11 @@ def _merge_toolchain_and_user_values_test(ctx): "CUSTOM": "YES", } - res = export_for_test.merge_toolchain_and_user_values(target, source_cache, - export_for_test.CMAKE_CACHE_ENTRIES_CROSSTOOL) + res = export_for_test.merge_toolchain_and_user_values( + target, + source_cache, + export_for_test.CMAKE_CACHE_ENTRIES_CROSSTOOL, + ) expected_target = { "CMAKE_C_FLAGS": "-cc-flag -gcc_toolchain cc-toolchain --additional-flag", @@ -232,8 +245,19 @@ def _merge_flag_values_no_toolchain_file_test(ctx): "CMAKE_BUILD_TYPE": "RelWithDebInfo", } - script = create_cmake_script("ws", "linux", "cmake", tools, flags, "test_rule", - "external/test_rule", True, user_cache, user_env, []) + script = create_cmake_script( + "ws", + "linux", + "cmake", + tools, + flags, + "test_rule", + "external/test_rule", + True, + user_cache, + user_env, + [], + ) expected = """CC=\"/usr/bin/gcc\" CXX=\"/usr/bin/gcc\" CXXFLAGS=\"foo=\\\"bar\\\" -Fbat" cmake -DCMAKE_AR=\"/usr/bin/ar\" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_PREFIX_PATH=\"$EXT_BUILD_DEPS\" -DCMAKE_INSTALL_PREFIX=\"test_rule\" -DCMAKE_RANLIB=\"\" $EXT_BUILD_ROOT/external/test_rule""" asserts.equals(env, expected, script) @@ -262,8 +286,19 @@ def _create_min_cmake_script_no_toolchain_file_test(ctx): "CMAKE_PREFIX_PATH": "/abc/def", } - script = create_cmake_script("ws", "linux", "cmake", tools, flags, "test_rule", - "external/test_rule", True, user_cache, user_env, ["-GNinja"]) + script = create_cmake_script( + "ws", + "linux", + "cmake", + tools, + flags, + "test_rule", + "external/test_rule", + True, + user_cache, + user_env, + ["-GNinja"], + ) expected = "CC=\"/usr/bin/gcc\" CXX=\"/usr/bin/gcc\" CFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" CXXFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" ASMFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" cmake -DCMAKE_AR=\"/usr/bin/ar\" -DCMAKE_SHARED_LINKER_FLAGS=\"-shared -fuse-ld=gold\" -DCMAKE_EXE_LINKER_FLAGS=\"-fuse-ld=gold -Wl -no-as-needed\" -DNOFORTRAN=\"on\" -DCMAKE_PREFIX_PATH=\"$EXT_BUILD_DEPS;/abc/def\" -DCMAKE_INSTALL_PREFIX=\"test_rule\" -DCMAKE_BUILD_TYPE=\"Debug\" -DCMAKE_RANLIB=\"\" -GNinja $EXT_BUILD_ROOT/external/test_rule" asserts.equals(env, expected, script) @@ -295,8 +330,19 @@ def _create_min_cmake_script_wipe_toolchain_test(ctx): "WIPE_ME_IF_PRESENT": "", } - script = create_cmake_script("ws", "linux", "cmake", tools, flags, "test_rule", - "external/test_rule", True, user_cache, user_env, ["-GNinja"]) + script = create_cmake_script( + "ws", + "linux", + "cmake", + tools, + flags, + "test_rule", + "external/test_rule", + True, + user_cache, + user_env, + ["-GNinja"], + ) expected = "CC=\"/usr/bin/gcc\" CXX=\"/usr/bin/gcc\" CFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" CXXFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" ASMFLAGS=\"-U_FORTIFY_SOURCE -fstack-protector -Wall\" cmake -DCMAKE_AR=\"/usr/bin/ar\" -DCMAKE_EXE_LINKER_FLAGS=\"-fuse-ld=gold -Wl -no-as-needed\" -DCMAKE_PREFIX_PATH=\"$EXT_BUILD_DEPS;/abc/def\" -DCMAKE_INSTALL_PREFIX=\"test_rule\" -DCMAKE_BUILD_TYPE=\"Debug\" -DCMAKE_RANLIB=\"\" -GNinja $EXT_BUILD_ROOT/external/test_rule" asserts.equals(env, expected, script) @@ -324,8 +370,19 @@ def _create_min_cmake_script_toolchain_file_test(ctx): "NOFORTRAN": "on", } - script = create_cmake_script("ws", "linux", "cmake", tools, flags, "test_rule", - "external/test_rule", False, user_cache, user_env, ["-GNinja"]) + script = create_cmake_script( + "ws", + "linux", + "cmake", + tools, + flags, + "test_rule", + "external/test_rule", + False, + user_cache, + user_env, + ["-GNinja"], + ) expected = """cat > crosstool_bazel.cmake < crosstool_bazel.cmake < with the actual output file flags = get_flags_info(ctx, "") no_toolchain_file = ctx.attr.cache_entries.get("CMAKE_TOOLCHAIN_FILE") or not ctx.attr.generate_crosstool_file diff --git a/tools/build_defs/cmake_script.bzl b/tools/build_defs/cmake_script.bzl index e1b0c13f..68157716 100644 --- a/tools/build_defs/cmake_script.bzl +++ b/tools/build_defs/cmake_script.bzl @@ -124,9 +124,9 @@ def _create_crosstool_file_text(toolchain_dict, user_cache, user_env): lines = [] for key in toolchain_dict: if ("CMAKE_AR" == key): - lines += ["set({} \"{}\" {})".format(key, toolchain_dict[key], "CACHE FILEPATH \"Archiver\"")] + lines.append("set({} \"{}\" {})".format(key, toolchain_dict[key], "CACHE FILEPATH \"Archiver\"")) continue - lines += ["set({} \"{}\")".format(key, toolchain_dict[key])] + lines.append("set({} \"{}\")".format(key, toolchain_dict[key])) cache_entries.update({ "CMAKE_TOOLCHAIN_FILE": "crosstool_bazel.cmake", @@ -237,9 +237,9 @@ def _fill_crossfile_from_toolchain(workspace_name, target_os, tools, flags): dict["CMAKE_AR"] = _absolutize(workspace_name, tools.cxx_linker_static, True) if tools.cxx_linker_static.endswith("/libtool"): dict["CMAKE_C_ARCHIVE_CREATE"] = " %s " % \ - " ".join(flags.cxx_linker_static) + " ".join(flags.cxx_linker_static) dict["CMAKE_CXX_ARCHIVE_CREATE"] = " %s " % \ - " ".join(flags.cxx_linker_static) + " ".join(flags.cxx_linker_static) if tools.cxx_linker_executable and tools.cxx_linker_executable != tools.cxx: normalized_path = _absolutize(workspace_name, tools.cxx_linker_executable) diff --git a/tools/build_defs/configure_script.bzl b/tools/build_defs/configure_script.bzl index 4c843cf2..ccf3efb6 100644 --- a/tools/build_defs/configure_script.bzl +++ b/tools/build_defs/configure_script.bzl @@ -1,5 +1,5 @@ load(":cc_toolchain_util.bzl", "absolutize_path_in_str") -load(":framework.bzl", "ForeignCcDeps", "get_foreign_cc_dep") +load(":framework.bzl", "get_foreign_cc_dep") def create_configure_script( workspace_name, @@ -18,23 +18,23 @@ def create_configure_script( script = [] for ext_dir in inputs.ext_build_dirs: - script += ["##increment_pkg_config_path## $$EXT_BUILD_ROOT$$/" + ext_dir.path] + script.append("##increment_pkg_config_path## $$EXT_BUILD_ROOT$$/" + ext_dir.path) - script += ["echo \"PKG_CONFIG_PATH=$$PKG_CONFIG_PATH$$\""] + script.append("echo \"PKG_CONFIG_PATH=$$PKG_CONFIG_PATH$$\"") configure_path = "$$EXT_BUILD_ROOT$$/{root}/{configure}".format( root = root, configure = configure_command, ) if (configure_in_place): - script += ["##symlink_contents_to_dir## $$EXT_BUILD_ROOT$$/{} $$BUILD_TMPDIR$$".format(root)] + script.append("##symlink_contents_to_dir## $$EXT_BUILD_ROOT$$/{} $$BUILD_TMPDIR$$".format(root)) configure_path = "$$BUILD_TMPDIR$$/{}".format(configure_command) - script += ["{env_vars} \"{configure}\" --prefix=$$BUILD_TMPDIR$$/$$INSTALL_PREFIX$$ {user_options}".format( + script.append("{env_vars} \"{configure}\" --prefix=$$BUILD_TMPDIR$$/$$INSTALL_PREFIX$$ {user_options}".format( env_vars = env_vars_string, configure = configure_path, user_options = " ".join(user_options), - )] + )) return "\n".join(script) def create_make_script( @@ -50,12 +50,12 @@ def create_make_script( env_vars_string = get_env_vars(workspace_name, tools, flags, user_vars, deps, inputs) script = [] for ext_dir in inputs.ext_build_dirs: - script += ["##increment_pkg_config_path## $$EXT_BUILD_ROOT$$/" + ext_dir.path] + script.append("##increment_pkg_config_path## $$EXT_BUILD_ROOT$$/" + ext_dir.path) - script += ["echo \"PKG_CONFIG_PATH=$$PKG_CONFIG_PATH$$\""] + script.append("echo \"PKG_CONFIG_PATH=$$PKG_CONFIG_PATH$$\"") - script += ["##symlink_contents_to_dir## $$EXT_BUILD_ROOT$$/{} $$BUILD_TMPDIR$$".format(root)] - script += ["" + " && ".join(make_commands)] + script.append("##symlink_contents_to_dir## $$EXT_BUILD_ROOT$$/{} $$BUILD_TMPDIR$$".format(root)) + script.append("" + " && ".join(make_commands)) return "\n".join(script) def get_env_vars( @@ -87,7 +87,7 @@ def _define_deps_flags(deps, inputs): dir_ = lib.dirname if not gen_dirs_set.get(dir_): gen_dirs_set[dir_] = 1 - lib_dirs += ["-L$$EXT_BUILD_ROOT$$/" + dir_] + lib_dirs.append("-L$$EXT_BUILD_ROOT$$/" + dir_) include_dirs_set = {} for include_dir in inputs.include_dirs: @@ -113,8 +113,8 @@ def _define_deps_flags(deps, inputs): gen_dirs_set[artifact.gen_dir] = 1 dir_name = artifact.gen_dir.basename - include_dirs += ["-I$$EXT_BUILD_DEPS$$/{}/{}".format(dir_name, artifact.include_dir_name)] - lib_dirs += ["-L$$EXT_BUILD_DEPS$$/{}/{}".format(dir_name, artifact.lib_dir_name)] + include_dirs.append("-I$$EXT_BUILD_DEPS$$/{}/{}".format(dir_name, artifact.include_dir_name)) + lib_dirs.append("-L$$EXT_BUILD_DEPS$$/{}/{}".format(dir_name, artifact.lib_dir_name)) return struct( libs = lib_dirs, diff --git a/tools/build_defs/framework.bzl b/tools/build_defs/framework.bzl index 666c0b7a..95a43e07 100644 --- a/tools/build_defs/framework.bzl +++ b/tools/build_defs/framework.bzl @@ -391,7 +391,7 @@ def _get_transitive_artifacts(deps): for dep in deps: foreign_dep = get_foreign_cc_dep(dep) if foreign_dep: - artifacts += [foreign_dep.artifacts] + artifacts.append(foreign_dep.artifacts) return artifacts def _print_env(): @@ -432,10 +432,10 @@ def _copy_deps_and_tools(files): lines.append("##symlink_to_dir## $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/bin/".format(tool)) for ext_dir in files.ext_build_dirs: - lines += ["##symlink_to_dir## $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$".format(_file_path(ext_dir))] + lines.append("##symlink_to_dir## $$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$".format(_file_path(ext_dir))) - lines += ["##children_to_path## $$EXT_BUILD_DEPS$$/bin"] - lines += ["##path## $$EXT_BUILD_DEPS$$/bin"] + lines.append("##children_to_path## $$EXT_BUILD_DEPS$$/bin") + lines.append("##path## $$EXT_BUILD_DEPS$$/bin") return lines @@ -448,10 +448,10 @@ def _symlink_contents_to_dir(dir_name, files_list): lines = ["##mkdirs## $$EXT_BUILD_DEPS$$/" + dir_name] for file in files_list: - path = _file_path(file).strip() - if path: - lines += ["##symlink_contents_to_dir## \ -$$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/{}".format(path, dir_name)] + path = _file_path(file).strip() + if path: + lines.append("##symlink_contents_to_dir## \ +$$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/{}".format(path, dir_name)) return lines @@ -549,7 +549,7 @@ def _define_inputs(attrs): for dep in attrs.deps: external_deps = get_foreign_cc_dep(dep) - cc_infos += [dep[CcInfo]] + cc_infos.append(dep[CcInfo]) if external_deps: ext_build_dirs += [artifact.gen_dir for artifact in external_deps.artifacts.to_list()] @@ -568,7 +568,7 @@ def _define_inputs(attrs): tools_files = [] for tool in attrs.tools_deps: tool_root = detect_root(tool) - tools_roots += [tool_root] + tools_roots.append(tool_root) for file_list in tool.files.to_list(): tools_files += _list(file_list) @@ -588,12 +588,12 @@ def _define_inputs(attrs): deps_compilation_info = cc_info_merged.compilation_context, deps_linking_info = cc_info_merged.linking_context, ext_build_dirs = ext_build_dirs, - declared_inputs = filter_containing_dirs_from_inputs(attrs.lib_source.files.to_list()) - + bazel_libs - + tools_files - + attrs.additional_inputs - + cc_info_merged.compilation_context.headers.to_list() - + ext_build_dirs, + declared_inputs = filter_containing_dirs_from_inputs(attrs.lib_source.files.to_list()) + + bazel_libs + + tools_files + + attrs.additional_inputs + + cc_info_merged.compilation_context.headers.to_list() + + ext_build_dirs, ) """When the directories are also passed in the filegroup with the sources, @@ -601,6 +601,7 @@ we get into a situation when we have containing in the sources list, which is not allowed by Bazel (execroot creation code fails). The parent directories will be created for us in the execroot anyway, so we filter them out.""" + def filter_containing_dirs_from_inputs(input_files_list): # This puts directories in front of their children in list sorted_list = sorted(input_files_list) @@ -628,7 +629,8 @@ def get_foreign_cc_dep(dep): # consider optimization here to do not iterate both collections def _get_headers(compilation_info): include_dirs = compilation_info.system_includes.to_list() + \ - compilation_info.includes.to_list() + compilation_info.includes.to_list() + # do not use quote includes, currently they do not contain # library-specific information include_dirs = collections.uniq(include_dirs) @@ -641,7 +643,7 @@ def _get_headers(compilation_info): included = True break if not included: - headers += [header] + headers.append(header) return struct( headers = headers, include_dirs = include_dirs, diff --git a/tools/build_defs/native_tools/tool_access.bzl b/tools/build_defs/native_tools/tool_access.bzl index 7099bfdc..425d61ac 100644 --- a/tools/build_defs/native_tools/tool_access.bzl +++ b/tools/build_defs/native_tools/tool_access.bzl @@ -1,4 +1,4 @@ -load(":native_tools_toolchain.bzl", "ToolInfo", "access_tool") +load(":native_tools_toolchain.bzl", "access_tool") def get_cmake_data(ctx): return _access_and_expect_label_copied("@rules_foreign_cc//tools/build_defs:cmake_toolchain", ctx, "cmake") diff --git a/tools/build_defs/shell_toolchain/polymorphism/generate_overloads.bzl b/tools/build_defs/shell_toolchain/polymorphism/generate_overloads.bzl index b6dff10d..d40c65b2 100644 --- a/tools/build_defs/shell_toolchain/polymorphism/generate_overloads.bzl +++ b/tools/build_defs/shell_toolchain/polymorphism/generate_overloads.bzl @@ -20,7 +20,7 @@ def get(file_name): def _mapping_text(ids): data_ = [] for id in ids: - data_ += ["{id} = wrapper_{id}".format(id = id)] + data_.append("{id} = wrapper_{id}".format(id = id)) return "_MAPPING = dict(\n{data}\n)".format(data = ",\n".join(data_)) def _load_and_wrapper_text(id, file_path, symbols): @@ -30,8 +30,8 @@ def _load_and_wrapper_text(id, file_path, symbols): wrapper_statement = "wrapper_{id} = dict({data})".format(id = id, data = data) return struct( load_ = load_statement, - wrapper = wrapper_statement - ) + wrapper = wrapper_statement, + ) def id_from_file(file_name): (before, middle, after) = file_name.partition(".") @@ -55,16 +55,16 @@ def _generate_overloads(rctx): wrappers = [] for file_ in rctx.attr.files: id = id_from_file(file_.name) - ids += [id] + ids.append(id) copy = _copy_file(rctx, file_) load_and_wrapper = _load_and_wrapper_text(id, copy, symbols) - loads += [load_and_wrapper.load_] - wrappers += [load_and_wrapper.wrapper] + loads.append(load_and_wrapper.load_) + wrappers.append(load_and_wrapper.wrapper) lines += loads lines += wrappers - lines += [_mapping_text(ids)] - lines += [_provider_text(symbols)] - lines += [_getter_text()] + lines.append(_mapping_text(ids)) + lines.append(_provider_text(symbols)) + lines.append(_getter_text()) rctx.file("toolchain_data_defs.bzl", "\n".join(lines)) rctx.file("BUILD", "") diff --git a/tools/build_defs/shell_toolchain/toolchains/access.bzl b/tools/build_defs/shell_toolchain/toolchains/access.bzl index e1206394..7b16874f 100644 --- a/tools/build_defs/shell_toolchain/toolchains/access.bzl +++ b/tools/build_defs/shell_toolchain/toolchains/access.bzl @@ -1,4 +1,3 @@ -load("@bazel_skylib//lib:types.bzl", "types") load("//tools/build_defs/shell_toolchain/toolchains:commands.bzl", "PLATFORM_COMMANDS") load(":function_and_call.bzl", "FunctionAndCall") diff --git a/tools/build_defs/shell_toolchain/toolchains/impl/default_commands.bzl b/tools/build_defs/shell_toolchain/toolchains/impl/default_commands.bzl index 746aacf1..9d2df00c 100644 --- a/tools/build_defs/shell_toolchain/toolchains/impl/default_commands.bzl +++ b/tools/build_defs/shell_toolchain/toolchains/impl/default_commands.bzl @@ -1,6 +1,6 @@ load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall") -_REPLACE_VALUE = "\${EXT_BUILD_DEPS}" +_REPLACE_VALUE = "\\${EXT_BUILD_DEPS}" def os_name(): return "linux" @@ -46,18 +46,16 @@ fi def define_function(name, text): lines = [] - lines += ["function " + name + "() {"] + lines.append("function " + name + "() {") for line_ in text.splitlines(): - lines += [" " + line_] - lines += ["}"] + lines.append(" " + line_) + lines.append("}") return "\n".join(lines) def replace_in_files(dir, from_, to_): return FunctionAndCall( text = """if [ -d "$1" ]; then - find -L $1 -type f \ - \( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \) \ - -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' + find -L $1 -type f \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \\) -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' fi """, ) diff --git a/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl b/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl index 746aacf1..9d2df00c 100644 --- a/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl +++ b/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl @@ -1,6 +1,6 @@ load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall") -_REPLACE_VALUE = "\${EXT_BUILD_DEPS}" +_REPLACE_VALUE = "\\${EXT_BUILD_DEPS}" def os_name(): return "linux" @@ -46,18 +46,16 @@ fi def define_function(name, text): lines = [] - lines += ["function " + name + "() {"] + lines.append("function " + name + "() {") for line_ in text.splitlines(): - lines += [" " + line_] - lines += ["}"] + lines.append(" " + line_) + lines.append("}") return "\n".join(lines) def replace_in_files(dir, from_, to_): return FunctionAndCall( text = """if [ -d "$1" ]; then - find -L $1 -type f \ - \( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \) \ - -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' + find -L $1 -type f \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \\) -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' fi """, ) diff --git a/tools/build_defs/shell_toolchain/toolchains/impl/osx_commands.bzl b/tools/build_defs/shell_toolchain/toolchains/impl/osx_commands.bzl index d578f04d..8500d223 100644 --- a/tools/build_defs/shell_toolchain/toolchains/impl/osx_commands.bzl +++ b/tools/build_defs/shell_toolchain/toolchains/impl/osx_commands.bzl @@ -1,6 +1,6 @@ load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall") -_REPLACE_VALUE = "\${EXT_BUILD_DEPS}" +_REPLACE_VALUE = "\\${EXT_BUILD_DEPS}" def os_name(): return "osx" @@ -46,17 +46,16 @@ fi def define_function(name, text): lines = [] - lines += ["function " + name + "() {"] + lines.append("function " + name + "() {") for line_ in text.splitlines(): - lines += [" " + line_] - lines += ["}"] + lines.append(" " + line_) + lines.append("}") return "\n".join(lines) def replace_in_files(dir, from_, to_): return FunctionAndCall( text = """if [ -d "$1" ]; then - find -L -f $1 \( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \) \ - -exec sed -i -e 's@'"$2"'@'"$3"'@g' {} ';' + find -L -f $1 \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \\) -exec sed -i -e 's@'"$2"'@'"$3"'@g' {} ';' fi """, ) diff --git a/tools/build_defs/shell_toolchain/toolchains/impl/windows_commands.bzl b/tools/build_defs/shell_toolchain/toolchains/impl/windows_commands.bzl index 84003dd6..69c6517e 100644 --- a/tools/build_defs/shell_toolchain/toolchains/impl/windows_commands.bzl +++ b/tools/build_defs/shell_toolchain/toolchains/impl/windows_commands.bzl @@ -1,6 +1,6 @@ load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall") -_REPLACE_VALUE = "\${EXT_BUILD_DEPS}" +_REPLACE_VALUE = "\\${EXT_BUILD_DEPS}" def os_name(): return "windows" @@ -46,18 +46,16 @@ fi def define_function(name, text): lines = [] - lines += ["function " + name + "() {"] + lines.append("function " + name + "() {") for line_ in text.splitlines(): - lines += [" " + line_] - lines += ["}"] + lines.append(" " + line_) + lines.append("}") return "\n".join(lines) def replace_in_files(dir, from_, to_): return FunctionAndCall( text = """if [ -d "$1" ]; then - $REAL_FIND -L $1 -type f \ - \( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \) \ - -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' + $REAL_FIND -L $1 -type f \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.cmake" \\) -exec sed -i 's@'"$2"'@'"$3"'@g' {} ';' fi """, ) diff --git a/workspace_definitions.bzl b/workspace_definitions.bzl index aa8c009f..38182389 100644 --- a/workspace_definitions.bzl +++ b/workspace_definitions.bzl @@ -1,4 +1,3 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("//for_workspace:repositories.bzl", "repositories") load( "//tools/build_defs/shell_toolchain/toolchains:ws_defs.bzl", @@ -58,8 +57,7 @@ def rules_foreign_cc_dependencies( native_tools_toolchains = [], register_default_tools = True, additonal_shell_toolchain_mappings = [], - additonal_shell_toolchain_package = None, - ): + additonal_shell_toolchain_package = None): """ Call this function from the WORKSPACE file to initialize rules_foreign_cc dependencies and let neccesary code generation happen (Code generation is needed to support different variants of the C++ Starlark API.). @@ -88,7 +86,7 @@ def rules_foreign_cc_dependencies( """ repositories() _read_build_options(name = "foreign_cc_platform_utils") - bazel_version(name="rules_foreign_cc_bazel_version") + bazel_version(name = "rules_foreign_cc_bazel_version") shell_toolchain_workspace_initalization( additonal_shell_toolchain_mappings,