Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service failing to start #4

Open
3noch opened this issue Nov 7, 2014 · 16 comments
Open

Service failing to start #4

3noch opened this issue Nov 7, 2014 · 16 comments

Comments

@3noch
Copy link

3noch commented Nov 7, 2014

I'm trying to run both the simple and official examples, but getting the following error:

[SC] StartService FAILED 1053:

The service did not respond to the start or control request in a timely fashion.

I'm using GHC 7.8.3 on Windows 8.1 x64 with the following cabal config:

  Extra-Libraries: Advapi32
  Extra-Lib-Dirs: "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x64"

Any ideas?

@mikesteele81
Copy link
Owner

It's been awhile since I tried running those examples. I'll get back to you
after going through the process.

Are you running the 32-bit version of GHC?

On Fri, Nov 7, 2014 at 12:33 PM, Elliot Cameron notifications@github.com
wrote:

I'm trying to run both the simple and official examples, but getting the
following error:

[SC] StartService FAILED 1053:

The service did not respond to the start or control request in a timely fashion.

I'm using GHC 7.8.3 on Windows 8.1 x64 with the following cabal config:

Extra-Libraries: Advapi32
Extra-Lib-Dirs: "C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64"

Any ideas?


Reply to this email directly or view it on GitHub
#4.

-- Michael Steele

@3noch
Copy link
Author

3noch commented Nov 7, 2014

I'm not precisely sure if GHC is 64-bit or not. But I would guess it is since I downloaded it from the "ghc-7.8.3-x86_64-unknown-mingw32.tar.bz2" link. Thanks for the lightning fast reply!

@3noch
Copy link
Author

3noch commented Nov 7, 2014

I just re-read your question. I would guess that GHC is 64-bit on my machine.

@mikesteele81
Copy link
Owner

The 64-bit version of GHC will not work because I make assumptions about pointer sizes in the marshaling code. I should have noted that in the cabal file's description. Sorry for any frustration you've had.

@3noch
Copy link
Author

3noch commented Nov 7, 2014

Ah ok. I'll try it with the 32-bit version. How hard would that be to fix?

@mikesteele81
Copy link
Owner

Supporting both 32-bit and 64-bit versions of GHC would require that I either sprinkle the code with CPP directives or use a marshalling helper such as c2hs or hsc2hs.

My preference would be to use c2hs, but as far as I know the current official release does not support marshaling function pointers in Windows. The c2hs developers have accepted a patch for this, but I don't think that has made it into an official release. Win32-services needs to pass function pointers around behind the scenes, so using c2hs is not an option at this time.

At the time I first published Win32-services there was no 64-bit version of GHC for Windows. This is probably why I don't mention lack of 64-bit support in the description.

@3noch
Copy link
Author

3noch commented Nov 7, 2014

That makes sense. Unfortunately, it looks like it can't find Advapi32 on my 64-bit machine?

C:\Code\dns-server>cabal install Win32-services --extra-lib-dirs="C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86"
Resolving dependencies...
Notice: installing into a sandbox located at C:\Code\dns-server\.cabal-sandbox
Configuring Win32-services-0.2.4...
Failed to install Win32-services-0.2.4
Build log ( C:\Code\dns-server\.cabal-sandbox\logs\Win32-services-0.2.4.log ):
Configuring Win32-services-0.2.4...
setup-Simple-Cabal-1.18.1.3-i386-windows-ghc-7.8.3.exe: Missing dependency on
a foreign library:
* Missing C library: Advapi32
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
Win32-services-0.2.4 failed during the configure step. The exception was:
ExitFailure 1

@mikesteele81
Copy link
Owner

Your extra-lib-dirs argument may require double backslash characters.

@mikesteele81
Copy link
Owner

If that doesn't work, then I really should double check whether the examples still build on my computer.

@3noch
Copy link
Author

3noch commented Nov 7, 2014

That didn't seem to work. :( Thanks for your help!

@mikesteele81
Copy link
Owner

I get the same error as you when trying to use the --extra-lib-dirs command-line argument to cabal-install. Unpacking Win32-services, and then editing the .cabal file as shown on the hackage page allows me to install the package.

Does that help get past your error?

@3noch
Copy link
Author

3noch commented Nov 14, 2014

Ok. That makes sense. That would likely do the trick.

P.S. Does Cabal have a bug then?

@mikesteele81
Copy link
Owner

This issue has been quiet, so here's a quick update. GHC 7.10.1 and c2hs 0.25.1 were both released last week, so I may have time to release a new version in the near future with 32-bit and 64-bit compatibility.

@3noch
Copy link
Author

3noch commented Mar 30, 2015

Excellent! I would gladly like to start writing/porting our services in Haskell.

@drchaos
Copy link

drchaos commented Oct 13, 2015

Seems like I have the same trouble. @mikesteele81 , do you have plans to fix this issue at the nearest time?

@mikesteele81
Copy link
Owner

32-bit GHC is sufficient for what I use Win32-services for. Because of this, making the necessary changes to support both 32-bit and 64-bit GHC has been given lower priority than other tasks.

I would like to see 64-bit GHC supported, and would be fine with just about any solution at this point. The issue will have to remain open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants