Windows support for haskell_cabal_* and stack_snapshot - #1074
Merged
Conversation
- The stack binary is called `stack.exe` on Windows.
- We cannot assume that `uname -m` is available on Windows to determine
the CPU architecture. We use `reg QUERY` instead, to lookup the
architecture in the registry.
- If the OS or architecture cannot be determined then fetching the stack
bindist will fail. We add descriptive error messages for this case.
`ctx.actions.run` with `executable = cabal_wrapper` fails on Windows:
java.io.IOException: ERROR: src/main/native/windows/process.cc(184):
CreateProcessW("...\cabal_wrapper-XYZ.sh" ...):
%1 is not a valid Win32 application
The problem is that the generated file is a bash script, not an `.exe`.
This change uses `run_shell` instead, which supports executing bash
scripts on Windows.
``` Setup.hs: Operating system: windows, does not support relocatable builds ```
So far zlib was only provisioned through nixpkgs, which is not available on Windows. This adds a version built from source using Bazel.
aherrmann
force-pushed
the
stack-windows
branch
from
September 5, 2019 13:48
8b81baa to
2ac851a
Compare
aherrmann
force-pushed
the
stack-windows
branch
from
September 5, 2019 14:12
2ac851a to
952bf76
Compare
aherrmann
force-pushed
the
stack-windows
branch
from
September 5, 2019 14:33
952bf76 to
5c712e5
Compare
mboes
approved these changes
Sep 8, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stack --> stack.exeon Windowsctx.actions.rundoesn't work with bash scripts on Windows, userun_shellinstead--enable-relocatableis not supported on Windowshaskell_cabal_binaryis a.exefile on Windowslibzon Windows where nixpkgs is not availablehaskell_cabal_library|binaryandstack_snapshoton Windows CI