Skip to content

Commit

Permalink
multiple: remove appengine specific build constraints and code (#4685)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Aug 24, 2021
1 parent bfd964b commit 46ab723
Show file tree
Hide file tree
Showing 24 changed files with 18 additions and 235 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ vetdeps:
clean \
proto \
test \
testappengine \
testappenginedeps \
testrace \
vet \
vetdeps
2 changes: 1 addition & 1 deletion channelz/service/func_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !linux appengine
// +build !linux

/*
*
Expand Down
6 changes: 0 additions & 6 deletions install_gae.sh

This file was deleted.

2 changes: 0 additions & 2 deletions internal/channelz/types_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2018 gRPC authors.
Expand Down
4 changes: 2 additions & 2 deletions internal/channelz/types_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !linux appengine
// +build !linux

/*
*
Expand Down Expand Up @@ -37,6 +37,6 @@ type SocketOptionData struct {
// Windows OS doesn't support Socket Option
func (s *SocketOptionData) Getsockopt(fd uintptr) {
once.Do(func() {
logger.Warning("Channelz: socket options are not supported on non-linux os and appengine.")
logger.Warning("Channelz: socket options are not supported on non-linux environments")
})
}
2 changes: 0 additions & 2 deletions internal/channelz/util_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build linux,!appengine

/*
*
* Copyright 2018 gRPC authors.
Expand Down
2 changes: 1 addition & 1 deletion internal/channelz/util_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !linux appengine
// +build !linux

/*
*
Expand Down
2 changes: 1 addition & 1 deletion internal/channelz/util_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,!appengine
// +build linux

/*
*
Expand Down
2 changes: 0 additions & 2 deletions internal/credentials/spiffe.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2020 gRPC authors.
Expand Down
31 changes: 0 additions & 31 deletions internal/credentials/spiffe_appengine.go

This file was deleted.

2 changes: 0 additions & 2 deletions internal/credentials/syscallconn.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2018 gRPC authors.
Expand Down
30 changes: 0 additions & 30 deletions internal/credentials/syscallconn_appengine.go

This file was deleted.

2 changes: 0 additions & 2 deletions internal/credentials/syscallconn_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2018 gRPC authors.
Expand Down
2 changes: 0 additions & 2 deletions internal/profiling/buffer/buffer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2019 gRPC authors.
Expand Down
43 changes: 0 additions & 43 deletions internal/profiling/buffer/buffer_appengine.go

This file was deleted.

2 changes: 0 additions & 2 deletions internal/profiling/buffer/buffer_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2019 gRPC authors.
Expand Down
2 changes: 0 additions & 2 deletions internal/syscall/syscall_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !appengine

/*
*
* Copyright 2018 gRPC authors.
Expand Down
20 changes: 10 additions & 10 deletions internal/syscall/syscall_nonlinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !linux appengine
// +build !linux

/*
*
Expand Down Expand Up @@ -35,41 +35,41 @@ var logger = grpclog.Component("core")

func log() {
once.Do(func() {
logger.Info("CPU time info is unavailable on non-linux or appengine environment.")
logger.Info("CPU time info is unavailable on non-linux environments.")
})
}

// GetCPUTime returns the how much CPU time has passed since the start of this process.
// It always returns 0 under non-linux or appengine environment.
// GetCPUTime returns the how much CPU time has passed since the start of this
// process. It always returns 0 under non-linux environments.
func GetCPUTime() int64 {
log()
return 0
}

// Rusage is an empty struct under non-linux or appengine environment.
// Rusage is an empty struct under non-linux environments.
type Rusage struct{}

// GetRusage is a no-op function under non-linux or appengine environment.
// GetRusage is a no-op function under non-linux environments.
func GetRusage() *Rusage {
log()
return nil
}

// CPUTimeDiff returns the differences of user CPU time and system CPU time used
// between two Rusage structs. It a no-op function for non-linux or appengine environment.
// between two Rusage structs. It a no-op function for non-linux environments.
func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
log()
return 0, 0
}

// SetTCPUserTimeout is a no-op function under non-linux or appengine environments
// SetTCPUserTimeout is a no-op function under non-linux environments.
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
log()
return nil
}

// GetTCPUserTimeout is a no-op function under non-linux or appengine environments
// a negative return value indicates the operation is not supported
// GetTCPUserTimeout is a no-op function under non-linux environments.
// A negative return value indicates the operation is not supported
func GetTCPUserTimeout(conn net.Conn) (int, error) {
log()
return -1, nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build linux,!appengine

/*
*
* Copyright 2019 gRPC authors.
Expand Down
2 changes: 1 addition & 1 deletion security/advancedtls/sni.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !appengine,go1.14
// +build go1.14

/*
*
Expand Down
30 changes: 0 additions & 30 deletions security/advancedtls/sni_appengine.go

This file was deleted.

4 changes: 2 additions & 2 deletions security/advancedtls/sni_beforego114.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !appengine,!go1.14
// +build !go1.14

/*
*
Expand Down Expand Up @@ -26,7 +26,7 @@ import (
)

// buildGetCertificates returns the first cert contained in ServerOptions for
// non-appengine builds before version 1.4.
// builds before version 1.14.
func buildGetCertificates(clientHello *tls.ClientHelloInfo, o *ServerOptions) (*tls.Certificate, error) {
if o.IdentityOptions.GetIdentityCertificatesForServer == nil {
return nil, fmt.Errorf("function GetCertificates must be specified")
Expand Down
53 changes: 0 additions & 53 deletions test/go_vet/vet.go

This file was deleted.

4 changes: 0 additions & 4 deletions vet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go"
# - Ensure all xds proto imports are renamed to *pb or *grpc.
git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "'

# - Check imports that are illegal in appengine (until Go 1.11).
# TODO: Remove when we drop Go 1.10 support
go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go

misspell -error .

# - Check that generated proto files are up to date.
Expand Down

0 comments on commit 46ab723

Please sign in to comment.