Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ common --config common
startup --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2

common --incompatible_require_linker_input_cc_api

common --incompatible_struct_has_no_methods
common --incompatible_disallow_empty_glob=true

# test environment does not propagate locales by default some tests reads files
Expand Down
10 changes: 5 additions & 5 deletions haskell/cabal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def _haskell_cabal_library_impl(ctx):

(_, runghc_manifest) = ctx.resolve_tools(tools = [ctx.attr._runghc])
json_args = ctx.actions.declare_file("{}_cabal_wrapper_args.json".format(ctx.label.name))
ctx.actions.write(json_args, c.args.to_json())
ctx.actions.write(json_args, json.encode(c.args))
ctx.actions.run(
executable = c.cabal_wrapper,
arguments = [json_args.path],
Expand Down Expand Up @@ -861,7 +861,7 @@ def _haskell_cabal_binary_impl(ctx):
)
(_, runghc_manifest) = ctx.resolve_tools(tools = [ctx.attr._runghc])
json_args = ctx.actions.declare_file("{}_cabal_wrapper_args.json".format(ctx.label.name))
ctx.actions.write(json_args, c.args.to_json())
ctx.actions.write(json_args, json.encode(c.args))
ctx.actions.run(
executable = c.cabal_wrapper,
arguments = [json_args.path],
Expand Down Expand Up @@ -1291,7 +1291,7 @@ library
)

# Create a stack.yaml capturing user overrides to the snapshot.
stack_yaml_content = struct(**{
stack_yaml_content = json.encode(struct(**{
"resolver": str(snapshot),
"packages": [resolve_package] + core_packages + [
# Determines path to vendored package's root directory relative to
Expand All @@ -1311,7 +1311,7 @@ library
])
for (pkg, flags) in repository_ctx.attr.flags.items()
},
}).to_json()
}))
repository_ctx.file("stack.yaml", content = stack_yaml_content, executable = False)

# We declared core packages as local packages in stack.yaml for two reasons.
Expand Down Expand Up @@ -1679,7 +1679,7 @@ def _write_snapshot_json(repository_ctx, all_cabal_hashes, resolved):
"__GENERATED_FILE_DO_NOT_MODIFY_MANUALLY": checksum,
"all-cabal-hashes": repr(all_cabal_hashes),
"resolved": _pretty_print_kvs(1, {
name: struct(**spec).to_json()
name: json.encode(struct(**spec))
for (name, spec) in resolved.items()
}),
}),
Expand Down
2 changes: 1 addition & 1 deletion haskell/private/actions/info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def write_proto_file(hs, output_name, proto_type, content):
"""
proto_txt = hs.actions.declare_file(output_name + ".txt")
proto_pb = hs.actions.declare_file(output_name + ".pb")
hs.actions.write(output = proto_txt, content = content.to_proto())
hs.actions.write(output = proto_txt, content = proto.encode_text(content))

protoc = hs.toolchain.protoc
rule_info_protos = hs.toolchain.rule_info_proto[ProtoInfo].direct_sources
Expand Down