diff --git a/toolchain/internal/configure.bzl b/toolchain/internal/configure.bzl index 0de9dbde..45eae3b9 100644 --- a/toolchain/internal/configure.bzl +++ b/toolchain/internal/configure.bzl @@ -19,6 +19,7 @@ load( ) load( "//toolchain/internal:common.bzl", + _BZLMOD_ENABLED = "BZLMOD_ENABLED", _arch = "arch", _canonical_dir_path = "canonical_dir_path", _check_os_arch_keys = "check_os_arch_keys", @@ -31,7 +32,6 @@ load( _pkg_path_from_label = "pkg_path_from_label", _supported_targets = "SUPPORTED_TARGETS", _toolchain_tools = "toolchain_tools", - _BZLMOD_ENABLED = "BZLMOD_ENABLED", ) load( "//toolchain/internal:sysroot.bzl", @@ -42,7 +42,9 @@ load( def _make_string_label(repository, package, target): return "{prefix}{repo}//{package}:{target}".format( prefix = "@@" if _BZLMOD_ENABLED else "@", - repo = repository, package = package, target = target, + repo = repository, + package = package, + target = target, ) def llvm_config_impl(rctx): @@ -77,12 +79,13 @@ def llvm_register_toolchains(): # Otherwise, interpret as a key into `toolchain_roots_label_map`: # Flip the map (note: no error on duplicate "keys" for now) - label_map = { key: label for label, key in rctx.attr.toolchain_roots_label_map.items() } + label_map = {key: label for label, key in rctx.attr.toolchain_roots_label_map.items()} if not toolchain_root in label_map: fail(("Value in `toolchain_roots` {key} was interpreted as a `toolchain_roots_label_map` " + - "key but it is not present in `toolchain_roots_label_map`: {map}").format( - key = toolchain_root, map = label_map, + "key but it is not present in `toolchain_roots_label_map`: {map}").format( + key = toolchain_root, + map = label_map, )) toolchain_root = label_map[toolchain_root] @@ -101,7 +104,9 @@ def llvm_register_toolchains(): # # TODO: should we just use the target name in the Label that was given? llvm_dist_label = Label(_make_string_label( - toolchain_root.workspace_name, toolchain_root.package, "BUILD.bazel", + toolchain_root.workspace_name, + toolchain_root.package, + "BUILD.bazel", )) if use_absolute_paths_llvm: llvm_dist_path_prefix = _canonical_dir_path(str(rctx.path(llvm_dist_label).dirname)) @@ -111,7 +116,9 @@ def llvm_register_toolchains(): if not use_absolute_paths_llvm: llvm_dist_rel_path = _canonical_dir_path("../../" + llvm_dist_path_prefix) llvm_dist_label_prefix = _make_string_label( - toolchain_root.workspace_name, toolchain_root.package, "", + toolchain_root.workspace_name, + toolchain_root.package, + "", ) # tools can only be defined as absolute paths or in a subdirectory of @@ -146,7 +153,7 @@ def llvm_register_toolchains(): symlinked_tools_str = "" # Flip the sysroot label map (note: no error on duplicate "keys" for now) - _sysroot_label_map = { key: label for label, key in rctx.attr.sysroot_label_map.items() } + _sysroot_label_map = {key: label for label, key in rctx.attr.sysroot_label_map.items()} sysroot_paths_dict, sysroot_labels_dict = _sysroot_paths_dict( rctx, rctx.attr.sysroot, diff --git a/toolchain/internal/repo.bzl b/toolchain/internal/repo.bzl index ef8af46a..6d430184 100644 --- a/toolchain/internal/repo.bzl +++ b/toolchain/internal/repo.bzl @@ -279,11 +279,11 @@ llvm_config_attrs.update({ # This map is inverted (Label -> key instead of key -> Label) because # there isn't a `string_keyed_label_dict`. doc = ("Inverted map from toolchain root Label to string identifier.\n" + - "This attribute is to be used with `toolchain_roots` in order to specify roots " + - "that come from a Bazel package. Keys can be any identifier that do not start " + - "with a forward slash '/`.\n" + - "Note that the target name in the Label to the root provided here is ignored: " + - "only the Label's repository and package are used."), + "This attribute is to be used with `toolchain_roots` in order to specify roots " + + "that come from a Bazel package. Keys can be any identifier that do not start " + + "with a forward slash '/`.\n" + + "Note that the target name in the Label to the root provided here is ignored: " + + "only the Label's repository and package are used."), ), "absolute_paths": attr.bool( default = False, diff --git a/toolchain/internal/sysroot.bzl b/toolchain/internal/sysroot.bzl index 870f01e1..8d945dcd 100644 --- a/toolchain/internal/sysroot.bzl +++ b/toolchain/internal/sysroot.bzl @@ -53,8 +53,9 @@ def _sysroot_path(sysroot_dict, label_map, os, arch): # Otherwise, consult the label map: if sysroot not in label_map: fail(("Value in `sysroot` {key} was interpreted as a `sysroot_label_map` " + - "key but it is not present in the map: {map}").format( - key = sysroot, map = label_map, + "key but it is not present in the map: {map}").format( + key = sysroot, + map = label_map, )) label = label_map[sysroot]