frasertweedale / hs-jose

Haskell JOSE and JWT library
http://hackage.haskell.org/package/jose
Apache License 2.0
122 stars 46 forks source link

jose-0.8.0.0 will not build on windows because of unix dependency #78

Closed reite closed 5 years ago

reite commented 5 years ago

When trying to build a package that depends on jose on windows with stack I get this error:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for jose-0.8.0.0:
    unix needed, but the stack configuration has no specified version  (latest matching version
         is 2.7.2.2)

The unix package is not supported on windows so this is not surprising. It seems to me that the unix package is only used in the example on this line to check if a path is a directory: https://github.com/frasertweedale/hs-jose/blob/71274bf64c0600c1d877152173a08a5bff7adf4d/example/Main.hs#L89

This could be replaced with the platform agnostic directory package. I could send a pull request for this change if you are interested, or would you solve it in another way?

frasertweedale commented 5 years ago

@reite there is a commit (https://github.com/frasertweedale/hs-jose/commit/b1260b732c548b3e42a64cc1551121b7533d0118) on master that disables building the executable by default. (That is the component that depends on unix package). So I consider this fixed and will mark it closed.

But for now you should be able to cabal new-build lib:jose to build only the library, and not the executable. Not sure what the equivalent is stack though. But if you're using stack you can pin your dependency to an exact Git commit so you can use the commit from master anyway.