aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
Commit message (Collapse)AuthorAge
* ToolchainContext directly implements SkylarkValue and SkylarkIndexable.Gravatar John Cater2018-06-22
| | | | | Change-Id: I355b138e143771fd826ab03951df821ea7d58ac5 PiperOrigin-RevId: 201740564
* Remove genrule's special handling of the "toolchains" attribute.Gravatar jcater2018-06-20
| | | | | | The general handling should be fine for this. PiperOrigin-RevId: 201352916
* Remove LIPO supportGravatar hlopko2018-06-15
| | | | | RELNOTES: Support for LIPO has been fully removed. PiperOrigin-RevId: 200724578
* Split BuildView into two classesGravatar ulfjack2018-06-14
| | | | | | | Move the testing class to the tests tree. This is in preparation for dismantling BuildView and merging the relevant parts into AnalysisPhaseRunner. PiperOrigin-RevId: 200532794
* Migrate android providers to use BuiltinProvider instead of NativeProviderGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200096226
* Fix `equals()` and `hashCode()` for artifacts: artifacts of different ↵Gravatar Dmitry Lomov2018-05-30
| | | | | | | | | | | | | classes are not equal. Also validate that there are no tree and file artifacts with the same exec path. Fixes #4668. Closes #5284. Change-Id: Id97c0407a476a5bfc697b4ca7b858e3d0c0f8c75 PiperOrigin-RevId: 198540425
* Remove attribute read checks expecting a DATA transition.Gravatar gregce2018-05-25
| | | | | | | | | | | | | | This is a precursor to removing the DATA transition outright. While we could also have changed the Mode.DATA instances to Mode.TARGET (which would declare that we expect the attribute not to apply any transition), that would break existing definitions and make depot cleanup more delicate. Plus, these checks weren't being consistently applied across attributes anyway so they don't really offer much. A lot of this logic is really just leftover legacy from the pre-dynamic configuration days. PiperOrigin-RevId: 198085059
* Provide ability to inject custom ConstraintSemantics behavior.Gravatar gregce2018-05-25
| | | | PiperOrigin-RevId: 198053509
* Migrate OutputGroupInfo to skylarkbuildapiGravatar cparsons2018-05-24
| | | | | RELNOTES: None. PiperOrigin-RevId: 197949354
* Make the SplitTransition, PatchTransition interfaces more compatible.Gravatar gregce2018-05-23
| | | | | | Part of https://docs.google.com/document/d/1_UJKmAQ9EE8i3Pl0il3YLTYr-Q9EKYYyLatt2zohfyM/edit# PiperOrigin-RevId: 197800831
* Simplify split transition semantics: noops now return the input build options.Gravatar gregce2018-05-23
| | | | | | This results in less special logic in the implementation and a simpler API. PiperOrigin-RevId: 197772283
* Fork RuleContext.ErrorReporter to create a Skylark-friendly RuleErrorConsumerGravatar asteinb2018-05-18
| | | | | | | | | | | | | | The new error consumer is simple to create from @SkylarkCallable methods, so we won't need to pass SkylarkRuleContext into those methods for that reason anymore. Create a new abstract class, rather than expand the existing AbstractRuleErrorConsumer class, since the latter is already being extended and used in a variety of tests, and I prefer not to have to migrate all of them as needed. Add Javadoc to make clear that this class should not be used similarly. RELNOTES: none PiperOrigin-RevId: 197148849
* Expose RuleContext methods in ActionConstructionContextGravatar asteinb2018-05-17
| | | | | | | | | | | | | - Common methods for creating artifacts - Convenience method for registering action Also, create a new getUniqueDirectoryArtifact method that doesn't require a root directory to be passed in - every call I've seen to getUniqueDirectoryArtifact always uses RuleContext#getBinOrGenfilesDirectory ffor this value. RELNOTES: none PiperOrigin-RevId: 196993195
* Documentation typo fixGravatar gregce2018-04-06
| | | | PiperOrigin-RevId: 191930771
* Delete dead codeGravatar carmi2018-04-06
| | | | | RELNOTES: None PiperOrigin-RevId: 191916828
* Move shell executable to its own configuration fragment.Gravatar lberki2018-04-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 191861074
* Make error messages about illegal dependencies involving aliases clearer.Gravatar lberki2018-03-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 190759949
* Add RuleContext#getConfiguredTargetAndDataMap and use it in analysis/Util.Gravatar janakr2018-03-10
| | | | PiperOrigin-RevId: 188629293
* Make RuleContext#getSplitPrerequisiteConfiguredTargetAndTargets public and ↵Gravatar janakr2018-03-10
| | | | | | use it in android/NativeLibs. PiperOrigin-RevId: 188625886
* Add RuleContext#getPrerequisiteConfiguredTargetAndTarget and use it in ↵Gravatar janakr2018-03-10
| | | | | | GoTest to avoid calling ConfiguredTarget#getConfiguration. PiperOrigin-RevId: 188623273
* Replace some #getConfiguration calls coming from a TransitiveInfoCollection ↵Gravatar janakr2018-03-10
| | | | | | that was obtained from a ConfiguredTargetAndData object anyway. PiperOrigin-RevId: 188621245
* Replace ConfiguredTargetAndData#getConfiguredTarget()#getConfiguration() ↵Gravatar janakr2018-03-10
| | | | | | with ConfiguredTargetAndData#getConfiguration(). Done using intellij structural replace. PiperOrigin-RevId: 188618282
* Add BuildConfiguration to ConfiguredTargetAndTarget and rename it to ↵Gravatar janakr2018-03-10
| | | | | | ConfiguredTargetAndData. We want to get BuildConfiguration out of ConfiguredTarget because it uses >800K when serialized. PiperOrigin-RevId: 188600002
* ActionOwner references only BuildEvent instead of full BuildConfigurationGravatar shahan2018-03-10
| | | | | | This reduces the size of its serialized representation. PiperOrigin-RevId: 188597127
* Move enabling of coverage related features to CcCommonGravatar Googler2018-02-23
| | | | | | | | Move dealing with coverage related features from CppConfiguration.configurationEnabledFeatures to CcCommon.configureFeatures. Remove configurationEnabledFeatures. RELNOTES: None. PiperOrigin-RevId: 186744803
* Route fdo logic that deals with the path to the fdo profile through ↵Gravatar Googler2018-02-20
| | | | | | | | | | CcToolchainProvider As --fdo_optimize can point to a label, the path to the fdo profile can not be reliably determined in CppConfiguration. In order to enable the fdo features (which depend on the path to the fdo profile), the logic from CppConfiguration.configurationEnabledFeatures() has been moved to CcCommon.configureFeatures(). The latter method has access to the fdo profile path through CcToolchainProvider. RELNOTES: None. PiperOrigin-RevId: 186278311
* Thread ConfiguredTargetAndTarget through objC classes to get rid of referencesGravatar mjhalupka2018-02-12
| | | | | | | | to ConfiguredTarget.GetTarget(). Also remove equivalence requirements for the ConfiguredTarget's target and the stored Target since there will soon no longer be a Target in ConfiguredTarget. PiperOrigin-RevId: 185417468
* Suppress ThinLTO indexing for testonly targetsGravatar Googler2018-02-08
| | | | | | | | Applies ThinLTO scalability fix https://github.com/bazelbuild/bazel/commit/8c5e290dfab3cab378a9ca107ecdd6267403cd4b to targets (e.g. cc_binary) marked "testonly = 1". RELNOTES: None PiperOrigin-RevId: 184991176
* Add type assertion that TreeFileArtifact's parentTreeArtifact member is aGravatar cpeyser2018-02-05
| | | | | | SpecialArtifact. PiperOrigin-RevId: 184539696
* Make RuleContext.getConfiguration() private.Gravatar gregce2018-02-02
| | | | | | | | | | This further discourages the paradigm of rule implementations consuming entire configs vs. declared fragments. It also makes RuleContext a more reliable tracker of which fragments rules use. PiperOrigin-RevId: 184355968
* Rename Transition to ConfigurationTransition.Gravatar gregce2018-01-30
| | | | PiperOrigin-RevId: 183859414
* Remove DynamicTransitionMapper, ConfigurationTransitionProxy.Gravatar gregce2018-01-30
| | | | PiperOrigin-RevId: 183826311
* Add alternative interface for LIPO data transitions, opt in native rules.Gravatar gregce2018-01-29
| | | | | | | | | | | This removes the need for ConfigurationTransitionProxy.DATA by providing a way for the C++ rule defs to directly inject the transition for all rules to use. Skylark attributes work differently, so they'll be addressed in another change. PiperOrigin-RevId: 183721293
* Remove ConfigurationTransitionProxy.NONE and ↵Gravatar gregce2018-01-18
| | | | | | | | BaseRuleClasses.DYNAMIC_TRANSITION_MAP. This leaves DATA as the last remaining legacy transition. PiperOrigin-RevId: 182422552
* Start the process of getting Target out of ConfiguredTarget: add a new ↵Gravatar janakr2018-01-18
| | | | | | | | | | | | container, ConfiguredTargetAndTarget, that can be used to access Targets, and deprecate ConfiguredTarget#getTarget. ConfiguredAndTargetObjects are intended to be limited in scope, not being persisted to Skyframe. The eventual plan is to remove the target field from ConfiguredTarget. This CL is mostly straightforward, except for dealing with AliasConfiguredTargets, which cause some complications. A significant cleanup is still needed before #getTarget can be removed, but I don't see any impossible blockers. We will may still need to store a Target-like object in ConfiguredTarget (that has the RuleClass, or at least a string representation of it, for instance), but that will let us avoid storing a full Target together with its associated Package. PiperOrigin-RevId: 182371566
* Rename Root to ArtifactRoot.Gravatar tomlu2018-01-16
| | | | | | This is slightly more descriptive, and we will potentially want to use the name Root for a broader concept shared between ArtifactRoot and RootedPath. PiperOrigin-RevId: 182082367
* Move PatchTransition and kin to analysis.config.transitions.Gravatar gregce2018-01-04
| | | | | | | HostTransition can't be migrated yet because it depends on BuildConfiguration. PiperOrigin-RevId: 180842784
* Fix Action subclasses so that the execution platform is properly set inGravatar John Cater2018-01-04
| | | | | | | | | more cases. Part of #4128. Change-Id: Ife5e4581f91ac07931d193ed5eaa256aab3ad047 PiperOrigin-RevId: 180826445
* Replace Attribute.ConfigurationTransition with ↵Gravatar gregce2017-12-28
| | | | | | | | | | | | | | | | config.transitions.ConfigurationTransitionProxy. The "proxy" part is to dissuade people from writing: void myfunc(ConfigurationTransition transition) signatures casually. Maybe that's actually a better name than "Transition". But I'd rather rename Transition to ConfigurationTransition in its own change if we want to do that. PiperOrigin-RevId: 180285321
* Replace Attribute.SplitTransition with config.transitions.SplitTransition.Gravatar gregce2017-12-22
| | | | PiperOrigin-RevId: 179948322
* Replace Attribute.Transition with config.transitions.Transition.Gravatar gregce2017-12-22
| | | | PiperOrigin-RevId: 179936355
* Remove final accessors of ConfigurationTransition.HOST.Gravatar gregce2017-12-21
| | | | | | | Also lean interfaces from Attribute.ConfigurationTransition to Attribute.Transition. PiperOrigin-RevId: 179846158
* Support for ThinLTO to be enabled implicitly with AFDOGravatar Googler2017-12-20
| | | | | | | Allows for ThinLTO to be enabled once the --features=autofdo_implicit_thinlto feature is enabled in the crosstool. Also allows for --features=-thin_lto to override and prevent ThinLTO from being enabled. RELNOTES: None. PiperOrigin-RevId: 179687743
* Aspects-on-aspect see and propagate over aspect attributes.Gravatar dslomov2017-12-20
| | | | | | | | | | | If an aspect is applied to a rule+aspect node, all attributes are merged into ctx.rule.attr collection, and the first one with the same name wins (in particular, rule attribute will always win over aspect attribute). This is backwards-compatible, and unlikely to cause problems in practice. RELNOTES: Aspects-on-aspect see and propagate over aspect attributes. PiperOrigin-RevId: 179675660
* Set the execution platform on a new SpawnAction based on the RuleContext.Gravatar John Cater2017-12-18
| | | | | | | Part of #4128. Change-Id: Ic46d2db2017b6cf4c14a91653ab75b3381b80b5a PiperOrigin-RevId: 179426362
* Fix missing print statements in output functionsGravatar vladmos2017-12-02
| | | | PiperOrigin-RevId: 177708823
* 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
* Automated rollback of commit 8cb1d2fb460a9caf47df58d7ff051d31080a77cb.Gravatar ulfjack2017-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll forward again without the changes to expand_location, but with the trimming fix from https://github.com/bazelbuild/bazel/commit/19617360121635a77ffec99b84d825e7d9b260b1. *** Original change description *** Automated rollback of commit ca77f608e486bf7aa762565d25bf7b9e30f2268c. This also rolls back unknown commit. *** Reason for rollback *** Affected expand_location Skylark API semantics - it no longer accepts ${abc} or plain dollar signs, but complains. *** Original change description *** Extend TemplateExpander to handle $(func param) expansion Rewrite the Expander to use the new functionality; also rewrite the Skylark expand_location function to use it. PiperOrigin-RevId: 174384095
* Add platform_common.MakeVariableInfo so that Skylark code has access to the ↵Gravatar lberki2017-10-27
| | | | | | | Make variables provider. RELNOTES: None. PiperOrigin-RevId: 173527191