aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
Commit message (Collapse)AuthorAge
* Refactoring: uses OutputService for ActionFileSystem injectionGravatar shahan2018-06-18
| | | | | | Moves more Action-oriented from skyframe package, which has become very unwieldy, to action package. This is needed to avoid circular dependencies caused when build-base is needed for skyframe. PiperOrigin-RevId: 200996982
* Expose single_jar and bootclasspath in the java toolchain to skylark.Gravatar Googler2018-06-18
| | | | | | This would allow pulling these from the toolchain in kotlin rules. PiperOrigin-RevId: 200996334
* Make java_toolchain attribute Environment aware.Gravatar dbabkin2018-06-18
| | | | | RELNOTES:none: PiperOrigin-RevId: 200988244
* RepositoryFunction: depend on overrides, even if there is no ruleGravatar Klaus Aehlig2018-06-18
| | | | | | | | | | Not all bazel external repositories are generated by a rule (e.g., they might be unbound names with the expectation that on override binds them). Still, even those external repositories depend on changes to the repository override. Register this dependency. Change-Id: I900c94f969d08dec82c5776eff28337878379b5e PiperOrigin-RevId: 200974283
* Fix bug in NestedSetStore where racing deserializations could create ↵Gravatar janakr2018-06-16
| | | | | | multiple futures for the same fingerprint and add a test showing that racing serializations can result in duplicate writes. PiperOrigin-RevId: 200860099
* Remove topLevelConfigurationHook now that LIPO is goneGravatar gregce2018-06-15
| | | | PiperOrigin-RevId: 200801973
* Allow CppCompilationHelper to disable coverage instrumentationGravatar Googler2018-06-15
| | | | | RELNOTES=None PiperOrigin-RevId: 200800112
* ActionFS supports fast digests. Add test coverage for this and some file ↵Gravatar felly2018-06-15
| | | | | | | metadata operations. RELNOTES: None PiperOrigin-RevId: 200765925
* Remove "artifactOwnerConfiguration" now that LIPO is goneGravatar gregce2018-06-15
| | | | PiperOrigin-RevId: 200763653
* Support ActionFS opening files with append. Also, fix ActionFS notifying its ↵Gravatar felly2018-06-15
| | | | | | | metadata consumer multiple times per inline output. RELNOTES: None PiperOrigin-RevId: 200730252
* Remove LIPO supportGravatar hlopko2018-06-15
| | | | | RELNOTES: Support for LIPO has been fully removed. PiperOrigin-RevId: 200724578
* Move remaining BazelLibrary skylark functions to MethodLibraryGravatar cparsons2018-06-15
| | | | | | | | | Ultimately, we'll need to make the call on whether these functions belong as part of the build API or as part of skylark builtins. For now, we keep them as skylark builtins. (In either case, we'll want to migrate to @SkylarkCallable, but that's for a later change) RELNOTES: None. PiperOrigin-RevId: 200723605
* Don't propagate empty asset containersGravatar asteinb2018-06-15
| | | | | | | If asset containers are empty, simply discard them rather than propagating them up the dependency graph. We don't currently use merging output except at the top level, so we don't need any of this information. (If/when asset merging is redone, we'd need to redo this code anyway.) RELNOTES: none PiperOrigin-RevId: 200721055
* Add a bit more profiler coverageGravatar ulfjack2018-06-15
| | | | | | | | | | | | | | | | | | The intent is that the main thread has ~zero gaps in the profile (though there may still be small gaps due to the time between one try block and an immediately subsequent try block). We need to be careful not to wrap markPhase calls (or methods that call markPhase) in try blocks for the profiler - the Profiler requires that all markPhase calls happen at top level, and throws an exception if not. This should not have any performance impact - all of these are once per build, or at most once per module per build, and we don't expect a very large number of modules (and if we see an increasing number, we need to change the module API to not have to call every single module, but only those that are actually interested in certain events, maybe with an EventBus-based setup). PiperOrigin-RevId: 200712677
* Remove CcCompilationContext.TransitiveModuleHeaders#getTransitiveModules. ↵Gravatar cpeyser2018-06-15
| | | | | | This information is persisted for testing only, and considerably slows NestedSet serialization. PiperOrigin-RevId: 200710549
* sync: also report errorsGravatar Klaus Aehlig2018-06-15
| | | | | | | | If a failure occurs during the syncing of the external repositories, not only set the exit code, but also report the error message. Change-Id: I3a0e19039ab4444e811c8cff4e6f9b33331a0e02 PiperOrigin-RevId: 200709468
* Move the BlazeRuntime.initProfiler call to BlazeCommandDispatcherGravatar ulfjack2018-06-15
| | | | | | | | | | The intend is to move the profiler setup earlier in the startup sequence, so we can get more profiler coverage. Ideally, we'd setup the profiler immediately after getting the client call, but this is not currently possible due to the requirement that initialization and shutdown happen in pairs (otherwise the next command invocation crashes with an exception from the Profiler). PiperOrigin-RevId: 200707029
* Remove the removeHandler/releaseHandler pairsGravatar ulfjack2018-06-15
| | | | | | | | | | | | | | | | | | | | | | | They weren't actually doing anything. With default flags, createHandler never returns a FancyTerminalEventHandler, because that always gets wrapped in a RateLimitingEventHandler. Even so, under normal circumstances, the fancy terminal event handler always leaves the terminal in a valid state at the end of each printed line. We can only end up in a bad state if the blaze server is killed, but even then, this code wasn't doing anything because it didn't get to run. The only way to guarantee that the terminal is always in a valid state is to make sure that every stdout/stderr buffer we send to the client ends with a reset code sequence. The experimental ui handler is better at sending only complete buffers (we were previously using an auto-line flushing output stream, which didn't allow the event handler to reason about how much stuff got actually printed in a single write call). Anyway, I think we're in a better place now, and this code wasn't run, and if we want to fix it properly (if the switch to experimental_ui isn't sufficient), then we need to fix it elsewhere. PiperOrigin-RevId: 200699609
* Add the BuildConfigurationCollection to the AnalysisResultGravatar ulfjack2018-06-15
| | | | | | This is in preparation for interleaving config creation with loading+analysis. PiperOrigin-RevId: 200695071
* Reimplement AsynchronousFileOutputStream to use a writer threadGravatar ulfjack2018-06-15
| | | | | | | | | | | | | | | | | | | | | Background: the original code is implementing the OutputStream interface. Given a sequence of write calls, the code puts each of these writes into a queue. On the other side of the queue is an unbounded thread pool, which takes the writes off the queue one by one, and then does individual blocking writes with a fixed file offset. There are three problems with the original code: 1. Writes are sent to the Kernel one-by-one. Imagine if the incoming writes a single-byte writes, then we do one kernel call for every single byte. This is the worst case. 2. Due to multithreading, the writes can get reordered. In the worst case, the order is reversed, and the kernel flushes each write to disk individually. Since the writes are not aligned to disk block boundaries, each write has to first *read* the block from disk, overwrite a few bytes, and then flush the block back to disk. On a spinning platter, this is the worst possible sequence of operations: write a block, read the same block back, write the same block again, read the same block back, etc., with each operation having to wait for a full disk rotation. Note that this gets worse if there's high thread and / or disk contention, e.g., when running a build system in the background. 3. Due to the unbounded thread pool, it may end up creating a new thread for every single write (possibly as many as one per byte written). This is also the worst case, although it's probably negligible compared to 1+2. Compared to that, this change uses an in-memory buffer before sending writes to the kernel so non-block sized writes are batched, it writes sequentially, and it uses a single thread created at the start. A single thread should be more than able to fully saturate local disk I/O, so multi-threading should ~never be a improvement here. This might look different if we had perfectly aligned writes of an integer multiple of the disk block size to a distributed network file system or a local SSD raid. If you look at the clients of this class, that's definitely not the case: this code is primarily used for local file BEP transports - we wouldn't use local file BEP transports to write to a network file system, we'd use the BES instead. It's also used to write a couple of log files, also all local - otherwise we'd add the data to BEP. These are all unaligned, ~random-sized writes. If we created a lot of these files, then using a thread pool with fewer threads than files and using non-blocking I/O might be an improvement due to the reduction in thread count, but I think it's very unlikely that we'll ever need that complexity. PiperOrigin-RevId: 200694423
* Refactor BlazeRuntime.initProfilerGravatar ulfjack2018-06-15
| | | | | | | - reduce the parameters to the minimum required - change to void, move additional setup into the method PiperOrigin-RevId: 200692559
* Add a mechanism for build event protocol events to upload filesGravatar ulfjack2018-06-15
| | | | | | | | This should be a no-op, mostly replacing PathConverter with BuildEventArtifactUploader, since none of the implementations perform any upload yet. PiperOrigin-RevId: 200685325
* Remove SerializationConstants.VALIDATE_CONFIGURED_TARGET_VALUE, since ↵Gravatar cpeyser2018-06-14
| | | | | | ConfiguredTargetValue is no longer prohibitively slow. PiperOrigin-RevId: 200640971
* Fix shared actions that generate tree artifacts after the recent change to ↵Gravatar janakr2018-06-14
| | | | | | | | make Artifact#equals take owner into account (unknown commit). In the case that shared actions generate tree artifacts, the outputs of the second action do not include all the artifacts present in the results of the first action, because those artifacts were not known until execution. However, corresponding artifacts can be created easily enough, with the proper owners. Fixes #5396 PiperOrigin-RevId: 200640969
* Use single source of truth for symlinks and warn when deleting them.Gravatar mstaib2018-06-14
| | | | | | | | | | | | | | | | | | | | | After this change, Bazel prints a warning when --use_top_level_targets_for_symlinks is active and the destination of a symlink would be ambiguous. This also includes a refactoring of OutputDirectoryLinksUtils to use a single source of truth for all symlink operations. This results in a few small visible behavior changes: * Bazel used to delete a convenience symlink with the name of the workspace from the WORKSPACE file... but it didn't create it. * Bazel used to check for a convenience symlink named "includes" when pretty-printing paths... but it didn't create it. * Bazel used to ignore the existence of the "testlogs" symlink when pretty-printing paths... despite that it created it. * Bazel used to prioritize the execroot over the output base when pretty-printing paths... despite that the former contains the latter. RELNOTES: None. PiperOrigin-RevId: 200629863
* Enable automatic trimming of test configuration when entering non-test rules.Gravatar mstaib2018-06-14
| | | | | | | | | | | | | | Note that this is not sufficient to see caching between builds on its own; currently when any flag changes, the analysis cache is reset. A follow-up will turn off this behavior when only test flags change while trim_test_configuration is on. config_settings which examine test options are treated the same as test rules; that is, they can only be successfully analyzed at the top level or when connected to the top level by an unbroken chain of test rules. RELNOTES: None. PiperOrigin-RevId: 200614584
* Automated rollback of commit 1615da781db78b7a910daf89720189c2b2e73dbe.Gravatar Googler2018-06-14
| | | | | | *** Reason for rollback *** PiperOrigin-RevId: 200605975
* SerializationCheckingGraph checks all ConfiguredTargetValues.Gravatar cpeyser2018-06-14
| | | | PiperOrigin-RevId: 200593618
* Remove fixed point config expansion.Gravatar ccalvarin2018-06-14
| | | | | | | Deprecates the flag, though it continues to exist as a no-op so that users get a warning before errors. RELNOTES: --noexpand_configs_in_place is deprecated. PiperOrigin-RevId: 200572053
* Create an ImmutableTableCodec.Gravatar mjhalupka2018-06-14
| | | | PiperOrigin-RevId: 200561008
* Expose new methods in CcToolchainProvider to eventually replace skylark ↵Gravatar juliexxia2018-06-14
| | | | | | callables that depend on CToolchain in CppConfiguration. PiperOrigin-RevId: 200559893
* Skylark Pretty Printer: shorten empty listGravatar Klaus Aehlig2018-06-14
| | | | | | | | | | | | | | When pretty printing a Skylark value, lists are presented as the opening bracket on a line by itself, each entry on its own line, and the closing bracket again on its own line. While this generally improves readability, for the empty list this is not the case, as the expression [] can easily be understood at a glance. In fact, the additional line even makes the outer structure harder to see, as it is spread over even more lines. Therefore, shorten the printing of the empty list to be on a single line. Change-Id: I032d1550b1f99bce47dbec7e77a4d5c6656d78a1 PiperOrigin-RevId: 200558784
* Skylark debugging protocol: remove conditional breakpoints, don't include ↵Gravatar brendandouglas2018-06-14
| | | | | | | | | | | | | | | | | | | | | frames in thread paused events. I started implementing conditional breakpoints server-side in unknown commit, but: - client-side implementations seem more common in debugging protocols - IntelliJ in particular has great support for client-side conditional breakpoints, but poor support for server-side - it's unnecessary extra complexity for the server -- simple line breakpoints + evaluation requests already give us conditional bps. Also removing frames from thread paused events. It results in poor performance for stepping and pausing (in which we get frame info for potentially dozens of threads), and again isn't usual for debuggers. Finally, ignore breakpoints when performing a client-requested evaluation. PiperOrigin-RevId: 200547972
* Support unconditional fetching of repositoriesGravatar Klaus Aehlig2018-06-14
| | | | | | | | | | | Make all external repositories depend on an additional SkyValue controllable via commands, so support unconditional fetching of all external repositories, as it is needed by the the `sync` command. Improves on #5175, provides a work around for #4907. Change-Id: I30033614c1a2fad3f1363b85ff69cf92f697c255 PiperOrigin-RevId: 200543985
* Allow @ in package names.Gravatar twerth2018-06-14
| | | | | | | | | | To disambiguate: - @foo refers to the external dependency @foo//:foo (as before this change). - //@foo refers to the target //@foo:@foo (i.e. in the default workspace). RELNOTES[NEW]: Allow @ in package names. PiperOrigin-RevId: 200541716
* Add a convenience method to ProfilerGravatar ulfjack2018-06-14
| | | | | | This reduces our reliance on ProfilerTask. PiperOrigin-RevId: 200538769
* Remove unnecessary flags from RunCommand command annotationGravatar ulfjack2018-06-14
| | | | | | | These are no longer necessary since we don't pipe the subprocess stdout/stderr through Bazel anymore. PiperOrigin-RevId: 200534552
* Split BuildView into two classesGravatar ulfjack2018-06-14
| | | | | | | Move the testing class to the tests tree. This is in preparation for dismantling BuildView and merging the relevant parts into AnalysisPhaseRunner. PiperOrigin-RevId: 200532794
* Allow Skylark rules to specify whether targets can add execution platform ↵Gravatar John Cater2018-06-14
| | | | | | | | | constraints. Closes #5341. Change-Id: Ib74e59fec48102469a5039e045e3f3d0e0d86d8c PiperOrigin-RevId: 200526448
* C++: Fixes error reporting for cc_importGravatar plf2018-06-14
| | | | | RELNOTES:none PiperOrigin-RevId: 200525022
* Fix Profiler setup to actually enable the Json formatGravatar ulfjack2018-06-14
| | | | PiperOrigin-RevId: 200518973
* Simplify CommandEnvironment constructor, make fields finalGravatar ulfjack2018-06-14
| | | | PiperOrigin-RevId: 200516863
* Serialize lambdas when they are cast to Serializable.Gravatar janakr2018-06-13
| | | | | | We could conceivably do some monkey-patching at server startup to make all lambdas act Serializable, but one step at a time. PiperOrigin-RevId: 200509321
* @AutoCodec stray usage of AndroidDataConverter. It should always be a static ↵Gravatar janakr2018-06-13
| | | | | | | | | | constant. This allows us to continue using lambdas in its definition. This is a partial rollback of https://github.com/bazelbuild/bazel/commit/ed1e7594b23100f89755491f36e46886b4a51c8d, since the work done to class-ify things there is unnecessary once every instance is @AutoCodec-ed. PiperOrigin-RevId: 200504678
* Add functionality to make certain SkyValues unshareable, meaning they are ↵Gravatar janakr2018-06-13
| | | | | | not serialized. Tag TestCompletionValue and any ActionExecutionValue coming from a NotifyOnActionCacheHit (i.e., tests) like that. To make such values really not shared, request the ActionExecutionValue from TestCompletionFunction as opposed to the ArtifactValue (propagating the unshareable bit up seemed like too much fuss, and I have a dream of getting rid of ArtifactValue anyway). PiperOrigin-RevId: 200504358
* When composing RuleTransitionFactories, return something that respects equality.Gravatar mstaib2018-06-13
| | | | | | | | | | | | If the output from composeTransitions is one of the input PatchTransitions, return it. If it's a composed transition, make sure to wrap it in a class which respects equality. Without this change, running the same RuleTransitionFactory on the same attribute and target twice will produce two non-equal Dependencies which can't be deduplicated by OrderedSetMultimap - no lambda is equal to any other instance of the same lambda. RELNOTES: None. PiperOrigin-RevId: 200472777
* Populate JavaInfo's annotation_processing field in java_common.compileGravatar kmb2018-06-13
| | | | | | RELNOTES: None. PiperOrigin-RevId: 200471197
* Reconvert the lambdas in AndroidDataConverter to anonymous inner classes.Gravatar mjhalupka2018-06-13
| | | | | | | Tag some static members with @AutoCodec. Replace some lambdas with explicit functions or classes. PiperOrigin-RevId: 200467500
* Pass ActionFS paths through to action-level FileOutErr for the Action's ↵Gravatar felly2018-06-13
| | | | | | | stdout/stderr. RELNOTES: None PiperOrigin-RevId: 200459354
* Delete empty comment lines.Gravatar dannark2018-06-13
| | | | | RELNOTES: None PiperOrigin-RevId: 200455297