Fix example for later bazel#14
Open
snapsam wants to merge 1 commit into
Open
Conversation
**Background**
Cloning and attempting to use this example repo breaks:
```
ERROR: /Users/snapsam/code/proto_library/WORKSPACE:4:1: name 'http_archive' is not defined
ERROR: /Users/snapsam/code/proto_library/WORKSPACE:13:1: name 'http_archive' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
INFO: Elapsed time: 0.296s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
```
Fixing http_archive gives the next error:
```
ERROR: /private/var/tmp/_bazel_snapsam/c0003f367b02e98a87175911e30b666a/external/com_google_protobuf/BUILD:597:1: Traceback (most recent call last):
File "/private/var/tmp/_bazel_snapsam/c0003f367b02e98a87175911e30b666a/external/com_google_protobuf/BUILD", line 597
internal_gen_well_known_protos_java(srcs = WELL_KNOWN_PROTOS)
File "/private/var/tmp/_bazel_snapsam/c0003f367b02e98a87175911e30b666a/external/com_google_protobuf/protobuf.bzl", line 266, in internal_gen_well_known_protos_java
Label(("%s//protobuf_java" % REPOSITOR...))
File "/private/var/tmp/_bazel_snapsam/c0003f367b02e98a87175911e30b666a/external/com_google_protobuf/protobuf.bzl", line 266, in Label
REPOSITORY_NAME
The value 'REPOSITORY_NAME' has been removed in favor of 'repository_name()', please use the latter (https://docs.bazel.build/versions/master/skylark/lib/native.html#repository_name).
INFO: An error occurred during the fetch of repository 'com_google_protobuf_javalite'
INFO: Call stack for the definition of repository 'com_google_protobuf_javalite':
- /Users/snapsam/code/proto_library/WORKSPACE:15:1
ERROR: /Users/snapsam/code/proto_library/src/BUILD:52:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: Target '@com_go
ogle_protobuf//:protoc' contains an error and its package is in error
ERROR: /Users/snapsam/code/proto_library/src/BUILD:46:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: Target '@com_go
ogle_protobuf//:protoc' contains an error and its package is in error
ERROR: /Users/snapsam/code/proto_library/src/BUILD:32:1: Target '@com_google_protobuf//:any_proto' contains an error and its package is in error and referenced by '//src:person_proto'
ERROR: /Users/snapsam/code/proto_library/src/BUILD:32:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: Target '@com_go
ogle_protobuf//:protoc' contains an error and its package is in error
ERROR: Analysis of target '//src:zip_code_proto' failed; build aborted: Analysis failed
INFO: Elapsed time: 2.218s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (6 packages loaded, 34 targets configured)
```
Both of these are due to incompatibility with recent versions of bazel. The
former is a problem in this repository's WORKSPACE, where as the latter is a
problem in the dependency
**Change**
* Provide a drop-in replacement for http_archive
* Upgrade proto dependencies to working version [see](protocolbuffers/protobuf#4650)
**Test Plan**
- [x] Compiles locally with Bazel 0.25.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Cloning and attempting to use this example repo breaks:
Fixing http_archive gives the next error:
Both of these are due to incompatibility with recent versions of bazel. The
former is a problem in this repository's WORKSPACE, where as the latter is a
problem in the dependency
Change
Test Plan