brick
brick copied to clipboard
Please make brick compilation gracefully fail on Windows (cabal and stack)
brick does not currently support Windows because of the unix dependency. Is it possible to configure the brick.cabal so as to directly prevent Windows compilation with an informative error message? Not every potential user of brick knows that it does not work on that platform.
Pictures of the current situation:
Thanks!
Sorry I have taken a while to respond to this! When this was first opened, my first thought was "Yeah, this isn't great and it would be nice if it failed in a clearer way." But I think I've drug my feet on doing anything about it because I don't have any Windows systems to test on! If I write up a patch on a branch, would you be willing to give it a try on your system?
If you're willing to try it out, I pushed a patch to the misc/windows-build-failure
branch.
@simonmichael also tagging you in case you're interested/willing to try this out.
I'm going to close this because I don't currently have a path forward. I don't develop on Windows so I can't test a patch for this problem. If someone wants to provide evidence of testing for the branch I pushed, that would be helpful. In the mean time, as far as I am concerned the build failure on Windows is not that much worse than what was requested here.
Same here, testing of @jtdaugherty's patch from any windows-based haskeller welcome.
It works nicely. One could also add buildable: False
in the same conditional block.
@ShrykeWindgrace how does that change the error message that gets generated?
@jtdaugherty with
diff --git a/brick.cabal b/brick.cabal
index c8caf36..cfac317 100644
--- a/brick.cabal
+++ b/brick.cabal
@@ -118,8 +118,13 @@ library
Brick.Types.Internal
Brick.Widgets.Internal
+
+ if os(windows)
+ build-depends: brick-is-not-supported-on-windows < 0
+ --buildable: False
I get
stack build
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for brick-1.6:
brick-is-not-supported-on-windows must match <0, but the stack configuration has no specified version (no package with that name found, perhaps there is a typo in a package's build-depends or an
omission from the stack.yaml packages list?)
needed since brick is a build target.
...
with brick-is-not-supported-on-windows
highlighted in red and $LASTEXITCODE == 1
With
diff --git a/brick.cabal b/brick.cabal
index c8caf36..cfac317 100644
--- a/brick.cabal
+++ b/brick.cabal
@@ -118,8 +118,13 @@ library
Brick.Types.Internal
Brick.Widgets.Internal
+
+ if os(windows)
+ build-depends: brick-is-not-supported-on-windows < 0
+ buildable: False
I get no alarming output but I get $LASTEXITCODE == 0
.
@ShrykeWindgrace thanks! By $LASTEXITCODE
do you mean $?
?
@jtdaugherty in powershell - not quite. Copypasting from https://stackoverflow.com/a/10666052/3206165:
$LastExitCode
is the return code of native applications.$?
just returnsTrue
orFalse
depending on whether the last command (cmdlet or native) exited without error or not.
Seen from afar, $? == ($LastExitCode > 0)
, but there are always subtleties and nuances =)