aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkAspectFactory.java
Commit message (Collapse)AuthorAge
* Expose aspect actions from Skylark.Gravatar tomlu2018-06-22
| | | | | | | | | | | Like with providers, consumers get a merged view of all actions from the merged configured target (all other aspects + the base target). I had to rejig the aspect value / configured aspect to be symmetric with rule configured targets. I do not expect significant memory bloat from this. All lists / maps already existed, only extra fields have been added. RELNOTES: Expose aspect actions provider to Skylark. PiperOrigin-RevId: 201697923
* Skylark debugging protocol: only track paused or stepping threads.Gravatar brendandouglas2018-06-21
| | | | | | | | | | | | | | | | | | | | | | | | - remove blaze-side thread creation/destruction hooks - remove ListThreads, ThreadStarted, ThreadEnded events from protocol - don't track unpaused, not stepping threads in ThreadHandler The threading model didn't provide useful information -- in practice, users never want to list currently-running threads, and the debug client doesn't need to list currently-paused threads, since it receives each ThreadPaused and ThreadContinued event, so its model is always up to date. Not tracking thread creation/destruction greatly simplifies the API, and reduces the blaze-side hooks -- it was also only semi-implemented, as plenty (/most?) skylark threads were never registered. The biggest cost to removing this is lack of nice thread names. In practice, I think the benefits greatly outweigh this cost. If it ever becomes a problem, there are other lighter-weight ways of communicating thread names. TAG_CHANGE_OK=This proto has never yet been used TYPE_CHANGE_OK=This proto has never yet been used PiperOrigin-RevId: 201532462
* 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
* Initial implementation of a Skylark debug server API.Gravatar Googler2018-05-23
| | | | | | | | | | | | | | | | | | I've pulled out the API for separate review. It includes all hooks from blaze/skylark used by the debugger. Debuggable thread contexts are currently declared in 3 places: - BuildFileAST (top-level evaluation of BUILD files) - SkylarkRuleConfiguredTargetUtil (rules) - SkylarkAspectFactory (aspects) The purpose of declaring these contexts is so that the debugger can track currently-active threads (and stop tracking them when the task is completed). Details of the actual debugging server are in unknown commit. PiperOrigin-RevId: 197770547
* 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
* Change ConfiguredAspectFactory.create signature to take in aGravatar mjhalupka2018-01-31
| | | | | | | ConfiguredTargetAndTarget instead of a ConfiguredTarget. This is to assist in deprecating ConfiguredTarget.getTarget(). PiperOrigin-RevId: 184043491
* Rename some ClassObject/Provider-related methodsGravatar brandjon2017-12-28
| | | | | | | The terminology "field" is preferred over "key" for the components of a struct or struct-like object. RELNOTES: None PiperOrigin-RevId: 180269374
* 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
* Expose ObjcProtoAspect to Skylark.Gravatar cparsons2017-12-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 179737025
* Automatic code cleanup.Gravatar cushon2017-10-23
| | | | PiperOrigin-RevId: 173054453
* Don't set globals in environments that aren't readGravatar brandjon2017-10-23
| | | | | | | There are two Environments involved in running an implementation callback for rules/aspects/repository-rules: (1) The static environment of the function's definition, and (2) the caller's dynamic environment. The function will only consult (1), so trying to set anything on (2) is misleading. RELNOTES: None PiperOrigin-RevId: 172929301
* Move the Skylark rule infrastructure from lib.rules to lib.analysis.skylarkGravatar ulfjack2017-08-09
| | | | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. Unfortunately, there are a number of reverse deps from analysis code to Skylark classes, so moving these is the only way to make progress. PiperOrigin-RevId: 164612957
* Add a little more context to an error message for when a rule returns the ↵Gravatar Googler2017-08-07
| | | | | | | wrong thing RELNOTES: None. PiperOrigin-RevId: 164280579
* 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
* Fix declared providers behaviorGravatar vladmos2017-07-14
| | | | | | | | | DefaultInfo used to not be used when old-style and declared providers were mixed (struct=(custom='key', providers=[DefaultInfo(...)])). Also when a single declared provider was returned it used to be treated as an old-style struct. PiperOrigin-RevId: 161796415
* Introduce --incompatible_new_actions_api flag.Gravatar dslomov2017-07-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 160831413
* Make Skylark interpreter read Skylark command-line flagsGravatar brandjon2017-04-30
| | | | | | | | | | | This is the second of two CLs for making command line options able to affect the Skylark interpreter. For the main kinds of evaluation contexts -- package loading, .bzl loading, rule analysis, aspect analysis, and computed defaults -- the SkylarkSemanticsOptions object is retrieved from Skyframe and passed along to the Environment builder. For other contexts such as tests, default values of builtin functions, and standalone Skylark, flags are currently not processed. In the future, we may want to split into separate files the options that affect "pure" Skylark vs the options that affect Bazel-flavored Skylark. One possibility is to subclass SkylarkSemanticsOptions into SkylarkBazelSemanticsOptions, and go through an indirection in SkylarkUtils. We could also pass SkylarkSemanticsOptions to the parser, to support --incompatible_* changes that alter Skylark's syntax. I don't think that's needed at the moment. RELNOTES: None PiperOrigin-RevId: 154628391
* 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
* Support declared providers for aspectsGravatar Vladimir Moskva2017-03-06
| | | | | | | | Fixes #2016 -- PiperOrigin-RevId: 149102037 MOS_MIGRATED_REVID=149102037
* Names of extra-action protos now take into account all aspect names.Gravatar Dmitry Lomov2016-12-16
| | | | | | | | | | | | | If an Aspect registered an action that an extra-action is shadowing, its name is used when creating the extra-action's ID and name. Since recently, an aspect can see other aspects applied to the same target. This CL record the names of other aspects applied to the target as well, disambiguating the action owners. -- PiperOrigin-RevId: 142264153 MOS_MIGRATED_REVID=142264153
* Add 'aspect_id' for to identify aspects that has been applied to the target.Gravatar Dmitry Lomov2016-12-05
| | | | | | | | | | | | | | | | | | | Add a concept of aspect_id: an unique string that identifies a propagating aspect (aspect class + parameters). This string is designed to be: - Unique for each aspect - human-readable for debugging purposes - not easily parsable. Skylark API: - `ctx.aspect_id` returns an identifier of the current aspect inside aspect implementation function - `Target.aspect_ids` return a list of aspect ids for aspects applied to a given Target (https://www.bazel.io/versions/master/docs/skylark/lib/Target.html) -- PiperOrigin-RevId: 141057865 MOS_MIGRATED_REVID=141057865
* Remove isSkylark and eval from Environment.Gravatar Laurent Le Brun2016-11-29
| | | | | -- MOS_MIGRATED_REVID=140371603
* Provide AspectDescriptor to ConfiguredAspect.Gravatar Dmitry Lomov2016-11-29
| | | | | | | | Also clean up the setting of aspect name in ConfiguredAspect and AspectDefintion - it is now obtained from the AspectClass. -- MOS_MIGRATED_REVID=140357052
* 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
* Rollback of commit a3f5f576cd35798140ba3e81d03d919dd4ecb847.Gravatar Alex Humesky2016-11-17
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks targets in the depot: [] *** Original change description *** output_group is not a real Skylark provider for aspects, as well as for rules. -- MOS_MIGRATED_REVID=139354682
* output_group is not a real Skylark provider for aspects, as well as for rules.Gravatar Dmitry Lomov2016-11-11
| | | | | -- MOS_MIGRATED_REVID=138863855
* Add SkylarkAspect to SkylarkRuleContext for aspectsGravatar Dmitry Lomov2016-11-09
| | | | | -- MOS_MIGRATED_REVID=138556910
* Rollback of commit b91fac3b1f0f5142a906aa12280de936f29fb607.Gravatar Luis Fernando Pino Duque2016-11-09
| | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks several tests under //devtools/ide/eclipse/aspects as shown by the nightly []: [] *** Original change description *** Restrict google_glob_information to eclipse_aspect. '--legacy_expose_globs' flag has no effect now. -- MOS_MIGRATED_REVID=138517258
* Restrict google_glob_information to eclipse_aspect.Gravatar Dmitry Lomov2016-11-08
| | | | | | | '--legacy_expose_globs' flag has no effect now. -- MOS_MIGRATED_REVID=138410651
* Make SkylarkClassObject "Bazel-specific".Gravatar Dmitry Lomov2016-08-05
| | | | | | | This in preparation to DeclaredProviders implementation. -- MOS_MIGRATED_REVID=129420617
* Expose parameterized aspects to Skylark.Gravatar Googler2016-05-09
| | | | | | | | | | | | | | | There are no syntactic changes within Skylark; the only difference is that aspects may have non-implicit attributes, so long as they have type 'string' and use the 'values' restriction. Such aspects may only be requested by rules which have attributes with types and names matching the non-implicit, non-defaulted attributes of the aspect. This is not yet a complete match for native AspectParameters functionality since implicit attributes cannot yet be affected by attribute values, but that will be added later. Implicit aspects are still required to have default values. Non-implicit aspect attributes are considered "required" unless they have a default value. An error will occur if they are applied to a rule that does not "cover" all required attributes by having attributes of matching name and type. While non-implicit aspect attributes with a default are not required, they will still take on the value of a rule attribute with the same name and type if it is present. Aspects with non-implicit, non-defaulted ("required") attributes cannot be requested on the command line, only by a rule. RELNOTES: Expose parameterized aspects to Skylark. -- MOS_MIGRATED_REVID=121711715
* Remove SkylarkAspectClass.getDefintion.Gravatar Dmitry Lomov2016-04-07
| | | | | -- MOS_MIGRATED_REVID=119162307
* Allow Skylark rules and aspects to contribute to output groups.Gravatar Dmitry Lomov2015-12-28
| | | | | -- MOS_MIGRATED_REVID=110840166
* Implement aspect attributes and expose them to aspect implementation function.Gravatar Dmitry Lomov2015-12-16
| | | | | -- MOS_MIGRATED_REVID=110356954
* Emit extra-actions for actions registered by Aspects.Gravatar Carmi Grushko2015-11-17
| | | | | | | A prerequisite is to pass RuleContext to ConfiguredAspect, so we can read from it the registered actions when we build() the aspect. -- MOS_MIGRATED_REVID=107997593
* Aspect terminology update.Gravatar Dmitry Lomov2015-11-10
| | | | | | | | Aspect => ConfiguredAspect AspectWithParameters => Aspect -- MOS_MIGRATED_REVID=107375211
* Implement propagation along dependencies for Skylark aspects.Gravatar Dmitry Lomov2015-11-02
| | | | | -- MOS_MIGRATED_REVID=106694515
* Improve error diagnostics for Skylark aspects.Gravatar Dmitry Lomov2015-10-20
| | | | | -- MOS_MIGRATED_REVID=105851371
* Implement aspect(...) Skylark function.Gravatar Dmitry Lomov2015-10-20
| | | | | -- MOS_MIGRATED_REVID=105844221
* Rollback of commit ac7195025b073948785db8c6975a53fc305c5087.Gravatar Peter Schmitt2015-10-20
| | | | | | | | | | | | | *** Reason for rollback *** Uses tests that don't run on Bazel *** Original change description *** Implement aspect(...) Skylark function. -- MOS_MIGRATED_REVID=105808850
* Implement aspect(...) Skylark function.Gravatar Dmitry Lomov2015-10-16
-- MOS_MIGRATED_REVID=105596479