Bug 1342329 - [PATCH] Fix compiler bootstrap
Summary: [PATCH] Fix compiler bootstrap
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: golang
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Čajka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-03 01:52 UTC by Colin Walters
Modified: 2017-12-12 10:41 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:41:28 UTC
Type: Bug


Attachments (Terms of Use)

Description Colin Walters 2016-06-03 01:52:14 UTC
I'm trying to use rpmdistro-gitoverlay to build the fedora golang dist-git in CentOS Atomic Host Continuous (https://ci.centos.org/job/atomic-rdgo-centos7/)

I hit a bug in the patch for the bootstrap path - this is really a patch for a patch, but leaving polish for later.

From 75b16e09cec3d2376ed9847ae2adfc0fea3be80c Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Thu, 2 Jun 2016 14:50:57 -0400
Subject: [PATCH] Fix compiler bootstrap

---
 0001-Fix-compiler-bootstrap.patch | 46 +++++++++++++++++++++++++++++++++++++++
 golang.spec                       |  3 +++
 2 files changed, 49 insertions(+)
 create mode 100644 0001-Fix-compiler-bootstrap.patch

diff --git a/0001-Fix-compiler-bootstrap.patch b/0001-Fix-compiler-bootstrap.patch
new file mode 100644
index 0000000..7edd6fc
--- /dev/null
+++ b/0001-Fix-compiler-bootstrap.patch
@@ -0,0 +1,46 @@
+From 46e66eca16d0fba59c430ce83f1ed3c8ee639e77 Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters@verbum.org>
+Date: Thu, 2 Jun 2016 14:46:27 -0400
+Subject: [PATCH] Fix compiler bootstrap
+
+---
+ src/make.bash | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index de8995f..f127b2a 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -112,13 +112,13 @@ echo '##### Building Go bootstrap tool.'
+ echo cmd/dist
+ export GOROOT="$(cd .. && pwd)"
+ GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+-if [ -x "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" ]; then
+-	rm -f cmd/dist/dist
+-	GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" build -o cmd/dist/dist ./cmd/dist
+-elif [ -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+-	rm -f cmd/dist/dist
+-	GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+-else
++for gopath in "$GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go" "$GOROOT_BOOTSTRAP/bin/go"; do
++    if test -x ${gopath}; then
++       BOOTSTRAP_COMPILER=${gopath}
++       break
++    fi
++done
++if test -z "${BOOTSTRAP_COMPILER:-}"; then
+ 	echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
+ 	echo "ERROR: or $GOROOT_BOOTSTRAP/bin/${GOHOSTOS}_${GOHOSTARCH}/go." >&2
+ 	echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
+@@ -130,7 +130,7 @@ if [ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]; then
+ 	exit 1
+ fi
+ rm -f cmd/dist/dist
+-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "${BOOTSTRAP_COMPILER}" build -o cmd/dist/dist ./cmd/dist
+ 
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+-- 
+1.8.3.1
+
diff --git a/golang.spec b/golang.spec
index c9ac2ff..f2b8f9f 100644
--- a/golang.spec
+++ b/golang.spec
@@ -128,6 +128,8 @@ Patch213:       go1.5beta1-disable-TestGdbPython.patch
 # later run `go test -a std`. This makes it only use the zoneinfo.zip where needed in tests.
 Patch215:       ./go1.5-zoneinfo_testing_only.patch
 
+Patch300: 0001-Fix-compiler-bootstrap.patch
+
 # Having documentation separate was broken
 Obsoletes:      %{name}-docs < 1.1-4
 
@@ -249,6 +251,7 @@ Summary:        Golang shared object libraries
 %patch213 -p1
 
 %patch215 -p1
+%patch300 -p1
 
 %build
 # print out system information
-- 
1.8.3.1

Comment 1 Jakub Čajka 2016-06-03 06:30:21 UTC
I'm aware of this issue(bootstrap of Fedora golang fails with go1.4). I have caused it while forward porting patches a while back. As it is not affecting Fedora in any way and rebuilding Fedora on CentOS is not really supported(actually you are really lucky if it builds without any other changes to srpm on CentOS). I'm going to close this as wontfix, but I will include fixed patch when I will be doing respin of the package next time(BZ#1342090 I guess).

If you want (s)rpm with fixed patch for CentOS, you might look at my COPR repository https://copr.fedorainfracloud.org/coprs/jcajka/golang1.6/

Comment 2 Colin Walters 2016-06-03 12:54:38 UTC
(In reply to Jakub Čajka from comment #1)
> I'm aware of this issue(bootstrap of Fedora golang fails with go1.4). I have
> caused it while forward porting patches a while back. As it is not affecting
> Fedora in any way and rebuilding Fedora on CentOS is not really
> supported

I've been working on making it supported.  All the packages which pull from dist-git in https://github.com/CentOS/sig-atomic-buildscripts/blob/master/overlay.yml support it.

> (actually you are really lucky if it builds without any other
> changes to srpm on CentOS).

Since I am actually doing this, I can say most of the time it works, the main pain point is newer macros in Fedora for python etc.

> I'm going to close this as wontfix, but I will
> include fixed patch when I will be doing respin of the package next
> time(BZ#1342090 I guess).

That seems odd, but okay.  In the meantime I guess I can keep the fork on gitlab around.

But I don't quite understand why you'd mark the bug as WONTFIX this only to fix it later.

> If you want (s)rpm with fixed patch for CentOS, you might look at my COPR
> repository https://copr.fedorainfracloud.org/coprs/jcajka/golang1.6/

I'd rather not cross the bridge of starting to depend on COPRs for this project quite yet.  I think rpmdistro-gitoverlay is in many ways a better model (although COPR has some nice features too).

One option would be rebuilding from your dist-git, but now that I look at this your changes in:

http://copr-dist-git.fedorainfracloud.org/cgit/jcajka/golang1.6/golang.git/commit/?h=epel7&id=e36237976bf00443f5607835ba1d54c8339b59e4

Are very likely to break other dependent packages, since I am pulling go-srpm-macros, but you've changed things for golang to Provide them.

Comment 3 Adam Miller 2016-06-03 19:02:10 UTC
Jakub - You mentioned in Comment 1 that you will include the patch but then CLOSED:WONTFIX. I'm confused, are you planning include the fix for or not?

Comment 4 Ian McLeod 2016-06-06 19:03:07 UTC
If the general goal here is to allow a shared SRPM to work between rawhide/Fedora and the CentOS SIGs, then I'd like to add an enthusiastic +1.  Having commonality for golang should help both groups up the stack with things like docker and kube.

(Keep in mind that the SIG process is different than EPEL.  RHEL packages can be overridden and front-run the RHEL versions.)

To be clear, I'm not suggesting that a Fedora package maintainer is generally obliged to make the SRPM continue to work downstream.  However, that's not the situation here.  We have people in the broader community actively trying to make this work and keep it working.  I think we should encourage that.

Thoughts?

Comment 5 Adam Miller 2016-07-06 20:58:54 UTC
+1 to working along with the broader community

Jakub, any thoughts on the topic?

Comment 6 Jan Kurik 2016-07-26 04:22:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 7 Fedora End Of Life 2017-11-16 18:53:01 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 8 Fedora End Of Life 2017-12-12 10:41:28 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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.