| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
Add all tests under //tools/... to
//src:all_windows_tests, to run them on Bazel CI.
See https://github.com/bazelbuild/bazel/issues/4292
Closes #5839.
Change-Id: Iae647f561683cc50ef62416c4b834576ae918486
PiperOrigin-RevId: 208167743
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I realized that I wrote the wrong warning code when I use Bazel from master branch and build something with MSVC.
For the curious:
- C4117: https://msdn.microsoft.com/en-us/library/9d2szxf8.aspx
- C4177: https://msdn.microsoft.com/en-us/library/s4becxs9.aspx
/cc @meteorcloudy
Closes #5631.
PiperOrigin-RevId: 207235606
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove `/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS`: it disables warnings for deprecated C++ headers (`<stdext/*>`, `<hash_map>` etc.). Only useful for legacy codebase.
- Remove `/J`: `char` is signed according to ISO C++. There is no reason to make `char` unsigned by default.
- Remove default `/Gy`: moved to feature (`smaller_binary`).
- Remove default `/GF`: string pooling, enabled by default with `/O2`.
- Remove `/DDEBUG` in `dbg` mode: conflict with macros defined in some OSS projects such as LLVM. User should use standard `NDEBUG` to detect debug mode.
Implements a few general `feature` to abstract away details about the compiler:
- `treat_warnings_as_errors`: aka `-Werror`.
- `frame_pointer`: aka `-fno-omit-frame-pointer'.
- `determinism`: redact `__TIME__` macros etc.
- `disable_assertions`: allow user to have `assert/DCHECK` back even in `opt` mode.
- `smaller_binary`: common optimization enabled in `opt` mode. Still allow user to disable it in `opt` (such as when using ASAN).
- `ignore_noisy_warnings`: suppress a bunch of warnings most people don't care. If users want to be pedantic, they can still get those warnings back with `--features=-ignore_noisy_warnings`.
Closes #5519.
PiperOrigin-RevId: 203959555
|
|
|
|
|
|
|
| |
'_cc_toolchain' exists on the ctx being passed to this function. (I broke TAP once because I forgot to add the attribute. Perhaps not that helpful this late in the migration but doesn't hurt.)
RELNOTES: None.
PiperOrigin-RevId: 203947282
|
|
|
|
|
|
|
|
|
|
| |
This makes console output of `bazel build -s` shorter when debugging `CROSSTOOL`.
/cc @meteorcloudy
Closes #5539.
PiperOrigin-RevId: 203899866
|
|
|
|
|
|
|
|
|
|
| |
library
1. Do not apply /WHOLEARCHIVE to interface library
2. On Windows, we cannot link dll directly, so remove related flag_groups
RELNOTES: None
PiperOrigin-RevId: 203752406
|
|
|
|
|
|
|
|
|
|
|
| |
The only reason that those python wrapper scripts still exists is for
TensorFlow's Windows GPU build. As we will create a custom GPU CROSSTOOL
in TF repo, we can finally remove wrapper scripts from Bazel.
Closes #5526.
RELNOTES: Python wrapper scripts for MSVC are removed.
PiperOrigin-RevId: 203472223
|
|
|
|
|
|
|
|
|
|
| |
Clang reports missing -Wl,-z,relro as "ld: unknwon option:
-z"). This cl fixes the autodetection to expect the short variant.
Fixes #5468.
RELNOTES: NONE.
PiperOrigin-RevId: 203449206
|
|
|
|
|
|
|
| |
Should not be needed anymore since we have dynamic configurations for a while.
RELNOTES: None.
PiperOrigin-RevId: 203435557
|
|
|
|
|
|
|
|
|
|
|
| |
Flags passed through clang to linker get -Wl, stripped in the error message
(e.g. -Wl,-no-as-needed will be reported as "ld: unknwon option:
-no-as-needed"). This cl fixes the autodetection to expect the stripped variant.
Fixes #5468.
RELNOTES: None.
PiperOrigin-RevId: 203341563
|
|
|
|
|
|
|
| |
See https://github.com/bazelbuild/bazel/issues/5254#issuecomment-402131986
RELNOTES: None
PiperOrigin-RevId: 203273587
|
|
|
|
|
|
|
|
| |
Signed-off-by: Bin Lu <bin.lu@arm.com>
Closes #5477.
PiperOrigin-RevId: 203241216
|
|
|
|
|
|
|
| |
Fixed https://github.com/bazelbuild/bazel/issues/5495
RELNOTES: None
PiperOrigin-RevId: 202929359
|
|
|
|
|
|
|
| |
crosstool to agregate all its together.
RELNOTES:none
PiperOrigin-RevId: 202470052
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Update all runfiles libraries to have the same
header comment format, including the build rule
to depend on the namespace / header / module to
import
- Fix runfiles_test.cc to include the right files
(recent refactoring commit has split
src/main/cpp/util/path.cc from
file_[platform].cc)
- Change exported variable
_rlocation_isabs_pattern in runfiles.bash to be
upper-case, so it is visibly a variable and not
a function.
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I17e18308506ab9f5c9f410ef6bc6b9df912d42a9
Closes #5481.
Change-Id: I17e18308506ab9f5c9f410ef6bc6b9df912d42a9
PiperOrigin-RevId: 202291629
|
|
|
|
|
|
|
| |
This was never used. We thought it will be useful, but it's not.
RELNOTES: None.
PiperOrigin-RevId: 202143524
|
|
|
|
|
|
|
|
| |
Based on work of Sun Zhiyi <zhiyisun@gmail.com>.
Closes #5360.
PiperOrigin-RevId: 201339882
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert most `COMPILER_MSVC` to `_WIN32` (as they apply to Windows platform, not MSVC compiler). Only `src/tools/singlejar/zip_headers.h` and `src/main/cpp/util/md5.h` actually need `_MSC_VER`.
`COMPILER_MSVC` in `third_party/protobuf` are not removed. They can be fixed by updating dependency to newer version.
/cc @meteorcloudy
Closes #5350.
Change-Id: Ibc131abfaf34a0cb2bd338549983ea9d28eaabfe
PiperOrigin-RevId: 200019793
|
|
|
|
|
|
|
|
|
|
|
| |
Leave functions that make file accesses in the file library, and general blaze utilities in the blaze_util file, but move the functions that boil down to string manipulation and path formatting to their own file. (With the exception of getCWD, since absolute path syntax is relevant here.)
Doing this largely to consolidate all Windows path control into a single place, so that it's easier to notice inconsistencies. For instance, ConvertPath currently makes Windows paths absolute, but not Posix paths, and MakeAbsolute relies on this behavior. In addition, JoinPath assumes Posix path syntax, which leads to some odd looking paths. These will be fixed in a followup change.
(Found these issues while working on #4502, trying to fix the windows-specific system bazelrc.)
RELNOTES: None.
PiperOrigin-RevId: 199368226
|
|
|
|
|
|
|
| |
Fixes #5090
RELNOTES: NONE.
PiperOrigin-RevId: 198870918
|
|
|
|
|
|
| |
This CL aslo enables a presubmit check for correct formatting of all bzl files in //third_party/bazel.
PiperOrigin-RevId: 198857055
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 198676014
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the C++ runfiles library to
@bazel_tools//tools/cpp/runfiles:runfiles.
RELNOTES[NEW]: C++,runfiles: to access data-dependencies (runfiles) in C++ programs, use the runfiles library built into Bazel. For usage info, see https://github.com/bazelbuild/bazel/blob/master/tools/cpp/runfiles/runfiles.h
Change-Id: I5057a9f477289eea7244c60105e77fc71652a817
Closes #5293.
Change-Id: I90cba6fa4c6595c838ae42f9d2c17548c8387e5d
PiperOrigin-RevId: 198531849
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repository functions restart whenever they have to resolve a label due
to the way Skyframe currently works. This is problematic because such
functions are often costly: they try to detect features of the host
system by building and running tools, and they touch the file system.
To minimize the cost of these restarts, which are unavoidable, resolve
the paths to all necessary labels upfront. This way, while the restarts
still happen, they have no side-effects and thus are cheap. As a
side-effect of this work, remove the strange and undocumented "tpl"
function, which only made things more cryptic and harder to refactor.
This cuts down Bazel's own analysis time on macOS on my Mac Pro 2013
from 14 seconds to 6 seconds by trimming about 15 unnecessary rebuilds
and executions of the xcode-locator-bin tool to just 1. In other
words: one fewer awkward pause during analysis time.
Additionally, there is the hope that this will fix the problems users
observe where Bazel writes persistent garbage during autoconfiguration
(needing "clean --expunge" to recover) when Visual Studio Code is
running and Santa is enabled on macOS; see
https://github.com/bazelbuild/bazel/issues/4603. This is most likely
a bug in Santa (see https://github.com/google/santa/issues/260) but
we were tickling it due to our apparently-abusive behavior of building,
executing, and then removing the same thing over and over again.
Fixes https://github.com/bazelbuild/bazel/issues/5196 and should also
fix https://github.com/bazelbuild/bazel/issues/4603.
RELNOTES: None.
PiperOrigin-RevId: 198434395
|
|
|
|
|
|
| |
This is a prequisite to removing cc_toolchain_type entirely.
PiperOrigin-RevId: 198402472
|
|
|
|
|
|
|
| |
CROSSTOOL
RELNOTES: None
PiperOrigin-RevId: 198295290
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merge the manifest- and directory-based runfiles
strategies into the Runfiles class. The resulting
Runfiles object can look up runfiles from the
manifest or from the filesystem, as needed.
Change-Id: Ifff4b76849ce67248bb9152901024e241aaea800
Closes #5251.
Change-Id: Ifff4b76849ce67248bb9152901024e241aaea800
PiperOrigin-RevId: 197863872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the C++ runfiles library so it can use the
runfiles manifest (if present) and the runfiles
directory (if present) simultaneously.
If the Runfiles object fails to look up a runfile
from the manifest (or the manifest didn't exist or
wasn't found) then it looks it up from the
runfiles directory.
This change allows using the same binary with and
without a runfiles tree, which is often what sets
local and remote runs apart.
https://github.com/bazelbuild/bazel/issues/4460
Change-Id: Iae879ff084ba084fcd7c111638ddeae4c6754f4f
Closes #5235.
Change-Id: Iae879ff084ba084fcd7c111638ddeae4c6754f4f
PiperOrigin-RevId: 197726412
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes Bazel respect artifact name patterns specified in
CROSSTOOL.
Users cannot specify any arbitrary name pattern, it must ends with allowed
extensions. For example, for dynamic library, it can only ends with .so,
.dylib or .dll, otherwise Bazel throws an error.
Change-Id: I21d9e6fa7c3a282e1a9b8ff29679b00925cddb33
PiperOrigin-RevId: 197553413
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compute the list of environment variables when
creating the runfiles library instead of computing
it on-demand.
Since we already have the manifest and directory
path from Runfiles::PathsFrom, creating the vector
is cheap, though we have to store it even if we
don't use it later.
In a subsequent change I'll merge the manifest-
and directory-based implementations into
RunfilesImpl, and collapse RunfilesImpl into the
Runfiles base class. The point of that is to make
the runfiles library be able to handle both the
directory-based and the manifest-based case
simultaneously, dependening on what is available
to it in the filesystem.
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I56310423528df2d0f7494f45904150193368e2d6
Closes #5218.
Change-Id: I73d1f44611c4b0a73c41162319d0ba7a8a4ae6d7
PiperOrigin-RevId: 197543865
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the new codepath (Runfiles::PathsFrom) to
compute the paths of the runfiles manifest file
and runfiles directory.
This method considers the RUNFILES_* envvars but
also the argv0 value, and tries hard to discover
where the runfiles manifest or directory is.
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I041b9d12f5c4138853fac1c2bf48873af8e2bd93
Closes #5216.
Change-Id: I041b9d12f5c4138853fac1c2bf48873af8e2bd93
PiperOrigin-RevId: 197146764
|
|
|
|
|
|
|
|
| |
The difference between them is that user_link_flags will stay after we remove
legacy fields from the crosstool.
RELNOTES: None.
PiperOrigin-RevId: 196940832
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 196870840
|
|
|
|
|
|
|
|
|
|
|
|
| |
present
This is useful e.g. when all C++ builds happen remotely and there's no C++
toolchain installed on the host machine.
Fixes #5133.
RELNOTES: None.
PiperOrigin-RevId: 196798471
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new method discovers the runfiles manifest and
runfiles directory using the values of the
RUNFILES_MANIFEST_FILE and RUNFILES_DIR envvars
(if specified), and if needed, also looks for them
next to argv[0].
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: Ie9af0a92aa6879b1d9afdee2789f625de1b0d595
Closes #5140.
Change-Id: Ie9af0a92aa6879b1d9afdee2789f625de1b0d595
PiperOrigin-RevId: 195093387
|
|
|
|
|
|
|
|
| |
`-lgcov` is not supported on macOS.
Closes #5138.
PiperOrigin-RevId: 195081921
|
|
|
|
|
|
|
| |
https://github.com/bazelbuild/bazel/commit/819bf38d97e6eef3c823bdae3ffcdb013d6d83e3.
RELNOTES: none
PiperOrigin-RevId: 194770938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the half-done C++ runfiles library to
`//tools/cpp/runfiles`. (The Python and
Bash runfiles libraries are already under
`//tools/<language>/runfiles`.)
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I1006f7f81462ea0e4b1de1adcdba89e386d4f9e7
Closes #5107.
Change-Id: I1006f7f81462ea0e4b1de1adcdba89e386d4f9e7
PiperOrigin-RevId: 194763392
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
Closes #5036.
Usage with statically linked tests (works with clang 3.9 or later):
BAZEL_USE_LLVM_NATIVE_COVERAGE=1 GCOV=llvm-profdata-3.9 CC=clang-3.9 /tmp/bazel coverage --instrumentation_filter=src/main/cpp --dynamic_mode=off src/test/cpp:option_processor_test
(LLVM_COV_CMD="llvm-cov-3.9 show -format=html -output-dir=$(pwd)/report/ -instr-profile bazel-out/k8-fastbuild/testlogs/src/test/cpp/option_processor_test/coverage.dat bazel-out/k8-fastbuild/bin/src/test/cpp/option_processor_test" && cd bazel-os-bazel && $LLVM_COV_CMD)
Usage with dynamically linked tests (requires clang 4.0 or later):
BAZEL_USE_LLVM_NATIVE_COVERAGE=1 GCOV=llvm-profdata-4.0 CC=clang-4.0 bazel coverage --instrumentation_filter=src/main/cpp src/test/cpp:option_processor_test
(LLVM_COV_CMD="llvm-cov-4.0 show -format=html -output-dir=$(pwd)/report/ -instr-profile bazel-out/k8-fastbuild/testlogs/src/test/cpp/option_processor_test/coverage.dat bazel-out/k8-fastbuild/bin/src/test/cpp/option_processor_test $(cat bazel-out/k8-fastbuild/bin/src/test/cpp/option_processor_test.runfiles_manifest | cut -d' ' -f 2 | egrep "\.so$" | xargs -n 1 -I xxx echo -n "-object xxx ")" && cd bazel-os-bazel && $LLVM_COV_CMD)
PiperOrigin-RevId: 194357292
|
|
|
|
|
|
|
|
| |
We have some cases where clang is installed, but not gcc, and there is no convenience symlink for gcov to point to the corresponding clang tool. In this case, coverage won't work, but let's not error out. We can't tell here whether coverage is enabled or not.
Fixes #5066.
PiperOrigin-RevId: 194245346
|
|
|
|
|
|
|
| |
Ping #3977
RELNOTES: None
PiperOrigin-RevId: 194240625
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Allow overriding the gcov tool with the GCOV env variable in cc_configure
- Symlink the GCOV tool in collect-coverage.sh to a temporary location with
the name "gcov"
This allows the user to specify GCOV=llvm-cov in the environment of a bazel
build, which then leads to cc_configure picking up llvm-cov in the crosstool,
which the collect-coverage.sh script then uses as "gcov".
On linux distributions, the gcov tool does not generally work with clang
coverage output, so this provides at least a workaround for running coverage
with clang (by setting the GCOV env variable).
Closes #5040.
PiperOrigin-RevId: 193487773
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I get failing tests without this flag in coverage mode.
Workaround is to pass --linkopt=-fprofile-arcs in Bazel.
Here are the steps that work at this time (with this change):
bazel coverage --strategy=TestRunner=standalone //my/funky:test
genhtml -o report-output-directory/ path/to/coverage.dat
Some progress on #1118.
PiperOrigin-RevId: 193193164
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 191713379
|
|
|
|
|
|
|
|
|
| |
The entries in BUILD.tpl specify cpu "local", so CROSSTOOL.tpl needs to match.
Closes #4957.
Change-Id: I68d7148fa6cb73cd83ef99eab76e0fd2f6227580
PiperOrigin-RevId: 191444915
|
|
|
|
|
|
|
|
|
| |
The proguard.txt is the concatenation of the proguard_specs on the android_library rule itself. Note that it does not include transitively defined proguard_specs.
Fixes https://github.com/bazelbuild/bazel/issues/4467
RELNOTES: android_library AAR output now contains proguard.txt
PiperOrigin-RevId: 191302610
|
|
|
|
| |
Change-Id: If9d641445dc8c6520b5f4c53eab438e44486b5ac
|
|
|
|
| |
PiperOrigin-RevId: 190611069
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`setup_vc_env_vars` runs vcvarsall.bat to setup environment varibles for Visuall C++ build tools.
It returns the values of PATH, LIB, INCLUDE and WINDOWSSDKDIR.
Expose this function so that users can use
load("@bazel_tools/tools/cpp:windows_cc_configure.bzl", "setup_vc_env_vars")
to access this function.
Fixed https://github.com/bazelbuild/bazel/issues/4542
RELNOTES[NEW]:
Now you can access three functions in windows_cc_configure.bzl by:
load("@bazel_tools/tools/cpp:windows_cc_configure.bzl", "<function_name>")
1. find_vc_path(repository_ctx): Detect the VC installation path on your machine, respect BAZEL_VC first, return None if VC not found.
2. setup_vc_env_vars(repository_ctx, vc_path): Get PATH, LIB, INCLUDE, WINDOWSSDKDIR env vars set by VCVARSALL.bat, return None if VCVARSALL.bat not found.
3. find_msvc_tool(repository_ctx, vc_path, tool): Find a certain VC build tool (eg. cl.exe, lib.exe, link.exe), return None if tool not found.
Change-Id: Iec5770165aaa4766470bb3b4d818a2cf90678586
Closes #4892.
Change-Id: Iec5770165aaa4766470bb3b4d818a2cf90678586
PiperOrigin-RevId: 190039950
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks on windows: https://www.google.com/url?sa=D&q=https%3A%2F%2Fbuildkite.com%2Fbazel%2Fgoogle-bazel-presubmit%2Fbuilds%2F624%234a68440b-948b-437b-a633-4f0595721bab
*** Original change description ***
Automated rollback of commit 3c5a1098af0c5ae80d4e3b1fc52dd1fef6027d43.
*** Reason for rollback ***
Breaks bazel ci: https://github.com/bazelbuild/bazel/issues/4894#event-1533040075
*** Original change description ***
Add crosstool_lib.bzl and crosstool_utils.bzl
These will be used to rewrite current crosstool autoconfiguration into
action_configs and features.
RELNOTES: None.
PiperOrigin-RevId: 189906675
|