Bug 1135152 - user: Current not implemented on linux/amd64
Summary: user: Current not implemented on linux/amd64
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: golang
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Batts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-29 00:28 UTC by Adam Goode
Modified: 2015-12-02 16:14 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 03:35:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Goode 2014-08-29 00:28:53 UTC
Description of problem:
golang seems to be using some cross-compiled components which are causing problems. Specifically, Fedora has exactly the problem described here:
http://stackoverflow.com/questions/20609415/cross-compiling-user-current-not-implemented-on-linux-amd64

Here is the sample code from that page:

package main

import (
    "fmt"
    "os/user"
)

func main() {
    fmt.Println(user.Current())
}


You can build the sample code and see the problem directly:

$ go build ./current.go
$ ./current 
<nil> user: Current not implemented on linux/amd64



Version-Release number of selected component (if applicable):
golang-1.2.2-22.fc20.x86_64


How reproducible:
Always

Comment 1 Adam Goode 2014-08-29 00:29:34 UTC
Here is a related upstream bug that describes this behavior:
https://code.google.com/p/go/issues/detail?id=6376

Comment 2 Wayne Walker 2015-01-23 16:42:32 UTC
If one downloads golang from golang.org (http://golang.org/dl/ the tar.gz "go1.4.1.linux-amd64.tar.gz", and use that, the bug is not there.  This is a fedora build failure:

wwalker@wwalker-desktop:~$ sudo tar -C /usr/local -xzf go1.3.3.linux-amd64.tar.gz 
wwalker@wwalker-desktop:~$ PATH=/usr/local/bin:$PATH
wwalker@wwalker-desktop:~$ cd -
/home/wwalker/golang_workspace/src/github.com/wwalker/hello
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ rm -rf ~/golang_workspace/pkg/*
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ rm -rf ~/golang_workspace/bin/*
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ go install
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ hello
asdf
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ PATH=/usr/bin:$PATH
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ go install
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ hello
asdf
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ rm -rf ~/golang_workspace/bin/*
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ rm -rf ~/golang_workspace/pkg/*
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ go install
wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ hello
user: Current not implemented on linux/amd64

wwalker@wwalker-desktop:~/golang_workspace/src/github.com/wwalker/hello$ rpm -q golang
golang-1.3.3-1.fc21.x86_64

Comment 3 Vincent Batts 2015-02-19 19:02:53 UTC
"""
os/user relies on cgo, and cgo is disabled for cross compiling,
thus this is expected.

if you use os/user, you must compile natively on OS X.

even if we enable cross compilation cgo support, I doubt everybody have
a working OS X cross toolchain on their linux machine.

"""
Upstream issue closed as WorkingAsIntended.

Comment 4 Vincent Batts 2015-02-19 19:06:18 UTC
ah, i see. this has to deal with the artifacts chosen by koji when the rpm is built across the arm, i386 and x86_64 builders. argh.

Comment 5 Miloslav Trmač 2015-08-17 20:24:09 UTC
(To list a real-world impact:) this breaks build of https://github.com/docker/notary/blob/master/cmd/notary/main.go .

Comment 6 Vincent Batts 2015-08-20 22:25:20 UTC
Can you test this on the go1.5 build that is in f23/f24(rawhide)?

Comment 8 Nalin Dahyabhai 2015-08-21 13:27:55 UTC
Both claim to require a matching build of golang-src that doesn't exist.  If I use --nodeps to install the f23 package on x86_64, the sample code builds and runs, printing out the expected contents of a User struct describing my logged-in user:
   &{1000 1000 nalin Nalin Dahyabhai /home/nalin} <nil>

Comment 9 techtonik 2015-08-22 04:37:32 UTC
This also breaks LXD (friendly LXC wrapper) on Fedora https://github.com/lxc/lxd/issues/830 Is there any workaround?

Comment 10 Vincent Batts 2015-08-24 17:44:38 UTC
(In reply to Nalin Dahyabhai from comment #8)
> Both claim to require a matching build of golang-src that doesn't exist.  If
> I use --nodeps to install the f23 package on x86_64, the sample code builds
> and runs, printing out the expected contents of a User struct describing my
> logged-in user:
>    &{1000 1000 nalin Nalin Dahyabhai /home/nalin} <nil>

there are several rpms to update (golang, golang-bin, golang-src), not just a single rpm. Download them all, and `rpm -Uvh golang*rpm`.

Comment 11 Nalin Dahyabhai 2015-08-24 18:09:47 UTC
Ah, they're noarch, so I missed them when downloading them with koji download-build.  Same result: they work.

Comment 12 Vincent Batts 2015-08-27 13:29:22 UTC
right, so go1.5 fixes this. Presently on f23 and rawhide. Soon we can roll this out safely to el6 and prior fedora releases.

Comment 13 Vincent Batts 2015-09-03 14:04:33 UTC
go1.5 is in -testing for f21, f22 and el6

Comment 14 Fedora End Of Life 2015-11-04 16:04:00 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Miloslav Trmač 2015-11-04 17:21:31 UTC
Fix confirmed as of golang-1.5.1-0.fc22.x86_64.

Comment 16 Fedora End Of Life 2015-12-02 03:35:48 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.