From 6eee324d17d0e65036acc899ecf13fb026991007 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mar 19 2015 15:16:53 +0000 Subject: Merge branch 'f20' into el6 --- diff --git a/.gitignore b/.gitignore index 281e185..415af81 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,14 @@ /go1.3.1.src.tar.gz /go1.3.2.src.tar.gz /go1.3.3.src.tar.gz +/go1.3.src.tar.gz /go1.3beta2.src.tar.gz /go1.3rc1.src.tar.gz /go1.3rc2.src.tar.gz -/go1.3.src.tar.gz +/go1.4.1.src.tar.gz +/go1.4.2.src.tar.gz +/go1.4.src.tar.gz +/go1.4beta1.src.tar.gz +/go1.4rc1.src.tar.gz +/go1.4rc2.src.tar.gz /golang-19087:a15f344a9efa-xattrs.tar diff --git a/go1.3-tar-fix_writing_of_pax_headers.patch b/go1.3-tar-fix_writing_of_pax_headers.patch deleted file mode 100644 index 1c847e7..0000000 --- a/go1.3-tar-fix_writing_of_pax_headers.patch +++ /dev/null @@ -1,110 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1405555229 -36000 -# Thu Jul 17 10:00:29 2014 +1000 -# Node ID 1b17b3426e3c281a973d2d7bbf235b936d6a0942 -# Parent 278365dff593f027db6c6b2c0a89262490d6b676 -archive/tar: fix writing of pax headers - -"archive/tar: reuse temporary buffer in writeHeader" introduced a -change which was supposed to help lower the number of allocations from -512 bytes for every call to writeHeader. This change broke the writing -of PAX headers. - -writeHeader calls writePAXHeader and writePAXHeader calls writeHeader -again. writeHeader will end up writing the PAX header twice. - -example broken header: -PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 -PaxHeaders.4007/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021512 xustar0000000000000000 - -example correct header: -PaxHeaders.4290/NetLock_Arany_=Class_Gold=_Ftanstvny.crt0000000000000000000000000000007112301216634021516 xustar0000000000000000 -0100644000000000000000000000270412301216634007250 0ustar0000000000000000 - -This commit adds a dedicated buffer for pax headers to the Writer -struct. This change increases the size of the struct by 512 bytes, but -allows tar/writer to avoid allocating 512 bytes for all written -headers and it avoids allocating 512 more bytes for pax headers. - -LGTM=dsymonds -R=dsymonds, dave, iant -CC=golang-codereviews -https://codereview.appspot.com/110480043 - -Committer: David Symonds - -diff -r 278365dff593 -r 1b17b3426e3c src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Wed Jul 16 16:29:51 2014 -0700 -+++ b/src/pkg/archive/tar/writer.go Thu Jul 17 10:00:29 2014 +1000 -@@ -39,7 +39,8 @@ - closed bool - usedBinary bool // whether the binary numeric field extension was used - preferPax bool // use pax header instead of binary numeric header -- hdrBuff [blockSize]byte // buffer to use in writeHeader -+ hdrBuff [blockSize]byte // buffer to use in writeHeader when writing a regular header -+ paxHdrBuff [blockSize]byte // buffer to use in writeHeader when writing a pax header - } - - // NewWriter creates a new Writer writing to w. -@@ -161,7 +162,17 @@ - // subsecond time resolution, but for now let's just capture - // too long fields or non ascii characters - -- header := tw.hdrBuff[:] -+ var header []byte -+ -+ // We need to select which scratch buffer to use carefully, -+ // since this method is called recursively to write PAX headers. -+ // If allowPax is true, this is the non-recursive call, and we will use hdrBuff. -+ // If allowPax is false, we are being called by writePAXHeader, and hdrBuff is -+ // already being used by the non-recursive call, so we must use paxHdrBuff. -+ header = tw.hdrBuff[:] -+ if !allowPax { -+ header = tw.paxHdrBuff[:] -+ } - copy(header, zeroBlock) - s := slicer(header) - -diff -r 278365dff593 -r 1b17b3426e3c src/pkg/archive/tar/writer_test.go ---- a/src/pkg/archive/tar/writer_test.go Wed Jul 16 16:29:51 2014 -0700 -+++ b/src/pkg/archive/tar/writer_test.go Thu Jul 17 10:00:29 2014 +1000 -@@ -454,3 +454,38 @@ - t.Fatal("Couldn't recover long name") - } - } -+ -+func TestValidTypeflagWithPAXHeader(t *testing.T) { -+ var buffer bytes.Buffer -+ tw := NewWriter(&buffer) -+ -+ fileName := strings.Repeat("ab", 100) -+ -+ hdr := &Header{ -+ Name: fileName, -+ Size: 4, -+ Typeflag: 0, -+ } -+ if err := tw.WriteHeader(hdr); err != nil { -+ t.Fatalf("Failed to write header: %s", err) -+ } -+ if _, err := tw.Write([]byte("fooo")); err != nil { -+ t.Fatalf("Failed to write the file's data: %s", err) -+ } -+ tw.Close() -+ -+ tr := NewReader(&buffer) -+ -+ for { -+ header, err := tr.Next() -+ if err == io.EOF { -+ break -+ } -+ if err != nil { -+ t.Fatalf("Failed to read header: %s", err) -+ } -+ if header.Typeflag != 0 { -+ t.Fatalf("Typeflag should've been 0, found %d", header.Typeflag) -+ } -+ } -+} diff --git a/go1.3-tar_reuse_buffer_readHeader.patch b/go1.3-tar_reuse_buffer_readHeader.patch deleted file mode 100644 index 1c6693c..0000000 --- a/go1.3-tar_reuse_buffer_readHeader.patch +++ /dev/null @@ -1,64 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1404344479 -36000 -# Thu Jul 03 09:41:19 2014 +1000 -# Node ID 17404efd6b02d4b3acd17070e3f89de97a145877 -# Parent 837348e418f33fc7a242f56dbe2feff829532526 -archive/tar: reuse temporary buffer in readHeader - -A temporary 512 bytes buffer is allocated for every call to -readHeader. This buffer isn't returned to the caller and it could -be reused to lower the number of memory allocations. - -This CL improves it by using a pool and zeroing out the buffer before -putting it back into the pool. - -benchmark old ns/op new ns/op delta -BenchmarkListFiles100k 545249903 538832687 -1.18% - -benchmark old allocs new allocs delta -BenchmarkListFiles100k 2105167 2005692 -4.73% - -benchmark old bytes new bytes delta -BenchmarkListFiles100k 105903472 54831527 -48.22% - -This improvement is very important if your code has to deal with a lot -of tarballs which contain a lot of files. - -LGTM=dsymonds -R=golang-codereviews, dave, dsymonds, bradfitz -CC=golang-codereviews -https://codereview.appspot.com/108240044 - -Committer: David Symonds - -diff -r 837348e418f3 -r 17404efd6b02 src/pkg/archive/tar/reader.go ---- a/src/pkg/archive/tar/reader.go Thu Jul 03 09:40:53 2014 +1000 -+++ b/src/pkg/archive/tar/reader.go Thu Jul 03 09:41:19 2014 +1000 -@@ -29,10 +29,11 @@ - // The Next method advances to the next file in the archive (including the first), - // and then it can be treated as an io.Reader to access the file's data. - type Reader struct { -- r io.Reader -- err error -- pad int64 // amount of padding (ignored) after current file entry -- curr numBytesReader // reader for current file entry -+ r io.Reader -+ err error -+ pad int64 // amount of padding (ignored) after current file entry -+ curr numBytesReader // reader for current file entry -+ hdrBuff [blockSize]byte // buffer to use in readHeader - } - - // A numBytesReader is an io.Reader with a numBytes method, returning the number -@@ -426,7 +427,9 @@ - } - - func (tr *Reader) readHeader() *Header { -- header := make([]byte, blockSize) -+ header := tr.hdrBuff[:] -+ copy(header, zeroBlock) -+ - if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { - return nil - } diff --git a/go1.3-tar_reuse_buffer_writeHeader.patch b/go1.3-tar_reuse_buffer_writeHeader.patch deleted file mode 100644 index 6cd8969..0000000 --- a/go1.3-tar_reuse_buffer_writeHeader.patch +++ /dev/null @@ -1,56 +0,0 @@ -# HG changeset patch -# User Cristian Staretu -# Date 1404344453 -36000 -# Thu Jul 03 09:40:53 2014 +1000 -# Node ID 837348e418f33fc7a242f56dbe2feff829532526 -# Parent c5f72a685e256457a0872f6587e2bb9500eac7c4 -archive/tar: reuse temporary buffer in writeHeader - -A temporary 512 bytes buffer is allocated for every call to -writeHeader. This buffer could be reused the lower the number -of memory allocations. - -benchmark old ns/op new ns/op delta -BenchmarkWriteFiles100k 634622051 583810847 -8.01% - -benchmark old allocs new allocs delta -BenchmarkWriteFiles100k 2701920 2602621 -3.68% - -benchmark old bytes new bytes delta -BenchmarkWriteFiles100k 115383884 64349922 -44.23% - -This change is very important if your code has to write a lot of -tarballs with a lot of files. - -LGTM=dsymonds -R=golang-codereviews, dave, dsymonds -CC=golang-codereviews -https://codereview.appspot.com/107440043 - -Committer: David Symonds - -diff -r c5f72a685e25 -r 837348e418f3 src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Wed Jul 02 15:28:57 2014 -0700 -+++ b/src/pkg/archive/tar/writer.go Thu Jul 03 09:40:53 2014 +1000 -@@ -37,8 +37,9 @@ - nb int64 // number of unwritten bytes for current file entry - pad int64 // amount of padding to write after current file entry - closed bool -- usedBinary bool // whether the binary numeric field extension was used -- preferPax bool // use pax header instead of binary numeric header -+ usedBinary bool // whether the binary numeric field extension was used -+ preferPax bool // use pax header instead of binary numeric header -+ hdrBuff [blockSize]byte // buffer to use in writeHeader - } - - // NewWriter creates a new Writer writing to w. -@@ -160,7 +161,8 @@ - // subsecond time resolution, but for now let's just capture - // too long fields or non ascii characters - -- header := make([]byte, blockSize) -+ header := tw.hdrBuff[:] -+ copy(header, zeroBlock) - s := slicer(header) - - // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax diff --git a/golang-1.2-archive_tar-xattr.patch b/golang-1.2-archive_tar-xattr.patch deleted file mode 100644 index 10c8f3d..0000000 --- a/golang-1.2-archive_tar-xattr.patch +++ /dev/null @@ -1,197 +0,0 @@ -# HG changeset patch -# User Alexander Larsson -# Date 1392282510 -39600 -# Node ID a15f344a9efa35ef168c8feaa92a15a1cdc93db5 -# Parent 1a32fe60e0798d82bbff6c945001c7f0ba8de5ea -archive/tar: support extended attributes - -This adds support for archives with the SCHILY.xattr field in the -pax header. This is what gnu tar and star generate. -Fixes issue 7154. - -LGTM=dsymonds -R=golang-codereviews, gobot, dsymonds -CC=golang-codereviews -https://codereview.appspot.com/54570043 - -Committer: David Symonds - -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/common.go ---- a/src/pkg/archive/tar/common.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/common.go Thu Feb 13 20:08:30 2014 +1100 -@@ -57,6 +57,7 @@ - Devminor int64 // minor number of character or block device - AccessTime time.Time // access time - ChangeTime time.Time // status change time -+ Xattrs map[string]string - } - - // File name constants from the tar spec. -@@ -189,6 +190,7 @@ - paxSize = "size" - paxUid = "uid" - paxUname = "uname" -+ paxXattr = "SCHILY.xattr." - paxNone = "" - ) - -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader.go ---- a/src/pkg/archive/tar/reader.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/reader.go Thu Feb 13 20:08:30 2014 +1100 -@@ -139,8 +139,14 @@ - return err - } - hdr.Size = int64(size) -+ default: -+ if strings.HasPrefix(k, paxXattr) { -+ if hdr.Xattrs == nil { -+ hdr.Xattrs = make(map[string]string) -+ } -+ hdr.Xattrs[k[len(paxXattr):]] = v -+ } - } -- - } - return nil - } -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader_test.go ---- a/src/pkg/archive/tar/reader_test.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/reader_test.go Thu Feb 13 20:08:30 2014 +1100 -@@ -161,6 +161,46 @@ - }, - }, - }, -+ { -+ file: "testdata/xattrs.tar", -+ headers: []*Header{ -+ { -+ Name: "small.txt", -+ Mode: 0644, -+ Uid: 1000, -+ Gid: 10, -+ Size: 5, -+ ModTime: time.Unix(1386065770, 448252320), -+ Typeflag: '0', -+ Uname: "alex", -+ Gname: "wheel", -+ AccessTime: time.Unix(1389782991, 419875220), -+ ChangeTime: time.Unix(1389782956, 794414986), -+ Xattrs: map[string]string{ -+ "user.key": "value", -+ "user.key2": "value2", -+ // Interestingly, selinux encodes the terminating null inside the xattr -+ "security.selinux": "unconfined_u:object_r:default_t:s0\x00", -+ }, -+ }, -+ { -+ Name: "small2.txt", -+ Mode: 0644, -+ Uid: 1000, -+ Gid: 10, -+ Size: 11, -+ ModTime: time.Unix(1386065770, 449252304), -+ Typeflag: '0', -+ Uname: "alex", -+ Gname: "wheel", -+ AccessTime: time.Unix(1389782991, 419875220), -+ ChangeTime: time.Unix(1386065770, 449252304), -+ Xattrs: map[string]string{ -+ "security.selinux": "unconfined_u:object_r:default_t:s0\x00", -+ }, -+ }, -+ }, -+ }, - } - - func TestReader(t *testing.T) { -@@ -180,7 +220,7 @@ - f.Close() - continue testLoop - } -- if *hdr != *header { -+ if !reflect.DeepEqual(*hdr, *header) { - t.Errorf("test %d, entry %d: Incorrect header:\nhave %+v\nwant %+v", - i, j, *hdr, *header) - } -@@ -253,7 +293,7 @@ - } - - // check the header -- if *hdr != *headers[nread] { -+ if !reflect.DeepEqual(*hdr, *headers[nread]) { - t.Errorf("Incorrect header:\nhave %+v\nwant %+v", - *hdr, headers[nread]) - } -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer.go ---- a/src/pkg/archive/tar/writer.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/writer.go Thu Feb 13 20:08:30 2014 +1100 -@@ -236,6 +236,12 @@ - return tw.err - } - -+ if allowPax { -+ for k, v := range hdr.Xattrs { -+ paxHeaders[paxXattr+k] = v -+ } -+ } -+ - if len(paxHeaders) > 0 { - if !allowPax { - return errInvalidHeader -diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer_test.go ---- a/src/pkg/archive/tar/writer_test.go Thu Feb 13 03:09:03 2014 -0500 -+++ b/src/pkg/archive/tar/writer_test.go Thu Feb 13 20:08:30 2014 +1100 -@@ -10,6 +10,7 @@ - "io" - "io/ioutil" - "os" -+ "reflect" - "strings" - "testing" - "testing/iotest" -@@ -338,6 +339,45 @@ - } - } - -+func TestPaxXattrs(t *testing.T) { -+ xattrs := map[string]string{ -+ "user.key": "value", -+ } -+ -+ // Create an archive with an xattr -+ fileinfo, err := os.Stat("testdata/small.txt") -+ if err != nil { -+ t.Fatal(err) -+ } -+ hdr, err := FileInfoHeader(fileinfo, "") -+ if err != nil { -+ t.Fatalf("os.Stat: %v", err) -+ } -+ contents := "Kilts" -+ hdr.Xattrs = xattrs -+ var buf bytes.Buffer -+ writer := NewWriter(&buf) -+ if err := writer.WriteHeader(hdr); err != nil { -+ t.Fatal(err) -+ } -+ if _, err = writer.Write([]byte(contents)); err != nil { -+ t.Fatal(err) -+ } -+ if err := writer.Close(); err != nil { -+ t.Fatal(err) -+ } -+ // Test that we can get the xattrs back out of the archive. -+ reader := NewReader(&buf) -+ hdr, err = reader.Next() -+ if err != nil { -+ t.Fatal(err) -+ } -+ if !reflect.DeepEqual(hdr.Xattrs, xattrs) { -+ t.Fatalf("xattrs did not survive round trip: got %+v, want %+v", -+ hdr.Xattrs, xattrs) -+ } -+} -+ - func TestPAXHeader(t *testing.T) { - medName := strings.Repeat("CD", 50) - longName := strings.Repeat("AB", 100) diff --git a/golang-1.2-remove-ECC-p224.patch b/golang-1.2-remove-ECC-p224.patch index 1b9e021..ef5a4a6 100644 --- a/golang-1.2-remove-ECC-p224.patch +++ b/golang-1.2-remove-ECC-p224.patch @@ -10,10 +10,10 @@ Index: go/api/go1.txt pkg crypto/elliptic, func P256() Curve pkg crypto/elliptic, func P384() Curve pkg crypto/elliptic, func P521() Curve -Index: go/src/pkg/crypto/ecdsa/ecdsa_test.go +Index: go/src/crypto/ecdsa/ecdsa_test.go =================================================================== ---- go.orig/src/pkg/crypto/ecdsa/ecdsa_test.go -+++ go/src/pkg/crypto/ecdsa/ecdsa_test.go +--- go.orig/src/crypto/ecdsa/ecdsa_test.go ++++ go/src/crypto/ecdsa/ecdsa_test.go @@ -33,7 +33,6 @@ func testKeyGeneration(t *testing.T, c e } @@ -39,10 +39,10 @@ Index: go/src/pkg/crypto/ecdsa/ecdsa_test.go case "P-256": pub.Curve = elliptic.P256() case "P-384": -Index: go/src/pkg/crypto/elliptic/bottombits.go +Index: go/src/crypto/elliptic/bottombits.go =================================================================== --- /dev/null -+++ go/src/pkg/crypto/elliptic/bottombits.go ++++ go/src/crypto/elliptic/bottombits.go @@ -0,0 +1,14 @@ + +// Copyright 2012 The Go Authors. All rights reserved. @@ -58,10 +58,10 @@ Index: go/src/pkg/crypto/elliptic/bottombits.go +const two31m3 = 1<<31 - 1<<3 +const two31m15m3 = 1<<31 - 1<<15 - 1<<3 + -Index: go/src/pkg/crypto/elliptic/elliptic.go +Index: go/src/crypto/elliptic/elliptic.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/elliptic.go -+++ go/src/pkg/crypto/elliptic/elliptic.go +--- go.orig/src/crypto/elliptic/elliptic.go ++++ go/src/crypto/elliptic/elliptic.go @@ -326,7 +326,6 @@ var p384 *CurveParams var p521 *CurveParams @@ -70,20 +70,20 @@ Index: go/src/pkg/crypto/elliptic/elliptic.go initP256() initP384() initP521() -Index: go/src/pkg/crypto/elliptic/elliptic_test.go +Index: go/src/crypto/elliptic/elliptic_test.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/elliptic_test.go -+++ go/src/pkg/crypto/elliptic/elliptic_test.go +--- go.orig/src/crypto/elliptic/elliptic_test.go ++++ go/src/crypto/elliptic/elliptic_test.go @@ -1,3 +1,5 @@ +// +build ignore + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -Index: go/src/pkg/crypto/elliptic/p224.go +Index: go/src/crypto/elliptic/p224.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/p224.go -+++ go/src/pkg/crypto/elliptic/p224.go +--- go.orig/src/crypto/elliptic/p224.go ++++ go/src/crypto/elliptic/p224.go @@ -1,3 +1,5 @@ +// +build ignore + @@ -111,20 +111,20 @@ Index: go/src/pkg/crypto/elliptic/p224.go // p224Mul computes *out = a*b // // a[i] < 2**29, b[i] < 2**30 (or vice versa) -Index: go/src/pkg/crypto/elliptic/p224_test.go +Index: go/src/crypto/elliptic/p224_test.go =================================================================== ---- go.orig/src/pkg/crypto/elliptic/p224_test.go -+++ go/src/pkg/crypto/elliptic/p224_test.go +--- go.orig/src/crypto/elliptic/p224_test.go ++++ go/src/crypto/elliptic/p224_test.go @@ -1,3 +1,5 @@ +// +build ignore + // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -Index: go/src/pkg/crypto/x509/x509.go +Index: go/src/crypto/x509/x509.go =================================================================== ---- go.orig/src/pkg/crypto/x509/x509.go -+++ go/src/pkg/crypto/x509/x509.go +--- go.orig/src/crypto/x509/x509.go ++++ go/src/crypto/x509/x509.go @@ -306,9 +306,6 @@ func getPublicKeyAlgorithmFromOID(oid as // RFC 5480, 2.1.1.1. Named Curve diff --git a/golang-1.2-skipCpuProfileTest.patch b/golang-1.2-skipCpuProfileTest.patch deleted file mode 100644 index 3dee29f..0000000 --- a/golang-1.2-skipCpuProfileTest.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -r 87dea3f5ebe7 src/pkg/runtime/pprof/pprof_test.go ---- a/src/pkg/runtime/pprof/pprof_test.go Fri Nov 29 08:32:31 2013 +1100 -+++ b/src/pkg/runtime/pprof/pprof_test.go Fri Jan 24 13:47:42 2014 -0500 -@@ -32,7 +32,7 @@ - }) - } - --func TestCPUProfileMultithreaded(t *testing.T) { -+func testCPUProfileMultithreaded(t *testing.T) { - buf := make([]byte, 100000) - defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) - testCPUProfile(t, []string{"crc32.ChecksumIEEE", "crc32.Update"}, func() { diff --git a/golang-f21-hostname.patch b/golang-f21-hostname.patch index 6025ecb..730e8a8 100644 --- a/golang-f21-hostname.patch +++ b/golang-f21-hostname.patch @@ -1,5 +1,5 @@ ---- src/pkg/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600 -+++ src/pkg/os/os_test.go 2014-02-20 13:14:55.934813622 -0600 +--- src/os/os_test.go.orig 2014-02-20 13:14:45.543644182 -0600 ++++ src/os/os_test.go 2014-02-20 13:14:55.934813622 -0600 @@ -854,7 +854,7 @@ t.Fatal(err) } diff --git a/golang.spec b/golang.spec index 4db3070..15dc272 100644 --- a/golang.spec +++ b/golang.spec @@ -19,7 +19,6 @@ # rpmbuild magic to keep from having meta dependency on libc.so.6 %define _use_internal_dependency_generator 0 %define __find_requires %{nil} -%global debug_package %{nil} %global __spec_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot \ /usr/lib/rpm/brp-compress @@ -40,9 +39,11 @@ %global gohostarch arm %endif +%global go_api 1.4 + Name: golang -Version: 1.3.3 -Release: 1%{?dist} +Version: 1.4.2 +Release: 2%{?dist} Summary: The Go Programming Language License: BSD @@ -63,31 +64,22 @@ BuildRequires: /bin/hostname Provides: go = %{version}-%{release} Requires: golang-bin -Requires: golang-src - -BuildRequires: emacs +Requires: golang-src = %{version}-%{release} Patch0: golang-1.2-verbose-build.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Patch1: golang-1.2-remove-ECC-p224.patch -# disable flaky test for now -# http://code.google.com/p/go/issues/detail?id=6522 -Patch2: ./golang-1.2-skipCpuProfileTest.patch - -# these patches can be dropped for go1.4 -# discovered working here https://github.com/dotcloud/docker/pull/6829 -Patch3: ./go1.3-tar_reuse_buffer_readHeader.patch -Patch4: ./go1.3-tar_reuse_buffer_writeHeader.patch -# https://code.google.com/p/go/source/detail?r=1b17b3426e3c -Patch5: ./go1.3-tar-fix_writing_of_pax_headers.patch - # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 # RPM can't handle symlink -> dir with subpackages, so merge back Obsoletes: %{name}-data < 1.1.1-4 +# go1.4 deprecates a few packages +Obsoletes: %{name}-vim < 1.4 +Obsoletes: emacs-%{name} < 1.4 + # These are the only RHEL/Fedora architectures that we compile this package for ExclusiveArch: %{go_arches} @@ -110,32 +102,10 @@ Source102: macros.golang #%{summary}. -%package vim -Summary: Vim plugins for Go -# fedora only -%if 0%{?fedora} -Requires: vim-filesystem -%endif -BuildArch: noarch - -%description vim -%{summary}. - - -%package -n emacs-%{name} -Summary: Emacs add-on package for Go -Requires: emacs(bin) >= %{_emacs_version} -BuildArch: noarch - -%description -n emacs-%{name} -%{summary}. - - ## # the source tree %package src Summary: Golang compiler source tree -Requires: go = %{version}-%{release} BuildArch: noarch %description src %{summary} @@ -149,6 +119,7 @@ Requires: go = %{version}-%{release} Requires: golang-pkg-linux-386 = %{version}-%{release} Requires(post): golang-pkg-linux-386 = %{version}-%{release} Provides: golang-bin = 386 +Provides: go(API)(go) = %{go_api} # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. Requires: glibc @@ -166,6 +137,7 @@ Requires: go = %{version}-%{release} Requires: golang-pkg-linux-amd64 = %{version}-%{release} Requires(post): golang-pkg-linux-amd64 = %{version}-%{release} Provides: golang-bin = amd64 +Provides: go(API)(go) = %{go_api} # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. Requires: glibc @@ -183,6 +155,7 @@ Requires: go = %{version}-%{release} Requires: golang-pkg-linux-arm = %{version}-%{release} Requires(post): golang-pkg-linux-arm = %{version}-%{release} Provides: golang-bin = arm +Provides: go(API)(go) = %{go_api} # We strip the meta dependency, but go does require glibc. # This is an odd issue, still looking for a better fix. Requires: glibc @@ -200,6 +173,7 @@ Requires(postun): %{_sbindir}/update-alternatives %package pkg-linux-386 Summary: Golang compiler toolchain to compile for linux 386 Requires: go = %{version}-%{release} +Provides: go(API)(cgo) = %{go_api} BuildArch: noarch %description pkg-linux-386 %{summary} @@ -207,6 +181,7 @@ BuildArch: noarch %package pkg-linux-amd64 Summary: Golang compiler toolchain to compile for linux amd64 Requires: go = %{version}-%{release} +Provides: go(API)(cgo) = %{go_api} BuildArch: noarch %description pkg-linux-amd64 %{summary} @@ -214,6 +189,7 @@ BuildArch: noarch %package pkg-linux-arm Summary: Golang compiler toolchain to compile for linux arm Requires: go = %{version}-%{release} +Provides: go(API)(cgo) = %{go_api} BuildArch: noarch %description pkg-linux-arm %{summary} @@ -316,7 +292,7 @@ BuildArch: noarch %description pkg-openbsd-amd64 %{summary} -## missing ./go/src/pkg/runtime/defs_openbsd_arm.h +## missing ./go/src/runtime/defs_openbsd_arm.h ## we'll skip this bundle for now #%package pkg-openbsd-arm #Summary: Golang compiler toolchain to compile for openbsd arm @@ -350,24 +326,6 @@ end # remove the P224 curve %patch1 -p1 -# skip flaky test -%patch2 -p1 - -# performance for archive/tar -%patch3 -p1 -%patch4 -p1 -# buffer the PAX header -%patch5 -p1 - -# create a [dirty] gcc wrapper to allow us to build with our own flags -# (dirty because it is spoofing 'gcc' since CC value is stored in the go tool) -# TODO: remove this and just set CFLAGS/LDFLAGS once upstream supports it -# https://code.google.com/p/go/issues/detail?id=6882 -# UPDATE: this is fixed in trunk, and will be in go1.3 -mkdir -p zz -echo -e "#!/bin/sh\n/usr/bin/gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS \"\$@\"" > ./zz/gcc -chmod +x ./zz/gcc - %build # set up final install location export GOROOT_FINAL=%{goroot} @@ -388,8 +346,9 @@ pushd src continue fi fi - # use our gcc wrapper - PATH="$(pwd -P)/../zz:$PATH" CC="gcc" \ + # use our gcc options for this build, but store gcc as default for compiler + CC="gcc $RPM_OPT_FLAGS $RPM_LD_FLAGS" \ + CC_FOR_TARGET="gcc" \ GOOS=${goos} \ GOARCH=${goarch} \ ./make.bash --no-clean @@ -397,13 +356,6 @@ pushd src done popd -# compile for emacs -cd misc -mv emacs/go-mode-load.el emacs/%{name}-init.el -%{_emacs_bytecompile} emacs/go-mode.el -cd .. - - %install rm -rf $RPM_BUILD_ROOT @@ -484,28 +436,6 @@ ln -sf /etc/alternatives/go $RPM_BUILD_ROOT%{_bindir}/go rm -f $RPM_BUILD_ROOT%{_bindir}/gofmt ln -sf /etc/alternatives/gofmt $RPM_BUILD_ROOT%{_bindir}/gofmt -# misc/bash -mkdir -p $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions -cp -av misc/bash/go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions -for z in 8l 6l 5l 8g 6g 5g gofmt gccgo - do ln -s go $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/$z -done - -# misc/emacs -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} -mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} -cp -av misc/emacs/go-mode.* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name} -cp -av misc/emacs/%{name}-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir} - -# misc/vim -mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles -cp -av misc/vim/* $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles -rm $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/readme.txt - -# misc/zsh -mkdir -p $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions -cp -av misc/zsh/go $RPM_BUILD_ROOT%{_datadir}/zsh/site-functions - # gdbinit mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d cp -av %{SOURCE100} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d/golang.gdb @@ -596,10 +526,12 @@ fi %doc AUTHORS CONTRIBUTORS LICENSE PATENTS # VERSION has to be present in the GOROOT, for `go install std` to work %doc %{goroot}/VERSION +%doc %{goroot}/doc/* # go files %dir %{goroot} %{goroot}/* +%exclude %{goroot}/VERSION %exclude %{goroot}/bin/ %exclude %{goroot}/pkg/ %exclude %{goroot}/src/ @@ -613,10 +545,6 @@ fi %dir %{gopath}/src/code.google.com/p/ -# autocomplete -%{_datadir}/bash-completion -%{_datadir}/zsh - # gdbinit (for gdb debugging) %{_sysconfdir}/gdbinit.d @@ -630,19 +558,8 @@ fi %endif -%files vim -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS -%{_datadir}/vim/vimfiles/* - - -%files -n emacs-%{name} -%doc AUTHORS CONTRIBUTORS LICENSE PATENTS -%{_emacs_sitelispdir}/%{name} -%{_emacs_sitestartdir}/*.el - - %files -f go-src.list src -%{goroot}/src/ + %ifarch %{ix86} %files pkg-bin-linux-386 @@ -672,30 +589,6 @@ fi %{goroot}/pkg/tool/linux_386/objdump %{goroot}/pkg/tool/linux_386/pack %{goroot}/pkg/tool/linux_386/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_386.h -%{goroot}/src/pkg/runtime/zgoarch_386.go -%{goroot}/src/pkg/runtime/zmalloc_linux_386.c -%{goroot}/src/pkg/runtime/zmprof_linux_386.c -%{goroot}/src/pkg/runtime/znetpoll_linux_386.c -%{goroot}/src/pkg/runtime/zruntime1_linux_386.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_386.go -%{goroot}/src/pkg/runtime/zsema_linux_386.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_386.c -%{goroot}/src/pkg/runtime/zstring_linux_386.c -%{goroot}/src/pkg/runtime/zsys_linux_386.s -%{goroot}/src/pkg/runtime/ztime_linux_386.c -%{goroot}/src/pkg/runtime/zalg_linux_386.c -%{goroot}/src/pkg/runtime/zchan_linux_386.c -%{goroot}/src/pkg/runtime/zcomplex_linux_386.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_386.c -%{goroot}/src/pkg/runtime/zhashmap_linux_386.c -%{goroot}/src/pkg/runtime/ziface_linux_386.c -%{goroot}/src/pkg/runtime/zlfstack_linux_386.c -%{goroot}/src/pkg/runtime/zrdebug_linux_386.c -%{goroot}/src/pkg/runtime/zslice_linux_386.c -%{goroot}/src/pkg/runtime/zsymtab_linux_386.c %endif %ifarch x86_64 @@ -726,30 +619,6 @@ fi %{goroot}/pkg/tool/linux_amd64/objdump %{goroot}/pkg/tool/linux_amd64/pack %{goroot}/pkg/tool/linux_amd64/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_amd64.h -%{goroot}/src/pkg/runtime/zgoarch_amd64.go -%{goroot}/src/pkg/runtime/zmalloc_linux_amd64.c -%{goroot}/src/pkg/runtime/zmprof_linux_amd64.c -%{goroot}/src/pkg/runtime/znetpoll_linux_amd64.c -%{goroot}/src/pkg/runtime/zruntime1_linux_amd64.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_amd64.go -%{goroot}/src/pkg/runtime/zsema_linux_amd64.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_amd64.c -%{goroot}/src/pkg/runtime/zstring_linux_amd64.c -%{goroot}/src/pkg/runtime/zsys_linux_amd64.s -%{goroot}/src/pkg/runtime/ztime_linux_amd64.c -%{goroot}/src/pkg/runtime/zalg_linux_amd64.c -%{goroot}/src/pkg/runtime/zchan_linux_amd64.c -%{goroot}/src/pkg/runtime/zcomplex_linux_amd64.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_amd64.c -%{goroot}/src/pkg/runtime/zhashmap_linux_amd64.c -%{goroot}/src/pkg/runtime/ziface_linux_amd64.c -%{goroot}/src/pkg/runtime/zlfstack_linux_amd64.c -%{goroot}/src/pkg/runtime/zrdebug_linux_amd64.c -%{goroot}/src/pkg/runtime/zslice_linux_amd64.c -%{goroot}/src/pkg/runtime/zsymtab_linux_amd64.c %endif %ifarch %{arm} @@ -780,31 +649,6 @@ fi %{goroot}/pkg/tool/linux_arm/objdump %{goroot}/pkg/tool/linux_arm/pack %{goroot}/pkg/tool/linux_arm/pprof - -# arch dependent generated files, used by cgo -%{goroot}/src/pkg/runtime/zasm_linux_arm.h -%{goroot}/src/pkg/runtime/zgoarch_arm.go -%{goroot}/src/pkg/runtime/zmalloc_linux_arm.c -%{goroot}/src/pkg/runtime/zmprof_linux_arm.c -%{goroot}/src/pkg/runtime/znetpoll_linux_arm.c -%{goroot}/src/pkg/runtime/znoasm_arm_linux_arm.c -%{goroot}/src/pkg/runtime/zruntime1_linux_arm.c -%{goroot}/src/pkg/runtime/zruntime_defs_linux_arm.go -%{goroot}/src/pkg/runtime/zsema_linux_arm.c -%{goroot}/src/pkg/runtime/zsigqueue_linux_arm.c -%{goroot}/src/pkg/runtime/zstring_linux_arm.c -%{goroot}/src/pkg/runtime/zsys_linux_arm.s -%{goroot}/src/pkg/runtime/ztime_linux_arm.c -%{goroot}/src/pkg/runtime/zalg_linux_arm.c -%{goroot}/src/pkg/runtime/zchan_linux_arm.c -%{goroot}/src/pkg/runtime/zcomplex_linux_arm.c -%{goroot}/src/pkg/runtime/zcpuprof_linux_arm.c -%{goroot}/src/pkg/runtime/zhashmap_linux_arm.c -%{goroot}/src/pkg/runtime/ziface_linux_arm.c -%{goroot}/src/pkg/runtime/zlfstack_linux_arm.c -%{goroot}/src/pkg/runtime/zrdebug_linux_arm.c -%{goroot}/src/pkg/runtime/zslice_linux_arm.c -%{goroot}/src/pkg/runtime/zsymtab_linux_arm.c %endif %files pkg-linux-386 -f pkg-linux-386.list @@ -897,6 +741,37 @@ fi %changelog +* Wed Mar 18 2015 Vincent Batts - 1.4.2-2 +- obsoleting deprecated packages + +* Wed Feb 18 2015 Vincent Batts - 1.4.2-1 +- updating to go1.4.2 + +* Fri Jan 16 2015 Vincent Batts - 1.4.1-1 +- updating to go1.4.1 + +* Fri Jan 02 2015 Vincent Batts - 1.4-2 +- doc organizing + +* Thu Dec 11 2014 Vincent Batts - 1.4-1 +- update to go1.4 release + +* Wed Dec 03 2014 Vincent Batts - 1.3.99-3.1.4rc2 +- update to go1.4rc2 + +* Mon Nov 17 2014 Vincent Batts - 1.3.99-2.1.4rc1 +- update to go1.4rc1 + +* Thu Oct 30 2014 Vincent Batts - 1.3.99-1.1.4beta1 +- update to go1.4beta1 + +* Thu Oct 30 2014 Vincent Batts - 1.3.3-3 +- macros will need to be in their own rpm + +* Fri Oct 24 2014 Vincent Batts - 1.3.3-2 +- split out rpm macros (bz1156129) +- progress on gccgo accomodation + * Wed Oct 01 2014 Vincent Batts - 1.3.3-1 - update to go1.3.3 (bz1146882) diff --git a/sources b/sources index 66155c8..c9c38e8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar -2cdbad6baefcf1007f3cf54a5bc878b7 go1.3.3.src.tar.gz +907f85c8fa765d31f7f955836fec4049 go1.4.2.src.tar.gz