bazel build failure

211 views
Skip to first unread message

lesli...@gmail.com

unread,
Dec 25, 2018, 11:19:16 AM12/25/18
to proto-roughtime
Dear all,

I'm trying to build roughtime with bazel, but got below failure. My OS is ubuntu 18.04.1 x86_64, and bazel build label is 0.21.0

INFO: Invocation ID: b0983eb4-0984-4579-b4e9-0aaa270ea3ea
ERROR: error loading package '': Encountered error while reading extension file 'protobuf.bzl': no such package '@protobuf//': The native git_repository rule is deprecated. load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") for a replacement.
Use --incompatible_remove_native_git_repository=false to temporarily continue using the native rule.
INFO: Elapsed time: 0.086s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
    currently loading: 


I'm new to bazel, so can anyone tell me how to fix it?

Best Regards
Leslie

Adam Langley

unread,
Dec 25, 2018, 11:45:58 AM12/25/18
to lesli...@gmail.com, proto-roughtime
Looks like Bazel may have deprecated one of the features used in the BUILD file. Temporarily, looks like you can pass --incompatible_remove_native_git_repository=false to Bazel to undo that.


Cheers

AGL

 
Best Regards
Leslie

--
You received this message because you are subscribed to the Google Groups "proto-roughtime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proto-roughti...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/proto-roughtime/90865169-0ac6-4cb5-a28e-35557d67af28%40chromium.org.

lesli...@gmail.com

unread,
Dec 26, 2018, 2:09:39 PM12/26/18
to proto-roughtime, lesli...@gmail.com
Thanks for reply. Adding "--incompatible_remove_native_git_repository=false" causes different failure message:

$ bazel build ... --incompatible_remove_native_git_repository=false
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 9607a197-2aab-4f3c-bb5e-aa7c40ae7846
ERROR: /home/xiaodhu/workspace/roughtime/BUILD:71:1: Traceback (most recent call last):
        File "/home/xiaodhu/workspace/roughtime/BUILD", line 71
                cc_proto_library(name = "config_proto", srcs = ["co..."], <2 more arguments>)
        File "/home/xiaodhu/.cache/bazel/_bazel_xiaodhu/af8d6060d2fe231bad16963319afb52b/external/protobuf/protobuf.bzl", line 229, in cc_proto_library
                cc_libs += [default_runtime]
trying to mutate a frozen object
ERROR: package contains errors:
ERROR: error loading package '': Package '' contains errors
INFO: Elapsed time: 26.196s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

nikita....@gmail.com

unread,
Mar 2, 2019, 11:01:19 PM3/2/19
to proto-roughtime
For those who have problems with the build. Here is the solution.
--------------------------------------------------------------------------------------

$ diff ./roughtime/WORKSPACE ./roughtime-original/WORKSPACE

3,5d2
< load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
< load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
14,15c11,12
<     commit = "3.6.x",
---
>     commit = "v3.2.0",
18c15
< git_repository(
---
> new_http_archive(
20,21c17,20
<     commit = "db9b85e27522628ef173149a692031b7f2154b55",
---
>     sha256 = "f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc",
>     build_file = "gtest.BUILD",
>     strip_prefix = "googletest-release-1.7.0",

$ diff ./roughtime/BUILD ./roughtime-original/BUILD

28c28
<         "@gtest//:gtest_main",
---
>         "@gtest//:main",
49c49
<         "@gtest//:gtest_main",
---
>         "@gtest//:main",
125c125
<         "@gtest//:gtest_main",
---
>         "@gtest//:main",

Reply all
Reply to author
Forward
0 new messages