Bug 1464343 - Go crypto package is broken due to corrupted file /usr/lib/golang/src/crypto/crypto.go
Go crypto package is broken due to corrupted file /usr/lib/golang/src/crypto/...
Product: Fedora
Classification: Fedora
Component: golang (Show other bugs)
x86_64 Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Vincent Batts
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-06-23 03:31 EDT by Gerard Braad
Modified: 2017-06-23 04:25 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-06-23 04:09:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gerard Braad 2017-06-23 03:31:59 EDT
Description of problem:
Unable to compile when using the package crypto and/or md5

Version-Release number of selected component (if applicable):

How reproducible:
Consistent. Compiling Minishift will fail.

Steps to Reproduce:
1. dnf install -y golang glide
2. git clone https://github.com/minishift/minishift.git
3. make

Actual results:
/usr/lib/golang/src/crypto/crypto.go:1:1: expected 'package', found 'STRING' ""

Expected results:
Successful build. 

Additional info:
Build worked on 1.7.5, but started to fail after update.
As you can see herehttps://gist.github.com/gbraad/9dfa2b467ebcb60d987871ad2fc2f02c#file-crypto-go-L29, the file does not have a package and ends prematurely.
Comment 1 Gerard Braad 2017-06-23 03:56:57 EDT
just now did a clean install from a container:

$ docker run -it fedora:25 bash
# dnf install -y golang -y
# vi /usr/lib/golang/src/crypto/crypto.go

and this seems to be OK.
Comment 2 Gerard Braad 2017-06-23 04:04:48 EDT
On the original host occured AFTER doing a `dnf update`. updating golang or golang-bin did not solve it... only after removing golang-src as:

$ rpm -e golang golang-bin gol;ang-src was necessary
$ dnf install -y golang

the issue was resolved
Comment 3 Jakub Čajka 2017-06-23 04:09:13 EDT
I can't reproduce it locally on my F25 (after several attempts).
Build of minishift fails for me with:

[INFO]	Replacing existing vendor dependencies
[INFO]	Removing nested vendor and Godeps/_workspace directories...
[INFO]	Removing: /home/jcajka/upstream/minishift/vendor/github.com/cpuguy83/go-md2man/vendor
[INFO]	Removing: /home/jcajka/upstream/minishift/vendor/github.com/docker/docker/vendor
[INFO]	Removing: /home/jcajka/upstream/minishift/vendor/github.com/docker/machine/vendor
go install -pkgdir=/home/jcajka/upstream/minishift/out/bindata -ldflags="-X github.com/minishift/minishift/pkg/version.minishiftVersion=1.1.0 -X github.com/minishift/minishift/pkg/version.b2dIsoVersion=v1.0.2 -X github.com/minishift/minishift/pkg/version.centOsIsoVersion=v1.0.0 -X github.com/minishift/minishift/pkg/version.openshiftVersion=v1.5.1" ./cmd/minishift
cmd/minishift/main.go:20:2: cannot find package "github.com/minishift/minishift/cmd/minishift/cmd" in any of:
	/usr/lib/golang/src/github.com/minishift/minishift/cmd/minishift/cmd (from $GOROOT)
	/home/jcajka/go/src/github.com/minishift/minishift/cmd/minishift/cmd (from $GOPATH)
cmd/minishift/main.go:21:2: cannot find package "github.com/minishift/minishift/pkg/minikube/machine" in any of:
	/usr/lib/golang/src/github.com/minishift/minishift/pkg/minikube/machine (from $GOROOT)
	/home/jcajka/go/src/github.com/minishift/minishift/pkg/minikube/machine (from $GOPATH)
Makefile:57: recipe for target '/home/jcajka/go/bin/minishift' failed

This seems to me as some kind of bug in the Makefile/buildscripts.

So closing as notabug as it seems to me as some kind of build environment pollution. Also as I haven't been able to even reproduce on my machine with "go build crypto/md5", whenever clean install or on update path from 1.7.5.
Comment 4 Jakub Čajka 2017-06-23 04:25:30 EDT
Oh... and if it still persists for you. Please provide sha256sum of /usr/lib/golang/src/crypto/crypto.go, and output of "rpm -qa "golang*"" and "rpm -Vv golang-src-1.7.6-1.fc25.noarch"

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