Skip to content

Build with latest Bazel(upgrade Bazel from 0.5.4 to 0.21.0) #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Mar 1, 2019

Conversation

jiachenwang
Copy link
Contributor

No description provided.

@@ -57,4 +60,7 @@ libio-socket-ssl-perl is needed to run ESP tests:

To run ESP tests, run the following command in the terminal.

bazel test //src/... //third_party:all
bazel test --incompatible_remove_native_git_repository=false \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the ROOT folder, same folder as WORKSPACE, you can have .bazelrc file, similar to
https://github.com/cloudendpoints/esp/blob/master/tools/bazel.rc
But the new bazel obsoleted it,

I believe over there, you can specify these flags. so that it will apply to all

I don't know the detail, could you study it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -51,7 +47,7 @@ go_library(
srcs = glob(
["google/protobuf/*.pb.go"],
),
go_prefix = "//tools/src:go_prefix",
importpath = "github.com/cloudendpoints/esp",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this change, can we at least build it by
bazel build //tools/src/...

Otherwise, not need to change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though with this change "bazel build //tools/src/..." still fails, I would like keep it because go_prefix is no longer valid syntax in new version of Bazel and we need to use importpath instead. Also this moves one more step toward making "bazel build //tools/src/..." successful.

@qiwzhang
Copy link
Contributor

Good job. all presubmit tests are passed now. I just started a e2e test for this

https://endpoints-jenkins.appspot.com/job/jenkins-testing/job/pr-e2e/

@qiwzhang
Copy link
Contributor

Please rebase your changes

@whitlockjc
Copy link
Contributor

Upgrading Bazel would be a very welcome change. 0.5.4 is really old and the versions of the deps/tools being used have bugs in them that are fixed but require newer versions of Bazel, like this one. Is there anything I can do to help get this accepted?

@qiwzhang
Copy link
Contributor

@jiachenwang could you rebase this PR?

Copy link
Contributor

@qiwzhang qiwzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job to get it e2e tests passed. Some minor comments

'bazel-bin/external/org_golang_google_grpc/stress/metrics_client/metrics_client',
'bazel-bin/external/org_golang_google_grpc/interop/server/server',
'bazel-bin/external/org_golang_google_grpc/stress/client/client',
'bazel-bin/test/grpc/linux_amd64_stripped/interop-client',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if --config=asan or debug,the file name will without linux_amd64_stripped. do we need to stash or save them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins stores Release version binary to GCS bucket for e2e testing, so we do not neet stash asan or debug one.

WORKSPACE Outdated
@@ -168,7 +171,7 @@ bind(
#
git_repository(
name = "io_bazel_rules_pex",
commit = "6af30588d4f11cafcb744c50935cc37f029e6e7f",
commit = "0c5773db01ab8aeb3ae749b2fc570749b93af41f",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add comment on to state the date of this SHA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

WORKSPACE Outdated
http_archive(
name = "bazel_gazelle",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.16.0/bazel-gazelle-0.16.0.tar.gz"],
sha256 = "7949fc6cc17b5b191103e97481cf8889217263acf52e00b560683413af204fcb",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please state the date of the SHA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

repositories.bzl Outdated
"""
native.new_git_repository(
name = "org_golang_google_grpc_git",
commit = "9bf8ea0a8282ebecd1aa474c926e3028f5c22a4c",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please state the date for this SHA

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

build_file_content = BUILD,
)

if bind:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this bind is not used. when it is binded, instead of depends on "@org_golang_google_grpc_git//:test_proto", you can depend on "//external:test_proto"

I saw the BUILD file use @org_golang_google_grpc_git//:test_proto directly. so bind is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Other parts in this file uses bind = True. I would like to leave it to be consistent.

@jiachenwang jiachenwang force-pushed the update_bazel branch 3 times, most recently from b53af9d to eb76fe2 Compare February 27, 2019 22:01
@qiwzhang
Copy link
Contributor

Could you rebase it and run pre-e2e again? Thanks

@qiwzhang
Copy link
Contributor

qiwzhang commented Mar 1, 2019

Thanks. @jiachenwang Great job to get this in.

@qiwzhang qiwzhang merged commit c8f7a35 into cloudendpoints:master Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants