| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This overrides --bazelrc and --[no]master_bazelrc regardless of order. Like --bazelrc and --[no]master_bazelrc, it cannot be mentioned in an rc file, this would be a contradiction. This flag is useful for testing, and for having a version-agnostic way to turn off all rc files, such as in the canonical command line reporting. Now that blazerc and bazelrc are separate, this is necessary.
If explicit values for --bazelrc or --master_bazelrc are provided which are now ignored, Bazel will warn the user.
#4502
Alternatives considered - We could avoid this flag but would need to have some well-documented, reusable list of the startup flags that effectively come to the same effect. This would be necessary in our integration tests and in the CommandLineEvent and other places where rc files need to be completely disabled for correctness. We decided that this startup option was more straightforward and usable for both users and Bazel devs: it shouldn't be used when more fine-grained control is needed, but provides warnings if users are likely to be confused by the outcome.
RELNOTES: None.
PiperOrigin-RevId: 196750704
|
|
|
|
|
|
|
|
|
| |
This allows us to have clear file setup and tear down, so we can more carefully test cases where files are present but intentionally ignored due to flags.
Also stop using re2 and rely on gmock's MatchesRegex instead, which is more concise.
RELNOTES: None.
PiperOrigin-RevId: 195007726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Bazel client no longer supports MSYS paths.
The only exception is "/dev/null" which the client
treats as "NUL".
After this change you can no longer pass MSYS
paths as Bazel flag values on Windows.
See https://github.com/bazelbuild/bazel/issues/4319
Change-Id: I39d81843015c5a4014dd5953bac2e1c29dcd5bed
PiperOrigin-RevId: 194372504
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix error reporting in the path conversion methods
of the Bazel client. Previously the error
reporting logic used GetLastErrorString in places
where it was not appropriate (i.e. it was not a
failed Windows API call that caused an error).
This cleanup prepares removing the concept of the
MSYS root from the Bazel client, since MSYS paths
are no longer supported and we want to cut Bazel's
dependency on Bash (thus MSYS) completely.
See https://github.com/bazelbuild/bazel/issues/4319
Change-Id: Ie50a20e0ee0c572592f637340a2f2948c7f53088
Closes #5072.
Change-Id: Ie50a20e0ee0c572592f637340a2f2948c7f53088
PiperOrigin-RevId: 194052665
|
|
|
|
|
|
|
|
| |
Bazel now has its own subclass of StartupOptions to specify bazel-only options. This is needed for https://github.com/bazelbuild/bazel/issues/4502.
RELNOTES(INC): No longer accepts --blazerc or --[no]master_blazerc, accepts bazelrc name only.
PiperOrigin-RevId: 193718297
|
|
|
|
|
|
|
| |
In preparation for https://github.com/bazelbuild/bazel/issues/4502, make OptionProcessor::GetRcFiles contain the logic for both the user bazelrcs and the master bazelrcs.
RELNOTES: None
PiperOrigin-RevId: 193521683
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler infers the type of unsuffixed literals as signed. That causes GCC
warnings like this with gtest's ASSERT_EQ if one side is a literal and other is
an unsigned type:
```
In file included from src/test/cpp/option_processor_test.cc:23:0:
external/com_google_googletest/googletest/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]':
external/com_google_googletest/googletest/include/gtest/gtest.h:1449:23: required from 'static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int; bool lhs_is_null_literal = false]'
src/test/cpp/option_processor_test.cc:98:3: required from here
external/com_google_googletest/googletest/include/gtest/gtest.h:1421:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (lhs == rhs) {
~~~~^~~~~~
```
Closes #4994.
Change-Id: Ic40e8714531aaa0e0d748dd59658a6de15bfe12d
PiperOrigin-RevId: 193161516
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 192805836
|
|
|
|
|
|
|
| |
Will migrate die() instances in a later change, to keep this one clean.
RELNOTES: None.
PiperOrigin-RevId: 191491701
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was added during the JDK 7->8 transition to improve the diagnostic
when an older-than-supported host_javabase was used. The version number
handling doesn't work with JDK 9 (see [1]), and using Bazel binaries
with a bundled host_javabase avoid the error entirely so the message
is less important.
[1] http://openjdk.java.net/jeps/223
PiperOrigin-RevId: 190944476
|
|
|
|
|
|
|
| |
It was removed from the java code 4 years ago, mentioning it causes the server to crash at startup.
RELNOTES: None.
PiperOrigin-RevId: 190636455
|
|
|
|
|
|
|
| |
Missed this in https://github.com/bazelbuild/bazel/commit/8e9f4a8591d65c7972aea3957c57601570e0a39b.
RELNOTES: None.
PiperOrigin-RevId: 190506543
|
|
|
|
|
|
|
| |
To replace blaze_util::die and blaze_util::pdie as well, FATAL statements need to accept blaze exit codes.
RELNOTES: None.
PiperOrigin-RevId: 190285798
|
|
|
|
|
|
|
| |
third_party/gtest can go away after this.
RELNOTES: None.
PiperOrigin-RevId: 190221581
|
|
|
|
|
|
|
|
|
| |
We are still unable to turn this on to write to files, but there are currently 2 logging systems in use in the client: the inactive one, and the print-to-stderr option triggered by --client_debug. Combine these, so we can use the same logging format for both.
Also combine it with the VerboseLogging functionality - it was not documented anywhere and seems redundant.
RELNOTES: None.
PiperOrigin-RevId: 189979051
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These provide some testing for the following cases:
- tokenization
- recognizing comments
- grouping of different lines by command
- import ordering
- import cycles
- bad imports
There's still room for more, in particular in the multi-command case, but this feels like a good start.
Also identified some surprising behaviors that should be fixed. Leaving them tested as documentation of their broken nature.
RELNOTES: None.
PiperOrigin-RevId: 188355929
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 184865343
|
|
|
|
|
|
|
| |
`blaze --nomaster_bazelrc --master_bazelrc` now uses the master bazelrc.
RELNOTES: None
PiperOrigin-RevId: 183083839
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1.Deleted config_setting for --cpu=x64_windows_msys, because we don't build
Bazel with MSYS gcc anymore.
2.Deleted config_setting for --cpu=x64_windows_msvc, because it uses exactly
the same toolchain as --cpu=x64_windows, it'll be removed in the future.
This change reduces the complexity of our BUILD files and make them less
confusing.
Change-Id: I939831a6861413b0f745fb1be98aacd4fb780e0a
PiperOrigin-RevId: 181751853
|
|
|
|
|
|
|
| |
This will enable an easier transition from checked-in BUILD files to ones generated by copybara.
RELNOTES: None
PiperOrigin-RevId: 177514519
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit:
- fix the Windows JNI library to only use UTF-16
strings
Converting between multi-byte strings (UTF-8) and
wstrings (UTF-16) always carries the risk of
incorrectly handling the strings. It also takes
time, even if not much.
Not converting the strings but using the raw Java
strings (which are in fact UTF-16 strings)
simplifies the code and allows using non-ASCII
paths (at least in the JNI module, even if Bazel
as a whole doesn't support non-ASCII characters).
Change-Id: I827fbe92a1bbefac049a1e34ac1738c965ed2e9c
PiperOrigin-RevId: 172715277
|
|
|
|
| |
PiperOrigin-RevId: 169370539
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add recursive test_suite rules for all tests that
ci.bazel.io runs for Windows, and set the
top-level test_suite as the CI test target.
Doing so shortens the command line and works
around https://github.com/bazelbuild/bazel/issues/3742
I verified that the old set of tests are the same
as the new set.
Change-Id: Id8d5da3f0c03c9b8969a9f8e1e9a3096888365aa
PiperOrigin-RevId: 169242858
|
|
|
|
|
|
|
|
|
|
|
| |
Send the startup options tagged with their origin so that the server has correct information about the command line as the client received it.
Removes the unconditional stderr printing of all bazelrc startup options in the bazel client. Instead, the startup options are sent to the server and the same informational printing is gated on the --announce_rc option. This avoids unconditional log spam to stderr early in startup. If the server is unreachable or there are errors parsing startup options, the message is still printed to stderr.
Fixes https://github.com/bazelbuild/bazel/issues/2530.
RELNOTES: --announce_rc now controls whether bazelrc startup options are printed to stderr.
PiperOrigin-RevId: 165211007
|
|
|
|
| |
PiperOrigin-RevId: 164850909
|
|
|
|
| |
PiperOrigin-RevId: 163799447
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a method to test if a path is /dev/null (or
case-insensitive "NUL" on Windows), and use it in
blaze::MakeAbsolute.
In this commit:
- implement blaze_util::IsDevNull with POSIX and
Windows semantics + add tests
- blaze::MakeAbsolute calls blaze::ConvertPath
on its input to convert MSYS paths on Windows
- blaze_util::GetCwdW (thus GetCwd) always returns
a lowercase path so that it is deterministic
- blaze_util::GetCurrentDrive returns lowercase
letter to be consisent with blaze::ConvertPath,
which also returns a lowercase path
Fixes https://github.com/bazelbuild/bazel/issues/3440
Change-Id: I3af5ba0a033d542fe64a676d67f27472298d1089
PiperOrigin-RevId: 163038503
|
|
|
|
|
|
|
|
|
|
|
| |
Replace blaze_util::AsWindowsPathWithUncPrefix
with AsAbsoluteWindowsPath, which always returns
an absolute path.
Fixes https://github.com/bazelbuild/bazel/issues/2935
RELNOTES: none
PiperOrigin-RevId: 162727218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this change:
- add support for absolute-on-current-drive paths
(e.g. "\foo", meaning "c:\foo")
- report error for relative-on-current-drive paths
(e.g. "c:" and "c:foo")
- report error for remote Windows paths
(e.g. "\\servername\path\on\server")
- update blaze_util::AsWindowsPath comments
- update tests
RELNOTES: none
PiperOrigin-RevId: 162719763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit:
- remove blaze::PrintError in favor of
blaze_util::PrintError
- remove Ijar's PrintLastErrorMessage in favor of
blaze_util::PrintError
- use pdie every time path conversion fails,
because that indicates a fatal error (bad user
input for a path flag, or downright bug)
- remove explicitly printing GetLastErrror; pdie
and PrintError do it already
- unify the pdie/PrintError message formats
Fixes https://github.com/bazelbuild/bazel/issues/2935
Change-Id: I5feaf73885cab95c43a28c529ada6942e037b162
PiperOrigin-RevId: 162587490
|
|
|
|
|
|
|
| |
Fixes https://github.com/bazelbuild/bazel/issues/3357
RELNOTES: none
PiperOrigin-RevId: 161516302
|
|
|
|
|
|
|
|
| |
OptionProcessor.
This replaces the startup_args_, command_ and command_argument members to allow a more consistent representation of the command line throughout the class.
PiperOrigin-RevId: 161408010
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under macOS, the default soft resource limits for open files and concurrent
processes are pretty low, but their corresponding hard defaults are
reasonable. Because the soft limits are low, Bazel sometimes fails during
large builds -- not because of Bazel itself, but because the executed
actions do "too much work" or because the --jobs setting was high enough
to cause all parallel tasks to exceed the limits.
Instead of trying to fix the actions themselves, start by trying to raise
the system limits as a best-effort operation. And, given that this code
is fairly portable, try to do it on all POSIX systems and not just macOS.
Note that, for non-macOS systems, this might still not do what's promised
in all circumstances because I'm currently only implementing
GetExplicitSystemLimit on macOS.
RELNOTES: None.
PiperOrigin-RevId: 161401482
|
|
|
|
|
|
| |
Additionally rewrite the option_processor_test to make it more flexible.
PiperOrigin-RevId: 160958736
|
|
|
|
|
|
|
|
| |
Instead, let's reuse the cross-platform {Get,Set,Unset}Env() functions
when possible.
Change-Id: I40b4ff09c66fe238d5b3d70e49f91705cea64b0c
PiperOrigin-RevId: 160870850
|
|
|
|
|
|
|
|
| |
Additionally, add a warning note for developers who wish to delete startup
options: they first need to deprecate the flag and once it's a no-op
for a sufficient amount of time then they can delete it from the list
of valid options.
PiperOrigin-RevId: 160546248
|
|
|
|
| |
PiperOrigin-RevId: 160506627
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the Windows JNI C++ sources to a separate
package and separate namespace.
This no-op refactoring allows other build rules
than Bazel's client library to depend on file I/O
and/or JNI functionality.
A follow-up commit will split the
//src/main/native/windows:processes library into
:jni-processes and :jni-file.
Change-Id: I33c5f8ebd8961cc440db3b4a95ff78024d7c1d74
PiperOrigin-RevId: 160404298
|
|
|
|
| |
PiperOrigin-RevId: 160373741
|
|
|
|
|
|
|
|
|
|
|
| |
While fixing its TODO.
Tested with the following command line:
$ bazel test //src/test/cpp/...
Change-Id: I62d5d0f19b7242fd2eeae7901e1e236c782ebfb5
PiperOrigin-RevId: 160270960
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After this change, with a Bazel having MSVC as default toolchain,
the command to build a MSVC Bazel on Windows is simply:
bazel build //src:bazel
although bazel build --cpu=x64_windows_msvc //src:bazel is still supported.
And the command to build a MSYS Bazel on Windows is:
bazel build --cpu=x64_windows_msys //src:bazel
Also made //src/test/cpp:blaze_util_test pass without
--cpu=x64_windows_msvc
Change-Id: Iaf37513c778768d06fb5700442d5229a5f348964
PiperOrigin-RevId: 157446905
|
|
|
|
|
|
|
|
| |
This logger makes it easier to parse log statements and is now enabled for Bazel's java.log.
RELNOTES[INC]: Bazel now prints logs in single lines to java.log
PiperOrigin-RevId: 152954337
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 151145409
MOS_MIGRATED_REVID=151145409
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it more robust: it now works with Cygwin too,
e.g. BAZEL_SH=c:/cygwin64/bin/bash.exe
See https://github.com/bazelbuild/bazel/issues/2725
Related to https://github.com/bazelbuild/bazel/issues/2447
--
Change-Id: I911f09acd3e39c7cd0fe0750774fa0a900ffd844
Reviewed-on: https://cr.bazel.build/9510
PiperOrigin-RevId: 150885982
MOS_MIGRATED_REVID=150885982
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support drive roots as --output_user_root values,
so "d:\" and "d:/" will now work. However "d:"
doesn't work yet because that's shorthand for the
current working directory on "D:".
See https://github.com/bazelbuild/bazel/issues/2683
--
PiperOrigin-RevId: 150203657
MOS_MIGRATED_REVID=150203657
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After this change, a msys bazel can be built with
a MSVC-default Bazel by adding --cpu=x64_windows_msys --host=x64_windows_msys
See https://github.com/bazelbuild/bazel/issues/2627
--
Change-Id: Iaa82bf4dd911c5740b98d3b2739dfccca6203f79
Reviewed-on: https://cr.bazel.build/9293
PiperOrigin-RevId: 149532274
MOS_MIGRATED_REVID=149532274
|
|
|
|
|
|
|
|
|
|
|
| |
Mimic read(2) behavior when reading from /dev/null
and always successfully read 0 bytes.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 149286494
MOS_MIGRATED_REVID=149286494
|
|
|
|
|
|
|
|
|
|
| |
This method now works for non-existent paths too.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 149284633
MOS_MIGRATED_REVID=149284633
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not use `errno` in platform-independent code,
because Windows API functions don't set it.
This change abstracts away error handling and the
functions whose `errno` result we care about, will
set an input error variable.
Fixes https://github.com/bazelbuild/bazel/issues/2506
--
PiperOrigin-RevId: 148977873
MOS_MIGRATED_REVID=148977873
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a platform-specific file handle type
(HANDLE on Windows, int on Linux/Darwin/FreeBSD)
so we can get rid of the read_func and write_func
functions, since they are always the same
everywhere.
Also include file_platform.h in file.h, since they
are logically the same file (file_platform.h is
just the platform-specific part of file.h).
--
PiperOrigin-RevId: 148892736
MOS_MIGRATED_REVID=148892736
|