Hack around broken bazel golang build rules.

This commit is contained in:
Laramie Leavitt
2016-03-03 18:12:32 -08:00
parent a2e269c3f3
commit dfd84d2172
7 changed files with 54 additions and 28 deletions

4
BUILD
View File

@ -23,7 +23,7 @@ go_binary(
name = "remote",
srcs = ["remote.go"],
deps = [
"@remote//:remote",
"@ws_remote//:remote",
],
)
@ -31,6 +31,6 @@ go_binary(
name = "bare",
srcs = ["bare.go"],
deps = [
"@bare//:bare",
"@ws_bare//:bare",
],
)

View File

@ -3,7 +3,7 @@ load("@bazel_tools//tools/build_rules/go:def.bzl", "go_repositories")
go_repositories()
git_repository(
name = "remote",
name = "ws_remote",
remote = "https://github.com/laramiel/bazel-example-golang-remote.git",
commit = "8f2e405",
)
@ -23,7 +23,7 @@ go_library(
"""
new_git_repository(
name = "bare",
name = "ws_bare",
remote = "https://github.com/laramiel/bazel-example-golang-bare.git",
commit = "3bd848f",
build_file_content = BARE_BUILD

View File

@ -2,7 +2,13 @@ package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang-bare/bare"
// HACK ALERT
// The correct import is this:
// "github.com/laramiel/bazel-example-golang-bare/bare"
// But the bazel build rules for external golang packages like git_repository() are busted.
// We hack around it by importing where those external dependencies end up:
"github.com/laramiel/bazel-example-golang/external/ws_bare/bare"
)
func main() {

View File

@ -2,7 +2,13 @@ package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang-remote/remote"
// HACK ALERT
// The correct import is this:
// "github.com/laramiel/bazel-example-golang-remote/remote"
// But the bazel build rules for external golang packages like git_repository() are busted.
// We hack around it by importing where those external dependencies end up:
"github.com/laramiel/bazel-example-golang/external/ws_remote/remote"
)
func main() {

View File

@ -2,7 +2,14 @@ package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang-bare/bare"
// HACK ALERT
// The correct import is this:
// "github.com/laramiel/bazel-example-golang-bare/bare"
// But the bazel build rules for subversion packages don't support alternate
// go_prefix() commands.
// We hack around it by importing where those external dependencies end up:
"github.com/laramiel/bazel-example-golang/submodule/src/bare"
)
func main() {

View File

@ -2,7 +2,14 @@ package main
import (
"fmt"
"github.com/laramiel/bazel-example-golang-remote/remote"
// HACK ALERT
// The correct import is this:
// "github.com/laramiel/bazel-example-golang-bare/bare"
// But the bazel build rules for subversion packages don't support alternate
// go_prefix() commands.
// We hack around it by importing where those external dependencies end up:
"github.com/laramiel/bazel-example-golang/submodule/src/remote/remote"
)
func main() {