-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Initial bazel build file changes for Windows (#3884)
This is the first step in breaking up #3786 into smaller chunks. This contains the Bazel config / compiler options to allow Envoy to build on Windows. Future PRs will address the external deps build scripts and PGV. Risk Level: Low Testing: Ran bazel build //source/exe:envoy-static and bazel test //test/... on Linux Docs Changes: None Release Notes: None Signed-off-by: Sam Smith <[email protected]>
- Loading branch information
1 parent
b32eabf
commit e89c9d6
Showing
17 changed files
with
364 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ SOURCE_VERSION | |
.cache | ||
.vimrc | ||
.vscode | ||
.vs |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
echo "Start" | ||
@ECHO OFF | ||
%BAZEL_SH% -c "./repositories.sh %*" | ||
exit %ERRORLEVEL% |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$ErrorActionPreference = "Stop"; | ||
trap { $host.SetShouldExit(1) } | ||
|
||
if ("$env:NUM_CPUS" -eq "") { | ||
$env:NUM_CPUS = (Get-WmiObject -class Win32_computersystem).NumberOfLogicalProcessors | ||
} | ||
|
||
if ("$env:ENVOY_BAZEL_ROOT" -eq "") { | ||
Write-Host "ENVOY_BAZEL_ROOT must be set!" | ||
throw | ||
} | ||
|
||
mkdir -force "$env:ENVOY_BAZEL_ROOT" > $nul | ||
|
||
$env:ENVOY_SRCDIR = [System.IO.Path]::GetFullPath("$PSScriptRoot\..") | ||
|
||
echo "ENVOY_BAZEL_ROOT: $env:ENVOY_BAZEL_ROOT" | ||
echo "ENVOY_SRCDIR: $env:ENVOY_SRCDIR" | ||
|
||
$env:BAZEL_BASE_OPTIONS="--nomaster_bazelrc --output_base=$env:ENVOY_BAZEL_ROOT --bazelrc=$env:ENVOY_SRCDIR\windows\tools\bazel.rc" | ||
$env:BAZEL_BUILD_OPTIONS="--strategy=Genrule=standalone --spawn_strategy=standalone --verbose_failures --jobs=$env:NUM_CPUS --show_task_finish $env:BAZEL_BUILD_EXTRA_OPTIONS" | ||
$env:BAZEL_TEST_OPTIONS="$env:BAZEL_BUILD_OPTIONS --cache_test_results=no --test_output=all $env:BAZEL_EXTRA_TEST_OPTIONS" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$ErrorActionPreference = "Stop"; | ||
trap { $host.SetShouldExit(1) } | ||
|
||
. "$PSScriptRoot\build_setup.ps1" | ||
Write-Host "building using $env:NUM_CPUS CPUs" | ||
|
||
function bazel_debug_binary_build() { | ||
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 | ||
if ($exit -ne 0) { | ||
popd | ||
exit $exit | ||
} | ||
popd | ||
} | ||
|
||
echo "bazel debug build..." | ||
bazel_debug_binary_build |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.