driskell / log-courier

The Log Courier Suite is a set of lightweight tools created to ship and process log files speedily and securely, with low resource usage, to Elasticsearch or Logstash instances.
Other
419 stars 107 forks source link

Cannot build for Windows #211

Closed jbflowers closed 8 years ago

jbflowers commented 9 years ago

Firstly, I don't believe mssysgit comes with "make" anymore. I had to install and add it to the path myself.

After installing, using mssysgit I get the following error after calling "make":

"c:\Program: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)

Added "SHELL=C:/Windows/System32/cmd.exe" to the top of the Makefile and got this error:

The system cannot find the path specified. build/fix_version "" 'build' is not recognized as an internal or external command, operable program or batch file. make: *\ [fix_version] Error 1

driskell commented 9 years ago

Are you running make in the msysgit console or in cmd.exe? It will only work in the msysgit console. Adding SHELL=cmd.exe will most certainly break it too as it will force make itself to use the wrong console.

Can you try running make from a directory path with no spaces? It looks from the first error it's running from c:\Program Files and that might be where it is breaking up.

I'll do some more testing soon to check the guide still works.

jbflowers commented 9 years ago

Installed make to "C:\GnuWin32\bin" and cloned log-courier to "C:\". Changed my PATH to remove the old entry for "make" and added the new one. Followed the steps outlined in "Building for Windows". Getting this error now:

$ make c:\GnuWin32\bin\make.exe: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)

driskell commented 9 years ago

What version and architecture of Windows?

jbflowers commented 9 years ago

Windows 7 Ultimate x64

jbflowers commented 9 years ago

Just an update for anyone that needs a working Windows version, you can cross-compile relatively easily from Linux by:

  1. Building go for supported platforms, and
  2. Set your GOOS and GOARCH environment variables to "windows" and "amd64" respectively with export GOOS="windows" and export GOARCH="amd64"

Then simply follow the normal building instructions and a "windows_amd64" directory will be generated in "log-courier/bin" containing the Windows builds.

ghost commented 9 years ago

These are the steps that I use for building Log Courier in Windows, assuming that you installed Go and msysgit already:

  1. Open git bash
  2. Clone the Log Courier repository.
  3. cd to the log-courier folder
  4. Run /c/mingw/bin/mingw32-make.exe

I found that there was no need to set the Go paths myself; the Go installer should have already done that for you.

driskell commented 9 years ago

I think the problem here is the bash requirement. That's why I specified msysGit. Removing dependency on Git (so you can download .zip and make) is easy to be fair.

I think at this point rather than me trying to test and reproduce and find out if something msysgit has changed, I will put into the roadmap to just write Windows Shell or Powershell script counterparts for all the build utilities, so the only thing needed is GNU make and Git.

If anyone wants to help it's basically just making a Windows version of build/fix_version and then removing all Linux syntax from Makefile - mostly by dragging the bits out into external scripts in build. Makefile can detect Windows and run different scripts based on file extension (sh vs bat or ps1). Only grey area would be the tag handling in Makefile for the with=zmq flag to make it save the flag for future make runs without having to specify it again - but to be fair ZeroMQ is going in version 2 so I wouldn't mind losing that (think it's really only useful when I'm developing heh.)

driskell commented 9 years ago

I'm also looking into cross compiling possibilities so I can provide a EXE on the GitHub releases.

driskell commented 8 years ago

I've completely reworked how building works, now only relying on Golang itself to compile. Everything should be fairly clean. I have yet to test it but as it's in the works in master branch and the docs are updated there, once I've tested and ironed out this will be all resolved.

jfrome commented 8 years ago

I was able to successfully build the 2.x Windows binaries using the instructions here: https://github.com/driskell/log-courier/blob/master/docs/BuildingFromSource.md#windows The only additional step currently required is to run git checkout master before running the go generate ./lc-admin ./lc-lib/core command, since the 1.x branch is the repo default.

driskell commented 8 years ago

Thanks, that's as expected until I switch the main branch. Will close now!