Bug 1388254 - gcc-go breaking go builds on fedora 24 by messing go environment
Summary: gcc-go breaking go builds on fedora 24 by messing go environment
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-24 21:16 UTC by Avesh Agarwal
Modified: 2017-08-08 18:59 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 18:59:45 UTC
Type: Bug


Attachments (Terms of Use)

Description Avesh Agarwal 2016-10-24 21:16:37 UTC
Description of problem:
Compilation of kubernetes on f24 fails as it do not search packages in vendor and the compilation fails.

Version-Release number of selected component (if applicable):
gcc-go-6.2.1-2.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
1. Set GOPATH
2. go get k8s.io/kubernetes
3. cd $GOPATH/src/k8s.io/kubernetes
4. make

However removing gcc-go solved the issue.

Actual results:
compilation fails with errors like:

hack/cmd/teststale/teststale.go:34:24: error: import file ‘github.com/golang/glog’ not found

when the package glog exists in the vendor dir in kubernetes.


Expected results:
compilation should succeed.


Additional info:
By looking at go env, it seems that GOTOOLDIR is set incorrectly:

GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/6.2.1"

Because on my other systems it is: 
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"

I also noticed that GOROOT was also set to GOROOT=/usr but I dont think this was the issue.

There are other issues I also noticed, infact thats how I removed gcc-go:

a) I initially suspected libgo and tried to downgrade it, not sure why downgrade of libgo started installing other packages as seen below?

----------------
#dnf downgrade libgo libgo-devel
Last metadata expiration check: 3:03:55 ago on Mon Oct 24 12:50:50 2016.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                  Arch                                         Version                                                 Repository                                     Size
===================================================================================================================================================================================================================
Installing:
 glibc                                                    i686                                         2.23.1-10.fc24                                          updates                                       4.3 M
 libgcc                                                   i686                                         6.2.1-2.fc24                                            updates                                        97 k
 libgo                                                    i686                                         6.2.1-2.fc24                                            updates                                       6.7 M
 libgo-devel                                              i686                                         6.2.1-2.fc24                                            updates                                       503 k
 nss-softokn-freebl                                       i686                                         3.27.0-1.0.fc24                                         updates                                       209 k
Downgrading:
 libgo                                                    x86_64                                       6.1.1-2.fc24                                            fedora                                        8.3 M
 libgo-devel                                              x86_64                                       6.1.1-2.fc24                                            fedora                                        491 k

Transaction Summary
----------------

But the original issue was not solved and I saw different errors:

# k8s.io/kubernetes/vendor/github.com/golang/glog
vendor/github.com/golang/glog/glog.go:74:7: error: import file ‘bufio’ not found
  "bufio"


b) So I upgraded libgo again (as downgrading did not work), and it worked fine.
But the original compilation error came back.

c) So somehow I tried to downgrade libgo again, and here you "go":

# dnf downgrade libgo libgo-devel
Last metadata expiration check: 3:06:34 ago on Mon Oct 24 12:50:50 2016.
Error: package gcc-go-6.2.1-2.fc24.x86_64 requires libgo = 6.2.1-2.fc24, but none of the providers can be installed
(try to add '--allowerasing' to command line to replace conflicting packages)

So I did what was suggested above:

# dnf downgrade libgo libgo-devel --allowerasing
Last metadata expiration check: 3:06:59 ago on Mon Oct 24 12:50:50 2016.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                             Arch                                           Version                                                 Repository                                        Size
===================================================================================================================================================================================================================
Removing:
 gcc-go                                              x86_64                                         6.2.1-2.fc24                                            @updates                                          27 M
Downgrading:
 libgo                                               i686                                           6.1.1-2.fc24                                            fedora                                           6.7 M
 libgo                                               x86_64                                         6.1.1-2.fc24                                            fedora                                           8.3 M
 libgo-devel                                         i686                                           6.1.1-2.fc24                                            fedora                                           498 k
 libgo-devel                                         x86_64                                         6.1.1-2.fc24                                            fedora                                           491 k

Transaction Summary
===================================================================================================================================================================================================================
Remove     1 Package
Downgrade  4 Packages


And since now gcc-go was removed and when I did compile again, it worked. Even now upgrading to libgo also did work. 

So it seems to me that removing gcc-go solved the issue and I could see that GOTOOLDIR was restored:

GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"

Comment 1 Avesh Agarwal 2016-10-24 21:49:49 UTC
Just to clarify, I also have golang rpms on my system:

golang-1.6.3-3.fc24.x86_64
golang-bin-1.6.3-3.fc24.x86_64
golang-src-1.6.3-3.fc24.noarch

Comment 2 Avesh Agarwal 2016-10-24 22:07:23 UTC
Complete go env environment before and after gcc-go removal:

Before:

#go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/upstream-code/gocode"
GORACE=""
GOROOT="/usr"
GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/6.2.1"
GO15VENDOREXPERIMENT="1"
CC="/usr/bin/gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="/usr/bin/g++"
CGO_ENABLED="1"


After:
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/upstream-code/gocode"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

I think the changes variables are GOROOT and GOTOOLDIR

Comment 3 Fedora End Of Life 2017-07-25 23:35:56 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. 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 '24'.

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 24 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 4 Fedora End Of Life 2017-08-08 18:59:45 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 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.