"unsupported GOARCH amd64" error building on Windows

821 views
Skip to first unread message

Jens Alfke

unread,
May 20, 2014, 3:10:53 PM5/20/14
to golang-nuts
I’m asking this on behalf of my team’s build engineer, who’s trying & failing to produce a Windows 64-bit build of our product. Here’s his report of what happens:

> GOROOT=/usr/local/go/1.2
> . . .
> Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Git\cmd;C:\cygwin64\usr\local\go\1.2\bin
>
>
> => set CGO_ENABLED=1
>
> => echo GOOS=windows GOARCH=amd64
> GOOS=windows GOARCH=amd64
>
> => go build -v github.com\couchbaselabs\sync_gateway
> 2014/05/14 19:07:31 unsupported GOARCH amd64

Any ideas? Apologies if the answer is obvious, but though I’m experienced with Go on Mac and Linux I’ve never used it on Windows so I don’t know where to start…

—Jens

brainman

unread,
May 20, 2014, 7:27:43 PM5/20/14
to golan...@googlegroups.com
On Wednesday, 21 May 2014 05:10:53 UTC+10, Jens Alfke wrote:
> > GOROOT=/usr/local/go/1.2 

This is not a windows path. Go expects all files to have correct paths (as per OS requirements).

> > 2014/05/14 19:07:31 unsupported GOARCH amd64 

# grep 'unsupported GOARCH' * -r
pkg/go/build/build.go:  return "", errors.New("unsupported GOARCH " + goarch)
#

but I don't see how is it possible.

> ... I don’t know where to start… 

Do not use non standard shells. Try windows command prompt to build your program first.

Alex

Jesse McNelis

unread,
May 20, 2014, 8:00:25 PM5/20/14
to Jens Alfke, golang-nuts
On Wed, May 21, 2014 at 5:10 AM, Jens Alfke <je...@mooseyard.com> wrote:
>> => echo GOOS=windows GOARCH=amd64
>> GOOS=windows GOARCH=amd64

...this doesn't show what GOARCH is set to.

Jens Alfke

unread,
May 20, 2014, 11:37:48 PM5/20/14
to Jesse McNelis, golang-nuts

On May 20, 2014, at 5:00 PM, Jesse McNelis <jes...@jessta.id.au> wrote:

...this doesn't show what GOARCH is set to.

Yes, and I’m not familiar with the details of the build script he’s using, but since the error says "unsupported GOARCH amd64” I’m assuming it actually is set to that value.

—Jens

Jesse McNelis

unread,
May 21, 2014, 12:27:01 AM5/21/14
to Jens Alfke, golang-nuts
My assumption is that GOARCH is set to some value that looks like
amd64, but isn't.
Perhaps there is a whitespace character in there. newline, carriage
return, space, tab etc.
or their terminal has some weird encoding.

It's either that or string comparison is broken in Go.
Message has been deleted

Uriel Fanelli

unread,
Apr 24, 2015, 6:12:22 PM4/24/15
to golan...@googlegroups.com
I had the same problem. Sadly, it was a problem related to GOARCH="amd64" instead of GOARCH=amd64

Philippe Quesnel

unread,
Apr 25, 2015, 12:52:29 PM4/25/15
to golan...@googlegroups.com
it could even be caused by an extra space at the end of the amd64 !! (ie "amd64 ")
I don't remember if I had that problem on Linux or Windows, but it is something to check for !
Reply all
Reply to author
Forward
0 new messages