aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2
Commit message (Collapse)AuthorAge
* Drive-by clean-up: Remove unused visitedMapGravatar shreyax2018-02-07
| | | | PiperOrigin-RevId: 184913521
* When requesting nodes* look first in target configuration, then host (used ↵Gravatar juliexxia2018-02-07
| | | | | | | | | | | | to be the other way around). This fixes b/72817591 which saw the following - (1) somepath(//foo, //bar) --nohost_deps -> empty query results (2) deps(//foo) --nohost_deps | grep '//bar' -> found //bar This happened because //bar was configured in both the host and the target config. There was no path from //foo-target -> //bar-host because of the --nohost_deps setting (1) but //bar-target did exist in the results of (2) PiperOrigin-RevId: 184868484
* Cleaning up a missed reference to getTarget in ↵Gravatar mjhalupka2018-01-31
| | | | | | ConfiguredTargetQueryEnvironment. Follow up to https://github.com/bazelbuild/bazel/commit/426ab9067374bfe5af033e22153507c3f38e7221 PiperOrigin-RevId: 184049987
* 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
* Add a way to get a Target from the WalkableGraph instead of usingGravatar mjhalupka2018-01-30
| | | | | | | | | ConfiguredTarget.getTarget(). Might have reduced performance because we're doing some more lookups in the accessor now. PiperOrigin-RevId: 183864924
* Quick blanket replacement of getTarget().getLabel() with .getLabel(). Some ↵Gravatar Googler2018-01-22
| | | | | | have already been changed to ConfiguredTargetAndTarget so there's fewer classes than I thought there would be. PiperOrigin-RevId: 182839243
* Re-add WalkableGraph#isUpToDate and BuildDriver#alreadyEvaluatedGravatar Googler2018-01-18
| | | | | RELNOTES: None PiperOrigin-RevId: 182389876
* Introduce the blaze cquery command as the new ui for configurable query.Gravatar juliexxia2018-01-12
| | | | | | | | | | | | | | | | | | before: blaze build --nobuild //foo --experimental_post_build_query="deps(//foo)" after: blaze cquery "deps(//foo)" pros of ui change: - more concise - assumes query expression targets == targets to be built (but allows for flexibility through --top_level_targets flag) - separate from build command - cquery command recognizes query options, build options, and its own unique set of options cons of ui change: - adds another command to blaze - recognizes options that don't actually work yet -> requires more option validation RELNOTES: None PiperOrigin-RevId: 181816980
* Automated rollback of commit 9e63684a58025d98bfe2f180d56ba7ece69545ae.Gravatar juliexxia2018-01-05
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll forward of commit 86b4532769c22cca2ed7068a60f3326beaad34af after fixing bad import. +small misc fixes suggested by critique *** Original change description *** Automated rollback of commit 86b4532769c22cca2ed7068a60f3326beaad34af. *** Reason for rollback *** Probably breaking //javatests/com/google/devtools/build/lib:Query2Tests *** Original change description *** Restructure how universeScope is used when testing configured query to mimick impending changes to the configured query interface (CL/179872445) which will pull build targets out of the query expression. Fill in testTopLevelTransitions on the way! PiperOrigin-RevId: 180930388
* Automated rollback of commit 86b4532769c22cca2ed7068a60f3326beaad34af.Gravatar juliexxia2018-01-04
| | | | | | | | | | | | | | *** Reason for rollback *** Probably breaking //javatests/com/google/devtools/build/lib:Query2Tests *** Original change description *** Restructure how universeScope is used when testing configured query to mimick impending changes to the configured query interface (CL/179872445) which will pull build targets out of the query expression. Fill in testTopLevelTransitions on the way! PiperOrigin-RevId: 180880350
* Restructure how universeScope is used when testing configured query to ↵Gravatar juliexxia2018-01-04
| | | | | | | | mimick impending changes to the configured query interface (CL/179872445) which will pull build targets out of the query expression. Fill in testTopLevelTransitions on the way! PiperOrigin-RevId: 180854150
* After getting rid of LabelAndConfiguration, simplify some code by providing ↵Gravatar janakr2017-12-28
| | | | | | a ConfiguredTargetKey directly. PiperOrigin-RevId: 180285691
* Consolidate instances of the --loading_phase_threads flag.Gravatar juliexxia2017-12-21
| | | | | RELNOTES: None. PiperOrigin-RevId: 179838936
* 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
* Get rid of LabelAndConfiguration class: ConfiguredTargetKey contains the ↵Gravatar janakr2017-12-20
| | | | | | same information and is more useful, since it's practically a SkyKey. PiperOrigin-RevId: 179727105
* Consolidate instances of the --keep_going flag.Gravatar juliexxia2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179468685
* Add --implicit_deps custom filtering to configuredtargetqueryenvironment.Gravatar juliexxia2017-12-08
| | | | | | This implementation requires adding an interned list of LabelAndConfiguration objects to each RuleConfiguredTarget ('implicit' is an attribute describer, not a dep describer so filtering needs to happen while attribute information still exists). PiperOrigin-RevId: 178411882
* Add option to populate selector list in blaze query's proto output.Gravatar twerth2017-12-06
| | | | | | RELNOTES[NEW]: query: Add option --noproto:flatten_selects to turn off flattening of selector lists in proto output. PiperOrigin-RevId: 178106289
* Check for null build file returned from getBuildFileForPackage.Gravatar jcater2017-12-05
| | | | | | This can occur in genqueries when a referenced package isn't in the scope. PiperOrigin-RevId: 178038701
* 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
* Buffer blaze queryGravatar ulfjack2017-11-30
| | | | | | | | | | | It was previously sending each label individually over gRPC, where each call has a lot of overhead. This makes queries with a large amount of output _a lot_ faster. For an example query where all packages are already loaded, I observe a difference of ~3.5s before this change to ~1.6s after this change. PiperOrigin-RevId: 177426957
* 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
* Add --host_deps custom filtering to configuredtargetqueryenvironment.Gravatar juliexxia2017-11-17
| | | | | | | | Notable implementation details: - split the flag into --experimental_post_build_query and --experimental_query_options - allow --nohost_dep filtering to be applied to query targets configured in the host configuration (only returns deps also in the host configuration so allow deps as long as it never sees a transition from a host config to a non-host config) PiperOrigin-RevId: 176165870
* Refactor the representation of a collection of package specificationsGravatar cushon2017-11-15
| | | | PiperOrigin-RevId: 175832159
* 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
* Don't follow globs in rbuildfiles. Globs request the FILE node for symlinks ↵Gravatar shreyax2017-10-16
| | | | | | which causes the package containing the reference to be visited in rbuildfiles (which isn't the intended behaviour of rbuildfiles). Also add tests to guard against other types of inclusions. PiperOrigin-RevId: 172106051
* Categorize build options for BuildConfiguration.Gravatar gregce2017-10-06
| | | | PiperOrigin-RevId: 171017483
* Don't allow injection of non-default output formatters for genquery rule.Gravatar janakr2017-09-13
| | | | PiperOrigin-RevId: 168406412
* 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
* Fix assorted ErrorProne warnings.Gravatar lberki2017-09-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 167574104
* 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
* Split the cycle between vfs and profiler.Gravatar philwo2017-08-31
| | | | | | | | | | - Move ProfilerInfo into a subpackage (it's not necessary for profiling, just for analyzing a profile). - Make some fields in Profiler public for ProfileInfo. - Mark Profiler as ThreadSafe; there's no cyclic dependency here. This is based on ulfjack's microbazel patch series: https://github.com/ulfjack/bazel/commit/44553fcac0fc876784d8f48c2e577d8c999712de PiperOrigin-RevId: 167121952
* Split "shell", "graph" into their own packages.Gravatar philwo2017-08-29
| | | | PiperOrigin-RevId: 166849610
* 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
* Categorize query options.Gravatar janakr2017-08-18
| | | | PiperOrigin-RevId: 165581746
* 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
* Do not log stacktraces for interrupted ParallelVisitor workers, expected ↵Gravatar mschaller2017-07-27
| | | | | | | | | | | | | | query errors When a Query evaluation is interrupted, we expect ParallelVisitor worker threads to be interrupted. The RuntimeInterruptedException thrown by ParallelVisitor.Task#run does not represent an error. Likewise, QueryExceptions do not represent bugs and shouldn't be logged by ParallelVisitor either. RELNOTES: None. PiperOrigin-RevId: 163219663
* 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