Skip to content

Commit

Permalink
Merge pull request #1515 from tweag/fd/ghc-cc-wrapper-env
Browse files Browse the repository at this point in the history
Set cc wrapper env vars when running ghc
  • Loading branch information
mergify[bot] authored Mar 25, 2021
2 parents 183f7f3 + bb0cc21 commit 377db34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
5 changes: 1 addition & 4 deletions haskell/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,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

0 comments on commit 377db34

Please sign in to comment.