Skip to content

Commit fc76c6e

Browse files
committed
Remove unintended formatting changes.
1 parent b7b17c4 commit fc76c6e

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

haskell/ghc_bindist.bzl

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
load("@bazel_skylib//lib:paths.bzl", "paths")
44
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch")
55
load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_cpu_value")
6-
load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_TYPE")
76
load("@rules_sh//sh:posix.bzl", "sh_posix_configure")
8-
load("//haskell:ghc.bzl", "DEFAULT_GHC_VERSION")
9-
load(":private/bazel_platforms.bzl", "bazel_platforms")
7+
load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_TYPE")
108
load(
119
":private/pkgdb_to_bzl.bzl",
1210
"pkgdb_to_bzl",
@@ -19,6 +17,8 @@ load(
1917
"find_python",
2018
"resolve_labels",
2119
)
20+
load("//haskell:ghc.bzl", "DEFAULT_GHC_VERSION")
21+
load(":private/bazel_platforms.bzl", "bazel_platforms")
2222

2323
_GHC_DEFAULT_VERSION = DEFAULT_GHC_VERSION
2424

@@ -87,7 +87,7 @@ def _ghc_bindist_impl(ctx):
8787
if GHC_BINDIST_STRIP_PREFIX.get(version) != None and GHC_BINDIST_STRIP_PREFIX[version].get(target) != None:
8888
stripPrefix = GHC_BINDIST_STRIP_PREFIX[version][target]
8989
else:
90-
arch_suffix = {"amd64": "x86_64", "arm64": "aarch64"}.get(arch)
90+
arch_suffix = {"arm64": "aarch64", "amd64": "x86_64"}.get(arch)
9191

9292
if os == "windows" and version_tuple >= (9, 0, 1):
9393
stripPrefix += "-{}-unknown-mingw32".format(arch_suffix)
@@ -263,10 +263,10 @@ rm -f
263263
"BUILD",
264264
filepaths["@rules_haskell//haskell:ghc.BUILD.tpl"],
265265
substitutions = {
266-
"%{docdir}": docdir,
267-
"%{is_clang}": str(is_clang),
268266
"%{toolchain_libraries}": toolchain_libraries,
269267
"%{toolchain}": toolchain,
268+
"%{docdir}": docdir,
269+
"%{is_clang}": str(is_clang),
270270
},
271271
executable = False,
272272
)
@@ -275,11 +275,24 @@ _ghc_bindist = repository_rule(
275275
_ghc_bindist_impl,
276276
local = False,
277277
attrs = {
278-
"cabalopts": attr.string_list(),
278+
"version": attr.string(
279+
default = _GHC_DEFAULT_VERSION,
280+
doc = "The desired GHC version",
281+
),
282+
"target": attr.string(),
279283
"ghcopts": attr.string_list(),
280284
"haddock_flags": attr.string_list(),
281-
"locale": attr.string(
282-
mandatory = False,
285+
"repl_ghci_args": attr.string_list(),
286+
"cabalopts": attr.string_list(),
287+
"patches": attr.label_list(
288+
default = [],
289+
doc =
290+
"A list of files that are to be applied as patches afer " +
291+
"extracting the archive.",
292+
),
293+
"patch_tool": attr.string(
294+
default = "patch",
295+
doc = "The patch(1) utility to use.",
283296
),
284297
"patch_args": attr.string_list(
285298
default = ["-p0"],
@@ -289,21 +302,8 @@ _ghc_bindist = repository_rule(
289302
default = [],
290303
doc = "Sequence of commands to be applied after patches are applied.",
291304
),
292-
"patch_tool": attr.string(
293-
default = "patch",
294-
doc = "The patch(1) utility to use.",
295-
),
296-
"patches": attr.label_list(
297-
default = [],
298-
doc =
299-
"A list of files that are to be applied as patches afer " +
300-
"extracting the archive.",
301-
),
302-
"repl_ghci_args": attr.string_list(),
303-
"target": attr.string(),
304-
"version": attr.string(
305-
default = _GHC_DEFAULT_VERSION,
306-
doc = "The desired GHC version",
305+
"locale": attr.string(
306+
mandatory = False,
307307
),
308308
"_relpath_script": attr.label(
309309
allow_single_file = True,
@@ -475,7 +475,7 @@ def ghc_bindist(
475475
"9.2.1": ["@rules_haskell//haskell:assets/ghc_9_2_1_mac.patch"],
476476
}.get(version)
477477

478-
extra_attrs = {"patch_args": ["-p0"], "patches": patches} if patches else {}
478+
extra_attrs = {"patches": patches, "patch_args": ["-p0"]} if patches else {}
479479

480480
# We want the toolchain definition to be tucked away in a separate
481481
# repository, that way `bazel build //...` will not match it (and
@@ -611,6 +611,7 @@ toolchain(
611611
stub_shebang = stub_shebang,
612612
))
613613

614+
614615
_config_python3_toolchain = repository_rule(
615616
_configure_python3_toolchain_impl,
616617
configure = True,

0 commit comments

Comments
 (0)