| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Move blaze::AcquireLock and blaze::ReleaseLock
into blaze_util_<platform>.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140200355
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
--
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change:
- starts using blaze_util::CanAccess and
blaze_util::PathExists instead of access(2)
- implements and starts using blaze_util::GetCwd
instead of getcwd(2)
- implements and starts using
blaze_util::ChangeDirectory instead of chdir(2)
- adds tests for the new wrapper methods
--
MOS_MIGRATED_REVID=138750297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously they returned nanoseconds but all call
sites converted those to milliseconds.
This is not only a simplification of the semantics
and renaming of the methods to make the returned
units and the purpose clear, but also preparation
for the Windows/MSVC implementations of these
methods.
--
MOS_MIGRATED_REVID=138383956
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
- Use an explicit cast to void to tell the compiler that we are intentionally ignoring return values.
- Delete the unused function GetPeerProcessId()
--
MOS_MIGRATED_REVID=132970162
|
|
|
|
|
|
|
|
|
| |
- Don't call setrlimit() (it was needed to make 32-bit JVMs work with >3GB heaps)
- Remove a non-functional way to tweak the Linux scheduler
- Cosmetic fixes
--
MOS_MIGRATED_REVID=132653426
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address the following warnings from the compiler:
* "control reaches end of non-void function [-Wreturn-type]"
* "dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]"
* "ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]"
* "ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result [-Wunused-result]"
* "ignoring return value of 'int dup(int)', declared with attribute warn_unused_result [-Wunused-result]"
--
MOS_MIGRATED_REVID=128375065
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
This is so that only one server instance is started up if two clients are started in a workspace that doesn't have a running server yet.
More work towards #930. This may break Windows in case flock() doesn't work there as expected. In anticipation of this, locking is moved to blaze_util_platform.h / blaze_util.cc .
--
MOS_MIGRATED_REVID=121013078
|
|
|
|
|
|
|
|
|
| |
Fixes #1205 .
--
Change-Id: Ifd35cf141737f755b499a786cf9663153cd2cf53
Reviewed-on: https://bazel-review.googlesource.com/#/c/3513/
MOS_MIGRATED_REVID=120998788
|
|
|
|
|
|
|
|
|
| |
This is necessary because msys2 signals don't work on native Win32 processes, for example, java.exe .
Forcefully terminating the process still doesn't work because it uses signals. It's a-coming.
--
MOS_MIGRATED_REVID=120903711
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
--
Change-Id: I6a2f9026fda578905ccb72b317223eaca16b882b
Reviewed-on: https://bazel-review.googlesource.com/#/c/3440
MOS_MIGRATED_REVID=120228541
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was printing:
src/main/cpp/blaze_util.cc: In function 'bool blaze::WriteFile(const string&, const string&)':
src/main/cpp/blaze_util.cc:211:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return r == content.size();
^
src/main/cpp/blaze_util.cc: In function 'bool blaze::CheckJavaVersionIsAtLeast(const string&, const string&)':
src/main/cpp/blaze_util.cc:334:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < jvm_version_vect.size() && i < version_spec_vect.size();
^
src/main/cpp/blaze_util.cc:334:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < jvm_version_vect.size() && i < version_spec_vect.size();
^
src/main/cpp/blaze_util.cc:344:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (i < version_spec_vect.size()) {
^
src/main/cpp/blaze_util.cc:345:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (; i < version_spec_vect.size(); i++) {
This also fixes that we weren't checking write()'s return code.
--
MOS_MIGRATED_REVID=102656105
|
|
|
|
|
|
|
| |
--
Change-Id: I4e65cc583e758d2f7e45209ffcb37f6a871e2ed7
Reviewed-on: https://bazel-review.git.corp.google.com/#/c/1840
MOS_MIGRATED_REVID=101462155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Some progress towards #311.
--
Change-Id: I9276519d4a97d358b7c4f4e34a861522d75dd495
Reviewed-on: https://bazel-review.googlesource.com/#/c/1710
MOS_MIGRATED_REVID=99019961
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=94905648
|
|
|
|
|
| |
--
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=90517845
|
|
|
|
|
|
|
|
|
| |
-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
|