| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
`std::to_string` is faster than `std::stringstream`.
This issue only presents in older versions of Mingw/Cygwin. My Mingw64 GCC 7.1.0 has `std::to_string`. I can't determine the exact version of GCC that fixed the issue.
Closes #4493.
PiperOrigin-RevId: 187145391
|
|
|
|
|
|
|
| |
`blaze --nomaster_bazelrc --master_bazelrc` now uses the master bazelrc.
RELNOTES: None
PiperOrigin-RevId: 183083839
|
|
|
|
| |
PiperOrigin-RevId: 169370539
|
|
|
|
| |
PiperOrigin-RevId: 164850909
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
By this time (6 months later) Bazel clients should no longer need
this.
Change-Id: Ib058065a0ff3eedc777e95c7d06602ca6744d42a
PiperOrigin-RevId: 155478543
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 151145409
MOS_MIGRATED_REVID=151145409
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move GetJvmVersion from blaze_util to
blaze_util_platform, and remove the RunProgram
declaration from blaze_util.h.
Since GetJvmVersion is the only user of RunProgram
this is safe to do, and allows making RunProgram
static as well as simplifying its implementation
on Windows, while also changing it to use
CreateProcessW instead of CreateProcessA.
See https://github.com/bazelbuild/bazel/issues/2181
--
PiperOrigin-RevId: 142122045
MOS_MIGRATED_REVID=142122045
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the startup options.
This allows us to do the following:
- Avoid using the product name when reporting startup option parsing errors.
- Passing --bazelrc as a command argument throws an error (fix for issue #1659).
--
PiperOrigin-RevId: 141445030
MOS_MIGRATED_REVID=141445030
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 141157873
MOS_MIGRATED_REVID=141157873
|
|
|
|
|
|
|
|
|
|
| |
Move terminal-querying functions and GetUserName
from blaze_util.cc into blaze_util_<platform>.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140346402
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move blaze::ReadFile and blaze::WriteFile to
file.h and file_platform.h (thus into the
blaze_util namespace), and update references.
This allows us to implement these methods in a
platform-specific way.
Also move UnlinkPath.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140328273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make blaze::ReadFileDescriptor(int fd, ...) and
blaze::WriteFile(int fd, ...) platform-independent
by mocking out the read(2) and write(2) calls.
Also rename ReadFileDescriptor to ReadFrom and
introduce a new WriteTo method that encapsulates
WriteFile's prior logic.
In particular these functions now take a
read_func/write_func function argument instead of
a file descriptor, so the read(2)/write(2) calls
can be mocked out.
This allows us to use these functions on Windows
too, where read(2)/write(2) are not implemented,
and we can inject a different
read_func/write_func.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140195973
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We moved most of the functionality (e.g. _exit,
SetupStreams) into blaze_util_<platform> or
changed to alternative functions (fwrite + stderr
instead of write + STDERR_HANDLE).
This change brings us closer to compiling blaze.cc
with MSVC. We still have to move signal handlers
out of blaze.cc as well as code dealing with the
server PID.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140123945
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upon startup the Bazel client checks if there's
already a running server process and if so then
connects to it.
We achieve this by checking if there's a symlink
in the server directory called served.pid,
pointing to /proc/<server_pid>. If so, we read the
symlink's target and extract the PID; otherwise we
check if there's a file in the server's directory
(server.pid.txt) that contains the PID and read it
from there.
Since the PID file is always there, we don't need
the symlink, plus on Windows we don't support
symlinks anyway, which is the real motivation for
this change.
Just ignoring the PID symlink is not enough, we
need to actively delete it so that switching
between Bazel versions (one that writes a PID
symlink and one that doesn't) won't result in
having a symlink and PID file with different
PIDs and clients trying to kill the wrong server
process / not killing one that they should.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140117287
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=139899429
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can now compile blaze_util_windows.cc with
MSVC, yay! (when building //src:bazel
--cpu=x64_windows_msvc -k).
There are a lot of #ifdef's and TODOs so this
is a modest victory for now.
In this change:
- change blaze::MakeDirectories to return bool
instead of int, since that's how it was used
anyway, and to expect the permission mask as
unsigned int instead of mode_t, since the
former is good enough and compatible with
mode_t on POSIX while mode_t is not defined on
Windows
- move blaze::MakeDirectories into
blaze_util_<platform>
- implement envvar-handling in
blaze_util_<platform> and use it everywhere
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=139887503
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that takes a given command line args and splits it into the corresponding
{binary, startup_args, command, command_args}.
The purpose of this function is to help split the responsibilities
of the ParseOptions function by processing the startup options independently
(i.e. rc files detection and processing) from the command options.
This will be combined with ParseOptions in a subsequent CL.
--
MOS_MIGRATED_REVID=139773786
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this change:
- rename WriteFileToStreamOrDie to
WriteFileToStderrOrDie (since we only ever used it
for stderr)
- replace open/write/read/close operations with
blaze_util::ReadFile/WriteFile
- wrap ToString(getpid()) in a utility function
- move SyncFile to file_<platform>
--
MOS_MIGRATED_REVID=139560397
|
|
|
|
|
|
|
|
|
|
|
| |
* remove "using std::" declarations from header files
* add missing "std::" to some string declarations at some header files
* add "using std::string;" to some source files where necessary
--
Change-Id: Ib64f62b5add499d6171fa922227194ac992fa542
Reviewed-on: https://bazel-review.googlesource.com/#/c/6630/
MOS_MIGRATED_REVID=136355671
|
|
|
|
|
|
|
|
|
|
|
| |
These two functions have no logic inside it, they just return a string, and a
string that does not change, so they might be better expressed as real C/C++
constants. This might as well generate some better (and less) code anyway.
--
Change-Id: I78673c537c17c2665a74c5778e45a4d41a5f7b50
Reviewed-on: https://bazel-review.googlesource.com/#/c/6114
MOS_MIGRATED_REVID=133805201
|
|
|
|
|
|
|
|
|
| |
verifying the identity of the process killed on interrupt.
When the server dies, the client follows soon after, so this is kind of OK.
--
MOS_MIGRATED_REVID=133110872
|
|
|
|
|
|
|
| |
KillServerProcess() so that we don't call malloc() in signal handlers.
--
MOS_MIGRATED_REVID=132232499
|
|
|
|
|
|
|
|
|
|
| |
History in
https://github.com/emacs-mirror/emacs/blo[]f125aa3de06fa0180a83ec7b5a26970309eeeb6/etc/NEWS#L1769-L1773
RELNOTES: Emacs' [C-x `], a.k.a. next-error, works again in emacsen >= 25.1
--
MOS_MIGRATED_REVID=131851164
|
|
|
|
|
|
|
|
|
|
| |
GetNullaryOption() is a function whose return type is bool, which can
only return two possible values, true or false, and thus can not return NULL.
--
Change-Id: If9fc622d7132b15268bdcc76aed8d04fe5b92bc7
Reviewed-on: https://bazel-review.googlesource.com/#/c/4140/2
MOS_MIGRATED_REVID=128448779
|
|
|
|
|
|
|
|
|
| |
handler in the client.
This makes Ctrl-C work on Windows somewhat: in particular, in non-batch mode and while no actions are running.
--
MOS_MIGRATED_REVID=125318172
|
|
|
|
|
|
|
|
|
| |
new ones.
Add server.pid.txt that contains the same information in text form. ExecuteDaemon() on Windows will simply not write server.pid .
--
MOS_MIGRATED_REVID=120802055
|
|
|
|
|
|
|
| |
This is so that they can be implemented properly for Windows. For now, though, they are left in blaze_util.cc since the Windows implementations aren't there yet.
--
MOS_MIGRATED_REVID=120709884
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 2ad804cef42f: ("Fixed bugs blocking bazel shell test on Windows"),
updated the documentation in blaze_util.cc but forgot to update
the same doc comment in the header file.
To prevent this from happening again, this copies the added sentence
to the header file and deletes the documentation from the source file.
--
Change-Id: I240b3a31d7b457ef4d50558f1ca54619666b8d2c
Reviewed-on: https://bazel-review.googlesource.com/#/c/3470
MOS_MIGRATED_REVID=120561630
|
|
|
|
|
|
|
|
|
| |
Kudos to @tfarina for pointing out this dead function declaration.
An older commit (prior to bazel being open sourced) moved the file out of blaze_util.cc but forgot to delete the function declaration from the header file. And a subsequent change (also before bazel was open sourced) renamed/moved the implementation to a place that is now internal-only.
--
MOS_MIGRATED_REVID=116980458
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This functions was introduced by commit bf98f39d5d69: "Add the ability
to customize the bazel client's...", but at that time it didn't update
EnsureCorrectRunningVersion() function, that uses unlink() function, to
use DeleteFile() as well.
So this patch updates EnsureCorrectRunningVersion() to make use of it
now.
While there is nothing wrong with the current name, it is not very much
correct from the documentation point. If the path is a symlink, unlink()
will just the symbolic link and the file won't be removed (affected at all).
Otherwise, if it is just a normal file, it will just decrement the link
count of the file and when that count reaches zero (0) then the file
will longer be accessible.
So while at it we renamed the function to UnlinkPath(), but could just
stay as DeleteFile() if we wanted.
In this process we also improved the documentation for this function to
be a little more clear and removed moved it from the source file, since
the header file already has it.
For further reference, adhere to the documentation in
http://pubs.opengroup.org/onlinepubs/009695399/functions/unlink.html.
--
Change-Id: I0fc569f3324322cbc67a8fb540836c127f5c3399
Reviewed-on: https://bazel-review.googlesource.com/#/c/3061/
MOS_MIGRATED_REVID=116769254
|
|
|
|
|
|
|
| |
bazel server exits abruptly.
--
MOS_MIGRATED_REVID=111641619
|
|
|
|
|
|
|
|
|
|
|
| |
The headers were modified with
`find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'`
And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan.
The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand.
--
MOS_MIGRATED_REVID=103938715
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
exec(3) under mingw converts every command line argument that looks like Unix path
into Windows path when executing non-mingw images (criteria for non-mingw image is
that the image does not depend on msys-<version>.dll). This affects bazel labels
(`//foo:bar` becomes `/foo:bar` for example).
This CL:
1) Replaces usage of execv(3) with Windows-native CreateProcess.
2) Converts all command line arguments that are indeed paths into Windows paths.
--
MOS_MIGRATED_REVID=100386350
|
|
|
|
|
|
|
| |
std::to_string is not avcaliable on mingw.
--
MOS_MIGRATED_REVID=98923935
|
|
|
|
|
|
|
|
|
|
| |
This function has only a declaration, no implementation and thus no
uses. Confirmed that it has no uses internally as well.
--
Change-Id: Ifd9214b546f304077e4d729bf22abf6b49cc6af1
Reviewed-on: https://bazel-review.googlesource.com/1411
MOS_MIGRATED_REVID=94763256
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=94577279
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unnecessary copies) and label them const, per the
Google style guide.
Tested:
$ ./bootstrap_test.sh all
--
Change-Id: I17636703cf43283f71b9b913c130a51065bd896b
Reviewed-on: https://bazel-review.googlesource.com/1350
MOS_MIGRATED_REVID=93876332
|
|
|
|
|
|
|
|
|
| |
If someone ran two Bazel commands at the same time, the second mkdir call
could fail because the first had already created the directory MakeDirectories
was being called on.
--
MOS_MIGRATED_REVID=93531813
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=93413161
|
|
|
|
|
|
|
|
| |
There is no implementation and thus nobody is calling/using it.
--
Change-Id: I2cf184e3d80eb0ef2b04ea4617697e8426cc7a58
MOS_MIGRATED_REVID=93018104
|
|
|
|
|
|
|
|
|
|
|
|
| |
The header only uses std::string, std::vector, int and char types, and
thus all these headers do not need to be included there.
If necessary, they should be included in the relevant source files
instead.
--
Change-Id: Id1849a0f427016dcf732fe6bfc673e599e8d4b14
MOS_MIGRATED_REVID=92192506
|
|
|
|
|
|
|
|
| |
This is so util/ files do not depend on anything from higer level.
--
Change-Id: I522be6722851f25e79d9c2b85275856cbbd978de
MOS_MIGRATED_REVID=91882837
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=91681168
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Looks like in the transition it was forgotten to be moved to the new
location.
As an effect of this change it was discovered that file.cc had an
dependency back on blaze_util.cc (from client binary for die/pdie functions).
In order to fix that dependency we have had to move die/pdie functions into
util library (added errors.(cc|h)) for this.
Tested on Linux with the following command lines:
$ ./compile.sh
$ ./output/bazel build //src/main/cpp:all
$ ./output/bazel build //src:bazel
$ ./bootstrap_test.sh all
--
Change-Id: I70fb1b6189dc5af31f816332d76efe380ef26302
MOS_MIGRATED_REVID=90987514
|
|
|
|
|
|
|
|
|
| |
The same functionality is already provided by
blaze_util::VerboseLogging() function.
--
Change-Id: I6102ffd985354e666dc8440080de6c35146199cb
MOS_MIGRATED_REVID=90155343
|
|
|
|
|
|
|
|
|
| |
-version parsing.
The one-time read sometime fails when the JAVA_TOOL_OPTIONS is set making Bazel unable to detect JDK version.
--
MOS_MIGRATED_REVID=85984806
|
|
--
MOE_MIGRATED_REVID=85702957
|