aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze_util_freebsd.cc
Commit message (Collapse)AuthorAge
* Ensure that shutdown commands end the server process before completionGravatar mschaller2017-07-12
| | | | | | | | | | | | | | | | | | | | 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
* Raise the maximum number of processes and open files to their maximum.Gravatar jmmv2017-07-11
| | | | | | | | | | | | | | | | | | | 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
* blaze_util_freebsd.cc: gracefully handle server directory being NULLGravatar Klaus Aehlig2017-07-05
| | | | | | | | | | | | Gracefully handle the case that the working directory of the server process no longer exists in the file system. This happens if the directory in which bazel was called gets removed and later a directory with the same name is created; a particular such case is running bazel in integration tests. Closes #3324. PiperOrigin-RevId: 160938332
* use procstat_getpathname to get self pathGravatar Jov2017-06-27
| | | | | | | | Use procstat_getpathname instead of /proc/curproc/file to get self path, as /proc do not always exists, and need root privilege to mount. procstat_getpathname is preferred on FreeBSD. Closes #3179. PiperOrigin-RevId: 160260464
* cpp: remove blaze_util::sys_ioprio_set() call from FreeBSD portGravatar Thiago Farina2017-05-24
| | | | | | | Currently sys_ioprio_set() is only implemented for Linux. Change-Id: Iadacf8fd48a804b981274e92ca3066a403c467fb PiperOrigin-RevId: 156977281
* Update ExecuteDaemon() on POSIX systems so that the client writes the PID ↵Gravatar lberki2017-05-10
| | | | | | | | | file and not the server. This is so that the server does as few things as possible before exec() (preferably, nothing) so that we don't accidentally call malloc() which would make it possible to deadlock if the server spawned multiple threads before ExecuteDaemon(). RELNOTES: None. PiperOrigin-RevId: 155603273
* Fix compileGravatar kchodorow2017-05-09
| | | | | | See breakage @ http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=freebsd-11/1481/console. PiperOrigin-RevId: 155517063
* cpp: add PrintWarning() function to errors.hGravatar Thiago Farina2017-05-09
| | | | | | | | | 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
* Gracefully handle unset JAVA_HOMEGravatar Klaus Aehlig2016-12-01
| | | | | | | | | | | | getenv("JAVA_HOME") may return a null pointer; in this case, the corresponding string is in a state where calling .empty() segfaults. However, there is a legimitate use case for JAVA_HOME not being set; in fact, the default "/usr/local/openjdk8" is usually fine on FreeBSD. -- Change-Id: I4a2ad7d19ef38c79e9f1c62b0f8041e434203c7f Reviewed-on: https://cr.bazel.build/7590 MOS_MIGRATED_REVID=140716748
* Bazel client: reduce dependency on POSIX APIGravatar Laszlo Csomor2016-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* C++ refactor: time getters now return millisecondsGravatar Laszlo Csomor2016-11-08
| | | | | | | | | | | | | | 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
* 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
* 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
* 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
* Only tell the user that an old server process was killed if it actually was.Gravatar Lukacs Berki2016-07-14
| | | | | -- MOS_MIGRATED_REVID=127319649
* Linux-specific: check if the stray server process we are about to kill -9 is ↵Gravatar Lukacs Berki2016-05-02
| | | | | | | | | | | actually a server process. This should be implemented for other OSes, too, but OS X seems to lack a procfs and it's not clear how to discover anything about a process based on its PID and of course, Windows is a wholly different cup of tea. More work for #930. -- MOS_MIGRATED_REVID=121262673
* Fix build on FreeBSD.Gravatar Googler2015-11-17
| | | | | -- MOS_MIGRATED_REVID=108029812
* add some missing errno.h and string.h includesGravatar Mostyn Bramley-Moore2015-11-11
| | | | | | -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/571 MOS_MIGRATED_REVID=107471259
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | 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
* Port to FreeBSD.Gravatar Doug Rabson2015-08-26
-- Change-Id: I4e65cc583e758d2f7e45209ffcb37f6a871e2ed7 Reviewed-on: https://bazel-review.git.corp.google.com/#/c/1840 MOS_MIGRATED_REVID=101462155