Skip to content

Commit

Permalink
Remove experimental Go support until we have a solution which fits th…
Browse files Browse the repository at this point in the history
…e 'go' tool conventions better.

--
MOS_MIGRATED_REVID=89510837
  • Loading branch information
hanwen authored and damienmg committed Mar 25, 2015
1 parent bb3bde1 commit 8477641
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 655 deletions.
18 changes: 5 additions & 13 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,14 @@ Python binaries.
What about Go?
--------------

The server code written in Go at Google is also built with Bazel. The
rules that accomplish this are rather complex due to their
interactions with our C++ libraries, and we'd rather not open them up
in their current form. They also predate the conventions of the open
source `go` tool. Indeed, the experience with the Google internal
rules motivated some of the choices in the `go` tool.

If your codebase is 100% Go, the `go` tool has excellent support for
building and testing, and Bazel will not bring you much benefit.

For mixed language codebases, you could try the experimental rules at

<https://github.com/google/bazel/tree/master/examples/go>

They mimick the structure of our internal Go rules, and may require
editing some import lines.
The server code written in Go at Google is built with Bazel. However,
the rules that accomplish this are rather complex due to their
interactions with our C++ libraries, and are incompatible with the
conventions of the `go` tool. For this reason, we'd rather not open
them up in their current form.


Can I use Bazel for my LISP/Python/Haskell/Scala/Rust project?
Expand Down
1 change: 0 additions & 1 deletion examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ filegroup(
srcs = [
"//examples/cpp:srcs",
"//examples/gen:srcs",
"//examples/go:srcs",
"//examples/java-native:srcs",
"//examples/java-skylark:srcs",
"//examples/objc:srcs",
Expand Down
22 changes: 0 additions & 22 deletions examples/go/BUILD

This file was deleted.

121 changes: 0 additions & 121 deletions examples/go/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions examples/go/fib.go

This file was deleted.

29 changes: 0 additions & 29 deletions examples/go/lib1/BUILD

This file was deleted.

9 changes: 0 additions & 9 deletions examples/go/lib1/fail_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions examples/go/lib1/lib1.go

This file was deleted.

14 changes: 0 additions & 14 deletions examples/go/lib1/lib1_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions src/test/shell/bazel/bazel_example_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,6 @@ function test_python() {
expect_log "Fib(5)=8"
}

function test_go() {
if [ -e "tools/go/go_root" ]; then
bazel build -s //examples/go/lib1:lib1 \
|| fail "Failed to build //examples/go/lib1:lib1"
bazel clean
bazel build -s //examples/go:fib \
|| fail "Failed to build //examples/go:fib"
[ -x "bazel-bin/examples/go/fib" ] \
|| fail "bazel-bin/examples/go/fib is not executable"

bazel run //examples/go:fib >$TEST_log \
|| fail "Failed to run //examples/go:fib"
expect_log "Fib(5): 8"

bazel test //examples/go/lib1:lib1_test \
|| fail "Failed to run //examples/go/lib1:lib1_test"

bazel test //examples/go/lib1:fail_test \
&& fail "Test //examples/go/lib1:fail_test has succeeded" \
|| true
else
echo "Skipping go test: go_root not set"
fi
}

function test_java_skylark() {
local java_pkg=examples/java-skylark/src/main/java/com/example/myproject
assert_build ${java_pkg}:hello-lib ./bazel-bin/${java_pkg}/libhello-lib.jar
Expand Down
4 changes: 0 additions & 4 deletions src/test/shell/bazel/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ function create_new_workspace() {
ln -s ${jdk_dir} tools/jdk/jdk
fi

if [[ -d ${go_root} ]]; then
ln -s ${go_root} tools/go/go_root
fi

touch WORKSPACE
}

Expand Down
4 changes: 0 additions & 4 deletions src/test/shell/bazel/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ protoc_jar="${TEST_SRCDIR}/third_party/protobuf/protobuf-*.jar"
junit_jar="${TEST_SRCDIR}/third_party/junit/junit-*.jar"
hamcrest_jar="${TEST_SRCDIR}/third_party/hamcrest/hamcrest-*.jar"

# Try to detect go root and fallback with /usr/lib/golang
# The test itselfs is skipped if go_root is unset.
go_root="$(go env GOROOT 2>/dev/null || echo "/usr/lib/golang")"

# This function copy the tools directory from Blaze.
function copy_tools_directory() {
cp -R ${tools_dir}/* tools
Expand Down
1 change: 0 additions & 1 deletion tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//tools/jdk:srcs",
"//tools/go:srcs",
"//tools/genrule:srcs",
"//tools/cpp:srcs",
"//tools/objc:srcs",
Expand Down
Loading

0 comments on commit 8477641

Please sign in to comment.