aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
Commit message (Collapse)AuthorAge
* Global cleanup change.Gravatar Googler2017-01-16
| | | | | | -- PiperOrigin-RevId: 144474876 MOS_MIGRATED_REVID=144474876
* Merge the action input prefetcher into the ExecutorBuilder.Gravatar Ulf Adams2017-01-13
| | | | | | | | | This should be a no-op change, primarily intended to improve the BlazeModule API. The code simplification in the distributor code path is incidental. -- PiperOrigin-RevId: 144441458 MOS_MIGRATED_REVID=144441458
* Make the server commit suicide if its PID file vanishes.Gravatar Lukacs Berki2017-01-13
| | | | | | -- PiperOrigin-RevId: 144434688 MOS_MIGRATED_REVID=144434688
* Skylark repositories: propage value from --action_env to repository_ctx.environ Gravatar Damien Martin-Guillerez2017-01-10
| | | | | | | | | | | | | | | | | | | | | | The environment is now computed with a mixture of the client environment and the values specified by the --action_env flag. If a user want to overwrite its environment for skylark repository, they can do `--action_env FOO=BAR` and the repository will see FOO as having the value BAR, whichever value is set in the client environment. Also propagate it to all repository functions, and deduplicate the way the client environment is passed to repository functions. Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 1] RELNOTES[INC]: repository_ctx environment is now affected by --action_env flag (value from the client environment will be replaced by value given on the command line through --action_env). -- Change-Id: I131a9695439aa9949d5001f820e2ae450e41332f Reviewed-on: https://cr.bazel.build/7971 PiperOrigin-RevId: 144091492 MOS_MIGRATED_REVID=144091492
* Updates Android flag documentation.Gravatar Alex Humesky2017-01-09
| | | | | | -- PiperOrigin-RevId: 143792017 MOS_MIGRATED_REVID=143792017
* 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
* Make "profile --html --html_details" work again.Gravatar Lukacs Berki2017-01-03
| | | | | | | | The start time of critical path component wasn't recorded correctly since #getStartWallTimeMillis() didn't work right. However, since profiler tasks store nanotime anyway, it's pointless to try to convert back and forth. -- PiperOrigin-RevId: 143438289 MOS_MIGRATED_REVID=143438289
* Move some classes to lib.exec in preparation for layering enforcementGravatar Ulf Adams2016-12-21
| | | | | | | | | | | | This change is part of the mu-bazel effort, which aims to build a minimally useful Bazel binary with most extraneous functionality removed. As part of that, we want to enforce layering of packages. In particular, lib.actions must not depend on lib.rules or lib.exec. lib.rules must not depend on lib.exec. Moving these classes is a necessary step to enforce that layering. -- PiperOrigin-RevId: 142668172 MOS_MIGRATED_REVID=142668172
* Remove dead code referencing deleted "suites" attribute.Gravatar Greg Estren2016-12-21
| | | | | | | | | This used to be how test_suites depended on other test_suites. Now they just go in "tests". -- PiperOrigin-RevId: 142607603 MOS_MIGRATED_REVID=142607603
* Avoids NullPointerException when running `bazel coverage //:xxx`, since ↵Gravatar Yue Gan2016-12-20
| | | | | | | | | | PathFragment.getParentDirectory() may return null. Fixes #2212. Also adds coverage-specific attributes to the java_binary rule. -- PiperOrigin-RevId: 142516883 MOS_MIGRATED_REVID=142516883
* Move TestStrategy to lib.exec package.Gravatar Ulf Adams2016-12-15
| | | | | | | | | | | | | | | | This is part of refactoring test strategy to unify its implementation between Bazel and Blaze (Google's internal version of Bazel), which should fix several issues in Bazel. It's also necessary to untangle lib.rules and lib.exec to enforce proper layering by separating compilation of these packages, and to provide a minimal Bazel binary. In particular, no core part of Bazel should depend on any of the rules, to facilitate moving them out of Bazel / reimplementing them in Skylark (except for some core rules like test_suite, alias, and genquery). -- PiperOrigin-RevId: 142151901 MOS_MIGRATED_REVID=142151901
* 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
* correct the executable path in script_path docsGravatar Jeff Hodges2016-12-09
| | | | | | | | | | | This confused me every time I looked it up. Thought that was working through some magic shell alias tricks until I found the files on my hard drive. Closes #2203. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2203 PiperOrigin-RevId: 141556677 MOS_MIGRATED_REVID=141556677
* Add --async clean independent of expungeGravatar George Gensure2016-12-08
| | | | | | | | | | | | | | An asynchronous clean without a complete purge and daemon shutdown is particularly useful when the daemon takes an inordinate amount of time to read output files for md5sums. Incurs a garbage collector invocation after cache cleanup in the interest of correct usage reporting. Closes #2053. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2053 PiperOrigin-RevId: 141437418 MOS_MIGRATED_REVID=141437418
* Add the coverage command to the CLI.Gravatar Ulf Adams2016-11-24
| | | | | | | Progress on #1118. -- MOS_MIGRATED_REVID=140128848
* Coverage support.Gravatar Ulf Adams2016-11-24
| | | | | | | | | | | | | | | | | - open source CoverageCommand.java - add a collect-coverage.sh script - update test-setup.sh to be compatible with the coverage collector - update StandaloneTestStrategy to provide the necessary env variables - update StandaloneTestStrategy to set the right command line for coverage - add support for C++ coverage An HTML report can then be generated with genhtml like this: genhtml -o report/ -p "$(readlink -f bazel-<project>)" path/to/coverage.dat Progress on #1118. -- MOS_MIGRATED_REVID=140125715
* Use find instead of match for client_env filteringGravatar Michajlo Matijkiw2016-11-21
| | | | | -- MOS_MIGRATED_REVID=139794968
* Support ordering constraints on build eventsGravatar Klaus Aehlig2016-11-21
| | | | | | | | | | | | | | In the build event protocol, we promise to respect certain ordering constraints that come naturally by causality anyway (e.g., the root cause of a failure has to come before the failure). However, in the way the call structure is organized, events might occur on the event bus in wrong order. So allow events to specify that order and make the streamer honor it. -- Change-Id: I1fbe9b93681f0ddfa35d9d00d5d1b02103da38a5 Reviewed-on: https://bazel-review.googlesource.com/#/c/7370 MOS_MIGRATED_REVID=139774946
* Make LineBufferedOutputStream resistant to exceptions thrown while flushing ↵Gravatar Lukacs Berki2016-11-21
| | | | | | | its buffer. -- MOS_MIGRATED_REVID=139771073
* Don't get output service or action input prefetcher if not running a "build" ↵Gravatar Janak Ramakrishnan2016-11-18
| | | | | | | command, to save time on the critical path of a build. -- MOS_MIGRATED_REVID=139477157
* Stop including the size of the action cache file in our crash message. I've ↵Gravatar Janak Ramakrishnan2016-11-17
| | | | | | | never seen a case it was useful, and it adds to startup latency by putting a file stat on the critical path of every command. -- MOS_MIGRATED_REVID=139467038
* Change the "tests succeeded but one or more targets failed to build" message ↵Gravatar Lukacs Berki2016-11-16
| | | | | | | to "there were other errors" to account for errors that aren't build failures. -- MOS_MIGRATED_REVID=139314129
* Merge all action input prefetchers into a single one.Gravatar Ulf Adams2016-11-16
| | | | | | | | | It seems unnecessary to pass these lists around, so this should simplify the APIs. Also, I want to move the action input prefetcher setup to the serverInit call. -- MOS_MIGRATED_REVID=139304928
* Use #equals() to check equality between ExitCode instances.Gravatar Lukacs Berki2016-11-15
| | | | | -- MOS_MIGRATED_REVID=139180153
* Add a GenSignatureActionContext to inject the command line info.Gravatar Ulf Adams2016-11-15
| | | | | | | | | This is needed to fulfill the contract of the gensignature rule / the corresponding audit trail protobuf. Note that the action is uncachable and unconditional to execute. -- MOS_MIGRATED_REVID=139178114
* Minor refactoring.Gravatar Lukacs Berki2016-11-15
| | | | | -- MOS_MIGRATED_REVID=139173954
* Only set the logging level if it has changed.Gravatar Janak Ramakrishnan2016-11-15
| | | | | -- MOS_MIGRATED_REVID=139118594
* Add two startup options:Gravatar Lukacs Berki2016-11-08
| | | | | | | | - --client_debug that turns out debug logging from the client - --connect_timeout_secs that controls the timeout of the initial Ping() RPC from the client to the server -- MOS_MIGRATED_REVID=138491791
* Writes a machine readable representation of BuildEvents to a file (varint ↵Gravatar Eduardo Colaco2016-11-03
| | | | | | | | | | | | | | | | | | | delimited). Adds --experimental_build_event_binary_file option that enables varint delimited proto loggging to the specified file path Adds varint delimited BuildEventStreamTransport and BuildEventStreamerModule Adds BuildEventStreamerModule for configuring and setting up BuildEventStreamer and its associated BuildEventTransports. Adds BuildEventTransportFactory which creates a Set of transports from command options. Moves BuildEventStreamer configuration from BlazeCommandDispatcher and BuildEventStreamerModule -- Change-Id: If71f2b58654879c2509206da47e6d1a846bf397f Reviewed-on: https://bazel-review.googlesource.com/#/c/7010/ MOS_MIGRATED_REVID=138073726
* Also provide test summaries in the build-event streamGravatar Klaus Aehlig2016-11-02
| | | | | | | | | | | For each test target, also have a test summary as children to this event. As test summaries are posted on the event bus anyway, it is enough to make then an instance of BuildEvent. -- Change-Id: Id53e5f1760548a1fa621b1667fdb4470f51a52e8 Reviewed-on: https://bazel-review.googlesource.com/#/c/6931 MOS_MIGRATED_REVID=137961100
* Merge BlazeModule.getEnvironmentExtensions into serverInit / ServerBuilder.Gravatar Ulf Adams2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137955061
* Move createActionCache to ExecutorBuilder.Gravatar Ulf Adams2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137936478
* Refactor the module API to use the builder pattern for executor creation.Gravatar Ulf Adams2016-11-02
| | | | | | | This significantly simplifies several of our modules. -- MOS_MIGRATED_REVID=137713119
* "bazel clean": prevent creation of command.logGravatar Laszlo Csomor2016-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Open files cannot be deleted on Windows, thus `bazel clean --expunge` fails when it attemps to delete the `command.log` that stdout/stderr is tee'd into, and so does BlazeCommandDispatcher when it attemps to delete the `command.log` just before dispatching to the command implementation (not just `clean` but any command). This change: - closes `command.log` before we attempt to delete it - marks CleanCommand (through the Command annotation) as one that should not write to the command.log, thus we don't create a new instance of the file This change allows `bazel clean --expunge` to delete everything in the output base, with the exception of `jvm.log`. Unfortunately that file is opened by the C++ bazel client process, so we have to close it there prior to sending the clean to the bazel server. See https://github.com/bazelbuild/bazel/issues/1586 -- MOS_MIGRATED_REVID=137278553
* Report completion of a target together with failed actionsGravatar Klaus Aehlig2016-10-27
| | | | | | | | | | | | | | | | Report the completion of all targets together with the root causes on the build event stream. To do so, have TargetCompleteEvent and ActionExecutedEvent be instances of BuildEvent; however, ignore an ActionExecutedEvent in the BuildEventStreamer if the execution was successful. By this change we get, for the first time, a build event stream that is naturally closed, i.e., without Aborted events closing up lose ends. Add a test asserting this property. -- Change-Id: Ie90dd52ee80deb0fdabdce1da551935522880a1a Reviewed-on: https://bazel-review.googlesource.com/#/c/6279 MOS_MIGRATED_REVID=137273002
* Clarify how startup options are conveyed between the client and the server.Gravatar Lukacs Berki2016-10-27
| | | | | -- MOS_MIGRATED_REVID=137266505
* Fix help text for --command_port so that it does not refer to the ↵Gravatar Lukacs Berki2016-10-25
| | | | | | | nonexistent AF_UNIX mode. -- MOS_MIGRATED_REVID=137135400
* Failing back to --expunge when using --expunge_async on non-Linux machineGravatar Damien Martin-Guillerez2016-10-17
| | | | | | | | | | | | --expunge_async rely on setsid to create a new process group, this is non-existent on Darwin nor on Windows. This lead to moving the output base to a location and forget about it silently. Instead, we fall-back to expunge_async until we completely fixes #1906. -- Change-Id: Ia932613f687149a85f766de9faa7ce49aaa20b38 Reviewed-on: https://bazel-review.googlesource.com/6694 MOS_MIGRATED_REVID=136340995
* 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
* Register the BuildEventStreamerGravatar Klaus Aehlig2016-10-07
| | | | | | | | | | | ...so that it gets informed about all relevant events happening during the build. For the time being, we only consider one transport, that to a text file. -- Change-Id: I429c957f39a07b795a71acbeaa1360178574a1d1 Reviewed-on: https://bazel-review.googlesource.com/#/c/6276 MOS_MIGRATED_REVID=135464059
* 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
* Fix info key client-envGravatar Klaus Aehlig2016-10-07
| | | | | | | | | ...to produce 'build --action_env=' statements, not common ones. See also d59bcb633. -- Change-Id: Ib0fc75ff8991650c43dd72300b3d92a6986b1165 Reviewed-on: https://bazel-review.googlesource.com/#/c/6493 MOS_MIGRATED_REVID=135350639
* Line buffer stderr.Gravatar Lukacs Berki2016-10-05
| | | | | | | Ideally, stdout would be line buffered, too, except that we sometimes pump large amounts of binary data through it, so line buffering would result in performance loss. -- MOS_MIGRATED_REVID=135237450
* 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
* Unify AbstractBlazeQueryEnvironment#evaluateQuery with its subclass ↵Gravatar Nathan Harmata2016-10-04
| | | | | | | overrides. Also, have AbstractBlazeQueryEnvironment#evaluateQuery take an OutputFormatterCallback instance rather than a Callback instance. This is more sensible since the latter is only intended to be used intra-query, while the former is intended for usage in end-to-end query evaluation. This lets us slightly simplify QueryCommand, by shifting the responsibility for managing the OutputFormatterCallback to AbstractBlazeQueryEnvironment#evaluateQuery. -- MOS_MIGRATED_REVID=134827588
* Add a build-event streamer classGravatar Klaus Aehlig2016-10-04
| | | | | | | | | | | | | The BuildEventStreamer will listen for BuildEvents and stream them to the provided transports. It also ensures events are properly chained: for unsolicited events, it will add progress events to chain them and at the end of a build it closes all announced but not produced events as aborted. -- Change-Id: I623b582657573fe1288821c96f084e0ab0bca4d4 Reviewed-on: https://bazel-review.googlesource.com/#/c/6275 MOS_MIGRATED_REVID=134787541
* Don't force PrintStream on streaming output formattersGravatar Michajlo Matijkiw2016-09-30
| | | | | | | | Usually an OutputStream will do. Forgo the extra layer of indirection and stream directly to the output. -- MOS_MIGRATED_REVID=134682243