aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
Commit message (Collapse)AuthorAge
* Remove BlazeModule.checkEnvironmentGravatar ulfjack2018-06-13
| | | | | | Do the work in beforeCommand instead. PiperOrigin-RevId: 200391086
* Add --print_workspace_in_output_paths_if_needed flag.Gravatar mstaib2018-06-12
| | | | | | | | | | | | | | | | When this flag is turned on, and the user's working directory is beneath the workspace (but is not the workspace itself), the workspace's absolute path is printed as a prefix to the convenience symlink. With this flag off, the displayed convenience symlink path is always relative to the user's workspace, even if that isn't the current working directory. (This is the current behavior.) The new (flag-on) behavior will become default soon, and then this flag will be removed. RELNOTES: None. PiperOrigin-RevId: 200278355
* Add support for the Json trace file formatGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | Add a --experimental_generate_json_trace_profile option that puts a file into the output base (or uses --profile if set). There are still a lot of problems with this. - unexplained holes - way too many threads - nonsensical event titles - too many detail events, too little overview - it may also cause unnecessary load - it silently overwrites the existing file on subsequent invocations The format is documented here: goo.gl/oMZPLh PiperOrigin-RevId: 200259431
* Refactor profilerGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | - move the save method to an inner class - don't use a timer, use a blocking queue instead - add a format enum (in anticipation of adding a json output format) - update the test to use an in memory buffer, and avoid FoundationTestCase Compared to the original https://github.com/bazelbuild/bazel/commit/15b8c259db111012b4642287172cb4d1d82151f3, it contains these changes: - Make it so we don't create a queue if we are not going to write any data! The queue is now owned by the writer, and if there is no writer, there is no queue. This was causing a memory regression because slowest task profiling is enabled by default, in which case the profiler is started with no output file. In that case, there's no thread that is emptying the queue, but the queue was still created by default. - add additional tests for slowest task and histogram handling; these also provide coverage for the case where the profiler is started without an output stream - move all the writer thread handling into the inner class - make writer access thread-safe - add a bunch of documentation PiperOrigin-RevId: 200212978
* Split TargetPatternEvaluator into two interfacesGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | - the TargetPatternPreloader is still used for query in all its forms - the remaining TargetPatternEvaluator part is no longer used except in tests - also make both implementations stateless and pass the offset to the methods instead; note that they both modify the underlying skyframe graph, so there are side effects to the calls even if there's no direct state anymore The intent is to migrate the relevant tests to LoadingPhaseRunnerTest (which could also now be renamed since it's not doing a loading phase), and then delete the TargetPatternEvaluator interface. This depends on the previous commit that removed the last direct use of TPE from an internal command. PiperOrigin-RevId: 200198067
* Automated rollback of commit 15b8c259db111012b4642287172cb4d1d82151f3.Gravatar jmmv2018-06-11
| | | | | | | | *** Reason for rollback *** Breaks internal performance tests. PiperOrigin-RevId: 200103033
* Refactor profilerGravatar ulfjack2018-06-11
| | | | | | | | | - move the save method to an inner class - don't use a timer, use a blocking queue instead - add a format enum (in anticipation of adding a json output format) - update the test to use an in memory buffer, and avoid FoundationTestCase PiperOrigin-RevId: 200065404
* Add AutoProfiler-like API to ProfilerGravatar ulfjack2018-06-11
| | | | | | - migrate all startTask/completeTask pairs to the new API PiperOrigin-RevId: 200038703
* Clean up Profiler a bitGravatar ulfjack2018-06-08
| | | | PiperOrigin-RevId: 199849102
* BlazeOptionHandler: only check in the parent directory, if there is oneGravatar Klaus Aehlig2018-06-08
| | | | | | | | | | | When checking for a file called DO_NOT_BUILD_HERE in the parent direcotry of the workspace path, first verify that there is such a parent directory. This avoids a null pointer exception if the WORKSPACE file is in the top-level directory. Fixes #5349 Change-Id: I81289a27a3f7fb0f4b5a112343de1b454fb5b8c5 PiperOrigin-RevId: 199790735
* Filter middleman artifacts from NamedArtifactGroupGravatar ulfjack2018-06-08
| | | | PiperOrigin-RevId: 199786555
* Rewrite TargetPattern failure reportingGravatar ulfjack2018-06-07
| | | | | | | | | | | | | | Report failures in TargetPatternFunction, rather than in its callers. Since we can't distinguish between keep_going and nokeep_going modes, we otherwise end up double-reporting errors. In the particular case that's covered by the build_event_stream_test.sh, we end up reporting the same target pattern as both skipped and failed. Unfortunately, this means we cannot report whether the target pattern was skipped or failed, so the pattern_skipped event is now unused (if we agree that this is acceptable, I'll remove the corresponding infrastructure). PiperOrigin-RevId: 199593700
* Mark --batch as deprecated in the documentation.Gravatar ccalvarin2018-06-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 199503117
* Clean up `bazel help coverage`Gravatar Googler2018-06-05
| | | | | | | Remove blaze references and add a missing "a". RELNOTES: None. PiperOrigin-RevId: 199300497
* Refactor root cause reporting in ConfiguredTargetFunctionGravatar ulfjack2018-05-29
| | | | | | We now track Causes instead of plain Labels, which will allow us to do better reporting in the future. Add basic tests. PiperOrigin-RevId: 198380468
* Remove special casing from processes stat line.Gravatar Googler2018-05-25
| | | | | | | | Fixes #5263 RELNOTES: execution strategies line no longer handles differently the case where all processes have the same strategy. PiperOrigin-RevId: 198057496
* Refactor analysis failure reporting, report loading failuresGravatar ulfjack2018-05-24
| | | | | | | | Split the AnalysisFailureEvent into a legacy and a new variant; always post an AnalysisFailureEvent, even if the legacy variant is not posted - this gives us some coverage for loading failures. PiperOrigin-RevId: 197862257
* Get ConfiguredTargetAndData out of TargetCompleteEvent.Gravatar janakr2018-05-22
| | | | | | Having it in there makes serializing events harder. PiperOrigin-RevId: 197648233
* Changing SymlinkTreeStrategy not to use spawns.Gravatar Googler2018-05-18
| | | | | RELNOTES: An internal action for symlinking runfiles will use Command instead of a Spawns. This should have no functional chages; the only user visible consequence should be that the internal action is no longer be included in statistics when calculating processes count. PiperOrigin-RevId: 197131917
* Remove the "--as_test" command line option to "bazel run".Gravatar lberki2018-05-18
| | | | | | RELNOTES[INC]: "bazel run --noas_test" is not supported anymore. PiperOrigin-RevId: 197126838
* Remove "bazel run --nodirect_run".Gravatar lberki2018-05-18
| | | | | | | RELNOTES[INC]: Bazel now always runs binaries in with "bazel run" in interactive mode. The "--nodirect_run" command line option is now a no-op. PiperOrigin-RevId: 197121535
* Rename BuildEventConverters to BuildEventContextGravatar ulfjack2018-05-17
| | | | | | | This is in preparation for adding options to the class, which can be used to modify the behavior of build events posted to the BEP. PiperOrigin-RevId: 196997573
* Remove AbruptException(ExitCode exitCode) constructor.Gravatar lpino2018-05-17
| | | | | | | | | This constructor was creating an Exception with a null message leading to possible NullPointerExceptions in a few places in our codebase. The call sites have been replaced with calls to AbruptException(String message, ExitCode exitCode) with a meaningful message. PiperOrigin-RevId: 196973540
* Fix embedded JDK LICENSE handling for JDK 9Gravatar cushon2018-05-16
| | | | PiperOrigin-RevId: 196840344
* Port bazelrc flags into their own module.Gravatar ccalvarin2018-05-16
| | | | | | | | | This way the documentation logs them correctly as named "bazel," and describes the correct behavior. Needed for #4502. RELNOTES: None. PiperOrigin-RevId: 196837021
* Add --ignore_all_rc_files startup options.Gravatar ccalvarin2018-05-15
| | | | | | | | | | | | | This overrides --bazelrc and --[no]master_bazelrc regardless of order. Like --bazelrc and --[no]master_bazelrc, it cannot be mentioned in an rc file, this would be a contradiction. This flag is useful for testing, and for having a version-agnostic way to turn off all rc files, such as in the canonical command line reporting. Now that blazerc and bazelrc are separate, this is necessary. If explicit values for --bazelrc or --master_bazelrc are provided which are now ignored, Bazel will warn the user. #4502 Alternatives considered - We could avoid this flag but would need to have some well-documented, reusable list of the startup flags that effectively come to the same effect. This would be necessary in our integration tests and in the CommandLineEvent and other places where rc files need to be completely disabled for correctness. We decided that this startup option was more straightforward and usable for both users and Bazel devs: it shouldn't be used when more fine-grained control is needed, but provides warnings if users are likely to be confused by the outcome. RELNOTES: None. PiperOrigin-RevId: 196750704
* Move --track_incremental_state and --keep_state_after_build to ↵Gravatar felly2018-05-15
| | | | | | CommonCommandOptions to better facilitate certain kinds of benchmarking. PiperOrigin-RevId: 196695342
* Implement a limit for named_set_of_file eventsGravatar ulfjack2018-05-15
| | | | | | | | | | | This adds a command-line option which can be used to force Bazel to split up very large events, e.g., events with hundreds of thousands of entries. This is rare, but happens occasionally. It would be better to control the maximum event size directly, but that is significantly more difficult to do here. PiperOrigin-RevId: 196690600
* C++: Renames CcCompilationContextInfo to CcCompilationContextGravatar plf2018-05-14
| | | | | | | Since it's not a provider, it doesn't need the Info suffix anymore. RELNOTES:none PiperOrigin-RevId: 196498526
* Refactor TestAttempt event posting codeGravatar ulfjack2018-05-14
| | | | | | | | For flaky tests, Bazel may have cached information about multiple test attempts. In that case, we might want to post all of them on a subsequent cache hit, rather than posting only the passing attempt. We currently subclass TestResult inside Google, which overrides the new getCachedTestAttempts method. PiperOrigin-RevId: 196491575
* 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 INTERNAL flags from help flags-as-proto.Gravatar mstaib2018-04-26
| | | | | | | | | These flags cannot be specified under any circumstances - the parser treats them as absent, and they can't be named in config_setting, etc. - so listing them here doesn't help anyone. RELNOTES: None. PiperOrigin-RevId: 194419952
* ExperimentalEventHandler: properly complete buildGravatar Klaus Aehlig2018-04-25
| | | | | | | | | | | | When completing the build and doing the final flush of the incomplete stdout/stderr lines, remove any existing progress bar first (and redraw afterwards) to avoid interference. Also, upon receiving the AfterCommandEvent, just call completeBuild instead of trying to do the same manually again. Change-Id: If375be798a5e66558676f0ffb845fb64279584f8 PiperOrigin-RevId: 194203925
* Automated rollback of commit 77777d1a769e938839b82c65ff320e09b1e7a715.Gravatar Googler2018-04-24
| | | | | | | | | | | | | | | | | | This CL includes the rollback + better fix for issue #4922. https://github.com/bazelbuild/bazel/issues/4922 *** Reason for rollback *** Breaks mobile-install v2 adb port forwarding, b/78432638 *** Original change description *** Fix crash from mobile-install with --device but no --adb_args. Fixes #4922. RELNOTES: None PiperOrigin-RevId: 194155557
* Add hook to inform SkyframeExecutor that build is finished.Gravatar janakr2018-04-24
| | | | PiperOrigin-RevId: 194099006
* SpawnAction.setShellCommand: expect shell pathGravatar laszlocsomor2018-04-23
| | | | | | | | | | | | | | | | | | | | | | | SpawnAction.setShellCommand(String) now expects the shell interpreter's path as an argument. This change enables two things: - rules can report an error if the shell is missing - SpawnAction no longer has to know about a default shell The new ShToolchain class will later also be responsible for retrieving the active shell toolchain (added in https://github.com/bazelbuild/bazel/commit/81ed3add408adb20bddbc3ba1818c65806738dc5). This change brings Bazel closer to not depend on the shell unless it has to (e.g. to run shell scripts). See https://github.com/bazelbuild/bazel/issues/4319 RELNOTES: none PiperOrigin-RevId: 193885943
* Add BazelCrashUtils to make it easier to crash the JVM when uncaught ↵Gravatar janakr2018-04-20
| | | | | | exceptions are detected in async worker threads. PiperOrigin-RevId: 193725871
* Flip the default to --direct_run to true.Gravatar lberki2018-04-20
| | | | | RELNOTES: "bazel run" now lets one run interactive binaries. The BUILD_WORKSPACE_DIRECTORY and BUILD_WORKING_DIRECTORY environment variables indicate the working directory and the workspace root of the Bazel invocation. Tests are provided with an approximation of the official test environment. PiperOrigin-RevId: 193659165
* Fix up all the tests to work with "blaze run --direct_run".Gravatar lberki2018-04-20
| | | | | | | | | In particular, update run_test so that the little test binary used to check ANSI escape code stripping explicitly marks the beginning of its output and delete a bunch of tests run RunCommandTest that verified the output of the binary. They are not relevant anymore now that the output is not piped through the server. Also drive-by fix a few linter issues in RunCommand. RELNOTES: None. PiperOrigin-RevId: 193655720
* Make "run --direct_run" always use an absolute path for $0.Gravatar lberki2018-04-19
| | | | | | | This is so that the runfiles directory can always be found. RELNOTES: None. PiperOrigin-RevId: 193514152
* Keep LANG/LANGUAGE and related environment variables for the process spawned ↵Gravatar lberki2018-04-18
| | | | | | | by "blaze run --direct_run". RELNOTES: None. PiperOrigin-RevId: 193391379
* Emit the command executed with "blaze run --direct_run" and its cwd.Gravatar lberki2018-04-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 193364213
* A slight refactoring of RunCommand.Gravatar lberki2018-04-17
| | | | | RELNOTES: None. PiperOrigin-RevId: 193203414
* Move test_timeout to BuildConfiguration and TargetCompleteEvent.Gravatar Googler2018-04-17
| | | | | | | | - Move test_timeout to BuildConfiguration. - Add test_timeout_seconds field to BEP TargetCompleteEvent. - Deprecate test_timeout field in ExecutionInfo. Data is still written to deprecated field to allow consumer transition. PiperOrigin-RevId: 193192636
* Rollback https://github.com/bazelbuild/bazel/pull/5007Gravatar cparsons2018-04-16
| | | | | | | It breaks downstream rules_nodejs. See https://github.com/bazelbuild/bazel/issues/5028 for details. RELNOTES: None. PiperOrigin-RevId: 193074798
* Roll forward of ↵Gravatar philwo2018-04-16
| | | | | | | | | | | | | | | | | | | | https://github.com/bazelbuild/bazel/commit/656a0bab1e025ff3c27d595284a4bf1c5a8d8028 with test (unknown commit) and fix. Big round of sandbox fixes / performance improvements. - The number of stat() syscalls in the SymlinkedSandboxedSpawn was way too high. Do less, feel better. - When using --experimental_sandbox_base, ensure that symlinks in the path are resolved. Before this, you had to check whether on your system /dev/shm is a symlink to /run/shm and then use that instead. Now it no longer matters, as symlinks are resolved. - Remove an unnecessary directory creation from each sandboxed invocation. Turns out that the "tmpdir" that we created was no longer used after some changes to Bazel's TMPDIR handling. - Use simpler sandbox paths, by using the unique ID for each Spawn provided by SpawnExecutionPolicy instead of a randomly generated temp folder name. This also saves a round-trip from our VFS to NIO and back. Clean up the sandbox base before each build to ensure that the unique IDs are actually unique. ;) - Use Java 8's Process#isAlive to check whether a process is alive instead of trying to get the exitcode and catching an exception. Closes #4913. PiperOrigin-RevId: 193031017
* Add a --as_test flag to "blaze run" that can be used to tell Blaze not to ↵Gravatar lberki2018-04-13
| | | | | | | use the test environment when a test is invoked with "blaze run". RELNOTES: None. PiperOrigin-RevId: 192733014
* CommandBuilder: remove useShell and setWorkingDirGravatar Laszlo Csomor2018-04-12
| | | | | | | | | | | | | | | | | | | | | Remove the .useShell method, expect callers to just pass the shell interpreter if they need it. This removes the argument vector transformation heuristic, and stops shelling out to cmd.exe on Windows. Also remove the .setWorkingDir method because callers always had to set the working directory. Instead, the CommandBuilder constructor takes the working directory. Closes #2190. (Test code still shells out to cmd.exe though.) Closes #5007. Change-Id: I545e01c811daaf34913cb585492923da81aa02ee PiperOrigin-RevId: 192611370
* analyze-profile: prevent bazel from crashing outside a workspaceGravatar Shmuel H2018-04-11
| | | | | | | | This commit closes #3256. Closes #4971. PiperOrigin-RevId: 192429422
* Remove alphabetical sorting of options in the canonical list.Gravatar ccalvarin2018-04-09
| | | | | | | This was broken for --config. Doing this properly requires keeping the order in which the options were given, which could be done either by filtering the ordered list according to which values affect the final outcome or by tracking the order correctly. I picked the later: the option order was not explicitly tracked for expansions before but now it is. RELNOTES: canonicalize-flags no longer reorders the flags PiperOrigin-RevId: 192132260