aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java
Commit message (Collapse)AuthorAge
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Get Target out of SupportedEnvironmentsProvider. Only a Label and Location ↵Gravatar janakr2018-02-14
| | | | | | are needed, so just use that. PiperOrigin-RevId: 185738140
* Refactor Info classGravatar brandjon2017-12-27
| | | | | | | This simplifies the location field (now non-nullable), removes a couple redundant loc args, and clarifies the type's description and some javadoc. RELNOTES: None PiperOrigin-RevId: 180210943
* Rename OutputGroupProvider -> OutputGroupInfo.Gravatar dslomov2017-12-14
| | | | | RELNOTES: None PiperOrigin-RevId: 179046403
* 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
* Remove the runfiles middleman from py_binary's data runfiles.Gravatar Benjamin Peterson2017-10-26
| | | | | | | | | | | | | | This requires polluting Runfiles and RuleConfiguredTargetBuilder with some custom infrastructure to lift a py_binary runfiles middleman into the FilesToRunProviders and output groups of its reverse dependency. That can all go away when the --experimental_build_transitive_python_runfiles transition is complete. This is another step towards https://bazel-review.googlesource.com/c/bazel/+/14010. Change-Id: Ib750d72d4be42324c8edec485707480690b9fc9c PiperOrigin-RevId: 173514090
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Merging a RunfilesSupport object into Runfiles.Builder no longer adds the ↵Gravatar Benjamin Peterson2017-09-12
| | | | | | | | | | | | | | | | | | | | | | runfiles middleman to the artifacts. Runfiles.Builder.merge(RunfilesSupport) would add the runfiles middleman of the RunfilesSupport object being merged into the artifacts of the nascent Runfiles object. This effectively made the construction of one runfiles tree depend on that of another. Instead of putting the runfiles middleman into the runfiles artifacts, we can put it into the FilesToRunProvider, which should have the same effect. To facilitate this, RuleConfiguredTargetBuilder gains a addFilesToRun method. Note that not every caller of merge(RunfilesSupport) has to be modified because some were already adding the runfiles middleman to their FilesProvider (e.g., AndroidHostServiceFixture), which is a subset of FilesToRunProvider. This is split out from https://bazel-review.googlesource.com/c/14010 Change-Id: Icfca5262a32619e1e351477f3ff641350b6798dc PiperOrigin-RevId: 168358030
* Automated rollback of commit fc41c430e4de4594a1d699f573d191cbad52a2fb.Gravatar plf2017-09-01
| | | | PiperOrigin-RevId: 167154793
* Move ObjcProvider FLAG into a new provider type (TransitiveSourcesProvider) ↵Gravatar cpeyser2017-08-30
| | | | | | that is accessible to the c++ rules. PiperOrigin-RevId: 166934390
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Better names for declared providers-related classes.Gravatar dslomov2017-08-01
| | | | | | | | Follows https://docs.google.com/document/d/1aAIVWvHPERDz2cv_PCFGwr8dvh5FcAkENFoRsNS4clk/. RELNOTES: None. PiperOrigin-RevId: 163728291
* Assert that declared providers are not TransitiveInfoProviders.Gravatar dslomov2017-07-28
| | | | | | | Also fix the remaining violations. RELNOTES: None. PiperOrigin-RevId: 163391215
* Make all WithLegacySkylarkName providers declared providers.Gravatar dslomov2017-07-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 163343931
* Automated rollback of commit 6d884afa8da1b08288cb0108e8bbf6c22ec63393.Gravatar dslomov2017-07-25
| | | | | | | | | | | | | *** Reason for rollback *** Broke bazel_apple_rules *** Original change description *** Make all WithLegacySkylarkName providers declared providers. RELNOTES: None PiperOrigin-RevId: 163054821
* Make all WithLegacySkylarkName providers declared providers.Gravatar dslomov2017-07-25
| | | | | RELNOTES: None PiperOrigin-RevId: 163042362
* Use the same data structure for native and Skylark providers.Gravatar dslomov2017-07-05
| | | | | | | | | The memory cost of adding Skylark provider is now the same as native. Skylark providers (declared and legacy) benefit from the same shape-sharing optimization as native providers. RELNOTES: None. PiperOrigin-RevId: 160944263
* Use nested sets for configured target runfiles instead of flattened lists.Gravatar Googler2017-05-26
| | | | | RELNOTES: None PiperOrigin-RevId: 157124371
* Do not access SkylarkProviders anywhere outside of ConfiguredTarget ↵Gravatar dslomov2017-05-16
| | | | | | | | | | | implementation. A first step towards applying the same memory optimizations we do for native provider representation to Skylark providers (declared and legacy). RELNOTES: None. PiperOrigin-RevId: 156111749
* Optimize TransitiveInfoMap memory consumption.Gravatar Googler2017-05-09
| | | | | | Instead of using ImmutableMap, we share the keys between all provider maps with an identical key set. PiperOrigin-RevId: 155432135
* Make TransitiveInfoMap interface narrower.Gravatar Googler2017-05-05
| | | | | | This constrains implementations less, allowing for greater freedom when optimizing. PiperOrigin-RevId: 155203001
* Make TransitiveInfoProviderMap an interface.Gravatar Googler2017-05-04
| | | | PiperOrigin-RevId: 155125357
* Do not put OutputGroupProvider into SkylarkProviders.Gravatar dslomov2017-05-03
| | | | | | | | | Almost every target has an OutputGroupProvider. Putting an ("output_groups", value) pair into SkylarkProviders creates an unneccessary map. This CL removes it. RELNOTES: None. PiperOrigin-RevId: 154940624
* Remove memory regression introduced with OutputGroupInfo provider.Gravatar dslomov2017-05-03
| | | | | | | | Almost every target has an OutputGroupProvider. Do not create another Key->Provider map just for it. RELNOTES: None. PiperOrigin-RevId: 154937690
* Implement OutputGroupInfo provider.Gravatar dslomov2017-05-03
| | | | | | | Work towards #2894. RELNOTES: None. PiperOrigin-RevId: 154829065
* Fix memory regression introduced by default providersGravatar vladmos2017-04-13
| | | | | | | The memory regression was introduced in https://github.com/bazelbuild/bazel/commit/360fb4d9a1e2c44154b17aeb866e07bac2dd1b5b , now default providers are optimized and are built only on demand for all types of targets. PiperOrigin-RevId: 152957220
* Implement default providerGravatar vladmos2017-04-11
| | | | | | | Default providers can now be used not only to return standard providers values from a rule implementation function, but also to access these values provided by other rules. PiperOrigin-RevId: 152797193
* Remove provider safety check and make all old ctx objects featurelessGravatar Vladimir Moskva2017-03-23
| | | | | | | | | | | | It's now allowed to return anything from a rule implementation function. If a ctx object is returned it becomes featureless and cannot be used from anywhere else (i.e. from an implementation function of another rule). Fixes #2319 -- PiperOrigin-RevId: 151015919 MOS_MIGRATED_REVID=151015919
* Refactor implementation of native and Skylark declared providers.Gravatar Dmitry Lomov2017-03-03
| | | | | | | | | | | | 1) Instead of having a single class for both, split them into {Skylark,Native}ClassObjectConstructors 2) Allow NativeClassObjectConstructors to customize their instantiation logic. 3) Prepare ClassObjectConstructor.Key to be serializable. -- PiperOrigin-RevId: 148997553 MOS_MIGRATED_REVID=148997553
* Migrates TestEnvironmentProvider to using the new Skylark declared providers ↵Gravatar Sergio Campama2016-12-12
| | | | | | | | API. This enables creating a TestEnvironmentProvider from Skylark. -- PiperOrigin-RevId: 141775285 MOS_MIGRATED_REVID=141775285
* Add a testing Skylark module that exposes an ExecutionInfoProvider constructor.Gravatar Sergio Campama2016-12-12
| | | | | | -- PiperOrigin-RevId: 141594768 MOS_MIGRATED_REVID=141594768
* Add documentation for add{Skylark,Native}DeclaredProvider.Gravatar Dmitry Lomov2016-12-05
| | | | | | -- PiperOrigin-RevId: 140904064 MOS_MIGRATED_REVID=140904064
* Implement 'output_groups' provider.Gravatar Dmitry Lomov2016-11-21
| | | | | | | | | | This behavior - that 'output_groups' is a provider available on targets and aspects - has been accidental, but people already depend on it. This CL keeps that behavior, while fixing the bug that two aspects could not both provide output groups. -- MOS_MIGRATED_REVID=139578378
* Add cc_common.link_params declared provider.Gravatar Dmitry Lomov2016-10-07
| | | | | -- MOS_MIGRATED_REVID=135346927
* Add a specialized TransitiveInfoProviderMap to map TransitiveInfoProviders ↵Gravatar Googler2016-09-19
| | | | | | | | | | | | by class. TransitiveInfoProviderMap enforces that the provider implements the interface it's keyed by and provides accessors the reduce the amount of casting. This in general reduces boilerplate throughout wherever TransitiveInfoProviders are mapped by their class. Also add shorthand for adding a provider where it only implements TransitiveInfoProvider once, reducing the redundant specification of the TransitiveInfoProvider class. Infer the class as the exclusive direct implementor of TransitiveInfoProvider to account for special cases like AutoValue and LicenseProvider. -- MOS_MIGRATED_REVID=133386336
* First step towards allowing returning declared providers from rule ↵Gravatar Dmitry Lomov2016-09-01
| | | | | | | implementations. -- MOS_MIGRATED_REVID=131923497
* Pass the coverage environment into tests using a nested set collected from ↵Gravatar Lukacs Berki2016-07-27
| | | | | | | the transitive closure instead of having a global environment in the configuration. -- MOS_MIGRATED_REVID=128559756
* Provide clearer messaging when a build fails because a rule'sGravatar Greg Estren2016-06-27
| | | | | | | | | | | | | | | | | | supported environments get refined away by incompatible select paths. This is a fix of TODO: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java#L597 Old message: ERROR: /workspace/foo/BUILD:3:1: in cc_binary rule //foo:main: all environments have been refined out of the following groups: //buildenv:environment_group New message: ERROR: /workspace/foo/BUILD:3:1: in cc_binary rule //foo:main: the current command-line flags disqualify all supported environments because of incompatible select() paths: environment: //buildenv:gce removed by: //util/lib:some_dep_with_select (/workspace/util/lib/BUILD:12:1) -- MOS_MIGRATED_REVID=125788804
* Add an overview comment about how the analysis phase works and some pointers ↵Gravatar Lukacs Berki2016-05-19
| | | | | | | to it. -- MOS_MIGRATED_REVID=122718503
* Add an "alias" rule.Gravatar Lukacs Berki2016-05-10
| | | | | | | This will be used to replace RedirectChaser so that we don't need to load packages during configuration creation anymore. -- MOS_MIGRATED_REVID=121935989
* Introduces a registry of native providers to the BuildConfiguration, which ↵Gravatar Cal Peyser2016-05-03
| | | | | | | can be added to by fragments. Uses the registry to enable native access to TranstiveProviderInstances from Skylark. In particular, makes ObjcProvider accessible to skylark rule implementations. -- MOS_MIGRATED_REVID=121390911
* Split ActionMetadata into ActionAnalysisMetadata and ActionExecutionMetadata.Gravatar Rumou Duan2016-04-26
| | | | | | | Except in action execution logic (ActionExecutionFunction, SkyframeActionExecutor, etc.), switch Action interface references to either ActionAnalysisMetadata if possible or ActionExecutionMetadata. -- MOS_MIGRATED_REVID=120723431
* Remove FileProvider.label.Gravatar Ulf Adams2016-04-22
| | | | | -- MOS_MIGRATED_REVID=120539626
* Make constraints and select() work well with each other.Gravatar Greg Estren2016-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements most of a design proposal that splits constraint checking into two pieces: *static* checks, which apply the standard constraint checking done today, and *refined* checks, which selectively prune environments based on select paths and check that not every environment gets pruned out. As a result of this change, dependencies like: java_library( name = "lib", restricted_to = [":A", ":B"], deps = select({ ":config_a": [":depA"], ":config_b": [":depB"], })) java_library( name = "depA", restricted_to = [":A"]) java_library( name = "depB", restricted_to = [":B"]) are allowed. Specifically, even though neither "depA" nor "depB" supports [":A", ":B"], the combination of the two does. So the select as a whole supports all environments declared in lib, even though only one of those environments actually gets chosen for a given build. Refinement makes lib "match" the chosen path. So for "config_a" builds, lib's environment set is "refined" down to [":A"], meaning [":B"]-restricted rules cannot depend on it. Likewise, for "config_b" builds, lib's environment set is "refined" down to [":B"], meaning [":A"]-restricted rules cannot depend on it. This guarantees that the restrictions imposed by the chosen select path propagate faithfully up the dependency chain. See new documentation in ConstraintSemantics.java for more details. -- MOS_MIGRATED_REVID=120464241
* Remove FilesToRunProvider.label.Gravatar Ulf Adams2016-04-22
| | | | | | | The TransitiveInfoProvider already contains a label, use that instead. -- MOS_MIGRATED_REVID=120443298
* Clean up the runfiles / files-to-run related code a bit.Gravatar Ulf Adams2016-04-21
| | | | | -- MOS_MIGRATED_REVID=120433463
* Remove RuleConfiguredTarget#getMandatoryStampFiles().Gravatar Lukacs Berki2016-04-20
| | | | | | | This is apparently unused. -- MOS_MIGRATED_REVID=120317405
* Allow filtering out some extra-actions related to Java proto compilation.Gravatar Carmi Grushko2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112709717