envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Build broken with Bazel 0.20

Open f3nry opened this issue 7 years ago • 7 comments

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!

f3nry avatar Dec 06 '18 20:12 f3nry

Hmm I'm able to building using 0.20. @htuch @lizan @jmillikin-stripe?

mattklein123 avatar Dec 06 '18 20:12 mattklein123

Oh btw, I'm building specifically with Envoy checked out to 1.8.0: https://github.com/envoyproxy/envoy/commit/4dd49d8809f7aaa580538b3c228dd99a2fae92a4

f3nry avatar Dec 06 '18 20:12 f3nry

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".

htuch avatar Dec 06 '18 20:12 htuch

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! 😄

f3nry avatar Dec 06 '18 21:12 f3nry

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.

stale[bot] avatar Jan 05 '19 23:01 stale[bot]

@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.

utkarsh-simha avatar Jan 11 '19 22:01 utkarsh-simha

Closing this out given https://github.com/envoyproxy/envoy/issues/5236#issuecomment-445025576.

htuch avatar Jan 14 '19 01:01 htuch