| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
child of the process where the Blaze client itself was run.
Limitations:
- Untested on Windows; it should work because ExecuteProgram() is implemented there, too, but since Windows doesn't support exec(), there is at least one process in between
Progress towards #2815.
RELNOTES[NEW]: The new "--direct_run" flag on "blaze run" lets one run interactive binaries.
PiperOrigin-RevId: 184528845
|
|
|
|
|
|
|
|
| |
This makes way more sense than using the name of the *parent* directory of the workspace.
Closes #4253 - thanks @akira-baruah for suggesting this change and making it happen!
PiperOrigin-RevId: 184147456
|
|
|
|
| |
PiperOrigin-RevId: 183995676
|
|
|
|
|
|
|
|
|
| |
Fail fast if we are about extract the Bazel binary for version V into the predetermined install_base directory for version V'. This fixes Bazel's weakness to a race condition that puts it in a stable inconsistent state where all current and future attempts to use Bazel at version V will actually use V'. A rerun of the Bazel client will be able to successfully use version V'.
This race condition occurs when the Bazel binary is replaced after determine the install directory (via the install_base_key file in the Bazel zip) but before we extract the files in the zip into the directory.
RELNOTES: None
PiperOrigin-RevId: 183843099
|
|
|
|
|
|
|
|
| |
Allows users to monitor server output without needing to fish the output base.
Windows support is copied more or less verbatim from recommendations, I unfortunately
don't know how to test this on windows.
PiperOrigin-RevId: 183674130
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 177420511
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--expand_configs_in_place.
--config options were expanded in a fix-point expansion, where in practice, the flags that --config values expanded to ended up between the normal bazelrc options and the command line's explicit options. Since the options parser has an order-based priority scheme and it accepts multiple mentions of a single-valued option, this conflicts with users' expectations of being able to override these config expansions by using the order in which they are mentioned.
This change makes it possible to expand the config values defined in your bazelrc (or blazerc) files to occur in-place: --stuff --config=something --laterstuff will interpret the options that --config=something expands to as if they had been mentioned explicitly between --stuff and --laterstuff.
In order to not break users relying on complex flag combinations to configure their builds, this behavior will not yet be turned on by default. Instead, use --expand_configs_in_place as a startup flag to test this feature. --announce_rc may be helpful for debugging any differences between the fixed point and in-place expansions. Once you've debugged your problems, add "startup --expand_configs_in_place" to your blazerc to stick to the new behavior.
RELNOTES: Use --expand_configs_in_place as a startup argument to change the order in which --config expansions are interpreted.
PiperOrigin-RevId: 176371289
|
|
|
|
|
|
|
|
|
|
| |
value of --max_idle_secs is 15s when the TEST_TMPDIR environment variable is set.
(i) Add a log line to blaze.INFO when the server shuts itself down due to idleness.
(ii) Mention the --max_idle_secs default in the existing stderr spam when TEST_TMPDIR is set.
RELNOTES: None
PiperOrigin-RevId: 174745511
|
|
|
|
|
|
|
| |
more intelligible.
RELNOTES: None.
PiperOrigin-RevId: 173512953
|
|
|
|
|
|
|
| |
Fixes https://github.com/bazelbuild/bazel/issues/3938
Change-Id: Ic837f1b97cf8469434118f2660fb15d14c035a14
PiperOrigin-RevId: 173100466
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks a test of Bazel on Windows: http://ci.bazel.io/view/Dashboard/job/bazel-tests/1078/testReport/src_test_py_bazel_bazel_clean_test/exe/src_test_py_bazel_bazel_clean_test_exe/
Fixes #3882.
*** Original change description ***
Don't release the client lock while the server executes a command. The
server still doesn't support concurrency, even for commands like 'help',
so there's no benefit from releasing it.
This also improves progress messages. Today the client may print
WARNING: Running Blaze server needs to be killed, because the startup options are different.
and then wait indefinitely while the server finishes processing a
request. With this change, an explanation for the delay is given.
RELNOTES: None.
GO...
***
RELNOTES: None.
PiperOrigin-RevId: 171689429
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
server still doesn't support concurrency, even for commands like 'help',
so there's no benefit from releasing it.
This also improves progress messages. Today the client may print
WARNING: Running Blaze server needs to be killed, because the startup options are different.
and then wait indefinitely while the server finishes processing a
request. With this change, an explanation for the delay is given.
RELNOTES: None.
PiperOrigin-RevId: 171571670
|
|
|
|
| |
PiperOrigin-RevId: 166874758
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Bazel client checks the installation files
every time it starts. Bazel checks that it can
read the installation files and that their mtimes
are in the future.
The "bazel-tests" project on Bazel CI recently
produced flaky-looking failures. The error
messages talk about a missing installation file.
This change makes Bazel print more debugging info
when the aformentioned check fails. I hope the
information will help catching this bug.
See https://github.com/bazelbuild/bazel/issues/3618
Change-Id: Ic51384b5840262484515fa320f162a79cfd0e012
PiperOrigin-RevId: 166696141
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also adds some extra debug logging.
Also removes some msys-only code paths.
Fixes #3498.
This is a reland of commit 2f38404.
Change-Id: I1690a64f427070cc3f127b857650e6a32d1aab35
PiperOrigin-RevId: 166049222
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #3584
*** Reason for rollback ***
Broke bazel_windows_test fails on windows.
*** Original change description ***
Propagate detected value of BAZEL_SH to --client_env.
Also make debug_log available as soon as possible on startup.
Also adds some extra debug logging.
Also removes some msys-only code paths.
Fixes #3498.
Change-Id: I5b769f2c5a728106e5252869745ec79e555cbaf2
PiperOrigin-RevId: 165692468
|
|
|
|
|
|
|
|
|
|
|
| |
Also make debug_log available as soon as possible on startup.
Also adds some extra debug logging.
Also removes some msys-only code paths.
Fixes #3498.
Change-Id: I5b769f2c5a728106e5252869745ec79e555cbaf2
PiperOrigin-RevId: 165574022
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bazel now detects whether it was started from a
command line (or as a subprocess), or from Windows
Explorer (by clicking its icon). In the latter
case it displays an error message asking the user
to run it from a command line, and waiting for a
keypress so the user has time to read this
message.
Change-Id: I4b0430e30d2f1f243cec6ff63cb3abac907e60e3
PiperOrigin-RevId: 163338527
|
|
|
|
|
|
|
|
|
|
|
| |
cinttypes is the C++ header that should replace stdint.h. Not
using the correct header was leading to compilation error on CentOS 6.7
Fixes #3455.
To be cherry-picked for #3375.
Change-Id: I6df22134a4a4902ec9fa7ecdfaeb5408eacf3564
PiperOrigin-RevId: 163334651
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic is as follows:
1) search for msys installation
2) search got git-on-Windows installation
3) search in PATH.
This happens on every client startup unless BAZEL_SH enviornment
variable is set.
My measurements show that the time required for this detection is
negligible (<10 msec in the worst case).
Change-Id: If130e2491a9df5a23954d303f2ccdb932eeed1db
PiperOrigin-RevId: 162466913
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change ensures that the server process is terminated before the
client process terminates, when evaluating a command that shuts down
the server.
When completing such a command, the server communicates to the client
that the server will terminate itself by setting a termination_expected
bit in the final RunResponse message. The client then waits up to 60s
for the server process to actually terminate. If it does not, then the
client SIGKILLs the server.
Also makes the gRPC server stop accepting new commands before the
shutdown command completes.
Drive-by fix to comments on Search{Un,Null}aryOption.
RELNOTES: Commands that shut down the server (like "shutdown") now ensure that the server process has terminated before the client process terminates.
PiperOrigin-RevId: 161537480
|
|
|
|
| |
PiperOrigin-RevId: 161523047
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This change is a spiritual successor of https://bazel-review.googlesource.com/c/7410/ . That one had a merge conflict and it was small enough that a rewrite was easier than updating it.
RELNOTES: None.
PiperOrigin-RevId: 160251282
|
|
|
|
|
|
|
|
|
|
| |
Also add a helper method to GlobalVariables to
retrieve this path, thus concentrating the
assumptions about the layout of extracted_binaries
in one place.
Change-Id: If172b6f5bf4451845ad89d3d488ef2a2c2e5d286
PiperOrigin-RevId: 158241854
|
|
|
|
|
|
|
|
|
| |
- Only try to communicate with the server if it passes verification (i.e. the indicated PID exists and its start time is correct)
- Use only one thread to delete files on exit
- Don't set restart reason to NEW_VERSION unless there is an existing server
RELNOTES: None.
PiperOrigin-RevId: 158131470
|
|
|
|
|
|
| |
and SERVER_UNRESPONSIVE, since it looks like these are happening with upsetting frequency in our new grpc world.
PiperOrigin-RevId: 156271743
|
|
|
|
|
|
|
|
| |
Since commit 1977d92e17e6: ("Various cleanups and refactorings in the client:"),
StartServer() does not return a file descriptor anymore.
Change-Id: I920240d3aed5f16077bf9f046522b65664319947
PiperOrigin-RevId: 155871851
|
|
|
|
|
|
|
|
| |
By this time (6 months later) Bazel clients should no longer need
this.
Change-Id: Ib058065a0ff3eedc777e95c7d06602ca6744d42a
PiperOrigin-RevId: 155478543
|
|
|
|
|
|
|
|
|
| |
It provides a single and clean way to output warning messages,
and replaces the fprintf(stderr, "Warning: ...\n") or
fprintf(stderr, "WARNING: ...\n") calls.
Change-Id: I2f8a8f659085b9e57a08b5208a8b8f683a7cd72c
PiperOrigin-RevId: 155386233
|
|
|
|
|
|
|
|
| |
It does not need to be a fully allocated std::string every time.
A simple character constant is enough for it.
Change-Id: I98b9d4bb77932ea18646fbc793132e089bc66124
PiperOrigin-RevId: 154054987
|
|
|
|
|
|
|
|
| |
It is not necessary to have these function declarations (prototypes)
because they are declared+defined before they are actually called.
Change-Id: I32d9ba82e056e368eecc553569231ad1174ad5e0
PiperOrigin-RevId: 154035760
|
|
|
|
|
|
|
| |
fprintf(stderr, "\nCannot write to %s; exiting...\n\n", broken_pipe_name);
Closes #2736.
PiperOrigin-RevId: 152675241
|
|
|
|
|
|
|
|
|
| |
The user interface is not changing. The policy will still be accepted as a flag passed to the client, as a startup flag (before the command), it will just no longer trigger server restarts and will not be passed on to a bazel server as part of the startup arguments. In batch mode, however, it will still be a startup argument, because the RunRequest proto is not sent, and all invocations restart bazel in batch mode anyway.
Since invocation policy only affects command arguments, and changes in command arguments do not cause server restarts, this is consistent with other server restart behavior.
RELNOTES: Changing --invocation_policy will no longer force a server restart.
PiperOrigin-RevId: 152426207
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bugfixed version of
https://cr.bazel.build/9520 which broke some
Google-internal tests.
This change allows removing duplicate code:
ReadDirectorySymlink was implemented on Windows as
a junction resolver, which is also implemented in
file_windows.cc. Now it uses the JunctionResolver.
RELNOTES: none
PiperOrigin-RevId: 151691895
|
|
|
|
|
|
|
|
| |
Ability to configure this was added to provide an easy correction in case
writing the exit code to a file proved problematic. This feature has been out
for 3 months with no reported issues, no reason to keep the extraneous flag.
PiperOrigin-RevId: 151496431
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Windows-implementation of this function
shortens paths that we pass to the JVM, such as
the Bazel server jar's path, the log file path,
etc. These must be shortened because the JVM
doesn't handle long paths.
We don't shorten paths passed to the Bazel server
itself though because Bazel can handle long paths.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 149548361
MOS_MIGRATED_REVID=149548361
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 149282686
MOS_MIGRATED_REVID=149282686
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
RELNOTES: Convert --use_action_cache to a regular option
--
PiperOrigin-RevId: 148804881
MOS_MIGRATED_REVID=148804881
|
|
|
|
|
|
|
|
|
| |
Disabling the action cache is helpful in contexts where incremental builds are
not required, or where actions need to be repeatedly executed for debugging.
--
PiperOrigin-RevId: 147485055
MOS_MIGRATED_REVID=147485055
|
|
|
|
|
|
|
|
|
|
|
| |
- Differentiate between the server terminating abruptly and it erroneously not returning an exit code.
- Do not assume that the message buffer stays untouched on the last call to Read() that eventually returns false.
There is a small chance that the channel will be shut down because it's idle between Read() returning false and us checking the state. Unfortunately, I haven't found a way to set the idle timeout from C++ :(
--
PiperOrigin-RevId: 147321404
MOS_MIGRATED_REVID=147321404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not give up immediately if renaming/moving the
install base directory fails, wait and retry
instead.
This is necessary because on Windows the directory
we just created and populated with the extracted
embedded binaries may still be scanned by the
antivirus, so there are open file handles in it so
it cannot be renamed. This new logic ensures the
AV has enough time to scan all files, close the
handles, letting us successfully rename the
directory.
Fixes the occasional "install base directory
cannot be renamed in place" error messages on
Windows.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 146899919
MOS_MIGRATED_REVID=146899919
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move `strerror` calls into errors_<platform>.
We have to get rid of direct `errno` reading too,
because it doesn't work on Windows native.
Fixes https://github.com/bazelbuild/bazel/issues/2411
--
Change-Id: I69ff502487d698aa9e9147f02fd0bc5253e94e64
Reviewed-on: https://cr.bazel.build/8490
PiperOrigin-RevId: 145777524
MOS_MIGRATED_REVID=145777524
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create an IFileMtime class and platform-specific
implementations to deal with mtime handling.
Since epochs and time granularity vary from
platform to platform, and we only care about
setting a file's/directory's mtime to the current
time or to a future time plus querying whether
something is in the future, we can easily create
an interface for these operations and that's
exactly what IFileMtime is.
Implement PosixFileMtime and WindowsFileMtime.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 144956966
MOS_MIGRATED_REVID=144956966
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 144688363
MOS_MIGRATED_REVID=144688363
|
|
|
|
|
|
|
|
|
|
| |
log file to the error message.
Helps with #2309. Hopefully.
--
PiperOrigin-RevId: 144431711
MOS_MIGRATED_REVID=144431711
|