Skip to content

Commit ea1658b

Browse files
committed
WIP Pass cc_wrapper its path via env var
The inherited RUNFILES_* environment variables aren't correct. Pass in a path to try and find the correct directory/manifest. Only prints currently.
1 parent 3a5c4fd commit ea1658b

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

haskell/cc.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def cc_interop_info(ctx, override_cc_toolchain = None):
147147
env["CC_WRAPPER_PLATFORM"] = "linux"
148148

149149
env["CC_WRAPPER_CC_PATH"] = real_cc_path
150+
env["CC_WRAPPER_PATH"] = cc_wrapper.executable.path
150151
env["CC_WRAPPER_CPU"] = cc_toolchain.cpu
151152

152153
cc_libraries_info = deps_HaskellCcLibrariesInfo(

haskell/private/cc_wrapper.py.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,10 @@ def find_cc():
10261026
# being called from a GHCi REPL then we need to find this wrapper
10271027
# script using Bazel runfiles.
10281028
r = bazel_runfiles.Create()
1029+
if r is None:
1030+
exe_path = os.environ.get("CC_WRAPPER_PATH", None)
1031+
if exe_path is not None:
1032+
r = bazel_runfiles.CreateDirectoryBased(exe_path + ".runfiles")
10291033
cc = r.Rlocation("/".join([WORKSPACE, CC]))
10301034
if cc is None and is_windows():
10311035
# We must use "/" instead of os.path.join on Windows, because the

0 commit comments

Comments
 (0)