Skip to content

Add repository name to build_defs.bzl #5104

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 1 commit into from
Jan 7, 2019
Merged

Add repository name to build_defs.bzl #5104

merged 1 commit into from
Jan 7, 2019

Conversation

yongtang
Copy link
Contributor

@yongtang yongtang commented Jan 5, 2019

In flatbuffers, build_defs.bzl has been updated to have the bazel rule flatbuffer_cc_library defined. Therefore, it should be possible to build another application and using flatbuffer_cc_library
directly with:

load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")

However, when I tried to do the above, I saw the following errors in bazel:

ERROR: /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b \
/external/arrow/BUILD.bazel:12:1: in deps attribute of cc_library rule \
@arrow//:arrow_format: target '@arrow//:runtime_cc' does not exist. \
Since this rule was created by the macro 'flatbuffer_cc_library', the error \
might have been caused by the macro implementation in \
/root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b\
/external/com_github_google_flatbuffers/build_defs.bzl:216:16

The reason for the bazel error was that //:runtime_cc and //:flatc does not have
the repo name prefixed.

By prefix @com_github_google_flatbuffers ("@com_github_google_flatbuffers//:flatc") the above bazel build error could be resolved.

This fix should help other programs to use flatbuffers directly through bazel.

Signed-off-by: Yong Tang [email protected]

In flatbuffers, build_defs.bzl has been updated to have the
bazel rule `flatbuffer_cc_library` defined. Therefore, it should
be possible to build another application and using `flatbuffer_cc_library`
directly (by `load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")`)

However, when I tried to do the above, I saw the following errors in bazel:
```
ERROR: /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/arrow/BUILD.bazel:12:1: in deps attribute of cc_library rule @arrow//:arrow_format: target '@arrow//:runtime_cc' does not exist. Since this rule was created by the macro 'flatbuffer_cc_library', the error might have been caused by the macro implementation in /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/com_github_google_flatbuffers/build_defs.bzl:216:16
```

The reason for the bazel error was that `//:runtime_cc` and `//:flatc` does not have
the repo name prefixed.

By prefix `` the above bazel build error could be resolved.

This fix should help other programs to use flatbuffers directly through bazel.

Signed-off-by: Yong Tang <[email protected]>
@aardappel aardappel merged commit 155c559 into google:master Jan 7, 2019
@yongtang yongtang deleted the build_defs branch January 7, 2019 18:19
zchee pushed a commit to zchee/flatbuffers that referenced this pull request Feb 14, 2019
In flatbuffers, build_defs.bzl has been updated to have the
bazel rule `flatbuffer_cc_library` defined. Therefore, it should
be possible to build another application and using `flatbuffer_cc_library`
directly (by `load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")`)

However, when I tried to do the above, I saw the following errors in bazel:
```
ERROR: /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/arrow/BUILD.bazel:12:1: in deps attribute of cc_library rule @arrow//:arrow_format: target '@arrow//:runtime_cc' does not exist. Since this rule was created by the macro 'flatbuffer_cc_library', the error might have been caused by the macro implementation in /root/.cache/bazel/_bazel_root/c27e9809996ce9a9c0ed8dd79ef0897b/external/com_github_google_flatbuffers/build_defs.bzl:216:16
```

The reason for the bazel error was that `//:runtime_cc` and `//:flatc` does not have
the repo name prefixed.

By prefix `` the above bazel build error could be resolved.

This fix should help other programs to use flatbuffers directly through bazel.

Signed-off-by: Yong Tang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants