aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
Commit message (Collapse)AuthorAge
* Refactor WalkableGraph and BuildDriver interfacesGravatar Googler2018-02-13
| | | | | | | | Remove WalkableGraph#isUpToDate and BuildDriver#alreadyEvaluated and delegate the work to implementation. RELNOTES: None PiperOrigin-RevId: 185562370
* Generalize QueryExpressionVisitor's visitation by permitting an arbitrary ↵Gravatar nharmata2018-01-31
| | | | | | | "context" object to be passed along. Also make some query internals public, for use in fancy QueryExpressionVisitor implementations. RELNOTES: None PiperOrigin-RevId: 184014063
* Re-add WalkableGraph#isUpToDate and BuildDriver#alreadyEvaluatedGravatar Googler2018-01-18
| | | | | RELNOTES: None PiperOrigin-RevId: 182389876
* Refactor WalkableGraph and BuildDriver interfacesGravatar Googler2017-12-21
| | | | | | | | Remove WalkableGraph#isUpToDate and BuildDriver#alreadyEvaluated and delegate the work to implementation. RELNOTES: None PiperOrigin-RevId: 179815374
* Fix getBuildFiles to not assume BUILD is the name of the build file.Gravatar John Cater2017-12-04
| | | | | | | Fixes #4056. Change-Id: Ia7425c2146f15e9293605ee3da53007805e82275 PiperOrigin-RevId: 177813070
* Fix bug in SkyQuery's 'rbuildfiles' implementation where we were incorrectly ↵Gravatar nharmata2017-11-27
| | | | | | | | | using FileValue, rather than FileStateValue, nodes as the roots of the rdep traversal. This is incorrect e.g. when a .bzl file is a target of a symlink that is load'd from a BUILD file. RELNOTES: None PiperOrigin-RevId: 177018264
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Cosmetic refactor of some of the helper methods used by ↵Gravatar nharmata2017-11-01
| | | | | | | | | ParallelSkyQueryUtils.RBuildFilesVisitor. Also a minor tweak of the batch size for feeding results to the callback. Also correctly use the packageSemaphore in SkyQueryEnvironment's non-parallel implementation of rbuildfiles. RELNOTES: None PiperOrigin-RevId: 174039067
* Fixes EvaluationResult BuilderGravatar Googler2017-10-31
| | | | | RELNOTES: None PiperOrigin-RevId: 173950304
* Rename Label.EXTERNAL_PACKAGE_FILE_NAME to WORKSPACE_FILE_NAMEGravatar ulfjack2017-10-27
| | | | | | | This more clearly indicates what this is. Also change some hard-coded uses to use the constant instead. PiperOrigin-RevId: 173658659
* Rename FakeSubincludeTarget to more appropriate name FakeLoadTarget (thanks ↵Gravatar juliexxia2017-10-26
| | | | | | | @ccalvarin) RELNOTES: None. PiperOrigin-RevId: 173463794
* Replace Futures.dereference with the appropriate async method.Gravatar Googler2017-10-20
| | | | | | Futures.dereference is being deprecated and deleted, because it has a race condition where cancellation is not propagated. PiperOrigin-RevId: 172748120
* More BUILD file refactorings.Gravatar philwo2017-09-06
| | | | | | | | | Split collect, concurrent, vfs, windows into package-level BUILD files. Move clock classes out of "util", into their own Java package. Move CompactHashSet into its own Java package to break a dependency cycle. Give nestedset and inmemoryfs their own package-level BUILD files. PiperOrigin-RevId: 167702127
* Rename all logger instances to "logger" (instead "LOG" or "log").Gravatar lberki2017-09-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 167505493
* Add method getRdepsUnboundedInUniverseParallel to StremableQueryEnvironmentGravatar Googler2017-09-04
| | | | | RELNOTES: None PiperOrigin-RevId: 167335614
* Initial (partial) implementation of configured target query. Activated by ↵Gravatar janakr2017-08-21
| | | | | | | | | | | | | | | | | | | | | passing the --post_build_query flag to a build command, with a query expression as the argument. Bazel then executes this query on the configured target graph as constructed by the build command. Since the prepare graph -> query workflow is how SkyQueryEnvironment works, this is mostly just copying that. Main missing features/code cleanups: * Recursive target patterns (/...) are not supported. * There is no way to specify the configuration of the targets in your query. * Configuration output is totally opaque (just the hash, or null if no configuration). * More generally, no output options. * Some features (visibility, label attrs) not supported. * No edge filtering (host deps, implicit deps). * Aspects are totally ignored. * Graceful failure on errors, edge cases, incompatible flags (like the TAP flags that discard edges). * Code hygiene issues (calling test-only method to get to Skyframe graph, some code duplication across ConfiguredTargetQueryEnvironment and SkyQueryEnvironment). Most of the features I plan to leave to rules-side people, since I think they won't be too hard for a general Blaze developer to implement, and designing the right features and user interfaces for these things is better left to the rules side. PiperOrigin-RevId: 165747829
* Change WalkableGraphFactory#prepareAndGet to take multiple SkyKeys as graph ↵Gravatar Googler2017-08-17
| | | | | | | | | | roots It also changes a few accessors of utility methods in Skyframe library. It refactors the QueryExpressionMapper to use a general QueryExpressionVisitor. RELNOTES: None PiperOrigin-RevId: 165534908
* Use Label for equality comparison instead of Target: Target objects don't ↵Gravatar janakr2017-08-14
| | | | | | have equality. PiperOrigin-RevId: 165039514
* Introduce the 'siblings' query function.Gravatar nharmata2017-08-14
| | | | | | RELNOTES[NEW]: There is now a 'siblings' query function. See the query documentation for more details. PiperOrigin-RevId: 165010653
* Use Maps#newHashMapWithExpectedSize rather than improper HashMap ctor usage.Gravatar nharmata2017-08-11
| | | | | RELNOTES: None PiperOrigin-RevId: 164884056
* Clean up Label validation, and introduce a factory method for constructing a ↵Gravatar nharmata2017-08-08
| | | | | | | Label without validation. RELNOTES: None PiperOrigin-RevId: 164479651
* Generalize some of methods in TargetPattern, PrepareDepsOfPatternValue, and ↵Gravatar nharmata2017-07-26
| | | | | | | RecursivePackageProvider dealing with the concept of "excluded directories". RELNOTES: None PiperOrigin-RevId: 163074794
* Make TargetPatternKey implement SkyKey instead of wrapping in LegacySkyKeyGravatar ulfjack2017-07-19
| | | | | | Makes for much nicer client code. PiperOrigin-RevId: 162454439
* Make AbstractBlazeQueryEnv closable, shutdown SkyQEnv executor on closeGravatar mschaller2017-07-18
| | | | | | | | Users of SkyQueryEnvironment ought to be able to shut down its executor when they're finished with it. RELNOTES: None. PiperOrigin-RevId: 162262117
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Refactor SkyQueryEnvironment to allow preprocessing or postprocessing targetsGravatar Googler2017-06-27
| | | | | | | | Refactor SkyQueryEnvironment and a few other query helpers to make it easier to work with targets. RELNOTES: None PiperOrigin-RevId: 160165398
* In the Blaze Query implementation, use Set and Map implementations backed by ↵Gravatar nharmata2017-06-22
| | | | | | | the same KeyExtractor used that the Uniquifier implementation uses. This fixes a hypothetical issue where we were previously relying on Target#equals/hashCode. RELNOTES: None PiperOrigin-RevId: 159741545
* Remove ErrorSensingEventHandler#resetErrors().Gravatar lberki2017-06-12
| | | | | | | The call sites in QueryEnvironment implementations were not needed because QueryEnvironments are always made afresh. RELNOTES: None. PiperOrigin-RevId: 158698881
* Have TransitiveTraversalValues store kind of targets which have errors when ↵Gravatar Googler2017-05-16
| | | | | | | computing TransitiveTraversalValues. RELNOTES: None PiperOrigin-RevId: 156138657
* Make SkyKey an interface, and start the migration of not creating SkyKey ↵Gravatar janakr2017-05-04
| | | | | | wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries. PiperOrigin-RevId: 154989520
* Global cleanup change.Gravatar Googler2017-03-23
| | | | | | -- PiperOrigin-RevId: 151019690 MOS_MIGRATED_REVID=151019690
* Configurably block errors from universe eval in query environmentsGravatar Mark Schaller2017-03-12
| | | | | | | | | | | | Universe evaluation only occurs in the SkyQueryEnvironment implementation. This setting is a no-op for other QueryEnvironment implementations. This support is needed to correctly test an upcoming bugfix. -- PiperOrigin-RevId: 149786616 MOS_MIGRATED_REVID=149786616
* Description redacted.Gravatar Nathan Harmata2017-03-09
| | | | | | -- PiperOrigin-RevId: 149585165 MOS_MIGRATED_REVID=149585165
* Fix bug with streaming bounded deps/allrdeps/rdeps.Gravatar Nathan Harmata2017-03-08
| | | | | | -- PiperOrigin-RevId: 149431500 MOS_MIGRATED_REVID=149431500
* Rollback of commit 822c37816ac669e51bec3853b41849a19ec5e230.Gravatar Nathan Harmata2017-03-01
| | | | | | -- PiperOrigin-RevId: 148844518 MOS_MIGRATED_REVID=148844518
* Reimplement blaze query using an async evaluation model. Use a concurrent ↵Gravatar Nathan Harmata2017-02-28
| | | | | | | | | | | | | | | | | | | backend for SkyQueryEnvironment's implementation in order to achieve parallelism. Advantages: -New design has no flaws that the old design had. -Code is structured so that deadlocks due to thread starvation are impossible (yup!). Disadvantages: -The meat of this change needs to all be in a single CL because every single QueryFunction and QueryExpression needs to be rewritten in the async style. Still TODO: -Fully embrace the async model in all QueryFunctions (e.g. 'rdeps', 'allpaths'). -Use concurrency in BlazeQueryEnvironment to achieve parallel evaluation for (non SkyQuery) 'blaze query' and genquery. -- PiperOrigin-RevId: 148690279 MOS_MIGRATED_REVID=148690279
* 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
* Fix an issue with cached EventHandlers in SkyQueryEnvironment's resolverGravatar Mark Schaller2017-01-23
| | | | | | | | | | | | Because the event handler's inner handlers are removed after each query command, caching the handler caused a subset of subsequent commands' errors (those reported through the resolver's handler) to go unlogged. Also fix a bug with cycle detection in DelegatingWalkableGraph. -- PiperOrigin-RevId: 145124271 MOS_MIGRATED_REVID=145124271
* Remove WalkableGraph#exists and allow WalkableGraph#getValue and ↵Gravatar Janak Ramakrishnan2017-01-03
| | | | | | | | WalkableGraph#getException to be given non-existent keys without crashing. Add WalkableGraph#isCycle to fill the gap in testing for the difference between non-existence and depending on a cycle. -- PiperOrigin-RevId: 143205289 MOS_MIGRATED_REVID=143205289
* Rollback of commit e0a330577d9fe98169645cb68d9fc22cc787eeb6.Gravatar Janak Ramakrishnan2016-12-21
| | | | | | | | | | *** Reason for rollback *** Investigating if causes deadlock/thread starvation. -- PiperOrigin-RevId: 142575769 MOS_MIGRATED_REVID=142575769
* Add some logging when query evaluation halts abruptly.Gravatar Nathan Harmata2016-12-16
| | | | | | -- PiperOrigin-RevId: 142295816 MOS_MIGRATED_REVID=142295816
* Rephrase query transformation in terms of composition of QueryExpressionMappers.Gravatar Nathan Harmata2016-12-13
| | | | | | -- PiperOrigin-RevId: 141904124 MOS_MIGRATED_REVID=141904124
* For all function expressions of the form f(..., e1, ..., e2, ..., eK, ...), ↵Gravatar Nathan Harmata2016-12-02
| | | | | | | | ensure that all of e1, e2, ..., and eK are elligble for parallel evaluation. This is _not_ the same as providing a parallel implementation of f, which we can do separately in followup CLs. -- PiperOrigin-RevId: 140861694 MOS_MIGRATED_REVID=140861694
* Update ParallelSkyQueryUtils to use QuiescingExecutor instead of ForkJoinPoolGravatar Googler2016-11-29
| | | | | | | | | | | for concurrent visitations. During BFS visitation of rdeps and rbuildfiles, it uses a centralized pool (backed by a LinkedBlockingQueue) to store all pending visits, and a periodically running scheduler to schedule tasks for each pending visit. -- MOS_MIGRATED_REVID=140398162
* Introduce a failFast mode to OutputFormatterCallback#close.Gravatar Nathan Harmata2016-11-18
| | | | | -- MOS_MIGRATED_REVID=139508838
* Cache all previously computed values in ↵Gravatar Janak Ramakrishnan2016-11-17
| | | | | | | | | SkyQueryEnvironment#beforeEvaluateQuery if possible to save on latency for small queries. This assumes that if the graph is up to date, then the data in SkyQueryEnvironment is also up to date. It also assumes that a ForkJoinPool remains usable until #shutdownNow is called. -- MOS_MIGRATED_REVID=139386363
* Re-use the precomputed universe key in WalkableGraphFactory#prepareAndGet.Gravatar Janak Ramakrishnan2016-11-17
| | | | | -- MOS_MIGRATED_REVID=139357569
* Make TargetPattern evaluation during query evaluation more parallel-friendly ↵Gravatar Nathan Harmata2016-11-15
| | | | | | | by introducing TargetPattern#parEval, which allows TargetPatterns' evaluations to explicitly have parallel implementations (no need to secretly use a FJP). -- MOS_MIGRATED_REVID=139101922
* In SkyQueryEnvironment, cache some more objects that are just functions of ↵Gravatar Janak Ramakrishnan2016-11-14
| | | | | | | final fields. -- MOS_MIGRATED_REVID=138894804
* Add a mechanism for bounding the number of Packages SkyQueryEnvironment's ↵Gravatar Nathan Harmata2016-11-11
| | | | | | | expensive parallel operations can operate on at once. -- MOS_MIGRATED_REVID=138779172