]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "cmd/dist: log CPU model when testing"
authorMichael Pratt <mpratt@google.com>
Fri, 14 Jan 2022 20:22:51 +0000 (15:22 -0500)
committerMichael Pratt <mpratt@google.com>
Fri, 14 Jan 2022 20:50:36 +0000 (20:50 +0000)
Fails TestRepeatBootstrap.

This reverts CL 371474.

For #50146.

Change-Id: Ie4adda4e0229e153471301ca00fe2c1c694b4b2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/378587
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/metadata.go [deleted file]
src/cmd/dist/metadata_bootstrap.go [deleted file]
src/cmd/dist/sys_windows.go
src/cmd/dist/test.go

diff --git a/src/cmd/dist/metadata.go b/src/cmd/dist/metadata.go
deleted file mode 100644 (file)
index f0a125f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2021 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.
-
-// Helper to print system metadata (CPU model, etc). This uses packages that
-// may not be available in the bootstrap toolchain. It only needs to be built
-// on the dist build using the final toolchain.
-
-//go:build go1.18
-// +build go1.18
-
-package main
-
-import (
-       "fmt"
-       "internal/sysinfo"
-       "runtime"
-)
-
-func logMetadata() error {
-       fmt.Printf("# GOARCH: %s\n", runtime.GOARCH)
-       fmt.Printf("# CPU: %s\n", sysinfo.CPU.Name())
-       return nil
-}
diff --git a/src/cmd/dist/metadata_bootstrap.go b/src/cmd/dist/metadata_bootstrap.go
deleted file mode 100644 (file)
index fe5f422..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2021 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.
-
-// No-op metadata implementation when building with an old bootstrap toolchain.
-
-//go:build !go1.18
-// +build !go1.18
-
-package main
-
-import (
-       "fmt"
-)
-
-func logMetadata() error {
-       // We don't return an error so we don't completely preclude running
-       // tests with a bootstrap dist.
-       fmt.Printf("# Metadata unavailable: bootstrap build\n")
-       return nil
-}
index 0fb66ad27dba305309987867340854ce0a2ef059..265f729d0fc345611f27e25037a955f9bc1fca17 100644 (file)
@@ -38,11 +38,11 @@ const (
        PROCESSOR_ARCHITECTURE_IA64  = 6
 )
 
-var winsysinfo systeminfo
+var sysinfo systeminfo
 
 func sysinit() {
-       syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&winsysinfo)), 0, 0)
-       switch winsysinfo.wProcessorArchitecture {
+       syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0)
+       switch sysinfo.wProcessorArchitecture {
        case PROCESSOR_ARCHITECTURE_AMD64:
                gohostarch = "amd64"
        case PROCESSOR_ARCHITECTURE_INTEL:
index fed83120ed2d55b79ab597eb00b3beb20d650ed0..50a2e5936c639846d8d9f78f78756552fcf10390 100644 (file)
@@ -218,15 +218,6 @@ func (t *tester) run() {
                }
        }
 
-       if err := t.maybeLogMetadata(); err != nil {
-               t.failed = true
-               if t.keepGoing {
-                       log.Printf("Failed logging metadata: %v", err)
-               } else {
-                       fatalf("Failed logging metadata: %v", err)
-               }
-       }
-
        for _, dt := range t.tests {
                if !t.shouldRunTest(dt.name) {
                        t.partial = true
@@ -277,16 +268,6 @@ func (t *tester) shouldRunTest(name string) bool {
        return false
 }
 
-func (t *tester) maybeLogMetadata() error {
-       if t.compileOnly {
-               // We need to run a subprocess to log metadata. Don't do that
-               // on compile-only runs.
-               return nil
-       }
-       t.out("Test execution environment.")
-       return logMetadata()
-}
-
 // short returns a -short flag value to use with 'go test'
 // or a test binary for tests intended to run in short mode.
 // It returns "true", unless the environment variable