psibi / tldr-hs

Haskell tldr client
BSD 3-Clause "New" or "Revised" License
92 stars 14 forks source link

tldr-0.2.5 wouldn't build on windows10 #9

Closed ShrykeWindgrace closed 6 years ago

ShrykeWindgrace commented 6 years ago

If I install it with stack install tldr, I get

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

In the dependencies for tldr-0.2.5:
    ansi-terminal must match -any, but the stack configuration has no specified version (latest
                  matching version is 0.8)
    cmark must match -any, but the stack configuration has no specified version (latest matching
          version is 0.5.6)
    optparse-applicative must match -any, but the stack configuration has no specified version
                         (latest matching version is 0.14.0.0)
    semigroups must match -any, but the stack configuration has no specified version (latest
               matching version is 0.18.3)
    shell-conduit must match >=4.6.0, but the stack configuration has no specified version (latest
                  matching version is 4.6.1)
    text must match -any, but the stack configuration has no specified version (latest matching
         version is 1.2.3.0)
needed since tldr is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps
    in C:\sr\global-project\stack.yaml:

- ansi-terminal-0.8
- cmark-0.5.6
- optparse-applicative-0.14.0.0
- semigroups-0.18.3
- shell-conduit-4.6.1
- text-1.2.3.0

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

If I do it manually stack unpack tldr ; cd tldr-0.2.5 ; stack init ; stack build I get

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

In the dependencies for shell-conduit-4.6.1:
    unix must match >=2.7.0.1, but the stack configuration has no specified version (latest matching
         version is 2.7.2.2)
needed due to tldr-0.2.5 -> shell-conduit-4.6.1

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps
    in E:\nosave\Projects\Haskell\StackPackages\tldr-0.2.5\stack.yaml:

- unix-2.7.2.2

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.

When I follow the advice of stack to add the unix dependency in extra-deps, I get

    unix is a library dependency, but the package provides no library

and then it snowballs from there.

What would be the correct approach to build tldr on a win10 machine?

Conf: stack 1.6.3, win10 with all updates, tldr-0.2.5

psibi commented 6 years ago

Can you try this:

stack install tldr-0.2.5 --resolver nightly-2018-01-21

Infact, even this should work:

stack install tldr-0.2.5 --resolver lts-10.3
ShrykeWindgrace commented 6 years ago

Both stack install tldr-0.2.5 --resolver nightly-2018-01-21 and stack install tldr-0.2.5 --resolver lts-10.3 give

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

In the dependencies for shell-conduit-4.6.1:
    unix must match >=2.7.0.1, but the stack configuration has no specified version (latest matching
         version is 2.7.2.2)
needed due to tldr-0.2.5 -> shell-conduit-4.6.1

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps
    in C:\sr\global-project\stack.yaml:

- unix-2.7.2.2

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * You may also want to try using the 'stack solver' command.

Plan construction failed.
ShrykeWindgrace commented 6 years ago

On a second thought, why do we need a dependency on the unix package on a windows machine?

psibi commented 6 years ago

unix is a transitive dependency. My guess is that shell-conduit package is not portable and doesn't work on Windows. A possible solution is to move to typed-process for the things I'm using shell-conduit for. Want to send a PR ?

ShrykeWindgrace commented 6 years ago

Ok, I see. I will take a look at the code, if it is not too complicated, I'll send a PR, and if I'm out of my depth, I'll let you know, too=)

psibi commented 6 years ago

👍

ShrykeWindgrace commented 6 years ago

Hi! I managed to build a working version (on both ubuntu16 and win10) with, as you suggested, typed-process in place of shell-conduit. I'll make some cleanup in my code and I will send a PR later today.

psibi commented 6 years ago

Awesome!

On Mon, Jan 29, 2018, 9:43 PM ShrykeWindgrace notifications@github.com wrote:

Hi! I managed to build a working version (on both ubuntu16 and win10) with, as you suggested, typed-process in place of shell-conduit. I'll make some cleanup in my code and I will send a PR later today.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/psibi/tldr-hs/issues/9#issuecomment-361296574, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtAxTH0E39hEL-oVlHhjpZzQk2o58YWks5tPe4TgaJpZM4Rpef5 .

psibi commented 6 years ago

Closing since this is fixed by #10

psibi commented 6 years ago

I have a released a new version in Hackage with your fixes. Thanks!

ShrykeWindgrace commented 6 years ago

That's great=)