-
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: Initial bazel build file changes for Windows #3884
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9b26b1e
Initial bazel build file changes for Windows
sesmith177 1e5ccfc
Cleanup bazel build options
ajgokhale 93dd729
Use Start-BitsTransfer instead of Invoke-WebRequest
sesmith177 8d04a12
Add note that `experimental_shortened_obj_file_path`
ajgokhale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 define 3 different
config_setting
rules for Windows for thecompilation_mode
options? They are all used the same way, you could substitute them with//bazel:windows_x86_64
.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 need the 3 different
config_setting
rules for thisselect
here: https://github.com/greenhouse-org/envoy/blob/windows-build-pr/bazel/envoy_build_system.bzl#L36-L41Specifically, we want to never append
-ggdb3
to thecopts
on Windows, but we want to keep the selection mechanism on Linux. If we just add//bazel:windows_x86_64
to thatselect
, it will fail since multiple options will be true (e.g.//bazel:windows_x86_64
and//bazel:dbg_build
).As far as we know, this is the best way to
select
on multiple conditions -- did we miss some other way to do 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.
Ah, I see. No, I think you're right. Thanks for the explanation!