aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2/output
Commit message (Collapse)AuthorAge
* Use targets' labels' package identifier for query output=packageGravatar mschaller2017-06-22
| | | | | | | | | | Subinclude targets' packages are the package containing the load statement. Subinclude targets' labels are the bzl files they refer to. The latter has the appropriate package to display for --output=package. Fixes #3122. PiperOrigin-RevId: 159750840
* Automated rollback of commit 7dec00574aa91327693f6ba7e90bff5bc834253e.Gravatar ajmichael2017-06-22
| | | | | | | | | *** Reason for rollback *** Tickled a hidden bug in Blaze query. RELNOTES: None PiperOrigin-RevId: 159718294
* Ban the combination of buildfiles/loadfiles and --output=location.Gravatar nharmata2017-06-19
| | | | | | RELNOTES[INC]: The --output=location flag to 'bazel query' cannot be used with query expressions that involve the 'buildfiles' or 'loadfiles' operators. This also applies to 'genquery' rules. PiperOrigin-RevId: 159259061
* 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
* Make PackageOutputFormatter use PackageIdentifier instead of package name.Gravatar ajmichael2017-06-08
| | | | | | | Fixes #3122. RELNOTES: bazel query --output package now displays packages from external repository with the format "@reponame//package". Packages in the main repository continue to have the format "package". PiperOrigin-RevId: 158327492
* Expose the target map from Package.Gravatar carmi2017-05-19
| | | | | | | | This doesn't really expose new information, because one can iterate over the existing getTargets() and recreate the map. Moreover, the map is immutable, so there's no risk in returning it to the user. RELNOTES: None PiperOrigin-RevId: 156349797
* Split out option usage restriction from option category.Gravatar ccalvarin2017-04-18
| | | | | | | | | These are two different concepts. Do not remove category overload compatibility in this CL, to keep this change limited to converting the current uses of category. With some flyby formatting fixes on affected OptionsBases. RELNOTES: None. PiperOrigin-RevId: 153390002
* Add select() support for "query --output=build".Gravatar gregce2017-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | Before this change, attributes with select() were completely skipped. This doesn't attempt to merge "trivial" selects, e.g. even though: attr = [":foo"] + select({"//conditions:default": [":bar"]}) always resolves to: attr = [":foo", ":bar"] this change still produces: attr = [":foo"] + [":bar"] We could merge these in a future change, if desired. But it's not even clear that's desired. There's conceptual value in keeping the lists separate since that's how they were originally written. That gives users a cue to maybe refactor their rules. RELNOTES[NEW]: "query --output=build" now includes select()s PiperOrigin-RevId: 152956939
* Delete STRING_DICT_UNARYGravatar michajlo2017-03-31
| | | | | | | This isn't used anymore, it's the same as STRING_DICT, deleting so no one tries to use it. PiperOrigin-RevId: 151738915
* Description redacted.Gravatar Nathan Harmata2017-03-09
| | | | | | -- PiperOrigin-RevId: 149585165 MOS_MIGRATED_REVID=149585165
* 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
* Handle TriState type in `bazel query --output=build`Gravatar Laurent Le Brun2017-02-27
| | | | | | -- PiperOrigin-RevId: 148643993 MOS_MIGRATED_REVID=148643993
* 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
* Add the LABEL_KEYED_STRING_DICT type for attributes.Gravatar Michael Staib2017-02-24
| | | | | | | | | This enables both native and Skylark rules to declare attributes which have labels/Targets as keys, and have string values. -- PiperOrigin-RevId: 148365033 MOS_MIGRATED_REVID=148365033
* Remove type checking requirement from AttributeMap.has.Gravatar Greg Estren2017-02-15
| | | | | | | | | | | | | | This overrides the traditional has(String name, Type<>T> type) with has(String name) and removes the type check outright from isConfigurable. Ideally we'd remove the old version in this same change. But there are enough uses of it that that's not a risk-free change and is safer as followup changes. -- PiperOrigin-RevId: 147513593 MOS_MIGRATED_REVID=147513593
* Remove special handling of name attribute. Fixes #278Gravatar Googler2017-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | The name attribute gets special treatment in the codebase, in that it's not simply yet another attribute but stored in it's own field. Thus, every callside dealing with attributes needs to be aware of this special case and explicitly handle the name attribute. It's easy to see that this can lead to bugs. For example, querying for the name attribute is currently broken due the querying code not being aware of the special case [1]. Discussions with experienced bazel developers came to the conclusion that there is no need (anymore) to treat the name attribute specially and thus we decided it's best to remove the special treatment and handle the name attribute as any other attribute. This change removes the handling of name attributes and also adds a test case to verify that bug [1] is fixed. [1] https://github.com/bazelbuild/bazel/issues/278 -- PiperOrigin-RevId: 147446345 MOS_MIGRATED_REVID=147446345
* Introduce a failFast mode to OutputFormatterCallback#close.Gravatar Nathan Harmata2016-11-18
| | | | | -- MOS_MIGRATED_REVID=139508838
* bazel query: Gravatar Greg Estren2016-10-28
| | | | | | | | | - Extend https://github.com/bazelbuild/bazel/commit/83ffb5e7bc034ea2dd1e957249079b3884a9450d to --output=xml, --output=proto, too. This makes query much more resilient against freezing / OOMing from "select() + select() + select() + ..." patterns. - Make the above logic accessible to any output type. - Move AggregatingAttributeMapper.flattenAttributeValues to ProtoOutputFormatter, since this is really a utility method for ProtoOutputFormatter. -- MOS_MIGRATED_REVID=137429116
* bazel query --output=xml: avoid iterating over all possible values forGravatar Greg Estren2016-10-26
| | | | | | | | attr = select({"a": LABEL_LIST, "b": LABEL_LIST, ...}). This can be exponential (w.r.t. the # of select conditions) and produce OOMs. -- MOS_MIGRATED_REVID=137200979
* Make a method in ProtoOutputFormatter visible for tests.Gravatar Janak Ramakrishnan2016-10-10
| | | | | -- MOS_MIGRATED_REVID=135495077
* Unify AbstractBlazeQueryEnvironment#evaluateQuery with its subclass ↵Gravatar Nathan Harmata2016-10-04
| | | | | | | overrides. Also, have AbstractBlazeQueryEnvironment#evaluateQuery take an OutputFormatterCallback instance rather than a Callback instance. This is more sensible since the latter is only intended to be used intra-query, while the former is intended for usage in end-to-end query evaluation. This lets us slightly simplify QueryCommand, by shifting the responsibility for managing the OutputFormatterCallback to AbstractBlazeQueryEnvironment#evaluateQuery. -- MOS_MIGRATED_REVID=134827588
* Add type annotation for the benefit of java 7Gravatar Klaus Aehlig2016-09-30
| | | | | | | Fixes #1863 -- MOS_MIGRATED_REVID=134767527
* Don't force PrintStream on streaming output formattersGravatar Michajlo Matijkiw2016-09-30
| | | | | | | | Usually an OutputStream will do. Forgo the extra layer of indirection and stream directly to the output. -- MOS_MIGRATED_REVID=134682243
* Make a couple helper methods in SkyQueryEnvironment public.Gravatar Nathan Harmata2016-09-21
| | | | | | | FIXED=31439098 -- MOS_MIGRATED_REVID=133751771
* Introduce a new method on the StreamedFormatter interface for creating a ↵Gravatar Nathan Harmata2016-09-21
| | | | | | | callback for streaming a precomputed result. -- MOS_MIGRATED_REVID=133720742
* Added support for null terminated queries.Gravatar Andreas Bergmeier2016-08-10
| | | | | | | | Closes #1496. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1496 MOS_MIGRATED_REVID=129846158
* Remove GlobList formatting logicGravatar Michajlo Matijkiw2016-07-18
| | | | | | | Isn't strictly necessary, remove it before anyone decides they want to use it. -- MOS_MIGRATED_REVID=127585617
* Remove not-quite necessary serialization bitsGravatar Michajlo Matijkiw2016-07-15
| | | | | | | What we really are doing here is formatting. -- MOS_MIGRATED_REVID=127481183
* Slight refactor of OutputFormatter interface: separate the specification of ↵Gravatar Nathan Harmata2016-06-16
| | | | | | | potentially-relevant options from the creation of the callback. -- MOS_MIGRATED_REVID=124981132
* Thread through a map of the attributes which we have serialized into ↵Gravatar Shreya Bhattarai2016-05-17
| | | | | | | postProcess(). -- MOS_MIGRATED_REVID=122542545
* Clean up javadoc links.Gravatar Shreya Bhattarai2016-05-09
| | | | | -- MOS_MIGRATED_REVID=121680610
* Allow ProtoOutputFormatter to filter aspect attributesGravatar Michajlo Matijkiw2016-04-15
| | | | | -- MOS_MIGRATED_REVID=119902657
* Fix build output formatting of licensesGravatar Liam Miller-Cushon2016-04-13
| | | | | -- MOS_MIGRATED_REVID=119655452
* Don't keep packages in the default repository around after loading.Gravatar Brian Silverman2016-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this would get thrown when referring to the same package from both the main and default repositories: java.lang.IllegalArgumentException: Multiple entries with same key: tools/cpp=/home/brian/971-Robot-Code and tools/cpp=/home/brian/971-Robot-Code at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:136) at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:98) at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:84) at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:295) at com.google.devtools.build.lib.buildtool.BuildTool.transformPackageRoots(BuildTool.java:301) at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:209) at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:334) at com.google.devtools.build.lib.runtime.commands.TestCommand.doTest(TestCommand.java:119) at com.google.devtools.build.lib.runtime.commands.TestCommand.exec(TestCommand.java:104) at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:371) at com.google.devtools.build.lib.runtime.BlazeRuntime$3.exec(BlazeRuntime.java:1016) at com.google.devtools.build.lib.server.RPCService.executeRequest(RPCService.java:65) at com.google.devtools.build.lib.server.RPCServer.executeRequest(RPCServer.java:434) at com.google.devtools.build.lib.server.RPCServer.serve(RPCServer.java:229) at com.google.devtools.build.lib.runtime.BlazeRuntime.serverMain(BlazeRuntime.java:975) at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:772) at com.google.devtools.build.lib.bazel.BazelMain.main(BazelMain.java:55) And this would get thrown for any packages in the main repository loaded from other repositories: java.lang.RuntimeException: Unrecoverable error while evaluating node 'PACKAGE:@//tools/build_rules/go/toolchain' (requested by nodes ) at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:982) at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:499) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Invalid BUILD file name for package '@//tools/build_rules/go/toolchain': /home/brian/bazel/tools/build_rules/go/toolchain/BUILD at com.google.devtools.build.lib.packages.Package.finishInit(Package.java:299) at com.google.devtools.build.lib.packages.Package$Builder.finishBuild(Package.java:1308) at com.google.devtools.build.lib.skyframe.PackageFunction.compute(PackageFunction.java:501) at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:933) ... 4 more Sponsor's comment: note the abundance of new Label.resolveRepositoryRelative() calls. They are ugly, but it's only making existing ugliness explicit. Yes, we should fix it, especially in the implementation of configurable attributes. Refs #940 -- Change-Id: I8bd7f7b00bec58a7157507595421bc50c81b404c Reviewed-on: https://bazel-review.googlesource.com/#/c/2591 MOS_MIGRATED_REVID=117429733
* Properly filter out Aspect attributes when `blaze query` requests ↵Gravatar Dmitry Lomov2016-01-22
| | | | | | | | | --noimplicit_deps and/or --nohost_deps. RELNOTES: --noimplicit_deps and --nohost_deps work correctly for Aspect attributes. -- MOS_MIGRATED_REVID=112724917
* Extract AttributeInfoProvider interface for DependencyFilters.Gravatar Dmitry Lomov2016-01-22
| | | | | | | | This is in preparation of implementing dependency filtering correctly for aspects. -- MOS_MIGRATED_REVID=112721440
* Refactor dependency filtering out of Rule class.Gravatar Dmitry Lomov2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112717648
* Allow more flexibility on proto output formatter.Gravatar Miguel Alcon Pinto2016-01-21
| | | | | -- MOS_MIGRATED_REVID=112681274
* Fileset (Google internal): code cleanup.Gravatar Laszlo Csomor2016-01-19
| | | | | -- MOS_MIGRATED_REVID=112466264
* Allow to filter attributes based on the rule of the attribute.Gravatar Miguel Alcon Pinto2016-01-11
| | | | | -- MOS_MIGRATED_REVID=111854804
* Permit proto serialization of configured attribute valuesGravatar Mark Schaller2016-01-04
| | | | | | | | | This commit adds proto messages that represent configurable values, and modifies attribute value serialization code to handle those values, which are called SelectorLists. -- MOS_MIGRATED_REVID=111149272
* Minor cleanup to AttributeSerializer, ProtoOutputFormatterGravatar Mark Schaller2015-12-16
| | | | | | | | Makes "explicitlySpecified" a primitive boolean instead of a boxed Boolean. Minor formatting changes to ProtoOutputFormatter. -- MOS_MIGRATED_REVID=110360334
* Add option to read query from a file.Gravatar Janak Ramakrishnan2015-12-11
| | | | | | | RELNOTES[NEW]: Evaluate the query expression in a file by passing --query_file=<file> to query -- MOS_MIGRATED_REVID=109932769
* Allow output formatters to work in stream mode.Gravatar Miguel Alcon Pinto2015-12-10
| | | | | -- MOS_MIGRATED_REVID=109908202
* Rollback of commit 8e7da8704dba78dba47fbaa0eafce3a91c2deb13.Gravatar Peter Schmitt2015-12-01
| | | | | | | *** Reason for rollback *** -- MOS_MIGRATED_REVID=109005097
* Extract Attribute serialization logicGravatar Michajlo Matijkiw2015-11-20
| | | | | -- MOS_MIGRATED_REVID=108368348
* Allow output formatters to work in stream mode.Gravatar Miguel Alcon Pinto2015-11-19
| | | | | -- MOS_MIGRATED_REVID=108142169
* Aspect terminology update.Gravatar Dmitry Lomov2015-11-10
| | | | | | | | Aspect => ConfiguredAspect AspectWithParameters => Aspect -- MOS_MIGRATED_REVID=107375211
* Parametrize aspect definition with AspectParameters.Gravatar Dmitry Lomov2015-11-02
| | | | | -- MOS_MIGRATED_REVID=106848269