Hack around broken bazel golang build rules.
This commit is contained in:
4
BUILD
4
BUILD
@ -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",
|
||||
],
|
||||
)
|
||||
|
@ -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
|
||||
|
8
bare.go
8
bare.go
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
Reference in New Issue
Block a user