Skip to content

Commit

Permalink
Remove unintended formatting changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel committed Dec 20, 2023
1 parent b7b17c4 commit fc76c6e
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions haskell/ghc_bindist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)
Expand All @@ -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"],
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -611,6 +611,7 @@ toolchain(
stub_shebang = stub_shebang,
))


_config_python3_toolchain = repository_rule(
_configure_python3_toolchain_impl,
configure = True,
Expand Down

0 comments on commit fc76c6e

Please # to comment.