aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp
Commit message (Collapse)AuthorAge
* Ignore the environment variable "http_proxy" so that it doesn't interfere ↵Gravatar Lukacs Berki2016-10-25
| | | | | | | with the gRPC-based communication between the Bazel client and server. -- MOS_MIGRATED_REVID=137138408
* cpp: remove unused functions after AF_UNIX refactoringGravatar Thiago Farina2016-10-24
| | | | | | | | | | With the removal of AF_UNIX code by commit a3c4833dc24b: ("Remove support for using AF_UNIX...") these function were left unused. -- Change-Id: I84b03bb7e168c22969d7fd1f35decccbc4a54b52 Reviewed-on: https://bazel-review.googlesource.com/#/c/6790/ MOS_MIGRATED_REVID=137002014
* Fix build on FreeBSD (again).Gravatar Piotr Sikora2016-10-19
| | | | | -- MOS_MIGRATED_REVID=136574107
* cpp: header hygienizationGravatar Thiago Farina2016-10-18
| | | | | | | | | | | * 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
* Remove support for using AF_UNIX to communicate between the Bazel cient and ↵Gravatar Lukacs Berki2016-10-07
| | | | | | | | | the Bazel server. RELNOTES[INC]: --command_port=-1 to use AF_UNIX for client/server communications is not supported anymore. -- MOS_MIGRATED_REVID=135355673
* cpp: refactoring blaze_globals.hGravatar Thiago Farina2016-10-07
| | | | | | | | | | | * drop "blaze_" prefix (like it was done with statup_options.h) * add a constructor to initalize the data members * rename the header file to global_variables.h to match the struct in there. -- Change-Id: I8c9f89f5d07c9a064bf1999c7bfb6d617d72818a Reviewed-on: https://bazel-review.googlesource.com/6370 MOS_MIGRATED_REVID=135342354
* Refactor: rename file_linux.* to file_posix.*Gravatar Laszlo Csomor2016-10-05
| | | | | | | | | | | | Subsequent commits will move methods out of src/main/cpp/blaze_util.cc and into file.h or file_<platform>.cc. Many of those methods heavily rely on the POSIX API, and we need to reimplement them against the Win32 API to compile Bazel on Windows using MSVC. -- MOS_MIGRATED_REVID=135128504
* Rollback of commit a6b4cbbd4a4bbb42eefe8fb0e646cd30780394e4.Gravatar Laszlo Csomor2016-10-04
| | | | | | | | | | | | | | | *** Reason for rollback *** Other projects may depend on Ijar without wanting to depend on Bazel. *** Original change description *** Ijar: use utilities from Bazel's source Remove a duplicate implementation of JoinPath. -- MOS_MIGRATED_REVID=135088616
* Ijar: use utilities from Bazel's sourceGravatar Laszlo Csomor2016-09-30
| | | | | | | Remove a duplicate implementation of JoinPath. -- MOS_MIGRATED_REVID=134778185
* cpp: integrate Init() into the StartupOptions constructorGravatar Thiago Farina2016-09-30
| | | | | | | | | | | This patch integrates the code of Init() function into StartupOptions's constuctor and thus fixing the TODO in startup_options.cc. -- Change-Id: Ic041306387f5ef82fa80d8511c3e9b7be706754a Reviewed-on: https://bazel-review.googlesource.com/#/c/6332/2 MOS_MIGRATED_REVID=134759417
* Windows: make the port library compile with MSVCGravatar Laszlo Csomor2016-09-30
| | | | | -- MOS_MIGRATED_REVID=134657410
* Move blaze_util::Which to standalone library.Gravatar Laszlo Csomor2016-09-29
| | | | | | | | | | | | | | | | | | This method is only used by blaze_util_linux.cc so instead of porting it to Windows, I'm moving it to a separate library. As part of this change I'm creating separate libraries for other sources in //src/main/cpp/util as well, so their dependencies are clearly defined in the BUILD file, plus we can port them one by one. This is part of the effort of compiling Bazel on Windows with the MSVC toolchain. -- MOS_MIGRATED_REVID=134636777
* Windows: make the md5 library compilable with MSVCGravatar Laszlo Csomor2016-09-29
| | | | | -- MOS_MIGRATED_REVID=134630535
* Windows, native: add windows_msvc config_settingGravatar Laszlo Csomor2016-09-28
| | | | | | | | | | | | | | | Update `select` statements in BUILD files with the new config_setting. This is a first step on a long path that leads to us being able to compile bazel on Windows with --cpu=x64_windows_msvc. Needless to say, we're not there yet. Tested: on Linux, Darwin, Windows/MSYS -- MOS_MIGRATED_REVID=134534613
* cpp: reuse InWorkspace() function in GetWorkspace()Gravatar Thiago Farina2016-09-28
| | | | | | | | | | | | The access() check in the do-while loop is basically doing the same thing that the InWorkspace() function provides. So lets just call that function instead. It also has the effect of making the code easier to read and understand. -- Change-Id: I02495775a9c9aa262396261824359538ca650e36 Reviewed-on: https://bazel-review.googlesource.com/#/c/6230 MOS_MIGRATED_REVID=134509465
* --Gravatar Googler2016-09-27
| | | | MOS_MIGRATED_REVID=134334656
* Remove a comment that says we can remove some obsolete code.Gravatar Lukacs Berki2016-09-21
| | | | | | | | | Spurred by Thiago's change in the area, I figured I'll try removing the PID symlink, but then I realized that this won't work, because the code currently gives precedence to the symlink, which means that if a server that writes both is replaced with a server that only writes the text file, the contents of the text file will not be read. Also note that in Bazel, long jumps between server versions are much more possible than internally, so the cleanup is just not worth the risk, which is sad. -- MOS_MIGRATED_REVID=133820484
* Use nanosleep(2) instead of poll(2) to sleep.Gravatar Chongyu Zhu2016-09-21
| | | | | | | | | | | | | Starting with macOS Sierra developer beta 4, the behavior of poll(2) was changed, such that poll(2) will return immediately regardless the timeout if there is no file descriptor. This fixes #1767. And, this should be a better solution for Homebrew/homebrew-core#5041. Closes #1803. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1803 MOS_MIGRATED_REVID=133816294
* cpp: convert ServerPidFile() and ServerPidSymlink() into constantsGravatar Thiago Farina2016-09-21
| | | | | | | | | | | 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
* Description redacted.Gravatar Laurent Le Brun2016-09-21
| | | | | -- MOS_MIGRATED_REVID=133693782
* Allow configuring writing of command.logGravatar Michajlo Matijkiw2016-09-19
| | | | | | | | Sometimes, especially in the case of a lot of output, one may not want to write everything twice. -- MOS_MIGRATED_REVID=133388416
* Bake in the product name into the StartupOptions classes.Gravatar Julio Merino2016-09-15
| | | | | | | | | | Now that we have gotten a StartupOptions class for each of the products we support, we can bake in the product name in each instance instead of passing it to the constructor. Helps with encapsulation and simplifies various instantiations of these classes. -- MOS_MIGRATED_REVID=133255854
* Roll-forward of the startup options refactoring.Gravatar Julio Merino2016-09-15
| | | | | | | | | | | | | | | This CL is a verbatim reproduction of the following CLs, modulo adjustments to cope with changes at HEAD: * commit 4a45d92130a6b1306a3840d006df165b8040a6cf: Use inheritance to support site-specific options. * commit dfb2c73eda3d2dd8787ea9b2d0a03b49dfa2acc5: Inject the product name via the per-product main.cc files. * unknown commit: Remove the internal/external startup_options duality. The cause that triggered the rollbacks was fixed separately in commit 69a8d7205287bedf3a6140ec9327e2fad1758c22 as prepartory work for this roll-forward, so things should work now. -- MOS_MIGRATED_REVID=133139218
* Roll back commit a34c4febbbdfba6c045598101ca9a491cfde7dd9 in favor of not ↵Gravatar Lukacs Berki2016-09-14
| | | | | | | | | 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
* Move the GetOutputRoot function to the WorkspaceLayout module.Gravatar Julio Merino2016-09-14
| | | | | | | | | | | | | | | | | | | | | | The result value of GetOutputRoot does not depend on the startup options: it only depends on the environment and/or the hardcoded values for Bazel and Blaze. Therefore, put it in the WorkspaceLayout module just as we did for all other similar functions. The fact that GetOutputRoot was part of BlazeStartupOptions was the root cause behind the rollback of commit 4a45d92130a6b1306a3840d006df165b8040a6cf: in particular, that CL silently added a virtual call to the GetOutputRoot method from the constructor of the superclass, and this invokes undefined behavior because the class has not yet been fully constructed. This caused Blaze to have incorrect values for the output_root. By moving the function out, we'll be able to roll that CL forward as it originally was. As part of this change, add unit tests for the value of output_root under various scenarios. These would have caught the discrepancy introduced by that CL. -- MOS_MIGRATED_REVID=133056251
* More client fixes:Gravatar Lukacs Berki2016-09-13
| | | | | | | | - 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
* Rollback of startup options changes.Gravatar Greg Estren2016-09-13
| | | | | -- MOS_MIGRATED_REVID=132940326
* Automated [] rollback of commit dfb2c73eda3d2dd8787ea9b2d0a03b49dfa2acc5.Gravatar Greg Estren2016-09-13
| | | | | | | | | | | | | | | | | *** Reason for rollback *** commit 4a45d92130a6b1306a3840d006df165b8040a6cf and everything after in [] breaks the Blaze nightlies *** Original change description *** Inject the product name via the per-product main.cc files. Instead of using a compile-time PRODUCT_NAME constant and complex Build rules to set the correct product name for Blaze and Bazel, use the new main.cc files to inject the appropriate value. -- MOS_MIGRATED_REVID=132934596
* Drop unnecessary -DBLAZE_JAVA_CPU definition.Gravatar Julio Merino2016-09-12
| | | | | -- MOS_MIGRATED_REVID=132703263
* Inject the product name via the per-product main.cc files.Gravatar Julio Merino2016-09-12
| | | | | | | | | Instead of using a compile-time PRODUCT_NAME constant and complex Build rules to set the correct product name for Blaze and Bazel, use the new main.cc files to inject the appropriate value. -- MOS_MIGRATED_REVID=132675327
* Various minor fixes in the client:Gravatar Lukacs Berki2016-09-09
| | | | | | | | | - 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
* Use inheritance to support site-specific options.Gravatar Julio Merino2016-09-09
| | | | | | | | | | | | | | | | | | Rename BlazeStartupOptions to StartupOptions and turn the latter into a class that can be subclassed to implement site-specific options behavior. This lends itself to easier customization for the site-specific versions, especially if there is more than one, and gets rid of the strange build-time parameterization of the old blaze_startup_options*.cc files. Note that this change introduces various TODOs. This is intentional. This change is quite complex as it is and I want to focus it on reshuffling the class structure without actually touching the internals. The latter can be done in subsequent, more targetted changes that are easier to review and understand. -- MOS_MIGRATED_REVID=132555032
* Do not print the "server probably died abruptly" warning message.Gravatar Lukacs Berki2016-09-08
| | | | | | | It is not really actionable and doesn't warn the user against real breakages, so there isn't much point. -- MOS_MIGRATED_REVID=132541684
* Don't use fancy STL data structures (including string) in ↵Gravatar Lukacs Berki2016-09-06
| | | | | | | KillServerProcess() so that we don't call malloc() in signal handlers. -- MOS_MIGRATED_REVID=132232499
* Update bazel's emacs check for 25.1's INSIDE_EMACS move.Gravatar Googler2016-09-01
| | | | | | | | | | 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
* Increase the deadline for cancellation request and add some extra logging in ↵Gravatar Lukacs Berki2016-08-31
| | | | | | | case the request fails. -- MOS_MIGRATED_REVID=131804959
* Move the workspace-related functions out of blaze_startup_options.Gravatar Julio Merino2016-08-29
| | | | | | | | | | This change introduces a new workspace_layout module that collects all the static methods previously contained in the BlazeStartupOptions class. These methods are not part of the options so it doesn't make sense for them to be there. -- MOS_MIGRATED_REVID=131576959
* option_processor: fix bad TMP parsing on Windows/MSYS.Gravatar Laszlo Csomor2016-08-26
| | | | | | | | See GitHub issue #1684: https://github.com/bazelbuild/bazel/issues/1684#issuecomment-242401560 -- MOS_MIGRATED_REVID=131368104
* --Gravatar Luis Fernando Pino Duque2016-08-19
| | | | MOS_MIGRATED_REVID=130747105
* Be more lenient with slow-to-react servers.Gravatar Michajlo Matijkiw2016-08-16
| | | | | | | | | | | | | | | | Increase the ping timeout on connect from five to ten seconds. This gives servers which may be suffering from gc pressure or other ailments extra time to respond. On the other end, wait for orphaned servers to really die before proceeding. This prevents race conditions around the delivery of SIGKILL and the starting of the new server. This may make us fail slower when the server is having hard times, however it should give us better determinism, and these conditions should be rare. -- MOS_MIGRATED_REVID=130118918
* Rollback of commit f107debac45ddf5859b1eb963379769b5815b18f. Also includes ↵Gravatar Janak Ramakrishnan2016-08-12
| | | | | | | | | the logical rollback of commit 67ad82a319ff8959e69e774e7c15d3af904ec23d. RELNOTES[INC]: Bazel supports Unix domain sockets for communication between its client and server again, temporarily, while we diagnose a memory leak. -- MOS_MIGRATED_REVID=130027009
* cpp: remove unused WaitForServerDeath() functionGravatar Thiago Farina2016-08-12
| | | | | | | | | | It is unused since commit f107debac45ddf5859b1eb963379769b5815b18f: (" Remove the AF_UNIX client/server communication"). -- Change-Id: Ia4051eb518ab7e97fb0523b0b3cdb4c0f19e704c Reviewed-on: https://bazel-review.googlesource.com/#/c/4290 MOS_MIGRATED_REVID=129971957
* Remove the AF_UNIX client/server communication protocol.Gravatar Lukacs Berki2016-08-05
| | | | | | | | | It has been superseded by gRPC. RELNOTES[INC]: Blaze doesn't support Unix domain sockets for communication between its client and server anymore. Therefore, the --command_port command line argument doesn't accept -1 as a valid value anymore. -- MOS_MIGRATED_REVID=129424092
* Make the default way of communication between client and the server gRPC ↵Gravatar Lukacs Berki2016-08-01
| | | | | | | instead of AF_UNIX. -- MOS_MIGRATED_REVID=128962306
* cpp: fix documentation of return value of GetNullaryOption() functionGravatar Thiago Farina2016-07-26
| | | | | | | | | | 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
* Placate the compiler.Gravatar Sasha Smundak2016-07-26
| | | | | | | | | | | | 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
* --Gravatar Luis Fernando Pino Duque2016-07-25
| | | | MOS_MIGRATED_REVID=128348972
* Add missing inlcudeGravatar Kristina Chodorow2016-07-22
| | | | | -- MOS_MIGRATED_REVID=128195657
* Mark output_base and output_user_root to not be backed up by TimeMachine on ↵Gravatar Dave MacLachlan2016-07-20
| | | | | | | | | | | Darwin. This is equivalent to what Xcode does with the directories that it generates as part its builds. fix for https://github.com/bazelbuild/bazel/issues/1514 -- MOS_MIGRATED_REVID=127927131
* Call TerminateProcess() is TerminateJobObject() fails.Gravatar Lukacs Berki2016-07-19
| | | | | | | This is to maintain some semblance of sanity on pre-Windows 8 systems where nested jobs are not supported. In that case, it's possible that the server is already in a job. -- MOS_MIGRATED_REVID=127810008