[golang/f20] cleaning up multiarch builds

Vincent Batts vbatts at fedoraproject.org
Tue Jul 15 15:30:29 UTC 2014


commit 96d7496e0543c6de0c1a1ef8cb9ee1dbb818f6a3
Author: Vincent Batts <vbatts at redhat.com>
Date:   Tue Jul 8 11:36:44 2014 -0400

    cleaning up multiarch builds
    
    bz1105901, bz1101508

 golang.spec |  175 ++++++++++++++---------------------------------------------
 1 files changed, 42 insertions(+), 133 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 4c3a7b2..f74d7fd 100644
--- a/golang.spec
+++ b/golang.spec
@@ -39,7 +39,7 @@
 
 Name:           golang
 Version:        1.2.2
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        The Go Programming Language
 
 License:        BSD
@@ -221,7 +221,7 @@ Requires(postun): %{_sbindir}/update-alternatives
 Summary:        Golang compiler toolchain to compile for linux 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-linux-386
 %{summary}
 
@@ -229,7 +229,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for linux amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-linux-amd64
 %{summary}
 
@@ -237,7 +237,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for linux arm
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-linux-arm
 %{summary}
 
@@ -245,7 +245,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for darwin 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-darwin-386
 %{summary}
 
@@ -253,7 +253,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for darwin amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-darwin-amd64
 %{summary}
 
@@ -261,7 +261,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for windows 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-windows-386
 %{summary}
 
@@ -269,7 +269,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for windows amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-windows-amd64
 %{summary}
 
@@ -277,7 +277,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for plan9 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-plan9-386
 %{summary}
 
@@ -285,7 +285,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for plan9 amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-plan9-amd64
 %{summary}
 
@@ -293,7 +293,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for freebsd 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-freebsd-386
 %{summary}
 
@@ -301,7 +301,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for freebsd amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-freebsd-amd64
 %{summary}
 
@@ -309,7 +309,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for freebsd arm
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-freebsd-arm
 %{summary}
 
@@ -317,7 +317,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for netbsd 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-netbsd-386
 %{summary}
 
@@ -325,7 +325,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for netbsd amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-netbsd-amd64
 %{summary}
 
@@ -333,7 +333,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for netbsd arm
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-netbsd-arm
 %{summary}
 
@@ -341,7 +341,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for openbsd 386
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-openbsd-386
 %{summary}
 
@@ -349,7 +349,7 @@ Requires(post): golang-bin
 Summary:        Golang compiler toolchain to compile for openbsd amd64
 Requires:       go = %{version}-%{release}
 BuildArch:      noarch
-Requires(post): golang-bin
+Requires:       gcc
 %description    pkg-openbsd-amd64
 %{summary}
 
@@ -359,7 +359,6 @@ Requires(post): golang-bin
 #Summary:        Golang compiler toolchain to compile for openbsd arm
 #Requires:       go = %{version}-%{release}
 #BuildArch:      noarch
-#Requires(post): golang-bin
 #%description    pkg-openbsd-arm
 #%{summary}
 
@@ -436,7 +435,7 @@ pushd src
 			PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \
 				GOOS=${goos} \
 				GOARCH=${goarch} \
-				./make.bash
+				./make.bash --no-clean
 		done
 	done
 popd
@@ -472,7 +471,7 @@ mkdir -p $RPM_BUILD_ROOT%{goroot}
 
 # install everything into libdir (until symlink problems are fixed)
 # https://code.google.com/p/go/issues/detail?id=5830
-cp -av api bin doc favicon.ico include lib pkg robots.txt src \
+cp -apv api bin doc favicon.ico include lib pkg robots.txt src misc VERSION \
    $RPM_BUILD_ROOT%{goroot}
 
 # remove the unnecessary zoneinfo file (Go will always use the system one first)
@@ -598,61 +597,11 @@ if [ $1 = 0 ]; then
 fi
 %endif
 
-# All these archives need to be newer than the corresponding source in goroot
-# https://bugzilla.redhat.com/show_bug.cgi?id=1099206
-%post pkg-linux-386
-GOROOT=%{goroot} GOOS=linux GOARCH=386 go install std
-
-%post pkg-linux-amd64
-GOROOT=%{goroot} GOOS=linux GOARCH=amd64 go install std
-
-%post pkg-linux-arm
-GOROOT=%{goroot} GOOS=linux GOARCH=arm go install std
-
-%post pkg-darwin-386
-GOROOT=%{goroot} GOOS=darwin GOARCH=386 go install std
-
-%post pkg-darwin-amd64
-GOROOT=%{goroot} GOOS=darwin GOARCH=amd64 go install std
-
-%post pkg-windows-386
-GOROOT=%{goroot} GOOS=windows GOARCH=386 go install std
-
-%post pkg-windows-amd64
-GOROOT=%{goroot} GOOS=windows GOARCH=amd64 go install std
-
-%post pkg-plan9-386
-GOROOT=%{goroot} GOOS=plan9 GOARCH=386 go install std
-
-%post pkg-plan9-amd64
-GOROOT=%{goroot} GOOS=plan9 GOARCH=amd64 go install std
-
-%post pkg-freebsd-386
-GOROOT=%{goroot} GOOS=freebsd GOARCH=386 go install std
-
-%post pkg-freebsd-amd64
-GOROOT=%{goroot} GOOS=freebsd GOARCH=amd64 go install std
-
-%post pkg-freebsd-arm
-GOROOT=%{goroot} GOOS=freebsd GOARCH=arm go install std
-
-%post pkg-netbsd-386
-GOROOT=%{goroot} GOOS=netbsd GOARCH=386 go install std
-
-%post pkg-netbsd-amd64
-GOROOT=%{goroot} GOOS=netbsd GOARCH=amd64 go install std
-
-%post pkg-netbsd-arm
-GOROOT=%{goroot} GOOS=netbsd GOARCH=arm go install std
-
-%post pkg-openbsd-386
-GOROOT=%{goroot} GOOS=openbsd GOARCH=386 go install std
-
-%post pkg-openbsd-amd64
-GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 
 %files
-%doc AUTHORS CONTRIBUTORS LICENSE PATENTS VERSION
+%doc AUTHORS CONTRIBUTORS LICENSE PATENTS
+# VERSION has to be present in the GOROOT, for `go install std` to work
+%doc %{goroot}/VERSION
 
 # go files
 %dir %{goroot}
@@ -708,65 +657,6 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 
 %files src
 %{goroot}/src/
-# files that are generated based on compile-time ARCH will go in that arch's pkg-bin-*
-%ifarch %{ix86}
-
-# this is wacky that now these files are generated in a different arch
-%exclude %{goroot}/src/cmd/8l/enam.c
-%exclude %{goroot}/src/pkg/runtime/zgoarch_386.go
-%exclude %{goroot}/src/cmd/6l/enam.c
-%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go
-
-%exclude %{goroot}/src/pkg/runtime/zasm_linux_386.h
-%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zmprof_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go
-%exclude %{goroot}/src/pkg/runtime/zsema_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zstring_linux_386.c
-%exclude %{goroot}/src/pkg/runtime/zsys_linux_386.s
-%exclude %{goroot}/src/pkg/runtime/ztime_linux_386.c
-%endif
-
-%ifarch x86_64
-%exclude %{goroot}/src/cmd/6l/enam.c
-%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go
-
-%exclude %{goroot}/src/pkg/runtime/zasm_linux_amd64.h
-%exclude %{goroot}/src/pkg/runtime/zmprof_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zsema_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go
-%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zstring_linux_amd64.c
-%exclude %{goroot}/src/pkg/runtime/zsys_linux_amd64.s
-%exclude %{goroot}/src/pkg/runtime/ztime_linux_amd64.c
-%endif
-
-%ifarch %{arm}
-%exclude %{goroot}/src/cmd/5l/enam.c
-%exclude %{goroot}/src/pkg/runtime/zgoarch_arm.go
-%exclude %{goroot}/src/cmd/6l/enam.c
-%exclude %{goroot}/src/pkg/runtime/zgoarch_amd64.go
-
-%exclude %{goroot}/src/pkg/runtime/zasm_linux_arm.h
-%exclude %{goroot}/src/pkg/runtime/znetpoll_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zmalloc_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zmprof_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zruntime1_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go
-%exclude %{goroot}/src/pkg/runtime/zsema_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zstring_linux_arm.c
-%exclude %{goroot}/src/pkg/runtime/zsys_linux_arm.s
-%exclude %{goroot}/src/pkg/runtime/ztime_linux_arm.c
-%endif
-
 
 %ifarch %{ix86}
 %files pkg-bin-linux-386
@@ -778,6 +668,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 %{goroot}/pkg/obj/linux_386/*
 %{goroot}/pkg/linux_386/runtime/cgo.a
 %dir %{goroot}/pkg/tool/linux_386
+%{goroot}/pkg/tool/linux_386/5a
+%{goroot}/pkg/tool/linux_386/5c
+%{goroot}/pkg/tool/linux_386/5g
+%{goroot}/pkg/tool/linux_386/5l
 %{goroot}/pkg/tool/linux_386/6a
 %{goroot}/pkg/tool/linux_386/6c
 %{goroot}/pkg/tool/linux_386/6g
@@ -819,10 +713,18 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 %{goroot}/pkg/obj/linux_amd64/*
 %{goroot}/pkg/linux_amd64/runtime/cgo.a
 %dir %{goroot}/pkg/tool/linux_amd64
+%{goroot}/pkg/tool/linux_amd64/5a
+%{goroot}/pkg/tool/linux_amd64/5c
+%{goroot}/pkg/tool/linux_amd64/5g
+%{goroot}/pkg/tool/linux_amd64/5l
 %{goroot}/pkg/tool/linux_amd64/6a
 %{goroot}/pkg/tool/linux_amd64/6c
 %{goroot}/pkg/tool/linux_amd64/6g
 %{goroot}/pkg/tool/linux_amd64/6l
+%{goroot}/pkg/tool/linux_amd64/8a
+%{goroot}/pkg/tool/linux_amd64/8c
+%{goroot}/pkg/tool/linux_amd64/8g
+%{goroot}/pkg/tool/linux_amd64/8l
 %{goroot}/pkg/tool/linux_amd64/addr2line
 %{goroot}/pkg/tool/linux_amd64/dist
 %{goroot}/pkg/tool/linux_amd64/nm
@@ -864,6 +766,10 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 %{goroot}/pkg/tool/linux_arm/6c
 %{goroot}/pkg/tool/linux_arm/6g
 %{goroot}/pkg/tool/linux_arm/6l
+%{goroot}/pkg/tool/linux_arm/8a
+%{goroot}/pkg/tool/linux_arm/8c
+%{goroot}/pkg/tool/linux_arm/8g
+%{goroot}/pkg/tool/linux_arm/8l
 %{goroot}/pkg/tool/linux_arm/addr2line
 %{goroot}/pkg/tool/linux_arm/dist
 %{goroot}/pkg/tool/linux_arm/nm
@@ -978,6 +884,9 @@ GOROOT=%{goroot} GOOS=openbsd GOARCH=amd64 go install std
 
 
 %changelog
+* Tue Jul 08 2014 Vincent Batts <vbatts at fedoraproejct.org> - 1.2.2-8
+- `go install std` requires gcc, to build cgo. bz1105901, bz1101508
+
 * Wed May 21 2014 Vincent Batts <vbatts at redhat.com> 1.2.2-7
 - bz1099206 ghost files are not what is needed
 


More information about the scm-commits mailing list