Skip to content

Commit

Permalink
Always pass an environment to run_ghc.
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez authored and mergify-bot committed Mar 25, 2021
1 parent 23fc762 commit bb0cc21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions haskell/private/actions/link.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Actions for linking object code produced by compilation"""

load("@bazel_skylib//lib:dicts.bzl", "dicts")
load(":private/packages.bzl", "expose_packages", "pkg_info_to_compile_flags")
load(":private/pkg_id.bzl", "pkg_id")
load(":private/cc_libraries.bzl", "create_link_config")
Expand Down Expand Up @@ -186,6 +187,7 @@ def link_binary(
mnemonic = "HaskellLinkBinary",
arguments = args,
params_file = objects_dir_manifest,
env = dicts.add(hs.env, cc.env),
)

return (executable, dynamic_libs)
Expand Down Expand Up @@ -368,6 +370,7 @@ def link_library_dynamic(hs, cc, posix, dep_info, extra_srcs, objects_dir, my_pk
mnemonic = "HaskellLinkDynamicLibrary",
arguments = args,
params_file = objects_dir_manifest,
env = dicts.add(hs.env, cc.env),
)

return dynamic_library
8 changes: 2 additions & 6 deletions haskell/toolchain.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Rules for defining toolchains"""

load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":ghc_bindist.bzl", "haskell_register_ghc_bindists")
load(
Expand All @@ -20,10 +19,7 @@ load(":cc.bzl", "ghc_cc_program_args")

_GHC_BINARIES = ["ghc", "ghc-pkg", "hsc2hs", "haddock", "ghci", "runghc", "hpc"]

def _run_ghc(hs, cc, inputs, outputs, mnemonic, arguments, params_file = None, env = None, progress_message = None, input_manifests = None):
if not env:
env = hs.env

def _run_ghc(hs, cc, inputs, outputs, mnemonic, arguments, env, params_file = None, progress_message = None, input_manifests = None):
args = hs.actions.args()
extra_inputs = []

Expand Down Expand Up @@ -83,7 +79,7 @@ def _run_ghc(hs, cc, inputs, outputs, mnemonic, arguments, params_file = None, e
executable = hs.ghc_wrapper,
mnemonic = mnemonic,
progress_message = progress_message,
env = dicts.add(env, cc.env),
env = env,
arguments = [compile_flags_file.path, flagsfile_prefix + flagsfile.path],
execution_requirements = execution_requirements,
)
Expand Down

0 comments on commit bb0cc21

Please sign in to comment.