go: 1.7.4 -> 1.7.5

authored by Yann Hodique and committed by Robin Gloster 19ebff1d 0a4cf89a

+6 -86
+3 -3
pkgs/development/compilers/go/1.7.nix
··· 24 24 25 25 stdenv.mkDerivation rec { 26 26 name = "go-${version}"; 27 - version = "1.7.4"; 27 + version = "1.7.5"; 28 28 29 29 src = fetchFromGitHub { 30 30 owner = "golang"; 31 31 repo = "go"; 32 32 rev = "go${version}"; 33 - sha256 = "1ks3xph20afrfp3vqs1sjnkpjb0lgxblv8706wa3iiyg7rka4axv"; 33 + sha256 = "00radlwbrssn0x3naamb33cfx7ap2jv7s51bqr705nmn2j5yyblk"; 34 34 }; 35 35 36 36 # perl is used for testing go vet ··· 105 105 106 106 patches = 107 107 [ ./remove-tools-1.7.patch 108 - ./ssl-cert-file-1.7.patch 108 + ./ssl-cert-file.patch 109 109 ./creds-test.patch 110 110 111 111 # This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
+1 -1
pkgs/development/compilers/go/1.8.nix
··· 107 107 108 108 patches = 109 109 [ ./remove-tools-1.8.patch 110 - ./ssl-cert-file-1.8.patch 110 + ./ssl-cert-file.patch 111 111 ./creds-test.patch 112 112 ./remove-test-pie-1.8.patch 113 113
-78
pkgs/development/compilers/go/ssl-cert-file-1.7.patch
··· 1 - diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go 2 - index a4b33c7..9700b75 100644 3 - --- a/src/crypto/x509/root_cgo_darwin.go 4 - +++ b/src/crypto/x509/root_cgo_darwin.go 5 - @@ -151,11 +151,20 @@ int FetchPEMRoots(CFDataRef *pemRoots) { 6 - import "C" 7 - import ( 8 - "errors" 9 - + "io/ioutil" 10 - + "os" 11 - "unsafe" 12 - ) 13 - 14 - func loadSystemRoots() (*CertPool, error) { 15 - roots := NewCertPool() 16 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 17 - + data, err := ioutil.ReadFile(file) 18 - + if err == nil { 19 - + roots.AppendCertsFromPEM(data) 20 - + return roots, nil 21 - + } 22 - + } 23 - 24 - var data C.CFDataRef = nil 25 - err := C.FetchPEMRoots(&data) 26 - diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go 27 - index 59b303d..d4a34ac 100644 28 - --- a/src/crypto/x509/root_darwin.go 29 - +++ b/src/crypto/x509/root_darwin.go 30 - @@ -28,16 +28,25 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate 31 - // The linker will not include these unused functions in binaries built with cgo enabled. 32 - 33 - func execSecurityRoots() (*CertPool, error) { 34 - + var ( 35 - + mu sync.Mutex 36 - + roots = NewCertPool() 37 - + ) 38 - + 39 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 40 - + data, err := ioutil.ReadFile(file) 41 - + if err == nil { 42 - + roots.AppendCertsFromPEM(data) 43 - + return roots, nil 44 - + } 45 - + } 46 - + 47 - cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain") 48 - data, err := cmd.Output() 49 - if err != nil { 50 - return nil, err 51 - } 52 - 53 - - var ( 54 - - mu sync.Mutex 55 - - roots = NewCertPool() 56 - - ) 57 - add := func(cert *Certificate) { 58 - mu.Lock() 59 - defer mu.Unlock() 60 - diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go 61 - index 7bcb3d6..3986e1a 100644 62 - --- a/src/crypto/x509/root_unix.go 63 - +++ b/src/crypto/x509/root_unix.go 64 - @@ -24,6 +24,14 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate 65 - 66 - func loadSystemRoots() (*CertPool, error) { 67 - roots := NewCertPool() 68 - + if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" { 69 - + data, err := ioutil.ReadFile(file) 70 - + if err == nil { 71 - + roots.AppendCertsFromPEM(data) 72 - + return roots, nil 73 - + } 74 - + } 75 - + 76 - var firstErr error 77 - for _, file := range certFiles { 78 - data, err := ioutil.ReadFile(file)
pkgs/development/compilers/go/ssl-cert-file-1.8.patch pkgs/development/compilers/go/ssl-cert-file.patch
+2 -4
pkgs/top-level/all-packages.nix
··· 5348 5348 inherit (darwin.apple_sdk.frameworks) Security Foundation; 5349 5349 }; 5350 5350 5351 - go_1_7 = callPackage ../development/compilers/go/1.7.nix ({ 5351 + go_1_7 = callPackage ../development/compilers/go/1.7.nix { 5352 5352 inherit (darwin.apple_sdk.frameworks) Security Foundation; 5353 - } // stdenv.lib.optionalAttrs stdenv.isDarwin { 5354 - stdenv = stdenvAdapters.overrideCC pkgs.stdenv pkgs.clang_38; 5355 - }); 5353 + }; 5356 5354 5357 5355 go_1_8 = callPackage ../development/compilers/go/1.8.nix ({ 5358 5356 inherit (darwin.apple_sdk.frameworks) Security Foundation;