aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages
Commit message (Collapse)AuthorAge
* Allow/require callers of AbstractPackageLoader to set Skylark semantics ↵Gravatar brandjon2017-10-27
| | | | | | | | | | | explicitly Previously the default semantics were used unconditionally. Allowing non-default semantics is a feature. Requiring semantics to be specified explicitly helps to avoid unintentional divergence from the caller's intended semantics. We recently did the same thing for Skylark's Environment.Builder (https://github.com/bazelbuild/bazel/commit/b368b39f8ba1e8e8a67af50e5ade9127b2b149d7). Also pass Skylark semantics through Package.Builder.Helper, so that the extra verification done for shell tests uses the same semantics as the build. RELNOTES: None PiperOrigin-RevId: 173544885
* Automated rollback of commit 5d9e8c1062e893b8acadba52db92364950ce760c.Gravatar mschaller2017-10-26
| | | | | | | | | | | | | *** Reason for rollback *** Calling toString on value, when it's really a SelectorList, can result in an IllegalStateException. *** Original change description *** Improve error messaging for AbstractAttributeMapper RELNOTES: None. PiperOrigin-RevId: 173441312
* Do not create instance of ExternalPackageBuilderGravatar Damien Martin-Guillerez2017-10-25
| | | | | | | | This class is a legacy remains of an actual builder and this is a first step to clean that up. Change-Id: Id54360641e9f779259c3819fdde286643928cca4 PiperOrigin-RevId: 173378325
* Improve error messaging for AbstractAttributeMapperGravatar cparsons2017-10-25
| | | | | RELNOTES: None. PiperOrigin-RevId: 173315354
* Implement custom executable API.Gravatar dslomov2017-10-24
| | | | | | | | | | Design is https://github.com/bazelbuild/bazel/issues/3826, specifically https://github.com/bazelbuild/bazel/issues/3826#issuecomment-336220897. Fixes #3826. RELNOTES: ctx.outputs.executable is deprecated. Use DefaultInfo(executable = ...) instead. PiperOrigin-RevId: 173132066
* Propagate skylark flags to WORKSPACE and repo rulesGravatar brandjon2017-10-24
| | | | | RELNOTES: Skylark semantics flags now affect WORKSPACE files and repository rules. PiperOrigin-RevId: 173130286
* Automated rollback of commit 1b98de65873054b148ced772cfa827a7bfb5ad9a.Gravatar dslomov2017-10-23
| | | | | | | | | | | | | | | | | | | *** Reason for rollback *** If the 'set' function was used in a .bzl file but not called, --incompatible_disallow_set_constructor=True would allow the load of that .bzl file without error, but this change removes the 'set' function so loading that bzl file is an error. Example failure: https://ci.bazel.io/blue/organizations/jenkins/Global%2FTensorFlow/detail/TensorFlow/245/pipeline/ *** Original change description *** Remove the deprecated set constructor from Skylark The `set` constructor used to be deprecated, but it was still possible to use it by providing --incompatible_disallow_set_constructor=false. RELNOTES[INC]: The flag --incompatible_disallow_set_constructor is no longer available, the deprecated `set` constructor is not available anymore. PiperOrigin-RevId: 173115983
* Be explicit about semantics of Skylark environmentsGravatar brandjon2017-10-23
| | | | | | | | | All callers that do not use Environment.Builder#setSemantics should call #useDefaultSemantics. A follow-up CL will enforce this requirement. Motivation: It's more important that we are strict about semantics than about the other builder args. It's too easy for a mistake in semantics to go unnoticed. RELNOTES: None PiperOrigin-RevId: 172912829
* Allow ClassObjects to throw EvalExceptions.Gravatar dslomov2017-10-23
| | | | | | | Preparations to fix https://github.com/bazelbuild/bazel/issues/3826. RELNOTES: None. PiperOrigin-RevId: 172876802
* Add memory profiler.Gravatar tomlu2017-10-18
| | | | | | | | | | | This adds two dump command, bazel dump --rules and bazel dump --skylark_memory. dump --rules outputs a summary of the count, action count, and memory consumption of each rule and aspect class. dump --skylark_memory outputs a pprof-compatible file with all Skylark analysis allocations. Users can then use pprof as per normal to analyse their builds. RELNOTES: Add memory profiler. PiperOrigin-RevId: 172558600
* Relax SplitTransitionProvider interface to use AttributeMapGravatar cparsons2017-10-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 172394552
* Extend from an abstract base class to avoid duplication of utility methods ↵Gravatar ruperts2017-10-18
| | | | | | | in RuleErrorConsumers RELNOTES: None. PiperOrigin-RevId: 172387755
* Extract more RuleContext error-related methods into RuleErrorConsumerGravatar cparsons2017-10-16
| | | | | | | This will make it easier to pass only error-handling functionality into support classes. RELNOTES: None. PiperOrigin-RevId: 172148072
* Flip the --incompatible_list_plus_equals_inplace flag by defaultGravatar vladmos2017-10-16
| | | | | | | | | RELNOTES[INC]: += on lists now mutates them. `list1 += list2` is now equivalent to `list1.extend(list2)` and not equivalent to `list1 = list1 + list2` anymore. Fixes #2350. PiperOrigin-RevId: 172111899
* Improve private skylark attribute error messagingGravatar cparsons2017-10-16
| | | | | RELNOTES: None. PiperOrigin-RevId: 172087232
* Remove the deprecated set constructor from SkylarkGravatar vladmos2017-10-13
| | | | | | | | | | The `set` constructor used to be deprecated, but it was still possible to use it by providing --incompatible_disallow_set_constructor=false. RELNOTES[INC]: The flag --incompatible_disallow_set_constructor is no longer available, the deprecated `set` constructor is not available anymore. PiperOrigin-RevId: 171962361
* Remove deprecated legacy string representations of Skylark objectsGravatar vladmos2017-10-13
| | | | | | | | RELNOTES[INC]: The flag --incompatible_descriptive_string_representations is no longer available, old style string representations of objects are not supported anymore. PiperOrigin-RevId: 171952621
* SplitTransitionProvider no longer requires the attributes it uses are "Non ↵Gravatar cparsons2017-10-11
| | | | | | | Configurable" RELNOTES: None. PiperOrigin-RevId: 171751391
* Refactor ConfiguredAttributeMapper to lib/packages from lib/analysis.Gravatar cparsons2017-10-11
| | | | | | | | | This requires moving the convenience constructor using RuleConfiguredTarget to be owned by RuleConfiguredTarget. This refactoring is required by later work to allow SplitTransitionProvider to use configurable attributes. This would require packages/Attribute.java -> analysis/ConfiguredAttributeMapper.java, where in general, the 'analysis' package depends on the 'packages' package. This is the easiest way to prevent a circular dependency. RELNOTES: None. PiperOrigin-RevId: 171741620
* Move SkylarkSemanticsOptions to the packages/ directory, alongside ↵Gravatar brandjon2017-10-07
| | | | | | | | | SkylarkSemanticsCodec Note that the syntax package and its test package still depend indirectly on the options parser via other Bazel-specific packages. RELNOTES: None PiperOrigin-RevId: 171342823
* Pass SkylarkSemantics through Skyframe instead of the options classGravatar brandjon2017-10-06
| | | | | | | Also remove the use of the @UsesOnlyCoreTypes annotation on SkylarkSemanticsOptions. It was only there to help mark that the options class was safe to put in Skyframe. RELNOTES: None PiperOrigin-RevId: 171248504
* Migrate from deprecated MutableList constructor to copyOf, fixing bug in latterGravatar michajlo2017-10-06
| | | | PiperOrigin-RevId: 171176871
* Split off SkylarkSemanticsOptions into an immutable classGravatar brandjon2017-10-06
| | | | | | | | | | | This is a first step toward making the core Skylark interpreter (the syntax/ directory) not depend on the options parser. Subsequent CLs will replace uses of SkylarkSemanticsOptions within the interpreter with uses of SkylarkSemantics, and move SkylarkSemanticsOptions to the packages/ directory alongside SkylarkSemanticsCodec. SkylarkSemantics will also replace SkylarkSemanticsOptions as the value that gets passed through Skyframe. This is nice because SkylarkSemantics is strictly immutable, whereas options classes are only kinda-sorta-immutable. The downside is significantly more redundancy when defining new options. But some of the work is saved by using AutoValue, and there are tests that protect us from dumb mechanical errors. The details are outlined in the javadoc for SkylarkSemanticsOptions and SkylarkSemanticsConsistencyTest. RELNOTES: None PiperOrigin-RevId: 171060034
* Only create builtins for rules once per PackageFactoryGravatar michajlo2017-10-02
| | | | | | Previously we'd do this on demand. This simplifies a bit. PiperOrigin-RevId: 170526646
* Another stale todoGravatar dslomov2017-09-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 170381009
* Remove stale todoGravatar dslomov2017-09-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 170360470
* Add required/advertised Skylark providers.Gravatar elenairina2017-09-28
| | | | | | | This is needed to advertise and request JavaInfo (a native declared provider) instead of JavaCompilationArgsProvider. RELNOTES: None. PiperOrigin-RevId: 170205997
* Delete duplicated definitions for package_name() and repository_name().Gravatar laurentlb2017-09-25
| | | | | RELNOTES: None. PiperOrigin-RevId: 169792510
* Add toString() methods for Advertised and Required Providers.Gravatar Googler2017-09-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 169582778
* LateBoundDefault: enforce access to a single fragment (or none).Gravatar mstaib2017-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no way to enforce that LateBoundDefaults only access the fragments that they declare. This means that LateBoundDefaults can fail to declare fragments at all, or declare the wrong ones, and still have no troubles. But when trimming, these fragments must be declared, because otherwise they will not necessarily be available. This change refactors LateBoundDefault to declare a single fragment type, not a set. All existing LateBoundDefaults use sets with a single element or no elements at all for their set of fragment classes, so this does not limit anything being done currently. To account for LateBoundDefaults which do not use configuration at all, typically those which only want to access the configured attribute map, it is possible for Void to be the fragment class which is requested. To account for LateBoundDefaults which need to access methods of the BuildConfiguration instance itself, it is possible for BuildConfiguration to be the fragment class which is requested; however, this is unsafe, so it is only a temporary state until a way to do this without also giving access to all of the fragments can be added. Drive-by refactoring: LateBoundDefaults' values are now typed. All actual production LateBoundDefaults were Label or List<Label> typed, through the LateBoundLabel and LateBoundLabelList subclasses. These subclasses have been removed, and LateBoundDefault has two type parameters, one for the type of its input, and one for the type of its output. RELNOTES: None. PiperOrigin-RevId: 169242278
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* `repository_name()` and `package_name()` are available only in loading phaseGravatar laurentlb2017-09-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 168815084
* Fix minor typo in RuleClass.Builder.RuleClassType.TEST validation message.Gravatar Googler2017-09-14
| | | | | RELNOTES: None PiperOrigin-RevId: 168652131
* Remove outdated Attribute.Configurator interface.Gravatar gregce2017-09-13
| | | | | | | | With dynamic configurations we no longer need a special class to apply transitions: a simple patch transition bound to an attribute works just as well. PiperOrigin-RevId: 168442602
* Remove outdated defaultsToSelf.Gravatar gregce2017-09-12
| | | | | | Part of the static config cleanup effort. PiperOrigin-RevId: 168270713
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-09-08
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 167901210
* Rule classes cannot request duplicate toolchains.Gravatar cpeyser2017-09-08
| | | | PiperOrigin-RevId: 167861778
* Fix assorted ErrorProne warnings.Gravatar lberki2017-09-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 167574104
* Rename all logger instances to "logger" (instead "LOG" or "log").Gravatar lberki2017-09-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 167505493
* Automated rollback of commit 964f0a5d83fe7958236c9eb0be619f553d488748.Gravatar cpeyser2017-09-01
| | | | | | | | | | | | *** Reason for rollback *** Breaks rules_go CI *** Original change description *** Bazel c++ rules depend on a c++ toolchain. PiperOrigin-RevId: 167191667
* Bazel c++ rules depend on a c++ toolchain.Gravatar cpeyser2017-09-01
| | | | PiperOrigin-RevId: 167147239
* Automated rollback of commit 9d5bce66280094c0531ddfde2752e596d0d78c79.Gravatar plf2017-08-30
| | | | PiperOrigin-RevId: 166966182
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-08-29
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166854893
* Automated rollback of commit 363413110f3a63a11d900864be1852adbaed2899.Gravatar cpeyser2017-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/bazel:bazel_bootstrap_distfile_test: INFO: You can skip this first step by providing a path to the bazel binary as second argument: INFO: ./compile.sh compile /path/to/bazel 🍃 Building Bazel from scratch...... 🍃 Building Bazel with Bazel. .WARNING: /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions. ERROR: in target '//external:cc_toolchain': error loading package '@local_config_cc//': Extension file not found. Unable to load file '@local_config_cc//:dummy_toolchain.bzl': file doesn't exist or isn't a file. INFO: Elapsed time: 3.343s ERROR: Could not build Bazel Found by git bisect. *** Original change description *** Add a new toolchain type for c++. In order to do this, PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166750885
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-08-28
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166509298
* Implement field declarations for declared providers.Gravatar dslomov2017-08-25
| | | | | RELNOTES: Skylark providers can specify allowed fields and their documentation. PiperOrigin-RevId: 166446104
* Split Info into SkylarkInfo and NativeInfo.Gravatar dslomov2017-08-22
| | | | | | | | Prerequisite to implementing shape-declaration and shape-sharing for declared providers, and cleaning up NativeInfo interface. RELNOTES: None. PiperOrigin-RevId: 166057070
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Initial (partial) implementation of configured target query. Activated by ↵Gravatar janakr2017-08-21
| | | | | | | | | | | | | | | | | | | | | passing the --post_build_query flag to a build command, with a query expression as the argument. Bazel then executes this query on the configured target graph as constructed by the build command. Since the prepare graph -> query workflow is how SkyQueryEnvironment works, this is mostly just copying that. Main missing features/code cleanups: * Recursive target patterns (/...) are not supported. * There is no way to specify the configuration of the targets in your query. * Configuration output is totally opaque (just the hash, or null if no configuration). * More generally, no output options. * Some features (visibility, label attrs) not supported. * No edge filtering (host deps, implicit deps). * Aspects are totally ignored. * Graceful failure on errors, edge cases, incompatible flags (like the TAP flags that discard edges). * Code hygiene issues (calling test-only method to get to Skyframe graph, some code duplication across ConfiguredTargetQueryEnvironment and SkyQueryEnvironment). Most of the features I plan to leave to rules-side people, since I think they won't be too hard for a general Blaze developer to implement, and designing the right features and user interfaces for these things is better left to the rules side. PiperOrigin-RevId: 165747829
* Remove RuleClass.Configurator and obsolete LIPO_ON_DEMAND uses.Gravatar gregce2017-08-18
| | | | | | | | Dynamic configs use RuleTransitionFactory instead. Part of the static config cleanup effort. PiperOrigin-RevId: 165590679