aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze_util_darwin.cc
Commit message (Collapse)AuthorAge
* Use the local JDK as the default target javabaseGravatar cushon2018-05-14
| | | | | | and continue to use the embedded JDK as the default host_javabase. PiperOrigin-RevId: 196471714
* Remove die() and replace it with BAZEL_DIE, part of the logging framework.Gravatar ccalvarin2018-04-06
| | | | | | | This will mean the messages will make it to the right output stream. RELNOTES: PiperOrigin-RevId: 191925662
* Remove pdie.Gravatar ccalvarin2018-03-29
| | | | | | | pdie and die are pretty similar, pdie just adds the errno string or equivalent from GetLastErrorString(). Make this explicit. This makes message formatting more clear in preparation for moving these all to BAZEL_LOG. RELNOTES: None. PiperOrigin-RevId: 190957255
* 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
* 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
* 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
* Add support for checking to see if we are on a network drive for darwin.Gravatar Dave MacLachlan2016-07-18
| | | | | | | Fix for: https://github.com/bazelbuild/bazel/issues/1511 -- MOS_MIGRATED_REVID=127722500
* 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
* 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
* Cleanup: Use the standard types from stdint.h.Gravatar Thiago Farina2015-05-05
| | | | | | | | | Now that our toolchain supports stdint.h, we don't need to provide our custom types ourselves through numbers.h. -- Change-Id: I01de083e735e5cd64bcca723b19c55b9429632b7 MOS_MIGRATED_REVID=92840495
* Move blaze_exit_code.h into util/ directory.Gravatar Thiago Farina2015-04-24
| | | | | | | | This is so util/ files do not depend on anything from higer level. -- Change-Id: I522be6722851f25e79d9c2b85275856cbbd978de MOS_MIGRATED_REVID=91882837
* Header cleanups.Gravatar Han-Wen Nienhuys2015-04-22
| | | | | -- MOS_MIGRATED_REVID=91681168
* Cleanup: Build file.cc as part of util library.Gravatar Thiago Farina2015-04-14
| | | | | | | | | | | | | | | | | | | | | | 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
* Cleanup: Change is IsSharedLibrary() to take a const-reference parameter.Gravatar Thiago Farina2015-04-08
| | | | | | | | This should avoid making unnecessary string copies. -- Change-Id: I655f348ddeb3df47264a899a10d36086d2c2b596 MOS_MIGRATED_REVID=90614260
* Use a /var/tmp path for Bazel output tree on OSXGravatar Daniel Wagner-Hall2015-03-23
| | | | | | | | | The current value: 1) Isn't created by anything, and 2) Generates too long a path for the name of a Unix domain socket -- MOS_MIGRATED_REVID=89152182
* Use OS-specific caches for output rootGravatar Kristina Chodorow2015-03-23
| | | | | -- MOS_MIGRATED_REVID=89144546
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957