New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows support for Cabal python wrapper #1133
Conversation
8675c98
to
87cec43
Compare
|
||
def _prepare_cabal_inputs(hs, cc, unix, dep_info, cc_info, component, package_id, tool_inputs, tool_input_manifests, cabal, setup, srcs, flags, cabal_wrapper, package_database): | ||
"""Compute Cabal wrapper, arguments, inputs.""" | ||
with_profiling = is_profiling_enabled(hs) | ||
|
||
(ghci_extra_libs, env) = get_ghci_extra_libs(hs, cc_info) | ||
env.update(**hs.env) | ||
env["PATH"] = _make_path(hs, tool_inputs) + ":" + ":".join(unix.paths) | ||
path_list_sep = ";" if hs.toolchain.is_windows else ":" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You can move this to the toplevel to avoid having to repeat it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, turns out this is a good opportunity to also refactor the path separator in LD_LIBRARY_PATH
, so I'll do that in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #1134
The execroot path can contain special characters, e.g. `\` on Windows.
Same as other paths, e.g. `LD_LIBRARY_PATH`. The reason is that Windows paths can contain ':', e.g. `C:\foo\bar`.
Use bazel_runfiles on Windows to find executables. By default Bazel does not generated symlinks to binaries in the execroot, so relative paths to executables will not work. Instead, they must be looked up in the runfiles manifest using bazel_runfiles.
To exit early if any of the `configure`, `build`, `install` steps fails.
Bazel 1.1 requires these now.
This version fixes the issue of `sh_binary`s called with upper-case `.EXE` extension not finding the actual script file. This issue was triggered by Cabal packages with `./configure` scripts, which called `cc` in 8.3 file name format.
Requires Bazel 1.1.0 on Windows
87cec43
to
2a775ae
Compare
C:\foo\bar
)cc_wrapper
on Windows, see sh_binary wrapper fails on upper case letters in file extension on Windows bazelbuild/bazel#9390.network
andlanguage-c
on Windows - these use./configure
scripts and are more problematic on Windows.