views:

377

answers:

4

http://code.google.com/r/hectorchu-go-windows/source/list

If you could compile it successfully, I like to know the procedures of how to.

+3  A: 

Assuming you are using Hector's source tree:

  1. Install MinGW and MSYS, along with MSYS Bison and any other tools you think you'll find useful (vim, etc).
  2. Install ed from the GNUWin32 project.
  3. Install Python and Mercurial.
  4. Clone the hectorchu-go-windows mercurial repository to C:\Go.
  5. Run an MSYS shell (or rxvt). The rest of these are bash commands...
    1. mkdir $HOME/bin
    2. export PATH=$HOME/bin:$PATH
    3. export GOROOT=C:\\Go
    4. export GOARCH=386
    5. export GOOS=mingw
    6. cd /c/Go/src
    7. ./all.bash
    8. Correct errors as it spits them out at you, repeat step 10 until it starts building.

It's the same idea as on Linux or MacOS, basically.

However, I still stand by what I said in my comment above: this isn't necessarily going to generate anything that actually works yet. You'd be better served by waiting until this effort has merged into the main Go tree before tackling it, unless your interest is in assisting with the porting effort.

Update: there is now a mostly-functional pre-built windows port available, for those not interested in building the compiler themselves. However, given the rate of change of the project, the lack of formal releases (other than the hg "release" tag), and the possibility of Hector's changes being merged into the main branch soon, keeping up with development via source builds is likely to produce better results over time.

esm
thx anyway, I found some mingw related files, so I thought It could able to compile with mingw, but cant figure out why.
S.Mark
+2  A: 

Hector said he was only able to get as far as being able to compile and run an empty main. See issue 107:

http://code.google.com/p/go/issues/detail?id=107

There is still a lot of work to do in porting that, especially since the code has lots of dependencies on ptrace and syscall, not to mention the different threading models between Linux/BSD and Windows.

Alan S
+2  A: 

Just FYI, there is seems offical one now.

http://code.google.com/p/go-windows/

S.Mark
+1  A: 

Update:

There's a new thread on golang-nuts (started 26.03.2010) with a link to a recent build and some current building instructions (using MinGW+MSYS).

akavel