From fc76c6ea3e42d3bc93d81c101e501da9f91fa240 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Tue, 19 Dec 2023 17:39:46 -0700 Subject: [PATCH] Remove unintended formatting changes. --- haskell/ghc_bindist.bzl | 51 +++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/haskell/ghc_bindist.bzl b/haskell/ghc_bindist.bzl index 0423939a2..119a866d0 100644 --- a/haskell/ghc_bindist.bzl +++ b/haskell/ghc_bindist.bzl @@ -3,10 +3,8 @@ load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch") load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_cpu_value") -load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_TYPE") load("@rules_sh//sh:posix.bzl", "sh_posix_configure") -load("//haskell:ghc.bzl", "DEFAULT_GHC_VERSION") -load(":private/bazel_platforms.bzl", "bazel_platforms") +load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_TYPE") load( ":private/pkgdb_to_bzl.bzl", "pkgdb_to_bzl", @@ -19,6 +17,8 @@ load( "find_python", "resolve_labels", ) +load("//haskell:ghc.bzl", "DEFAULT_GHC_VERSION") +load(":private/bazel_platforms.bzl", "bazel_platforms") _GHC_DEFAULT_VERSION = DEFAULT_GHC_VERSION @@ -87,7 +87,7 @@ def _ghc_bindist_impl(ctx): if GHC_BINDIST_STRIP_PREFIX.get(version) != None and GHC_BINDIST_STRIP_PREFIX[version].get(target) != None: stripPrefix = GHC_BINDIST_STRIP_PREFIX[version][target] else: - arch_suffix = {"amd64": "x86_64", "arm64": "aarch64"}.get(arch) + arch_suffix = {"arm64": "aarch64", "amd64": "x86_64"}.get(arch) if os == "windows" and version_tuple >= (9, 0, 1): stripPrefix += "-{}-unknown-mingw32".format(arch_suffix) @@ -263,10 +263,10 @@ rm -f "BUILD", filepaths["@rules_haskell//haskell:ghc.BUILD.tpl"], substitutions = { - "%{docdir}": docdir, - "%{is_clang}": str(is_clang), "%{toolchain_libraries}": toolchain_libraries, "%{toolchain}": toolchain, + "%{docdir}": docdir, + "%{is_clang}": str(is_clang), }, executable = False, ) @@ -275,11 +275,24 @@ _ghc_bindist = repository_rule( _ghc_bindist_impl, local = False, attrs = { - "cabalopts": attr.string_list(), + "version": attr.string( + default = _GHC_DEFAULT_VERSION, + doc = "The desired GHC version", + ), + "target": attr.string(), "ghcopts": attr.string_list(), "haddock_flags": attr.string_list(), - "locale": attr.string( - mandatory = False, + "repl_ghci_args": attr.string_list(), + "cabalopts": attr.string_list(), + "patches": attr.label_list( + default = [], + doc = + "A list of files that are to be applied as patches afer " + + "extracting the archive.", + ), + "patch_tool": attr.string( + default = "patch", + doc = "The patch(1) utility to use.", ), "patch_args": attr.string_list( default = ["-p0"], @@ -289,21 +302,8 @@ _ghc_bindist = repository_rule( default = [], doc = "Sequence of commands to be applied after patches are applied.", ), - "patch_tool": attr.string( - default = "patch", - doc = "The patch(1) utility to use.", - ), - "patches": attr.label_list( - default = [], - doc = - "A list of files that are to be applied as patches afer " + - "extracting the archive.", - ), - "repl_ghci_args": attr.string_list(), - "target": attr.string(), - "version": attr.string( - default = _GHC_DEFAULT_VERSION, - doc = "The desired GHC version", + "locale": attr.string( + mandatory = False, ), "_relpath_script": attr.label( allow_single_file = True, @@ -475,7 +475,7 @@ def ghc_bindist( "9.2.1": ["@rules_haskell//haskell:assets/ghc_9_2_1_mac.patch"], }.get(version) - extra_attrs = {"patch_args": ["-p0"], "patches": patches} if patches else {} + extra_attrs = {"patches": patches, "patch_args": ["-p0"]} if patches else {} # We want the toolchain definition to be tucked away in a separate # repository, that way `bazel build //...` will not match it (and @@ -611,6 +611,7 @@ toolchain( stub_shebang = stub_shebang, )) + _config_python3_toolchain = repository_rule( _configure_python3_toolchain_impl, configure = True,