Win32 (experimental) build of release 2010-05-27

25 views
Skip to first unread message

Joe Poirier

unread,
May 27, 2010, 9:51:12 PM5/27/10
to golang-nuts

John C.

unread,
May 28, 2010, 1:19:39 PM5/28/10
to golang-nuts
Joe,

Thanks so much for doing these builds. They are very helpful.

I would really like to see the "http" package make it into the Windows
build. Do you know which dependencies stand in the way of this?

John C.

Joseph Poirier

unread,
May 28, 2010, 3:22:36 PM5/28/10
to John C., golang-nuts
On Fri, May 28, 2010 at 12:19 PM, John C. <jscroc...@gmail.com> wrote:
Joe,

Thanks so much for doing these builds.  They are very helpful.

Glad to hear it! 


I would really like to see the "http" package make it into the Windows
build.  Do you know which dependencies stand in the way of this?

John C.

The "net" package, which I know Alex is currently working on.

-joe

Adrian Mihalcea

unread,
May 29, 2010, 12:21:28 PM5/29/10
to golang-nuts
Great work!

This is the second package I download from the windows port, but it
seems to be missing the "go/parser" package. Is there a reason for
that? Am I doing something wrong?

Adrian

On May 28, 10:22 pm, Joseph Poirier <jdpoir...@gmail.com> wrote:

Joseph Poirier

unread,
May 29, 2010, 6:26:24 PM5/29/10
to Adrian Mihalcea, golang-nuts
On Sat, May 29, 2010 at 11:21 AM, Adrian Mihalcea <adrian....@gmail.com> wrote:
Great work!

This is the second package I download from the windows port, but it
seems to be missing the "go/parser" package. Is there a reason for
that? Am I doing something wrong?

 Adrian

That's odd because the only go module that's excluded from the build in the make file is go/doc.

It looks like the only mods in the go package for the latest release were in go/doc, so you should be able to copy the go package over from the previous windows build.

Thanks for letting me know about the missing package and sorry for the inconvenience!

-joe

Paulo Pinto

unread,
May 30, 2010, 4:20:49 AM5/30/10
to golang-nuts
Hi,

any way to track down the Windows port development? Like to see what
is still missing and pending work?

The Windows port Wiki seems kind of dead, and the existing information
is also not that much.

--
Paulo

On May 30, 12:26 am, Joseph Poirier <jdpoir...@gmail.com> wrote:
> On Sat, May 29, 2010 at 11:21 AM, Adrian Mihalcea <adrian.mihal...@gmail.com

mizipzor

unread,
May 30, 2010, 5:07:40 PM5/30/10
to golang-nuts
I tried compiling the source on windows for a while. But then I gave
up and tried the language in Linux (much easier).

Is your build unpatched? If not so, can I found the sources somewhere?

Also, as Paulo said, Im quite interested in following the development
of this. Any goto place for news?

Andrew Gerrand

unread,
May 30, 2010, 5:25:00 PM5/30/10
to mizipzor, golang-nuts
Are you subscribed to golang-dev? I am going to start a thread there about it.

David Roundy

unread,
Jun 5, 2010, 11:33:28 AM6/5/10
to Joe Poirier, golang-nuts
Are there any instructions for how to build for windows? In
particular, I'd be interested in cross-compiling from linux to
windows, but I don't know what parts of the build should work. e.g. I
get a link failure building cov. I'd love to have an all-windows.bash
added (akin to all-nacl.bash), so that I could easily build everything
that can (yet) be built targeting windows.

David

On Thu, May 27, 2010 at 6:51 PM, Joe Poirier <jdpo...@gmail.com> wrote:
> Download it here: http://gomingw.googlecode.com/files/gowin32_2010-05-27.zip
>
> -joe
>

--
David Roundy

brainman

unread,
Jun 5, 2010, 7:02:54 PM6/5/10
to golang-nuts
> ... I'd be interested in cross-compiling from linux to
> windows, but I don't know what parts of the build should work.  e.g. I
> get a link failure building cov.  

I use linux to build windows programs. This is what I do:

1) Build go on linux as per http://golang.org/doc/install.html

...
cd $GOROOT/src
./make.bash

this will make all build tools for linux and copy them into $GOBIN
and, also, it will build all linux packages and copy results into
$GOROOT/pkg/linux_386/.

2) Build windows versions of all packages that have been converted so
far:

extern GOOS=windows
cd $GOROOT/src/pkg
make clean
./deps.bash
make install

this will build windows versions of packages and install them into
$GOROOT/pkg/windows_386/. Build will fail once it reaches net package,
but that is expected - net has not been implemented yet.

3) Ready to write hello.go (you can use any package you can see in
$GOROOT/pkg/windows_386/):

extern GOOS=windows
... use 8g and 8l to build you program ...
... copy you program to windows (make sure it has .exe extension) ...
... run your program on windows ...


Alex

abiosoft

unread,
Jun 5, 2010, 8:09:48 PM6/5/10
to golang-nuts
never thought of this before. Interesting.

On Jun 6, 12:02 am, brainman <alex.brain...@gmail.com> wrote:
> > ... I'd be interested in cross-compiling from linux to
> > windows, but I don't know what parts of the build should work.  e.g. I
> > get a link failure building cov.  
>
> I use linux to build windows programs. This is what I do:
>
> 1) Build go on linux as perhttp://golang.org/doc/install.html

abiosoft

unread,
Jun 5, 2010, 8:51:19 PM6/5/10
to golang-nuts
the cross compilation is working good. just compiled some codes with
GOOS=windows and the resulting binaries ran perfectly on my virtualbox
windows.

Joe Poirier

unread,
Jun 5, 2010, 11:09:33 PM6/5/10
to golang-nuts
On Jun 5, 6:02 pm, brainman <alex.brain...@gmail.com> wrote:
> > ... I'd be interested in cross-compiling from linux to
> > windows, but I don't know what parts of the build should work.  e.g. I
> > get a link failure building cov.  
>
> I use linux to build windows programs. This is what I do:
>
> 1) Build go on linux as perhttp://golang.org/doc/install.html
>
> ...
> cd $GOROOT/src
> ./make.bash
>
> this will make all build tools for linux and copy them into $GOBIN
> and, also, it will build all linux packages and copy results into
> $GOROOT/pkg/linux_386/.
>
> 2) Build windows versions of all packages that have been converted so
> far:
>
> extern GOOS=windows
> cd $GOROOT/src/pkg
> make clean
> ./deps.bash
> make install
>
> this will build windows versions of packages and install them into
> $GOROOT/pkg/windows_386/. Build will fail once it reaches net package,
> but that is expected - net has not been implemented yet.
>
> 3) Ready to write hello.go (you can use any package you can see in
> $GOROOT/pkg/windows_386/):
>
> extern GOOS=windows
> ... use 8g and 8l to build you program ...
> ... copy you program to windows (make sure it has .exe extension) ...
> ... run your program on windows ...
>
> Alex

The package exclusions are listed in the make files (src/pkg/Makefile)
of the windows builds (http://code.google.com/p/gomingw/downloads/
list). For the latest build, gowin32_2010-05-27.zip, they're:

# archive/tar\
# crypto/tls\
# expvar\
# go/doc\
# http\
# http/pprof\
# net\
# netchan\
# nntp\
# rpc\
# rpc/jsonrpc\
# syslog\
# websocket\

Alternatively, one can simply copy the go/pkg/windows_386 folder from
the latest windows build zip file to the Go pkg folder of the non-
windows box.

-joe

brainman

unread,
Jun 5, 2010, 11:16:12 PM6/5/10
to golang-nuts
> the cross compilation is working good. just compiled some codes with
> GOOS=windows and the resulting binaries ran perfectly on my virtualbox
> windows.
>

You can do more. If you use windows to develop (GOOS=windows), you
could build linux binary which will happily run on linux too:

set GOOS=linux
... build linux binary ...
... copy to linux pc ...
... run your binary on linux ...

In fact, it works for any go supported os / arch. Just set GOOS/
GOARCH, build go standard packages into $GOROOT/pkg/$GOOS_$GOARCH/ and
then build binaries for any platform to your heart content.


Alex

abiosoft

unread,
Jun 6, 2010, 7:48:12 AM6/6/10
to golang-nuts
I built the calculator example for windows but got the following error
after executing it on windows. I know there should be a way out.

C:\Documents and Settings\Abiosoft\Desktop>calculator.exe
throw: cgocall unavailable

panic PC=0x588d60
throw+0x48 /go/src/pkg/runtime/runtime.c:73
throw(0xffffffff, 0x489210)
cgocall+0x32 /go/src/pkg/runtime/cgocall.c:19
cgocall(0x489210, 0x4060f9, 0x8)
cmalloc+0x4a /go/src/pkg/runtime/cgocall.c:103
cmalloc(0x0, 0x588d98)
gtk._C_CString+0x29 /home/abiosoft/gocode/go-gtk/gtk/_cgo_defun.c:537
gtk._C_CString(0xf, 0x3fffffff, 0x588dc0, 0x4913c4)
gtk.Init+0x165 /home/abiosoft/gocode/go-gtk/gtk/gtk.cgo1.go:3107
gtk.Init(0x582000, 0xe)
main.main+0x31 /home/abiosoft/gocode/gocalc/gui.go:52
main.main()
mainstart+0xf 386/asm.s:83
mainstart()
goexit /go/src/pkg/runtime/proc.c:145
goexit()

brainman

unread,
Jun 6, 2010, 7:18:17 PM6/6/10
to golang-nuts
> I built the calculator example for windows but got the following error
> after executing it on windows. I know there should be a way out.
>
> C:\Documents and Settings\Abiosoft\Desktop>calculator.exe
> throw: cgocall unavailable
>

I do not not much about cgo, but maybe it hasn't been ported to
windows yet.


Alex
Reply all
Reply to author
Forward
0 new messages