-
Notifications
You must be signed in to change notification settings - Fork 81
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
Invoke a runghc for the execution platform in the cabal_wrapper #1510
Conversation
5c2a480
to
64e01f3
Compare
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.
On Windows this fails with
runghc2.exe: C:\users\runneradmin\_bazel_runneradmin\z5des2pa\execroot\YOUR_PROJECT_NAME_HERE\bazel-out\host\bin\external\rules_haskell\haskell\ghc-stage2.exe: rawSystem: does not exist (No such file or directory)
I suspect the issue is that ctx.actions.symlink
creates a copy instead of a symlink on Windows. (Symlinks not being available on Windows by default). runghc
then tries to find GHC relative to itself and can't. One way to work around this would be to not create a symlink but a wrapper script that calls runghc
. That will require two rules: One to generate the source file for the script and one sh_binary
that makes the script executable.
7d1c741
to
12d2fd6
Compare
8f8854c
to
1dcce54
Compare
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.
Looks good, thank you!
In this PR cabal_wrapper always uses a runghc binary from a toolchain that targets the execution platform. Otherwise, there would be no way to execute Setup.hs when cross-compiling.