Skip to content

Commit

Permalink
chore(all): constrain build environments for all internal tooling (#3504
Browse files Browse the repository at this point in the history
)
  • Loading branch information
codyoss committed Jan 7, 2021
1 parent 7388a88 commit fed8979
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 21 deletions.
2 changes: 2 additions & 0 deletions cmd/go-cloud-debug-agent/internal/debug/dwarf/frame_test.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

package dwarf_test

import (
Expand Down
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build go1.10
// +build linux,go1.10

package dwarf_test

Expand Down
2 changes: 2 additions & 0 deletions cmd/go-cloud-debug-agent/internal/debug/gosym/pclntab_test.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

package gosym

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/go-cloud-debug-agent/internal/debug/remote/remote.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

// Package remote provides remote access to a debugproxy server.
package remote

Expand Down
2 changes: 2 additions & 0 deletions httpreplay/cmd/httpr/integration_test.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

package main_test

import (
Expand Down
6 changes: 4 additions & 2 deletions internal/gapicgen/cmd/genbot/README.md
Expand Up @@ -16,8 +16,10 @@ information on how that's done can be found here:
Note: this may change your `~/.gitconfig`, `~/.gitcookies`, and use up
non-trivial amounts of space on your computer.

1. Make sure you have all the tools installed listed in genlocal's README.md
2. Run:
1. Make sure you are on a non-Windows platform. If you are using windows
continue on to the docker instructions.
2. Make sure you have all the tools installed listed in genlocal's README.md
3. Run:

```shell
cd /path/to/internal/gapicgen
Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/cmd/genbot/generate.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/cmd/genbot/github.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/cmd/genbot/main.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

// genbot is a binary for generating gapics and creating CLs/PRs with the results.
// It is intended to be used as a bot, though it can be run locally too.
package main
Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/cmd/genbot/update.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

package main

import (
Expand Down
38 changes: 21 additions & 17 deletions internal/gapicgen/cmd/genlocal/README.md
Expand Up @@ -6,25 +6,29 @@ run generators against googleapis-private, and various other local tasks.

## Required tools

1. Install [docker](https://www.docker.com/get-started)
*Note*: If you are on a Windows platform you will need to install these tools
in a linux docker container: [Install docker](https://www.docker.com/get-started)

1. Install [protoc](https://github.com/protocolbuffers/protobuf/releases)
1. Install [Go](http://golang.org/dl)
1. Install python3, pip3
1. Install virtualenv `pip3 install virtualenv`
1. Install Go tools:

```
go get \
github.com/golang/protobuf/protoc-gen-go \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
honnef.co/go/tools/cmd/staticcheck \
github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic
```
2. Install [Go](http://golang.org/dl)
3. Install python3, pip3
4. Install virtualenv `pip3 install virtualenv`
5. Install Go tools:

```bash
go get \
github.com/golang/protobuf/protoc-gen-go \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
honnef.co/go/tools/cmd/staticcheck \
github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic
```

## Running

```
cd /path/to/internal/gapicgen
`git clone` this project if you don't already have it checked-out locally.

```bash
cd /path/to/google-cloud-go/internal/gapicgen
go run cloud.google.com/go/internal/gapicgen/cmd/genlocal
```
```
2 changes: 2 additions & 0 deletions internal/gapicgen/cmd/genlocal/main.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

// genlocal is a binary for generating gapics locally. It may be used to test out
// new changes, test the generation of a new library, test new generator tweaks,
// run generators against googleapis-private, and various other local tasks.
Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/generator/generator.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

// Package generator provides tools for generating clients.
package generator

Expand Down
2 changes: 2 additions & 0 deletions internal/gapicgen/tools.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !windows

// Package gapicgen provides some helpers for gapicgen binaries.
package gapicgen

Expand Down
2 changes: 1 addition & 1 deletion internal/godocfx/main.go
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build go1.15
// +build linux,go1.15

/*Command godocfx generates DocFX YAML for Go code.
Expand Down
2 changes: 2 additions & 0 deletions internal/pretty/diff.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

package pretty

import (
Expand Down
2 changes: 2 additions & 0 deletions profiler/integration_test.go
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// +build linux

package profiler

import (
Expand Down

0 comments on commit fed8979

Please sign in to comment.