aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages
Commit message (Collapse)AuthorAge
* Batch all DependencyResolver#getTarget calls. This leads to some duplicate ↵Gravatar janakr2018-08-09
| | | | | | iteration, but that should be cheap, while requesting packages sequentially can hurt... PiperOrigin-RevId: 208126130
* Put main repo remapping behind a flag.Gravatar dannark2018-08-07
| | | | | RELNOTES: None PiperOrigin-RevId: 207801155
* Migrate ObjcProvider to BuiltinProvider from NativeProviderGravatar cparsons2018-08-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 207778688
* C++: Change Skylark API whitelisting to be part of flag.Gravatar plf2018-08-03
| | | | | | | | This uses SkylarkSemantics now instead of the C++ configuration. The flag is: --experimental_cc_skylark_api_enabled_packages RELNOTES:none PiperOrigin-RevId: 207235431
* Update comment about repository mapping containing entry from "@<main repo ↵Gravatar dannark2018-08-01
| | | | | | | name>" to "@". RELNOTES: None PiperOrigin-RevId: 207010178
* Removes serialization class that introduced bug.Gravatar plf2018-07-31
| | | | | RELNOTES:none PiperOrigin-RevId: 206767138
* [Skylark] Use POJOs instead of dynamic proxies.Gravatar Taras Tsugrii2018-07-30
| | | | | | | | | | | | | | Java uses dynamically generated proxy classes to access annotation properties and their methods are ~7X slower than plain getters. According to async-profiler 50%+ of `convertArgumentList` method time is spent in dynamic proxy methods, so optimizing their performance makes sense. This also makes the model less anemic, since POJOs can actually provide business methods. Closes #5666. PiperOrigin-RevId: 206608812
* [Skylark] Support dictionaries in structs when serializing them using ↵Gravatar Taras Tsugrii2018-07-25
| | | | | | | | | | | | | | | | | struct.to_json. Dictionaries are frequently used for generic configuration descriptions especially given that `struct` is not allowed in build files. In order to be JSON-compatible, only dictionaries with string keys are allowed. Technically Python also allows integers and booleans by automatically converting them to strings, but this is confusing and not necessarily a good thing to do. Fixes #5542 Closes #5543. PiperOrigin-RevId: 206049754
* Remove gender specific prononuns from Bazel codebaseGravatar hlopko2018-07-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 205635805
* [Skylark] Make range function lazy.Gravatar Taras Tsugrii2018-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | range used to use MutableList which would eagerly allocate an array list with all range elements, which is not efficient for very large ranges or when only a small number of its elements are used. This implementation uses a constant amount of RAM and computes a value for each requested index. For the following Skylark snippet: ``` def check_content(t): if t == []: return t return False def modulo(n): return n % 797 N = 10000000 [check_content(i) for i in range(N)] [check_content(i) for i in range(N)] [modulo(i) for i in range(N)] [modulo(i) for i in range(N)] ``` the total runtime goes from ``` $ time bazel-bin/src/main/java/com/google/devtools/skylark/Skylark test.bzl bazel-bin/src/main/java/com/google/devtools/skylark/Skylark test.bzl 93.09s user 1.67s system 316% cpu 29.930 total ``` to ``` $ time bazel-bin/src/main/java/com/google/devtools/skylark/Skylark test.bzl bazel-bin/src/main/java/com/google/devtools/skylark/Skylark test.bzl 31.45s user 0.86s system 179% cpu 17.974 total ``` which reflects the reduced system time (fewer allocations) and performance. Closes #5240. PiperOrigin-RevId: 204918577
* Add --incompatible_disable_deprecated_attr_params to disable some deprecated ↵Gravatar cparsons2018-07-16
| | | | | | | parameters of the skylark attr module. RELNOTES: None. PiperOrigin-RevId: 204797954
* Add implicit mapping from "@mainrepo" to "@". This fixes the issue where ↵Gravatar Danna Kelmer2018-07-16
| | | | | | | | | | referencing the main repository using its name caused bazel to treat it as a separate external repository. Closes #5586. Fixes #3115. RELNOTES: None PiperOrigin-RevId: 204752150
* Remove unused mapGravatar dannark2018-07-13
| | | | | RELNOTES: None PiperOrigin-RevId: 204533485
* [java_common.compile] Always generate a source jar.Gravatar elenairina2018-06-29
| | | | | | | | | | | | | | | [Rolling forward https://github.com/bazelbuild/bazel/commit/c4e128e2c6d8cacaeba034d6a3195796d50f1745] java_common.compile doesn't generate the output source jar when a source jar is the only input for the compilation. This is wrong because the source jar can include APT generated sources. It is also inconsistent with java_library and leads to inconsistent Skylark rules where a declared output will not always have a generating action. This new behavior is guarded by a new flag --incompatible_generate_javacommon_source_jar. RELNOTES: None. PiperOrigin-RevId: 202648346
* Add --incompatible_disable_data_transition for 'cfg = "data"' Skylark callsGravatar gregce2018-06-27
| | | | PiperOrigin-RevId: 202400312
* Automated refactor of Label.parseAbsolute() to always pass a repository mappingGravatar dannark2018-06-27
| | | | | RELNOTES: None PiperOrigin-RevId: 202360925
* Enforce that repository mapping is never null (it can be empty).Gravatar dannark2018-06-26
| | | | | RELNOTES: None PiperOrigin-RevId: 202167782
* Remove Label.parseAbsolute(string, boolean). The goal is to get rid of all ↵Gravatar dannark2018-06-22
| | | | | | | label methods that don't explicitly pass a repository mapping. RELNOTES: None PiperOrigin-RevId: 201717665
* Audit usages of Label.getRelative and update to Label.getRelativeWithRemappingGravatar dannark2018-06-21
| | | | | RELNOTES: None PiperOrigin-RevId: 201617188
* Remap labels that include a repository name that appear in $(location x).Gravatar dannark2018-06-21
| | | | | RELNOTES: None. PiperOrigin-RevId: 201588988
* Take into account repository mapping when processing labels inside BUILD ↵Gravatar dannark2018-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | files within external repositories. For example: a/BUILD genrule( name = "a", srcs = ["@x//:x.txt"], outs = ["result.txt"], cmd = "echo hello > \$(location result.txt)" ) If the main workspace file references that repository with a rule: local_repository( name = "other_repo", path = "../a", repo_mapping = {"@x" : "@y"} ) Then when a/BUILD is evaluated, the string "@x//:x.txt" will be turned into a Label "@y//:x.txt" RELNOTES: None PiperOrigin-RevId: 201562148
* Migrate DefaultInfo and its provider to skylarkbuildapiGravatar cparsons2018-06-21
| | | | | RELNOTES: None. PiperOrigin-RevId: 201544076
* Allow structField callables to specify useSkylarkSemantics, useLocation, and ↵Gravatar cparsons2018-06-20
| | | | | | | | | | useEnvironment Unfortunately this doesn't work for all callers, namely NativeInfo objects, as they may have structField callables invoked from contexts that have no environment available. RELNOTES[INC]: Skylark structs (using struct()) may no longer have to_json and to_proto overridden. PiperOrigin-RevId: 201376969
* On type errors for select()s, show which branch is responsible.Gravatar gregce2018-06-19
| | | | | | Reviewed at: https://github.com/bazelbuild/bazel/pull/5425 PiperOrigin-RevId: 201241451
* Be more permissive when dealing with rules which haveGravatar jcater2018-06-19
| | | | | | | ExecutionPlatformConstraintsAllowed set to PER_TARGET and also have an alread-existing exec_compatible_with attribute. PiperOrigin-RevId: 201238805
* Add more logging when executionPlatformConstraintsAllowed is set to PER_TARGETGravatar jcater2018-06-19
| | | | | | but the "exec_compatible_with" attribute is present. PiperOrigin-RevId: 201219412
* Make things easier to serialize: make constants constant, tag some lambdas. ↵Gravatar janakr2018-06-19
| | | | | | Get rid of a useless tag, because the Function being tagged is a concrete class, so won't be serializable. Will deal with it in a follow-up. Implement equality for BazelInfo. PiperOrigin-RevId: 201199255
* Move remaining BazelLibrary skylark functions to MethodLibraryGravatar cparsons2018-06-15
| | | | | | | | | Ultimately, we'll need to make the call on whether these functions belong as part of the build API or as part of skylark builtins. For now, we keep them as skylark builtins. (In either case, we'll want to migrate to @SkylarkCallable, but that's for a later change) RELNOTES: None. PiperOrigin-RevId: 200723605
* Compare using value equality instead of reference equality.Gravatar dannark2018-06-13
| | | | | RELNOTES: None PiperOrigin-RevId: 200446926
* Enable rules to inherit the ExecutionPlatformConstraintsAllowed value.Gravatar jcater2018-06-12
| | | | PiperOrigin-RevId: 200247872
* Remap repository names inside load statements in BUILD files if the ↵Gravatar dannark2018-06-12
| | | | | | | | | | | | | | | | | | | repository name is remapped. For example if main/WORKSPACE contains: local_repository( name = "a", path = "../a", repo_mapping = {"@x" : "@y"}, ) a/BUILD load("@x//:sample.bzl", "sample") Then the load in a/BUILD will be resolved as "@y//:sample.bzl" RELNOTES: None PiperOrigin-RevId: 200227431
* Migrate remaining assorted skylark types to skylarkbuildapiGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200100871
* Only remove 'repo_mapping' from kwargs if experimental_enable_repo_mapping ↵Gravatar dannark2018-06-11
| | | | | | | is set. Repository rules should throw an attribute not found error if repo_mapping is used but the flag isn't set, otherwise it silently fails. RELNOTES: None PiperOrigin-RevId: 200097695
* Migrate android providers to use BuiltinProvider instead of NativeProviderGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200096226
* BlazeOptionHandler: only check in the parent directory, if there is oneGravatar Klaus Aehlig2018-06-08
| | | | | | | | | | | When checking for a file called DO_NOT_BUILD_HERE in the parent direcotry of the workspace path, first verify that there is such a parent directory. This avoids a null pointer exception if the WORKSPACE file is in the top-level directory. Fixes #5349 Change-Id: I81289a27a3f7fb0f4b5a112343de1b454fb5b8c5 PiperOrigin-RevId: 199790735
* Fix bug in skyframe-based test-suite expansionGravatar ulfjack2018-06-07
| | | | | | | | | | It was tracking filtered tests and then applying the filter at the next higher level. I also added a bunch of comments - we actually have four implementations of test suite expansion, and they are not consistent. Sorry about that. PiperOrigin-RevId: 199629485
* Disable `repo_mapping` by default via a flag.Gravatar dannark2018-06-05
| | | | | RELNOTES: None PiperOrigin-RevId: 199374368
* Add flag --experimental_enable_repo_mapping to gate usage of repo_mapping ↵Gravatar dannark2018-06-05
| | | | | | | functionality in WORKSPACE rules. RELNOTES: None PiperOrigin-RevId: 199332092
* Allow rules and targets to specify extra execution platform constraints.Gravatar John Cater2018-06-05
| | | | | | | | | | | | | | | | | | | | | | RuleClass.Builder now allows authors to specify whether a rule's targets can add additional constraints on the execution platform, and to declare additional constraints for all targets of that rule. Targets which support this now have an attribute, "exec_compatible_with", which supports specifying additional constraints that the execution platform used must match. This attribute is non-configurable. It will only affect execution platforms used during toolchain resolution. Part of #5217. Change-Id: Id2400dbf869a00aa2be3e3d2f085c2850cd6dc00 Closes #5227. Change-Id: If7d55f08f7f44bc7d7f6dfec86a3e6bcd68574b9 PiperOrigin-RevId: 199326255
* Add functionality to SerializationContext and @AutoCodec to check that a ↵Gravatar janakr2018-06-05
| | | | | | | | class is allowed to be serialized in the current context. A codec can now add an explicitly allowed class that can be serialized underneath it (via SerializationContext#addExplicitlyAllowedClass), and that class's codec can check that it is explicitly allowed (via SerializationContext#checkClassExplicitlyAllowed). It is a runtime crash if a codec checks that it was explicitly allowed and finds that it wasn't. Thus, if PackageCodec is invoked without it having been explicitly allowed, we will crash, preventing Package from sneaking into a value it shouldn't be in. This is only enabled if the codec is memoizing. PiperOrigin-RevId: 199317936
* Remove step in SkylarkSemanticsOptions instructions that reference ↵Gravatar dannark2018-06-05
| | | | | | | non-existent code. RELNOTES: None PiperOrigin-RevId: 199307562
* Process 'repo_mapping' attribute from WORKSPACE rules. 'repo_mapping' is a ↵Gravatar dannark2018-06-04
| | | | | | | | | | | | | | | | way to remap references to repositories within an external repository by another name. This CL only adds the mappings to the Package object, but it does not actually enable the reassignments. Example usage (in a WORKSPACE file): local_repository( name = ?a?, path = ?../a?, repo_mapping = {?@x? : ?@y?} ) This change also creates a new SkyKey which represents the mappings. This is to prevent all packages from depending on the external package, and instead depending just on the mappings. i.e. a change to the WORKSPACE file that does not touch the mappings shouldn't cause a reload of the package. RELNOTES:None PiperOrigin-RevId: 199187963
* Make tools in action inputs an error.Gravatar tomlu2018-06-02
| | | | | | | | | | Supporting tools in inputs introduces a slow linear scan. Such tools should be moved to the 'tools' attribute. If --incompatible_no_support_tools_in_action_inputs is set the inputs are scanned, but a helpful error message is issued to the user. Eventually we will remove the slow scanning. Errors will surface in the execution phase instead of during analysis, and the resulting error messages will be less obvious. RELNOTES: None RELNOTES[INC]: With --incompatible_no_support_tools_in_action_inputs enabled, Skylark action inputs are no longer scanned for tools. Move any such inputs to the newly introduced 'tools' attribute. PiperOrigin-RevId: 198996093
* Special case * in target lookup, work around for #5300.Gravatar twerth2018-05-30
| | | | | | | | * is not an allowed file system character on Windows and checking if it's a directory or file for the wilcard check would throw an InvalidPathException. RELNOTES: None PiperOrigin-RevId: 198595138
* 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
* Simplify RuleClass.Builder#cfg, Attribute.Builder#cfg interfaces.Gravatar gregce2018-05-29
| | | | PiperOrigin-RevId: 198427902
* Merge ComposingSplitTransition and ComposingPatchTransition.Gravatar gregce2018-05-29
| | | | | | Part of https://docs.google.com/document/d/1_UJKmAQ9EE8i3Pl0il3YLTYr-Q9EKYYyLatt2zohfyM/edit# PiperOrigin-RevId: 198420365
* Make ConstantRuleVisibility static constants into @AutoCodec constants.Gravatar janakr2018-05-29
| | | | PiperOrigin-RevId: 198398386
* Start migration of apple skylark build APIGravatar cparsons2018-05-25
| | | | | RELNOTES: None. PiperOrigin-RevId: 198107604
* Migrate FilesToRunProvider, Target, and TemplateVariableInfo to skylarkbuildapiGravatar cparsons2018-05-25
| | | | | RELNOTES: None. PiperOrigin-RevId: 198095817