Skip to content

Commit

Permalink
Pull in a rules_go version wich works with ginkgo
Browse files Browse the repository at this point in the history
Pull in a rules_go version wich works reliable with ginkgo and resolve
grpc dependency issues.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Jan 9, 2020
1 parent 219f4b2 commit e4974eb
Show file tree
Hide file tree
Showing 40 changed files with 32 additions and 523 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.0
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ bazel-push-images:

push: bazel-push-images

bazel-tests:
hack/dockerized "hack/bazel-fmt.sh && bazel test \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
--workspace_status_command=./hack/print-workspace-status.sh \
--test_output=errors -- //pkg/..."
bazel-test:
hack/dockerized "hack/bazel-fmt.sh && hack/bazel-test.sh"

generate:
hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} ./hack/generate.sh"
Expand All @@ -50,7 +47,7 @@ goveralls: go-build
go-test: go-build
SYNC_OUT=false hack/dockerized "./hack/build-go.sh test ${WHAT}"

test: go-test
test: bazel-test

functest:
hack/dockerized "hack/build-func-tests.sh"
Expand Down
11 changes: 6 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ load(
"http_archive",
"http_file",
)
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# Additional bazel rules

# fix for https://github.com/bazelbuild/rules_go/issues/1999 will be included in > v0.20.3
http_archive(
name = "io_bazel_rules_go",
sha256 = "078f2a9569fa9ed846e60805fb5fb167d6f6c4ece48e6d409bf5fb2154eaf0d8",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.0/rules_go-v0.20.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.20.0/rules_go-v0.20.0.tar.gz",
],
sha256 = "aca4d0081b8bf96dce8f1395904ab1f21f5fea9c08afb9a9c67358982d4491eb",
strip_prefix = "rules_go-b2c7df325cf96bf8daa9c5d329baf85df4b405eb",
urls = ["https://github.com/bazelbuild/rules_go/archive/b2c7df325cf96bf8daa9c5d329baf85df4b405eb.tar.gz"],
)

http_archive(
Expand Down
7 changes: 6 additions & 1 deletion hack/bazel-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bazel run \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
--workspace_status_command=./hack/print-workspace-status.sh \
--host_force_python=${bazel_py} \
//:gazelle
//:gazelle -- -exclude vendor/google.golang.org/grpc

# inject changes to libvirt BUILD file
bazel run \
Expand All @@ -24,6 +24,11 @@ bazel run \
--workspace_status_command=./hack/print-workspace-status.sh \
--host_force_python=${bazel_py} \
-- @com_github_bazelbuild_buildtools//buildozer 'add copts -Ibazel-out/k8-fastbuild/genfiles' //vendor/github.com/libvirt/libvirt-go:go_default_library
bazel run \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
--workspace_status_command=./hack/print-workspace-status.sh \
--host_force_python=${bazel_py} \
-- @com_github_bazelbuild_buildtools//buildozer 'add copts -Ibazel-out/k8-fastbuild/genfiles' //vendor/github.com/libvirt/libvirt-go:go_default_library
# allign BAZEL files to a single format
bazel run \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
Expand Down
11 changes: 11 additions & 0 deletions hack/bazel-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set -e

source hack/common.sh
source hack/config.sh

bazel test \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo \
--stamp \
--workspace_status_command=./hack/print-workspace-status.sh \
--host_force_python=${bazel_py} \
--test_output=errors -- //pkg/...
2 changes: 1 addition & 1 deletion hack/builder/version.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=30-5.1.0
VERSION=30-5.2.0
2 changes: 1 addition & 1 deletion hack/kubevirt-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM kubevirt/builder@sha256:0cc33e4e2a04aa4ec44a9c38c37ff926a8b2ca67181200e31c48298bff79c4b2
FROM kubevirt/builder@sha256:e7935549daa12e222696a2e9715e820ab6ef5b1dd0f109431856fb144928b497

ENV GIMME_GO_VERSION=1.12.8
ENV GOPATH="/go" GOBIN="/usr/bin"
Expand Down
4 changes: 2 additions & 2 deletions pkg/virt-handler/cmd-client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ go_library(
"//staging/src/kubevirt.io/client-go/log:go_default_library",
"//vendor/github.com/golang/mock/gomock:go_default_library",
"//vendor/golang.org/x/net/context:go_default_library",
"//vendor/google.golang.org/grpc/codes:go_default_library",
"//vendor/google.golang.org/grpc/status:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
2 changes: 1 addition & 1 deletion vendor/github.com/google/goexpect/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 0 additions & 59 deletions vendor/google.golang.org/grpc/BUILD.bazel

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/google.golang.org/grpc/balancer/BUILD.bazel

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/google.golang.org/grpc/balancer/base/BUILD.bazel

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/google.golang.org/grpc/balancer/roundrobin/BUILD.bazel

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/google.golang.org/grpc/codes/BUILD.bazel

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/google.golang.org/grpc/connectivity/BUILD.bazel

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/google.golang.org/grpc/credentials/BUILD.bazel

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/google.golang.org/grpc/encoding/BUILD.bazel

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/google.golang.org/grpc/encoding/proto/BUILD.bazel

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/google.golang.org/grpc/grpclog/BUILD.bazel

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/google.golang.org/grpc/internal/BUILD.bazel

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/google.golang.org/grpc/internal/backoff/BUILD.bazel

This file was deleted.

24 changes: 0 additions & 24 deletions vendor/google.golang.org/grpc/internal/binarylog/BUILD.bazel

This file was deleted.

Loading

0 comments on commit e4974eb

Please sign in to comment.