yamadapc / stack-run

Like cabal run for stack
MIT License
29 stars 10 forks source link

Is stack-run available on Windows? #6

Closed dlorch closed 7 years ago

dlorch commented 7 years ago

I don't see any indications to the contrary, but installation fails on my machine:

c:\sr>stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 x86_64 hpack-0.15.0

c:\sr>stack install stack-run

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

In the dependencies for unix-2.7.2.0:
    unbuildable must match <0, but the stack configuration has no specified version

Plan construction failed.

I am running Windows 7 Enterprise.

yamadapc commented 7 years ago

No... Sorry

dlorch commented 7 years ago

No problem. Maybe you could add an info to the README?

yamadapc commented 7 years ago

Updated.

It's probably vty that using unix, I could just disable the interactive bits; if you want to do that this is just a very small program. I think it's the interactive mode stack run -i with a list prompt is what doesn't support Windows.

dlorch commented 7 years ago

My level of Haskell is still very low so unfortunately I can't provide you with a patch. I'd appreciate if you could consider doing what you suggested and simply remove the interactive mode for Windows users. stack-run is integrated into Haskelly and this might be useful for other users, too.

moodmosaic commented 7 years ago

Actually I've run into this issue as well. Haskelly looks like a decent Haskell extension and so it'd be nice with Windows support in stack-run.

yamadapc commented 7 years ago

Accidentally closed the issue; pushing fixes to get the project building on AppVeyor, then if someone could test an updated version I'd really appreciate it - so I don't have to set-up a Windows VM for Haskell.

yamadapc commented 7 years ago

Aahhh... Okay, supporting Windows isn't as straightforward as I'd like.

It should work if projectroot is updated to work on Windows. I'm not going to do this at this time. I suggest Haskelly use something else or someone that knows Windows to provide a simple patch there.

yamadapc commented 7 years ago

Currently the issue seems to be just Windows doesn't have glob.h: https://ci.appveyor.com/project/yamadapc/projectroot

moodmosaic commented 7 years ago

Any hints on what is that header file?

yamadapc commented 7 years ago

It's a globbing library; overall really simple to remove the dependency...

The only real "pattern" is to match *.cabal. https://github.com/yamadapc/projectroot/blob/master/libprojectroot.c#L39

moodmosaic commented 7 years ago

Then I guess we need a fork of projectroot in stack-run that matches only *.cabal files, right?

dfarmer commented 7 years ago

I'm another Haskelly user that would like to see this working on Windows. If I wanted to take a crack at this would you consider a patch that dropped projectroot all together and just reimplemented its functionality using filepath (or of course adding a glob'ing Haskell lib, I figured you'd probably prefer not to add another dependency though).

yamadapc commented 7 years ago

Yes, I think projectroot should just be removed or implemented very simply in Haskell only, it's a shame since it's all very simple.

@dfarmer If you can implement getCabalProjectRootCurrent :: IO (Maybe FilePath) in Haskell,

getCabalProjectRootCurrent :: IO (Maybe FilePath)
getCabalProjectRootCurrent = do
   cwd <- getCurrentDirectory
   -- while cwd isn't the root look for `.cabal` and go up

Fine if it just looks for extname .cabal.

I'd be happy to accept.

yamadapc commented 7 years ago

v0.1.1.4 should work on windows

moodmosaic commented 7 years ago

🎉