Build broken with Bazel 0.20
Issue Template
Title: Build broken with Bazel 0.20
Description:
The new version of bazel released 6 days ago seems to have some backwards compatibility issues with building envoy from scratch.
Build Script:
This script is run inside a docker container based on Ubuntu 16.04.
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
add-apt-repository ppa:longsleep/golang-backports
apt-get update \
&& apt-get install -y openjdk-8-jdk \
&& apt-get install -y bazel \
&& apt-get install -y cmake realpath clang-format-5.0 automake libtool \
&& apt-get install -y golang-go
export GOPATH=$HOME/go
go get github.com/bazelbuild/buildtools/buildifier
bazel fetch //source/...
bazel build //source/exe:envoy-static
The errors that appear are:
1. --incompatible_remove_native_http_archive flag
ERROR: Skipping '//source/exe:envoy-static': error loading package 'source/exe': in /source/bazel/envoy_build_system.bzl: Encountered error while reading extension file 'protobuf.bzl': no such package '@com_google_protobuf//': 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.
WARNING: Target pattern parsing failed.
ERROR: error loading package 'source/exe': in /source/bazel/envoy_build_system.bzl: Encountered error while reading extension file 'protobuf.bzl': no such package '@com_google_protobuf//': 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.
To fix, I've added the following exceptions in the bazel fetch step:
RUN bazel fetch --incompatible_remove_native_http_archive=false //source/...
Other Issues
There seems to be errors that are related to this flag that I'm still working through: https://docs.bazel.build/versions/master/skylark/backward-compatibility.html#disable-legacy-c-configuration-api
Release notes for bazel 0.20: https://github.com/bazelbuild/bazel/releases/tag/0.20.0
Any suggestions on how to better go about fixing this would be much appreciated!
Thanks!
Hmm I'm able to building using 0.20. @htuch @lizan @jmillikin-stripe?
Oh btw, I'm building specifically with Envoy checked out to 1.8.0: https://github.com/envoyproxy/envoy/commit/4dd49d8809f7aaa580538b3c228dd99a2fae92a4
It works fine for me at HEAD. We don't provide any Bazel - Envoy version compatibility guarantees other than "HEAD should build with the last Bazel point release".
Makes sense to me. The way we're building envoy from scratch tagged at old releases isn't great anyway. The lack of repeatable builds for older versions of envoy seems a bit odd to me, but will try with the older version of bazel for now and switch to consuming binary releases in the long term.
I appreciate the fast response! 😄
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
@f3nry I switched to an older version of envoy (0.17.2) and it worked for me.
I changed the BAZEL_VERSION in the script to build the container. This also fixed some other issues with @io_bazel_rules_go//go/toolchain.
Closing this out given https://github.com/envoyproxy/envoy/issues/5236#issuecomment-445025576.