angular/angular-bazel-example

The native http_archive rule is deprecated

prestonvanloon opened this issue · 2 comments

I think this is a new error with bazel 0.20.0.

To reproduce, have a fully clean build with bazel 0.20.0.

bazel build //src                     
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 5117a0e6-2b7f-4686-8902-7e221232a490
ERROR: error loading package '': Encountered error while reading extension file 'packages/bazel/package.bzl': no such package '@angular//packages/bazel': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
ERROR: error loading package '': Encountered error while reading extension file 'packages/bazel/package.bzl': no such package '@angular//packages/bazel': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
INFO: Elapsed time: 1.296s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

you simply need to add this to your WORKSPACE file before calling the http_archive rules:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

updated the WORKSPACE file here (adding buildifier lint pointed out the problem)