aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
Commit message (Collapse)AuthorAge
...
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Add a lambda now that we can.Gravatar lberki2017-06-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 160498120
* Move command.log writing to a moduleGravatar ulfjack2017-06-26
| | | | | | | This is part of refactoring / simplifying the BlazeCommandDispatcher. RELNOTES: None. PiperOrigin-RevId: 160110866
* Safe-guard against broken client environmentsGravatar Ulf Adams2017-06-19
| | | | | | | | | | | | | | The code previously threw StringIndexOutOfBoundsException if the client env contained just a variable name with no '=' or value. Fixed #3196. Change-Id: I5afcaa398ab2e8bacc709445f50ba363659cadbb Closes #3197. Change-Id: I5afcaa398ab2e8bacc709445f50ba363659cadbb PiperOrigin-RevId: 159222809
* BlazeModule.workspaceInit: also pass the BlazeRuntime to the callGravatar ulfjack2017-06-14
| | | | | | | | In order for BlazeModule.workspaceInit to be self-contained, also pass in the BlazeRuntime; we have use cases where this context is relevant, and there's currently no other way to get a reference to the BlazeRuntime. PiperOrigin-RevId: 158861142
* Move InvocationPolicy to the options parser package.Gravatar ccalvarin2017-06-09
| | | | | | | | | | | | | | It was originally included in runtime due to external dependencies, and a desire to keep the options parser a general options library. These dependencies have been or will be removed, and there are plenty of other general flag libraries. InvocationPolicy is fundamentally acting on the properties of this specific OptionsParser and needs proper access to it for the proper solution to a number of existing bugs, which means having access to things that should be package private. PiperOrigin-RevId: 158523111
* Split workspace-specific tests out of BlazeRuntimeTestGravatar ulfjack2017-06-09
| | | | | | | This creates a new class BlazeWorkspaceTest, and removes the initCommand method from BlazeRuntime. PiperOrigin-RevId: 158396032
* Move InvocationPolicy from a startup argument to part of the RunRequest proto.Gravatar ccalvarin2017-04-07
| | | | | | | | | The user interface is not changing. The policy will still be accepted as a flag passed to the client, as a startup flag (before the command), it will just no longer trigger server restarts and will not be passed on to a bazel server as part of the startup arguments. In batch mode, however, it will still be a startup argument, because the RunRequest proto is not sent, and all invocations restart bazel in batch mode anyway. Since invocation policy only affects command arguments, and changes in command arguments do not cause server restarts, this is consistent with other server restart behavior. RELNOTES: Changing --invocation_policy will no longer force a server restart. PiperOrigin-RevId: 152426207
* Remove configurability of abrupt exit code behavior.Gravatar ccalvarin2017-03-29
| | | | | | | | Ability to configure this was added to provide an easy correction in case writing the exit code to a file proved problematic. This feature has been out for 3 months with no reported issues, no reason to keep the extraneous flag. PiperOrigin-RevId: 151496431
* Log the server pid to java logging.Gravatar janakr2017-03-29
| | | | PiperOrigin-RevId: 151489034
* Clarify InvocationPolicy origins.Gravatar Chloe Calvarin2017-03-28
| | | | | | | | | Some policies can come from the module API, and some come from the user via startup argument. Clarify which one is which. -- PiperOrigin-RevId: 151324618 MOS_MIGRATED_REVID=151324618
* Move UnixFileSystem to lib.unix, WindowsFileSystem to lib.windowsGravatar Ulf Adams2017-02-28
| | | | | | -- PiperOrigin-RevId: 148749485 MOS_MIGRATED_REVID=148749485
* Provide more reporting options to SkyFunctions Gravatar Klaus Aehlig2017-02-27
| | | | | | | | | | | | | With more specific information to be reported by Skyfunctions, e.g., to inform the build-event protocol on missing files, the EventHandler interface is no longer enough. Therefore, provide an enriched context for reporting events. -- Change-Id: I2d06166fe4d5b9054e24ad8c752fafc039e3f9f8 Reviewed-on: https://cr.bazel.build/8794 PiperOrigin-RevId: 148463437 MOS_MIGRATED_REVID=148463437
* Reinstate IdleServerTasks that accidentally got disabled with the switch ↵Gravatar Lukacs Berki2017-02-07
| | | | | | | | | | from AF_UNIX to gRPC. Do not reinstate the checks whether the server should terminate itself, though, because we apparently get along pretty well without those. -- PiperOrigin-RevId: 146760481 MOS_MIGRATED_REVID=146760481
* Support mapping of Paths to URIsGravatar Klaus Aehlig2017-01-18
| | | | | | | | | | | Bazel-created files (like log files of test runs) are internally reported as Paths. However, this is not always the most useful representation of the location of that artifact for a consumer of build events. Therefore, support a mapping of paths to more useful URIs. -- PiperOrigin-RevId: 144843525 MOS_MIGRATED_REVID=144843525
* Make the server commit suicide if its PID file vanishes.Gravatar Lukacs Berki2017-01-13
| | | | | | -- PiperOrigin-RevId: 144434688 MOS_MIGRATED_REVID=144434688
* Rollback of commit 70c5790e4fb01db382d61d457596a46b68ba8d13.Gravatar Janak Ramakrishnan2017-01-05
| | | | | | | | | | | | | | | | (Tests kept.) *** Reason for rollback *** [] *** Original change description *** When --experimental_oom_more_eagerly is enabled, tell Bazel to exit with an OutOfMemoryError and have the JVM send Bazel a SIGUSR2 when it detects an OOM. This should help in certain pathological cases when Bazel GC thrashes for some time after an OOM has been detected. -- PiperOrigin-RevId: 143694970 MOS_MIGRATED_REVID=143694970
* Record correct exit code for uncaught exceptions in async threads.Gravatar Chloe Calvarin2016-12-13
| | | | | | | | | | Async threads are divorced from the server's error-reporting mechanism. In the event of a server shutdown originating in an async-thread, write the exit code to a file that can be read by the client. -- PiperOrigin-RevId: 141920284 MOS_MIGRATED_REVID=141920284
* Use find instead of match for client_env filteringGravatar Michajlo Matijkiw2016-11-21
| | | | | -- MOS_MIGRATED_REVID=139794968
* Merge BlazeModule.getEnvironmentExtensions into serverInit / ServerBuilder.Gravatar Ulf Adams2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137955061
* Clarify how startup options are conveyed between the client and the server.Gravatar Lukacs Berki2016-10-27
| | | | | -- MOS_MIGRATED_REVID=137266505
* Support per-module shutdown code on crash.Gravatar Julio Merino2016-10-17
| | | | | | | | | | | | | | Add a new "shutdown on crash" hook to the Blaze modules and call it when we exit due to a crash. This allows modules to perform necessary cleanup of internal state when exiting abruptly. Note that the need for implementing "shutdown on crash" is rare. As an example of when this may be useful is a module that has spawned background threads to communicate with a remote server and we want to shut down those connections in a controlled manner. -- MOS_MIGRATED_REVID=136330678
* Make --watchfs a common command option.Gravatar Ulf Adams2016-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | Adding an options parameter to DiffAwareness#getCurrentView seems like the simplest way to achieve that. Alternatives considered: 1. Making the diff awareness modules stateful. However, I did not want to do so as I've also been working on improving the module API to reduce state, or at least to have a proper lifecycle management for any necessary state. 2. Making the watchFs flag a constructor parameter. However, that would also invalidate any implementations that don't use the flag (of which we have several). 3. Only passing in a single boolean flag instead of an options class provider; however, this is a more principled, futureproof API, which allows other modules / awareness implementations to use their own options. RELNOTES: --watchfs is now a command option; the startup option of the same name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs build. -- MOS_MIGRATED_REVID=136154395
* Rollback of commit 2891ec527eed27d0c6460d66f51cb66a43373b6a.Gravatar Damien Martin-Guillerez2016-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Causes our integration tests on Darwin to time out *** Original change description *** Make --watchfs a common command option. Adding an options parameter to DiffAwareness#getCurrentView seems like the simplest way to achieve that. Alternatives considered: 1. Making the diff awareness modules stateful. However, I did not want to do so as I've also been working on improving the module API to reduce state, or at least to have a proper lifecycle management for any necessary state. 2. Making the watchFs flag a constructor parameter. However, that would also invalidate any implement... *** -- MOS_MIGRATED_REVID=136070807
* Make --watchfs a common command option.Gravatar Ulf Adams2016-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | Adding an options parameter to DiffAwareness#getCurrentView seems like the simplest way to achieve that. Alternatives considered: 1. Making the diff awareness modules stateful. However, I did not want to do so as I've also been working on improving the module API to reduce state, or at least to have a proper lifecycle management for any necessary state. 2. Making the watchFs flag a constructor parameter. However, that would also invalidate any implementations that don't use the flag (of which we have several). 3. Only passing in a single boolean flag instead of an options class provider; however, this is a more principled, futureproof API, which allows other modules / awareness implementations to use their own options. RELNOTES: --watchfs is now a command option; the startup option of the same name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs build. -- MOS_MIGRATED_REVID=136026835
* 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
* Enable Bazel commands to exit at any time.Gravatar Michael Staib2016-10-05
| | | | | | | | | | | | | This is the first step on a journey toward allowing commands to AbruptExit wherever they please, similar to how the user can press Ctrl+C at any time and we (should) bail out as fast as we can. By interrupting the command's main thread, we at least offer the command the ability to see that an error requiring a bail has happened, and it should trigger at potentially more locations, rather than just between phases. -- MOS_MIGRATED_REVID=135152330
* 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
* Move the query output formatters to ServerBuilder.Gravatar Ulf Adams2016-08-29
| | | | | -- MOS_MIGRATED_REVID=131569674
* Move QueryFunctions and InfoItems to ServerBuilder.Gravatar Ulf Adams2016-08-29
| | | | | | | Initialize these from BlazeModule.serverInit instead of on-the-fly. -- MOS_MIGRATED_REVID=131564738
* 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
* Replace calls to <class>.newInstance with <class>.getConstructor().newInstance.Gravatar Ulf Adams2016-08-12
| | | | | | | This is safer; newInstance on class objects bypasses exception checking. -- MOS_MIGRATED_REVID=129976805
* Remove the experimental hardlink / junction code from UnixFileSystem.Gravatar Ulf Adams2016-08-11
| | | | | -- MOS_MIGRATED_REVID=129863453
* Remove the outputPath parameter from BlazeModule.getFileSystem.Gravatar Ulf Adams2016-08-10
| | | | | | | | It's never used, and it's tricky to run with multiple different file systems in the same process -> remove it to simplify. -- MOS_MIGRATED_REVID=129858142
* Dedupe code: parse startup options in newRuntime, instead of calling it twice.Gravatar Ulf Adams2016-08-10
| | | | | -- MOS_MIGRATED_REVID=129856323
* Pass in the command options to BlazeModule.getCoverageReportFactory.Gravatar Ulf Adams2016-08-10
| | | | | | | This allows us to make the coverage module stateless if it depends on options. -- MOS_MIGRATED_REVID=129852270
* Cleanup BlazeRuntime and ServerBuilder slightly.Gravatar Ulf Adams2016-08-10
| | | | | -- MOS_MIGRATED_REVID=129843837
* Move workspace initialization out of BlazeRuntime.Builder.Gravatar Ulf Adams2016-08-10
| | | | | | | Require all callers to call initWorkspace after BlazeRuntime construction. -- MOS_MIGRATED_REVID=129842292
* Split BlazeDirectories into two classes.Gravatar Ulf Adams2016-08-09
| | | | | | | | | | | | | This is done in preparation for allowing multiple workspaces / commands in a single server. That requires changes to the module API, which currently hard-codes a 1:1 correspondence between workspaces and servers. Note how BlazeDirectories exists even when it runs outside a workspace. It's not ideal that the output base is in ServerDirectories, and the BlazeRuntime creation also still requires a BlazeDirectories instance. -- MOS_MIGRATED_REVID=129736613
* 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
* Add a ServerBuilder, and use that in the module API.Gravatar Ulf Adams2016-07-07
| | | | | | | This change is similar to a previous change that introduced WorkspaceBuilder. -- MOS_MIGRATED_REVID=126799657
* Rewrite workspace creation to use a builder class.Gravatar Ulf Adams2016-07-05
| | | | | | | | | An instance of the builder is passed to all modules, which can each add / set things on the builder. This reduces the BlazeModule API surface, while also being more flexible for future changes. -- MOS_MIGRATED_REVID=126613981
* Use the subprocess factory that uses the Win32 API on Windows.Gravatar Lukacs Berki2016-07-04
| | | | | | | We should really do something about the mess that is loading our JNI libraries -- io.bazel.EnableJNI is mentioned eight times in the code in various diverse contexts. This change is not the right place to do it, though. -- MOS_MIGRATED_REVID=126570481
* Rename the property io.bazel.UnixFileSystem to io.bazel.EnableJni because ↵Gravatar Lukacs Berki2016-07-01
| | | | | | | | | that's what it does. In particular, it affects Windows. -- MOS_MIGRATED_REVID=126293339
* Pass a locale to a getLowerCase call in BlazeRuntime.Gravatar Ulf Adams2016-06-21
| | | | | | | | Behavior of getLowerCase/getUpperCase is locale-specific, and can be rather surprising. We should _always_ pass a locale explicitly. -- MOS_MIGRATED_REVID=125450790
* Add a hook to Package.Builder.Helper that gets called by PackageFunction ↵Gravatar Nathan Harmata2016-06-07
| | | | | | | after the Package is fully loaded. -- MOS_MIGRATED_REVID=124260910
* Don't create CommandCompleteEvent for OOMs ahead of time. Its ↵Gravatar Janak Ramakrishnan2016-06-03
| | | | | | | super-constructor records timestamps and gc stats under the covers, so that data will be inaccurate. -- MOS_MIGRATED_REVID=123909692
* Replace Constants.PRODUCT_NAME with a startup option --product_name=bazel and Gravatar Luis Fernando Pino Duque2016-05-31
| | | | | | | | | | | (finally) delete Constants.java. For bazel the file Constants.java is the only source of src/main/java/com/google/devtools/build/lib:common and since it was exporting guava then many dependencies needed to be fixed. -- MOS_MIGRATED_REVID=123648270
* Allow BlazeModules to expose a helper that PackageFactory will use for ↵Gravatar Nathan Harmata2016-05-27
| | | | | | | creating fresh Package instances. Also make a few Package methods public. -- MOS_MIGRATED_REVID=123247246
* Pre-allocate memory at a few (non-exhaustive) sites that are on the exit ↵Gravatar Janak Ramakrishnan2016-05-24
| | | | | | | path after we OOM, in an attempt to make that path complete more quickly and successfully. -- MOS_MIGRATED_REVID=123040502