aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java
Commit message (Collapse)AuthorAge
* 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
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Remove shortcut addProvider() methods, to prepare for AutoValue-ed providers.Gravatar Carmi Grushko2015-12-09
| | | | | | | Such providers have a create() method which returns an object whose runtime class differs from its compile-time class, which makes the shortcut methods behave unexpectedly. -- MOS_MIGRATED_REVID=109815042
* Description redacted.Gravatar Carmi Grushko2015-11-24
| | | | | -- MOS_MIGRATED_REVID=108592613
* Description redacted.Gravatar Carmi Grushko2015-11-24
| | | | | -- MOS_MIGRATED_REVID=108555227
* Refactor createExtraActionProvider to not require mandatoryStampFiles, which ↵Gravatar Carmi Grushko2015-11-13
| | | | | | | is required by rules but not aspects. -- MOS_MIGRATED_REVID=107689641
* Move initializeExtraActions() unchcnaged (apart from its name) to a separate ↵Gravatar Carmi Grushko2015-11-12
| | | | | | | class, in preparation for calling it from Aspects. -- MOS_MIGRATED_REVID=107587682
* Improve error diagnostics for Skylark aspects.Gravatar Dmitry Lomov2015-10-20
| | | | | -- MOS_MIGRATED_REVID=105851371
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Switch objc rules to standard coverage propagation using ↵Gravatar Peter Schmitt2015-09-22
| | | | | | | InstrumentedFilesCollector. -- MOS_MIGRATED_REVID=103642172
* Move Label from the lib.syntax to the lib.cmdline package so that:Gravatar Lukacs Berki2015-09-21
| | | | | | | | | | - Label parsing can be simplified - lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change. -- MOS_MIGRATED_REVID=103527877
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Refactor SkylarkList to allow MutableListGravatar Francois-Rene Rideau2015-09-21
| | | | | | | | Make SkylarkList no longer read-only to match Python and the BUILD language. Instead, subject it to a Mutability object inherited from the Environment. -- MOS_MIGRATED_REVID=103332973
* Move global objects to RuntimeGravatar Francois-Rene Rideau2015-08-31
| | | | | | | | Move away global constants and global namespaces out of Environment and into a new file Runtime. -- MOS_MIGRATED_REVID=101940218
* Expose FilesToRun provider to Skylark.Gravatar Brian Silverman2015-08-27
| | | | | | | | | | It is now possible to get the main executable of *_binary rules with target.files_to_run.executable. -- Change-Id: I4a81f216bdd237fc5b0e7dbd7d0a312558f3cf2c Reviewed-on: https://bazel-review.googlesource.com/#/c/1760/ MOS_MIGRATED_REVID=101675365
* Add shortcut methods for adding providers. These do not require explicitly ↵Gravatar Carmi Grushko2015-08-24
| | | | | | | | | specifying the class of the provider object. -- MOS_MIGRATED_REVID=101227127
* Skylark: In addition to using ctx.configuration.fragment(CONF), the build ↵Gravatar Florian Weikert2015-08-06
| | | | | | | configuration can now be accessed via ctx.fragments.CONF where CONF is in {cpp, jvm, java}. -- MOS_MIGRATED_REVID=100016978
* Skylark: In addition to using ctx.configuration.fragment(CONF), the build ↵Gravatar Florian Weikert2015-07-30
| | | | | | | configuration can now be accessed via ctx.configuration.CONF where CONF is in {cpp, jvm, java}. -- MOS_MIGRATED_REVID=99470271
* Skylark: Expose proto providers in a cleaner way.Gravatar Laurent Le Brun2015-06-01
| | | | | | | | | | | Example: for target in ctx.attr.deps: print(target.proto.sources) print(target.proto.transitive_imports) print(target.proto.transitive_sources) -- MOS_MIGRATED_REVID=94747961
* Create a Skylark API for C++ rules.Gravatar Laurent Le Brun2015-05-29
| | | | | | | | | | | | | | The API doesn't expose the internal detail of the C++ rules. The goal here is to provide a simplified and stable access to the data. Example of use: for target in ctx.attr.deps: print(target.cc.include_srcs) More functions should be added later. -- MOS_MIGRATED_REVID=94672588
* Allow ios_test to override the GCOV environment variableGravatar Daniel Wagner-Hall2015-03-10
| | | | | -- MOS_MIGRATED_REVID=88218457
* Some constraint enforcement tweaks:Gravatar Greg Estren2015-03-10
| | | | | | | | | | | 1) Exclude host dependencies from constraint checking. 2) Check output files with the environment specs of their generating rules. 3) Provide a more generalized way to opt certain rule classes out of constraint checking (this fixes accidental checking on config_setting rules, which didn't really make sense). -- MOS_MIGRATED_REVID=87963638
* Rename TopLevelArtifactProvider to OutputGroupProvider.Gravatar Lukacs Berki2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87596401
* Add Union, contains() to SkylarkTypeGravatar Francois-Rene Rideau2015-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor SkylarkType, notably adding Union types and runtime typechecks. These are pre-requisites to unifying all Skylark function calls to use the same code path, that will check types (like SkylarkFunction currently does) as well handle a more complete Python calling convention (like MixedModeFunction is almost but not quite able to do). A SkylarkType can be either * a Simple type corresponding to a Java class, with special types TOP and BOTTOM corresponding respectively to Object and EmptyType (similar to Void). * a Combination of a generic class (LIST, MAP or SET) and an argument type * a Union of a finite number of types * a FunctionType associated with a name and a returnType (with ugly validation-time side-effects that we should probably move out of the type) Unions are necessary because: 1- the type of some builtin function arguments are actually the Union of some type and a function type for a callback that computes the actual value. 2- the type of some builtin function arguments declared as "List" is actually the Union of java List and SkylarkList. 3- instead of adding lots of special cases at the point of argument validation, it's cleaner and more generally useful to have explicit Union types, that can then be displayed to users for documentation or debugging purposes. Validation-time "type inference" is re-expressed simply as type intersection. None is treated specially as inferred into TOP instead of NoneType. Combination types are printed as genericType of argTypes, e.g. "dict of ints". "type" and "generic1" become "genericType" and "argType". In SkylarkList and SkylarkNestedSet, genericType becomes contentType. -- MOS_MIGRATED_REVID=87340881
* Tweaks off of upcoming changes to SkylarkType.Gravatar Francois-Rene Rideau2015-02-25
| | | | | -- MOS_MIGRATED_REVID=87154772
* Simplify the algorithm to compute top-level artifacts to build even more by ↵Gravatar Lukacs Berki2015-02-24
| | | | | | | creating a HIDDEN_TOP_LEVEL output group and putting the artifacts required for building runfiles there. -- MOS_MIGRATED_REVID=87039530
* Remove FilesToCompileProvider and CompilationPrerequisitesProvider and ↵Gravatar Lukacs Berki2015-02-24
| | | | | | | replace them with output groups. -- MOS_MIGRATED_REVID=87038548
* Remove BaselineCoverageArtifactsProvider in favor of an output group.Gravatar Lukacs Berki2015-02-19
| | | | | | | The only slightly different thing here is that now, instead of using target.getConfiguration().isCodeCoverageEnabled() we use BuildRequest.Options.collectCodeCoverage, but the only place where this is not the same I can think of is InputFileCT, which does not have baseline coverage files anyway. -- MOS_MIGRATED_REVID=86682774
* Use TopLevelArtifactProvider directly only within the lib/analysis package. ↵Gravatar Lukacs Berki2015-02-18
| | | | | | | | | Instead of instantiating it manually, add .addOutputGroup() method on RuleConfiguredTargetBuilder. This does away with the awkward repetition of the source jars output group in android_binary. Note that TopLevelArtifactProvider needs to remain public because it's a provider class. -- MOS_MIGRATED_REVID=86584080
* Cosmetic changes moved out of []Gravatar Francois-Rene Rideau2015-02-11
| | | | | | | | These shouldn't affect the semantic of the program in any significant way, but will hush the linter and other such metaprograms. -- MOS_MIGRATED_REVID=86089271
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957