aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib
Commit message (Collapse)AuthorAge
* Add a flag to evaluate the top level transitions in SkyframeGravatar ulfjack2018-08-02
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new PrepareAnalysisPhaseFunction, which started out as a copy of some existing code from SkyframeExecutor, BuildView, AnalysisPhaseRunner, AnalysisUtils, and ConfigurationResolver, which was then modified to work inside Skyframe. Most of our tests already work with the new code, except for some of the tests related to configuration trimming in combination with dependency cycles. The reason for this is that we can only recover from dependency cycles at the end of a Skyframe invocation, but never inside a Skyframe invocation. The new code therefore cannot return partial results like the old code. This seems to make null builds a bit faster. In my testing, I saw null build times for a single test target go from ~50ms to ~40ms. This is probably due to slightly better caching - it seems that computing the configuration transitions and top-level targets is non-negligible, even if there's only a single top-level configuration for a single top-level target. This might be an even bigger win if there are a lot of top-level targets and configurations. PiperOrigin-RevId: 207083192
* [Skylark] Speed up string.partition function.Gravatar Taras Tsugrii2018-08-02
| | | | | | | | | | | | | | | | According to JMH using `ImmutableList.of` or `Arrays.asList` is ~2X faster than using existing approach of creating an empty `ArrayList` with expected size and populating it using `add` method. This is most likely due to extra range and capacity checks. Returning `ImmutableList` instead of `ArrayList` avoids the need to copy it again in order to create a `SkylarkTuple`. These changes speed up the function by ~3X. Closes #5736. PiperOrigin-RevId: 207079605
* [Skylark] Improve Skylark interpreter performance.Gravatar Taras Tsugrii2018-08-02
| | | | | | | | | | | | | According to JMH and JIT assembly generated for iterators and index accesses, iterator methods like `hasNext` and `next` are not optimized away and result in 3-4X slower execution. Not using an iterator reduces Buck parse time for FB's internal Android apps by 7%+. Closes #5735. PiperOrigin-RevId: 207073078
* Return Java providers only onceGravatar elenairina2018-08-02
| | | | | | | through JavaInfo, instead of returning them also through ConfiguredTarget. Since these providers can not be found in ConfiguredTarget anymore they have to be retrieved from JavaInfo instead. RELNOTES: None. PiperOrigin-RevId: 207068520
* Change Deque -> LinkedHashSetGravatar ulfjack2018-08-02
| | | | | | | | In some cases, we may be reporting a lot of actions, and this has shown up as a hotspot in our profiling. LinkedHashSet should be just as fast for insertion, keep order as Deque, and be faster for removal. There are a couple of more aggressive steps we can take if this doesn't help. PiperOrigin-RevId: 207064758
* Add a normal startup-option for setting the digest function.Gravatar ccalvarin2018-08-01
| | | | | | | | | We continue to support the jvm property -Dbazel.DigestFunction, for backwards compatibility, but this will go away. The startup-option is marked experimental for now as we iron out issues. (note: leaving this out of release notes until the experimental tag is removed) As part of this refactor, the default constructor calls for FileSystem and derived classes will now use this default. This should remove the need for constructors that accept custom hash functions. RELNOTES: None. PiperOrigin-RevId: 207035217
* Update comment about repository mapping containing entry from "@<main repo ↵Gravatar dannark2018-08-01
| | | | | | | name>" to "@". RELNOTES: None PiperOrigin-RevId: 207010178
* Pass a path to ActionExecutedEvent that is resolved via ActionExecutionContext.Gravatar tomlu2018-08-01
| | | | | | | If the output artifact is backed by a different file system then we need to use that file system later. RELNOTES: None PiperOrigin-RevId: 206981369
* Refresh ConfigurationResolver.getConfigurationsFromExecutor documentation.Gravatar gregce2018-08-01
| | | | | Specifically: mention trimming less and rule transitions more. PiperOrigin-RevId: 206980126
* Only detect artifact conflicts between targets in current build.Gravatar tomlu2018-08-01
| | | | | | | Previously, two successive builds of targets A and B would fail if the two sets had conflicting actions. Now, only fail such builds if the targets from the current build has action conflicts. RELNOTES: None PiperOrigin-RevId: 206974011
* Refactor setupPackageCache to get all BuildConfiguration.Options references ↵Gravatar juliexxia2018-08-01
| | | | | | | | out of it. Setting up the package cache is necessary for proper loading. In the future, BuildConfiguration.Option options will be targets that need to be loaded in order to be parsed. Thus, we will need to be able to do loading before BuildConfiguration.Options are parsed. PiperOrigin-RevId: 206964473
* Add builtin include directories to action key for CppCompileActionGravatar hlopko2018-08-01
| | | | | | | | Since builtin include directories affect validation, they have to be part of the action key. RELNOTES: None. PiperOrigin-RevId: 206960988
* Automated rollback of commit 15b27e46ad766e777fb898f39bff06efa9268c2a.Gravatar Googler2018-08-01
| | | | | | | | | Keep the usage of Streams in place. Keep the test in place, updated it with the new expected values. Only removed the neverlink filter. RELNOTES: none. PiperOrigin-RevId: 206951071
* [Skylark] Avoid unnecessary allocations.Gravatar Taras Tsugrii2018-08-01
| | | | | | | | | Since this happens only every single Skylark method invocation CPU and memory usage quickly adds up and shows up on profiler samples a lot. Closes #5656. PiperOrigin-RevId: 206935520
* Automated rollback of commit 75810d5910073aa7a1550bbd36544971f3c95ae1.Gravatar twerth2018-08-01
| | | | | | | | | | | | | *** Reason for rollback *** [] *** Original change description *** Remove the gen_jars output group RELNOTES: Removed the gen_jars output group PiperOrigin-RevId: 206921241
* Automated rollback of commit 38899f708923d6a7e1edd011af2ba70f505bb4c9.Gravatar twerth2018-08-01
| | | | | | | | | | | | | | | *** Reason for rollback *** Necessary for [] *** Original change description *** Return Java providers only once through JavaInfo, instead of returning them also through ConfiguredTarget. Since these providers can not be found in ConfiguredTarget anymore they have to be retrieved from JavaInfo instead. RELNOTES: None. PiperOrigin-RevId: 206915058
* Remove the need for discoverInputsStage2(). Much like every other SkyframeGravatar Googler2018-08-01
| | | | | | | | function, discoverInputs() can be implemented to return null upon encountering missing ActionExecutionValues. RELNOTES: None. PiperOrigin-RevId: 206913969
* There is no need to do input discovery or .d file analysis for modular codegen.Gravatar Googler2018-08-01
| | | | | | | | Modular codegen simply transforms a .pcm file to a .o file containing the code of inline functions of the module's headers. RELNOTES: None PiperOrigin-RevId: 206902693
* Open source SpawnMetricsGravatar ulfjack2018-08-01
| | | | PiperOrigin-RevId: 206893284
* [Skylark] Move method invocation logic to MethodDescriptor.Gravatar Taras Tsugrii2018-07-31
| | | | | | | | | | | | | | | | | | This serves 2 purposes: - better encapsulation and domain model. - opens the door to optimizations like using `MethodHandle` instead of `Method` and caching. - performs one of the optimizations mentioned above - perform `setAccessible` only once instead of on every method invocation. JMH suggests that this saves ~5% of CPU time. Next steps are: - evaluate peformance improvements for some of the optimizations listed above - make PRs to apply optimizations that seem beneficial. Closes #5704. PiperOrigin-RevId: 206805670
* [Skylark] Cache isParamNamed computation.Gravatar Taras Tsugrii2018-07-31
| | | | | | | | | | When `isLegacyNamed` is `true`, `named` is considered to be `true` as well, so instead of going through an extra indirection and computation, just use `named` field to store combined result. Closes #5701. PiperOrigin-RevId: 206800781
* [Skylark] Avoid unnecessary copyOf invocations.Gravatar Taras Tsugrii2018-07-31
| | | | | | | | According to async-profiler, about 50% of `Tuple.getSlice` method invocation is spent in `ImmutableList.copyOf` which is completely unnecessary for cases when an `ImmutableList` instance is passed. Closes #5699. PiperOrigin-RevId: 206787490
* [Skylark] Size tuple slice sizes to avoid unnecessary allocations.Gravatar Taras Tsugrii2018-07-31
| | | | | | Closes #5698. PiperOrigin-RevId: 206780174
* Remove output jar from runfiles and the ijar from the OutputJar when sourcesGravatar Googler2018-07-31
| | | | | | | are not provided. RELNOTES: none. PiperOrigin-RevId: 206768891
* Removes serialization class that introduced bug.Gravatar plf2018-07-31
| | | | | RELNOTES:none PiperOrigin-RevId: 206767138
* Add the source jars of exports to the list of transitive source jars.Gravatar Googler2018-07-31
| | | | | RELNOTES: none. PiperOrigin-RevId: 206760974
* Get newlines back. After the switch to using a JsonWriter, the json profileGravatar Googler2018-07-31
| | | | | | | | | | | | | | | | | | | output was written all in one line. However, it is really convenient to be able to grep and count over the file (or generally be able to open it in an editor). This change is a bit hacky as just using setIndent makes the file completely expanded with one key-value pair per line, which is also not ideal. With this change, the format is: [ { <entry> }, { <entry> }, ... { <entry> } ] RELNOTES: None PiperOrigin-RevId: 206758496
* Slightly improve UnixGlob implementation. For recursive patterns, the currentGravatar Googler2018-07-31
| | | | | | | | | | | | | | | implementation leads to two identical recursive calls. This isn't harmful as there is a cache that will make the second call very cheap, but does not seem right. As a consequence, a cache is only needed if there are two recursive patterns in a single glob-path, e.g. /a/b/**/c/**/d/... as either "**" can expand to 0 or more directories (so /a/b/c/c/d could be reached in two different ways). If there is only a single recursive pattern, even with "*" placeholders, there is always a unique expansion (a "*" always represents exactly one path element). RELNOTES: None. PiperOrigin-RevId: 206753919
* Stop generating .d files when they won't be looked at later.Gravatar Googler2018-07-31
| | | | | | | | While at it remove CppCompilationActionBuilder.setAllowUsingHeaderModules, which isn't used anymore and would make the logic here (even) more complicated. RELNOTES: None. PiperOrigin-RevId: 206752281
* Add JavaSourceInfoProvider to JavaInfo.Gravatar elenairina2018-07-31
| | | | | | | | | JavaSourceInfoProvider is returned through JavaInfo instead of ConfiguredTarget for all Java rules. Only android_library and android_binary return it directly through ConfiguredTarget, since they don't return a JavaInfo provider. RELNOTES: None. PiperOrigin-RevId: 206746172
* Add option to post ProfileStartedEvent containing the profile's path.Gravatar twerth2018-07-31
| | | | | RELNOTES: None PiperOrigin-RevId: 206741115
* Use JsonWriter to ensure correct escaping of valuesGravatar ulfjack2018-07-31
| | | | PiperOrigin-RevId: 206729076
* Only call filterDiscoveredHeaders() if include scanning is in effect.Gravatar lberki2018-07-31
| | | | | | | | | | | | This is a step towards making CppCompileAction work without input discovery. This works because: - filterDiscoveredHeaders() is not necessary if we don't discover any - shouldPruneModules is always false if `shouldScanIncludes` is false (see CppCompileActionBuilder#shouldPruneModules()) RELNOTES: None. PiperOrigin-RevId: 206721143
* Do not collect source jars for neverlink targets.Gravatar Googler2018-07-31
| | | | | RELNOTES: none. PiperOrigin-RevId: 206717454
* Disable include scanning for C++ linkstamp compile actions, which are ↵Gravatar lberki2018-07-31
| | | | | | | | | supposed to be shared. Note that CppCompileAction#discoversInputs() will still almost always return true because it's still set to true when .d file pruning is enabled. RELNOTES: None. PiperOrigin-RevId: 206716704
* Make explicit the contract of ConfiguredTarget builders returning null when ↵Gravatar cparsons2018-07-30
| | | | | | | there are rule errors. RELNOTES: None. PiperOrigin-RevId: 206652580
* Internal changeGravatar ruperts2018-07-30
| | | | PiperOrigin-RevId: 206642715
* [Skylark] Size argument list builder to avoid allocations.Gravatar Taras Tsugrii2018-07-30
| | | | | | | | | | | This change is focused on 2 things: - avoid creating builders in case they don't end up being used - create builders using the maximum expected size to avoid intermediate allocations to accommodate more elements Closes #5694. PiperOrigin-RevId: 206636046
* Automated rollback of commit be88b8539b30d1c36c68b0f6acfe1e9ae010db3b.Gravatar cparsons2018-07-30
| | | | | | | | | | | | | *** Reason for rollback *** Concerns were raised about this breaking change, so rolling back to be safe. *** Original change description *** Throw a rule error when a skylark rule implementation returns multiple providers of the same type. RELNOTES: A rule error is now thrown if a Skylark rule implementation function returns multiple providers of the same type. PiperOrigin-RevId: 206629186
* Improve artifact->owner label accounting in two ways. First, don't do the ↵Gravatar janakr2018-07-30
| | | | | | full mapping unless requested. This gets rid of any performance issue for the vast majority of builds. Second, if requested, use a custom data structure so that we don't have to create a full HashSet for artifacts whose only owning labels are their own owner labels. PiperOrigin-RevId: 206610370
* [Skylark] Use POJOs instead of dynamic proxies.Gravatar Taras Tsugrii2018-07-30
| | | | | | | | | | | | | | Java uses dynamically generated proxy classes to access annotation properties and their methods are ~7X slower than plain getters. According to async-profiler 50%+ of `convertArgumentList` method time is spent in dynamic proxy methods, so optimizing their performance makes sense. This also makes the model less anemic, since POJOs can actually provide business methods. Closes #5666. PiperOrigin-RevId: 206608812
* Some code cleanups and improvements around the various DTC visitor ↵Gravatar nharmata2018-07-30
| | | | | | | | | | | implementations in SkyQuery: (1) Get rid of the 'errorReporter' param used in the two unbounded 'deps' implementations. In practice, this callback is always used right alongside the normal query callback. So we can re-implement it as a single, composite callback. (2) Revert the recent change to processResultsAndReturnTargets (and restore the old method name). It general, it's a bad idea to return Targets outside that method, because it means we aren't respecting the MultisetSemaphore<PackageIdentifier>. Along with (1), this fixes a real issue where DepsUnboundedVisitor#processPartialResults was using Targets (and thus keeping their Packages live in memory) outside of the package semaphore. RELNOTES: None PiperOrigin-RevId: 206606747
* Remove source index from SourceFileArtifactValue.Gravatar felly2018-07-30
| | | | PiperOrigin-RevId: 206586252
* Return Java providers only onceGravatar elenairina2018-07-30
| | | | | | | through JavaInfo, instead of returning them also through ConfiguredTarget. Since these providers can not be found in ConfiguredTarget anymore they have to be retrieved from JavaInfo instead. RELNOTES: None. PiperOrigin-RevId: 206585413
* Add manifestProtoOutput produced during Java compilation to the OutputJar so ↵Gravatar Googler2018-07-30
| | | | | | | that it can be accessed in Skylark. One example where this is used is in Android IDL processing where the manifestProtoOutput is used to split out the Android IDL generated Java classes from the overarching outputJar produced by the android_library rule. RELNOTES: none PiperOrigin-RevId: 206580880
* Add a todo to ProcessUtils to use the new Java 9 APIsGravatar ulfjack2018-07-30
| | | | PiperOrigin-RevId: 206573961
* Allows subclasses of SkyframeExecutor to enable analysis during execution.Gravatar shahan2018-07-30
| | | | PiperOrigin-RevId: 206568465
* Make the fallback strategy for Bazel's remote execution configurable.Gravatar philwo2018-07-30
| | | | | | | | | RELNOTES: When using Bazel's remote execution feature and Bazel has to fallback to local execution for an action, Bazel used non-sandboxed local execution until now. From this release on, you can use the new flag --remote_local_fallback_strategy=<strategy> to tell Bazel which strategy to use in that case. PiperOrigin-RevId: 206566380
* Document AndroidLibrary.java for readability.Gravatar jingwen2018-07-27
| | | | | RELNOTES: None. PiperOrigin-RevId: 206393574
* Blacklist PackageFactory$BuiltInRuleFunction from serialization.Gravatar janakr2018-07-27
| | | | PiperOrigin-RevId: 206389059