Skip to content

user.Current panic in darwin-amd64 when crosscompiled from linux-amd64 #6376

Closed
@calmh

Description

@calmh
Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What steps will reproduce the problem?

Compile and run http://play.golang.org/p/fI0-SKcrXR

This works as expected (i.e. prints current user details) on both linux-amd64 and
darwin-amd64. However, when using the cross compilation instructions at
http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go to build
a darwin-amd64 binary from linux-amd64 it does not. Both environments running go 1.1.2
built from source.

What is the expected output?

jb@jborg-mbp:~ $ ./homedir-built-locally
&{502 20 jb Jakob Borg /Users/jb} <nil>

What do you see instead?

jb@jborg-mbp:~ $ ./homedir-crosscompiled-in-linux
<nil> user: Current not implemented on darwin/amd64

Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Linux, Mac OS X

Which version are you using?  (run 'go version')

b@ps-build1:~ % go version
go version go1.1.2 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions