-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
build: bazel changes to build on Windows #3786
Conversation
This commit just contains the build changes required to build envoy on Windows. As is, it will not compile without code changes. We expect to add the code changes in an upcoming PR Signed-off-by: Sam Smith <sesmith177@gmail.com> Signed-off-by: Amin Jamali <ajamali@pivotal.io>
@jmillikin-stripe @htuch @lizan @htuch do you know if there is someone from the Bazel Windows team that might be able to help review? Excited to see this land! |
This is so it doesn't build when Linux ci runs `bazel build @envoy_api//envoy/...` Only one of the pgv_cc_proto_library or the native cc_proto_library can build at a time. Signed-off-by: Amin Jamali <ajamali@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
@dslomov do you know who we can get from Bazel Windows team to help out here? |
Laszlo (cc'd) is a TL for Bazel on Windows
htuch <notifications@github.com> schrieb am Di., 3. Juli 2018, 22:14:
… @dslomov <https://github.com/dslomov> do you know who we can get from
Bazel Windows team to help out here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3786 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AExrXzVT1UPXCsdwBNB2Z1ET1b6JQKNpks5uC9CdgaJpZM4VBbw0>
.
|
@dslomov thanks, I assume the GH handle is @laszlocsomor. |
I won't be able to review this PR for at least the next few days. Do you have any specific concerns about Windows? Or specific files that are risky and someone (maybe me, maybe someone else with Windows expertise) should look at? |
/cc @meteorcloudy |
I don't have any Windows machines and have never tried running Bazel or Envoy on Windows, so I may not be the best person to review this. Is there any particular part you'd like me to look at? |
@jmillikin-stripe if you could just sanity check that it won't break any of the linux stuff or is obviously doing something strange that would be great. We will find someone on the Bazel windows team to help review the windows stuff. |
bazel/repositories.bat
Outdated
@@ -0,0 +1,4 @@ | |||
echo "Start" | |||
@ECHO OFF | |||
bash -c "./repositories.sh %*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which Bash this will execute depends on the PATH
. Do you expect to run MSYS Bash or the Bash installed by Windows Subsystem for Linux (available on Window 10, 1607)?
If the latter, you can make this unambiguous by using an absolute path (via the %SYSTEMROOT%
environment variable):
%SYSTEMROOT%\system32\bash.exe -c "./repositories.sh %*"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set %BAZEL_SH%
to the MSYS2 bash here: https://github.com/greenhouse-org/envoy/blob/a8eefb8d2dbd9d0eb05ec5e839c8eea3b7994897/windows/setup/workstation_setup.ps1#L50
So we will update this script to use that environment variable
bazel/repositories.bzl
Outdated
@@ -7,6 +7,11 @@ load(":genrule_repository.bzl", "genrule_repository") | |||
load(":patched_http_archive.bzl", "patched_http_archive") | |||
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS") | |||
load(":target_recipes.bzl", "TARGET_RECIPES") | |||
load("@bazel_tools//tools/cpp:windows_cc_configure.bzl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meteorcloudy: do you think it's OK to use windows_cc_configure.bzl
? As far as I know it has no public interface. If Envoy starts depending on it, we won't be able to change it without potentially breaking them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine. windows_cc_configure.bzl
does expose find_vc_path
, setup_vc_env_vars
, find_msvc_tool
.
I believe they are quite common functions that're needed when setting up MSVC related repo. The function interface didn't change since the beginning, so I think it's stable enough to let others to depend on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is why do we need to setup the MSVC environment variables? @sesmith177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependencies that are built with scripts (e.g. https://github.com/envoyproxy/envoy/blob/75909a7d16f0291ccd0bbe29517ac387a34701ea/ci/build_container/build_recipes/cares.sh) need to have the MSVC environment variables set. So we set the variables up when calling the repositories.bat
script that ends up building them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation, then this looks good to me!
make_cmd=make | ||
benchmark_lib="libbenchmark.a" | ||
|
||
if [[ "${OS}" == "Windows_NT" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$OS
is defined under MSYS Bash and Cygwin Bash, but not under WSL Bash (Ubuntu 14.04 on Windows Subsystem for Linux).
Which Bash do you expect to run this script under?
(Same question goes for other shell scripts that use $OS
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We expect this to run under MSYS2 Bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sesmith177 can you add some build documentation to https://github.com/envoyproxy/envoy/blob/master/bazel/README.md that capture the build flow and also these assumptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to PR the build documentation when we PR source code changes? As it stands, Envoy won't actually build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to land the documentation either here or in a distinct PR for docs alone; it doesn't really make sense to make the source delta PR larger with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we'll follow up the source PR with a docs PR
./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --disable-libevent-regress --disable-openssl | ||
make V=1 install | ||
if [[ "${OS}" == "Windows_NT" ]]; then | ||
wget -O libevent-"$VERSION".tar.gz https://github.com/libevent/libevent/archive/release-"$VERSION".tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK wget
is not part of the default MSYS installation. You may need to document it as a requirement somewhere.
windows/bazel/get_workspace_status
Outdated
if [ -f SOURCE_VERSION ] | ||
then | ||
echo "BUILD_SCM_REVISION $(cat SOURCE_VERSION)" | ||
echo "STABLE_BUILD_SCM_REVISION $(cat SOURCE_VERSION)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUILD_SCM_VERSION
is a known volatile key:
What's the reason to export the same info as a stable key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script was copied from here: https://github.com/envoyproxy/envoy/blob/master/bazel/get_workspace_status
If we understand correctly, these variables are used for linkstamping: https://github.com/envoyproxy/envoy/blob/998b8119ed57269e77d0a03b1b92e7a98c5d30d1/source/common/common/version_linkstamp.cc
Since we haven't gotten linkstamping to work on Windows, we will just remove this
@@ -0,0 +1,3 @@ | |||
@ECHO OFF | |||
bash -c "bazel/get_workspace_status %*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question again as earlier: which Bash do you expect to use here?
Maybe it'd advantageous to check that the right Bash is the first on the PATH.
curl exists in MSYS2 by default. Signed-off-by: Sam Smith <sesmith177@gmail.com>
This was used for linkstamping on linux that would not work on windows. Signed-off-by: Amin Jamali <ajamali@pivotal.io>
workstation_setup.ps1 will set BAZEL_SH after installing MSYS2 Signed-off-by: Sam Smith <sesmith177@gmail.com>
@@ -131,6 +131,14 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de | |||
], | |||
visibility = ["//visibility:public"], | |||
) | |||
|
|||
native.cc_proto_library( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, without the PGV validation, there are two things we lose:
- The ability to reject configurations that are somewhat nonsensical.
- The guarantee that various preconditions on Envoy config processing code are met.
I think (1) is fine for an interim solution, but (2) is positively dangerous, since configuration can easily crash or pose security hazards to an Envoy instance. E.g. the config processing code might access an element in an array that has not been allocated, because it believes that due to PGV validation that the array is at least N elements long. If we want to accept (2) and the non-PGV variant for Windows, we probably want to slap a bunch of TODOs and warnings, together with tracking bugs, to ensure we bridge this gap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When building with the PGV validation, we ran into a few issues:
- rules_go wasn't properly handling Windows paths. This appears to be fixed in 1c7fd7e58310b832decc04963ec13db204f79150, but this commit has not been released
- in PGV,
_go_proto_library_gen_impl
: https://github.com/lyft/protoc-gen-validate/blob/master/bazel/go_proto_library.bzl#L130 was not generating an OS agnostic script - The
cc_proto_library
rule from@com_google_protobuf//:protobuf.bzl
did not de-duplicate command line arguments, causing it to hit the 32,768 character command line limit. The native Bazelcc_proto_library
rule does not have this issue.
So it looks like the way forward would be something like:
- Update project to latest rules_go once it is released
- Fix up PGV
_go_proto_library_gen_impl
so it generates valid scripts for both Linux and Windows - PGV uses native Bazel
cc_proto_library
rules.
From the comment in api/bazel/api_build_system.bzl
, it looks like the third step might not be possible at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think there's going to be some non-trivial changes to get us to native cc_proto_library
. I don't think we can do release binaries for Windows or consider Windows supported beyond experimental until this is fixed though. We should add TODOs and tracking issues for now.
api/bazel/api_build_system.bzl
Outdated
native.cc_proto_library( | ||
name = _Suffix(name, _CC_SUFFIX) + "_native", | ||
deps = [name], | ||
tags=["manual"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: prefer consistent spacing around =
here.
api/bazel/api_build_system.bzl
Outdated
@@ -131,6 +131,14 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de | |||
], | |||
visibility = ["//visibility:public"], | |||
) | |||
|
|||
native.cc_proto_library( | |||
name = _Suffix(name, _CC_SUFFIX) + "_native", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you might want to use a _CC_NATIVE_SUFFIX here instead.
) | ||
|
||
config_setting( | ||
name = "windows_fastbuild_build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with Bazel's platforms/toolchains support, but is this something we should be using to make the Windows vs. Linux vs. Mac OS X situation cleaner? In particular, I think we have multiple orthogonal build concerns:
- Target OS (Windows (native vs. Linux compat?), Linux, Mac OS X)
- Target runtime (libc++ vs. libstdc++)
- Target toolchain (clang, gcc, Visual Studio)
- Etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We added the windows_*_build
config settings because there is no way to perform a select
on multiple conditions. This allows envoy_copts
to conditionally append --ggdb3
on Linux and never to append it on Windows: https://github.com/greenhouse-org/envoy/blob/windows-build-pr/bazel/envoy_build_system.bzl#L36-L41
With respect to the more general question, we are open to suggestions and what the community decides as the best approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laszlocsomor @jmillikin-stripe is there a sensible way to handle this with https://docs.bazel.build/versions/master/platforms.html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laszlocsomor @jmillikin-stripe is there a sensible way to handle this with https://docs.bazel.build/versions/master/platforms.html?
pinging @katre to answer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding a cflag on one platform should be a property of the cc_toolchain, if I understand it properly (given how confusing C++ is, I possibly don't). Are you defining your own cc_toolchain targets, or using the ones from auto-configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, on Windows we are just using the ones from auto-configuration, though on Linux there's a wrapper script: https://github.com/envoyproxy/envoy/blob/master/bazel/cc_configure.bzl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the existing code is probably the best way to do things.
make_cmd=make | ||
benchmark_lib="libbenchmark.a" | ||
|
||
if [[ "${OS}" == "Windows_NT" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sesmith177 can you add some build documentation to https://github.com/envoyproxy/envoy/blob/master/bazel/README.md that capture the build flow and also these assumptions?
-DCMAKE_BUILD_TYPE=RELEASE \ | ||
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF | ||
make | ||
cp src/libbenchmark.a "$THIRDPARTY_BUILD"/lib | ||
$make_cmd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "$make_cmd"
.
|
||
if [[ "${OS}" == "Windows_NT" ]]; then | ||
cmake_generator="Ninja" | ||
make_cmd=ninja |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Ninja? Is there no way to do GNU make on Win?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided to use Ninja because that is what Microsoft uses in their VCPKG tool for managing/building C/C++ libraries. For benchmark specifically, see: https://github.com/Microsoft/vcpkg/blob/d977ac231e995250c169ac1778b7de34f7f57ead/ports/benchmark/portfile.cmake#L22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, does it fail if you use GNU make? I'm curious what the Bazel folks who are working on external dependency integration with cmake plan on Windows, CC @iirina.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For benchmark at least, we were not able to get it to work with GNU make
ci/prebuilt/BUILD
Outdated
@@ -4,21 +4,30 @@ package(default_visibility = ["//visibility:public"]) | |||
|
|||
cc_library( | |||
name = "ares", | |||
srcs = ["thirdparty_build/lib/libcares.a"], | |||
srcs = glob([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need glob
? Shouldn't this be select
based on platform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We initially had select
based on platform, but our method for doing so was fighting with the Bazel buildifier
. Thanks for having us take another look -- we will push a change that does the select
correctly
Signed-off-by: Natalie Arellano <narellano@pivotal.io>
bazel/repositories.bzl
Outdated
current_path = get_env_var(ctxt, "PATH", None, False) | ||
env = setup_vc_env_vars(ctxt, vc_path) | ||
env["PATH"]+=(";%s" % current_path) | ||
env["CC"]="cl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge master? We just merged a PR that applied Buildifier on Skylark files that should clean a lot of this up for consistency.
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 17e422b..b2e7a6e 100644 | ||
--- a/lib/CMakeLists.txt | ||
+++ b/lib/CMakeLists.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to upstream this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-DYAML_CPP_BUILD_TESTS=off \ | ||
-DCMAKE_BUILD_TYPE=Debug .. | ||
ninja | ||
ninja install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could switch to ninja on non-Window? I would prefer greater consistency for maintainability here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From our perspective, we are explicitly trying not to change anything about how non-Windows builds happen in this PR. Perhaps a future PR?
Also, switching to ninja on non-Windows introduces a new build dependency, which is maybe not good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a more fundamental question while we're thinking about this. How are we going to do CI, gate submissions and do build regression handling for Windows? I know a while back we chatted (@mattklein123 ) and had some idea that Windows would be best-effort, with the Microsoft folks owning the regression fixes. Is this where we are still at? I don't think CircleCI has Windows support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We spoke with @mattklein123 about this a couple of weeks ago. It seems like Windows support would still be best-effort at this time. We've used AppVeyor for Windows CI in the past, and that's what we were thinking of using. We could help get this set up so that the automation is in place, but not gate on CI passing (for now).
echo "Building..." | ||
pushd "$env:ENVOY_SRCDIR" | ||
bazel $env:BAZEL_BASE_OPTIONS.Split(" ") build $env:BAZEL_BUILD_OPTIONS.Split(" ") -c dbg "//source/exe:envoy-static" | ||
$exit = $LASTEXITCODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sadly don't even know how to review PowerShell; are there any @envoyproxy/maintainers who do?
@mattklein123 @laszlocsomor after merging in master, we had to disable all Envoy extensions to get the final compile command lines under the limit (bazelbuild/bazel#5163). |
Signed-off-by: Matthew Horan <mhoran@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com>
Signed-off-by: Sam Smith <sesmith177@gmail.com>
Signed-off-by: Matthew Horan <mhoran@pivotal.io> Signed-off-by: Sam Smith <sesmith177@gmail.com> Signed-off-by: Matthew Horan <mhoran@pivotal.io>
Signed-off-by: Sam Smith <sesmith177@gmail.com> Signed-off-by: Matthew Horan <mhoran@pivotal.io>
I've tried to fully review this PR a few times, but keep getting lost partway through -- it's quite large, and touches multiple parts of the build in ways that I don't understand the interactions of. Is it possible to split it up into multiple PRs? In particular, the order would be something like:
|
Static registration for message checks could work I think (providing there is no ordering issues), so no objection really if you can do the lifting there. We can always fork Ideally, we stop using |
We can also patch upstream dependencies with |
@htuch @jmillikin-stripe Here's our PR to PGV to bump rules_go: bufbuild/protoc-gen-validate#87 |
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Lets not mark things as stale just because they're difficult, stalebot. |
@htuch @jmillikin-stripe pr to PGV to break dependency on |
@htuch @jmillikin-stripe here's our PR to get PGV working on Windows: bufbuild/protoc-gen-validate#94 |
@sesmith177 great, thanks for the awesome work moving that forward. Can you refresh us on what the next steps are? |
@htuch the next step would be to bump PGV in Envoy (though that is currently blocked by lyft/protoc-gen-star#28). Once that is done, it looks like all the build changes will have been taken care of, and this PR could be closed. After that, we would begin the process of getting code changes upstream. Note that we currently have to use a forked version of bazel to build/test our Envoy fork due to bazelbuild/bazel#5163. So we're not blocked from working on our fork at the moment, but we'd probably want other people to be able to easily build our code before getting it upstream |
Working with @akonradi I've done some testing trying to integrate this latest PGV into Envoy. Diffs below and upgraded to diff --git a/WORKSPACE b/WORKSPACE
index 5545e2ac4..ebdb050a7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -10,7 +10,5 @@ load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
api_dependencies()
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
-load("@com_lyft_protoc_gen_validate//bazel:go_proto_library.bzl", "go_proto_repositories")
-go_proto_repositories(shared=0)
go_rules_dependencies()
go_register_toolchains() diff --git a/api/bazel/api_build_system.bzl b/api/bazel/api_build_system.bzl
index 497d82c5c..67ed53658 100644
--- a/api/bazel/api_build_system.bzl
+++ b/api/bazel/api_build_system.bzl
@@ -122,9 +122,8 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de
# the proto_library above are aligned.
pgv_cc_proto_library(
name = _Suffix(name, _CC_SUFFIX),
- srcs = srcs,
- deps = [_LibrarySuffix(d, _CC_SUFFIX) for d in deps],
- external_deps = [
+ deps = [name],
+ cc_deps = [_LibrarySuffix(d, _CC_SUFFIX) for d in deps] + [
"@com_google_protobuf//:cc_wkt_protos",
"@googleapis//:http_api_protos",
"@googleapis//:rpc_status_protos", diff --git a/api/bazel/repositories.bzl b/api/bazel/repositories.bzl
index 2e497d712..cdcde74d2 100644
--- a/api/bazel/repositories.bzl
+++ b/api/bazel/repositories.bzl
@@ -1,9 +1,9 @@
-PGV_GIT_SHA = "f9d2b11e44149635b23a002693b76512b01ae515"
+PGV_GIT_SHA = "f15f532855984e68dc1474598e4692fc6a08d841" # Aug 21, 2018
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
@@ -33,7 +33,10 @@ filegroup(
proto_library(
name = "api_httpbody_protos_proto",
srcs = [":api_httpbody_protos_src"],
- deps = ["@com_google_protobuf//:descriptor_proto"],
+ deps = [
+ "@com_google_protobuf//:any_proto",
+ "@com_google_protobuf//:descriptor_proto",
+ ],
visibility = ["//visibility:public"],
) |
@sesmith177 @moderation thanks for the update. I think this is actually blocking #4233 now; the reason this is because #4233 fails on OS X builds due to PGV paths being too long, I think your move to depsets fixed that, but I can't import it due to the failures you folks have been chasing. So, please do let me know when that lands, happy to review the PR to move things along. |
@sesmith177 @rodaine do you know where we are with PGV update for Envoy? I'd like to add some PGV features, but it seems we're blocked on the above item unless it has been resolved. Thanks. |
@htuch bufbuild/protoc-gen-validate#89 is still an outstanding blocker, as far as I know |
@sesmith177 now that bufbuild/protoc-gen-validate#103 has merged, this should be unblocked. |
@sesmith177 I tried to bump the existing build (see WiP branch https://github.com/htuch/envoy/tree/pgv-bump). Unfortunately, it looks like there are some issues with the new C++ validation rules (replacing the previous weak linking). Here's what I see:
I'm not sure how validate.pb.h is appearing there, we don't have this as a physical proto. |
Actually, looks like I just had to drop the |
That's interesting -- we are looking at this as well |
@htuch we have a branch that builds and passes all the tests on Linux: https://github.com/greenhouse-org/envoy/tree/pgv-on-windows With regard to the misleading comment in PGV, the issue is that all of the test cases in that repo import |
@sesmith177 great. I also have a PR ready to go. |
Description:
This is the first step in addressing #129
This PR just contains the build changes required to build a debug version of
envoy.exe
on Windows. The biggest difficulty is that Bazel hits the 32,768 character command line limit on Windows in 2 places:cc_proto_library
rule from https://github.com/google/protobuf/blob/master/protobuf.bzl.cc
files (usuallymain.cc
ormain_common.cc
)To work around the protobuf issue, we use Bazel's native
cc_proto_library
rule on Windows. This has the side effect of not being able to use PGV / protobuf validation.There's an issue open on Bazel to fix the long compile command issue: bazelbuild/bazel#5163. Until that is fixed, we work around this issue by not building the majority of the extensions on Windows. Once the issue is fixed, the extensions can begin to be enabled.
We plan to submit a follow-up PR that includes the actual code changes to make Envoy work on Windows.
Risk Level:
low
Testing:
bazel test //test/...
on LinuxDocs Changes:
none so far
Release Notes:
none so far
cc @aminjam