aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skylark
Commit message (Collapse)AuthorAge
* Remove final accessors of ConfigurationTransition.HOST.Gravatar gregce2017-12-21
| | | | | | | Also lean interfaces from Attribute.ConfigurationTransition to Attribute.Transition. PiperOrigin-RevId: 179846158
* Change cfg(HOST) to cfg(HostTransition.INSTANCE).Gravatar gregce2017-12-21
| | | | | | Preparatory step for removing ConfigurationTransition.HOST. PiperOrigin-RevId: 179838374
* Expose ObjcProtoAspect to Skylark.Gravatar cparsons2017-12-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 179737025
* 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
* Rename OutputGroupProvider -> OutputGroupInfo.Gravatar dslomov2017-12-14
| | | | | RELNOTES: None PiperOrigin-RevId: 179046403
* Remove the ctx.middle_man function from Skylark.Gravatar lberki2017-12-07
| | | | | | | | Let's not expose middlemen to Skylark if we can help. RELNOTES[INC]: The ctx.middle_man function is not supported anymore. PiperOrigin-RevId: 178226393
* Disallow undeclared access to the $(JAVA) and $(JAVABASE) template variables.Gravatar lberki2017-12-06
| | | | | | | | | If a rule needs these template variables, it will need to declare a dependency on them in the future by adding @bazel_tools//tools/jdk:current_java_runtime to its toolchains= attribute. RELNOTES[INC]: In order to access the template variables $(JAVA) and $(JAVABASE), @bazel_tools//tools/jdk:current_java_runtime needs to be added to the toolchains= attribute from now on. RELNOTES: None. PiperOrigin-RevId: 178070807
* Set default value of incompatible_load_argument_is_label to true.Gravatar laurentlb2017-12-04
| | | | | | | RELNOTES: First argument of 'load' must be a label. Path syntax is removed. (label should start with '//' or ':'). PiperOrigin-RevId: 177802628
* Fix missing print statements in output functionsGravatar vladmos2017-12-02
| | | | PiperOrigin-RevId: 177708823
* Update tests to use the label-based load() syntax.Gravatar laurentlb2017-11-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 177487913
* Update some of the tests to use the label-based load() syntax.Gravatar laurentlb2017-11-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 177476726
* MockRule-ify some more tests.Gravatar gregce2017-11-29
| | | | PiperOrigin-RevId: 177339358
* Shape sharing for Skylark providers.Gravatar Benjamin Peterson2017-11-27
| | | | | | | | | | Add CompactSkylarkInfo, which stores its values as an array instead of a map. The space savings will probably not be dramatic because providers usually have a limited amount of keys. But, there are a lot of them! Change-Id: Idd452a5e3982f773b1c5202c73f3d7031ec022c6 PiperOrigin-RevId: 176995376
* Break dependency on vfs from the interface of syntax and cmdline.Gravatar tomlu2017-11-06
| | | | | | | | These libs are exposed externally, implying that the vfs is also exposed externally. We break out PathFragment from vfs to still use this in their interface. This class is a much smaller dependency than the entire vfs. PiperOrigin-RevId: 174729373
* Expose late-bound-attributes to Skylark.Gravatar cparsons2017-11-06
| | | | | RELNOTES: Late-bound attributes are exposed to skylark. This is a new API (`configuration_field()`) to depend on certain configuration-defined targets from skylark rules. PiperOrigin-RevId: 174534104
* 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 a regression test for expand_locationGravatar ulfjack2017-10-26
| | | | | | | I accidentally broke expand_location in https://github.com/bazelbuild/bazel/commit/ca77f608e486bf7aa762565d25bf7b9e30f2268c, so here's a test that would have prevented that. PiperOrigin-RevId: 173513845
* Automated rollback of commit ca77f608e486bf7aa762565d25bf7b9e30f2268c.Gravatar ulfjack2017-10-26
| | | | | | | | | | | | | | | | | 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: 173508888
* Extend TemplateExpander to handle $(func param) expansionGravatar ulfjack2017-10-25
| | | | | | | Rewrite the Expander to use the new functionality; also rewrite the Skylark expand_location function to use it. PiperOrigin-RevId: 173280839
* 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
* 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
* 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
* 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
* Check parameter types for methods when multiple types are allowed.Gravatar Dmitry Lomov2017-09-25
| | | | | | | | | | | | | | | Relanding https://github.com/bazelbuild/bazel/commit/17214ac78ffaec369d5d5bafe62a39730473cfaa with fixes to 'repository_ctx.download()' and 'repository_ctx.download_and_extract()'. I reviewed other usages of @ParamType annotation - I do not think there are more issues. Fixes #3714. Change-Id: I17087ef3fc2d28ab99224740a2164675a49847d3 PiperOrigin-RevId: 169896223
* Automated rollback of commit 17214ac78ffaec369d5d5bafe62a39730473cfaa.Gravatar dslomov2017-09-22
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolled back commit enforces stricter parameter checks. Will fix and roll forward This creates several failures on the nightly build of Bazel: ERROR: /home/ci/workspace/Global/rules_closure-node=linux-x86_64/closure/protobuf/test/BUILD:23:1: no such package '@com_google_protobuf_protoc//': Cannot convert parameter 'url' to type string or sequence of strings, in method download_and_extract(List, string, string, string, string) of 'repository_ctx' and referenced by '//closure/protobuf/test:example_proto_gen'. ERROR: Analysis of target '//closure/protobuf/test:example_lib' failed; build aborted: no such package '@com_google_protobuf_protoc//': Cannot convert parameter 'url' to type string or sequence of strings, in method download_and_extract(List, string, string, string, string) of 'repository_ctx'. *** Original change description *** Check parameter types for methods when multiple types are allowed. Fixes #3714 RELNOTES: None. PiperOrigin-RevId: 169669802
* Increase the timeout for Bazel SkylarkTests to "long"Gravatar vladmos2017-09-21
| | | | | | | | | | The tests have become large so that the default 5 minutes timeout is no longer enough for them. At the same point it doesn't look that the test requires more resources, just a longer timeout. Fixes #3774 PiperOrigin-RevId: 169532333
* Add ability to write param files to disk.Gravatar tomlu2017-09-21
| | | | PiperOrigin-RevId: 169418286
* Check parameter types for methods when multiple types are allowed.Gravatar dslomov2017-09-20
| | | | | | Fixes #3714 RELNOTES: None. PiperOrigin-RevId: 169382686
* CI,windows: create test_suites for Windows testsGravatar L?szl? Csomor2017-09-19
| | | | | | | | | | | | | | | Add recursive test_suite rules for all tests that ci.bazel.io runs for Windows, and set the top-level test_suite as the CI test target. Doing so shortens the command line and works around https://github.com/bazelbuild/bazel/issues/3742 I verified that the old set of tests are the same as the new set. Change-Id: Id8d5da3f0c03c9b8969a9f8e1e9a3096888365aa PiperOrigin-RevId: 169242858
* Implement support for Skylark param files.Gravatar tomlu2017-09-19
| | | | PiperOrigin-RevId: 169234249
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Project reorg: move *ConfiguredTarget to new configuredtargets/ pathGravatar gregce2017-09-18
| | | | | | | Exempt RuleConfiguredTarget in this change because that's liable to touch a billion files. PiperOrigin-RevId: 168929827
* Rollback context.actions.args() functionality.Gravatar tomlu2017-09-14
| | | | | | This will be rolled forward with a different API. PiperOrigin-RevId: 168566666
* Fix string representations for root objectsGravatar vladmos2017-09-12
| | | | | | Root objects should not expose their absolute paths as they break hermeticity. PiperOrigin-RevId: 168363549
* Update ContainingPackageLookupFunction to properly handle cases where aGravatar John Cater2017-09-07
| | | | | | | | | | path crosses into a local repository and correctly report the repository-relative package. Fixes #3553. Change-Id: Ib912e69d546fb740ef8fe4c426dba30fa7776bda PiperOrigin-RevId: 167760229
* More BUILD file refactorings.Gravatar philwo2017-09-06
| | | | | | | | | Split collect, concurrent, vfs, windows into package-level BUILD files. Move clock classes out of "util", into their own Java package. Move CompactHashSet into its own Java package to break a dependency cycle. Give nestedset and inmemoryfs their own package-level BUILD files. PiperOrigin-RevId: 167702127
* Make Make variables from genrule.toolchains override the usual synthetic ↵Gravatar lberki2017-09-04
| | | | | | | | | host JAVA/JAVABASE attributes. Also fix a few lint warnings and move a class so that it's closer to where it's actually used. RELNOTES: None. PiperOrigin-RevId: 167501208
* Skylark: ctx.actions.run_shell uses helper scriptGravatar László Csomor2017-08-31
| | | | | | | | | | | | | | | | | If the shell command in ctx.actions.run_shell.command is longer than the platform's shell's limit, Bazel will dump the command to a helper shell script and execute that script in the run_shell action. Genrules also write a helper script when genrule.cmd is longer than the shell's limit, and ctx.actions.run_shell now uses the same machinery. Fixes https://github.com/bazelbuild/bazel/issues/3589 Change-Id: Ib24dce90182ef69552deb2d400e00ae061537309 PiperOrigin-RevId: 167126560
* Implement CustomCommandLine support for Skylark.Gravatar tomlu2017-08-28
| | | | | RELNOTES: Support ctx.actions.args() for more efficient Skylark command line construction. PiperOrigin-RevId: 166694148
* Make tests independent of the current state of the ↵Gravatar vladmos2017-08-28
| | | | | | incompatible_descriptive_string_representations flag PiperOrigin-RevId: 166475260
* Implement field declarations for declared providers.Gravatar dslomov2017-08-25
| | | | | RELNOTES: Skylark providers can specify allowed fields and their documentation. PiperOrigin-RevId: 166446104
* Remove dialect distinction from the parser.Gravatar laurentlb2017-08-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 166058718
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Refactor Bash LauncherGravatar Yun Peng2017-08-21
| | | | | | | | | | | | | | | | | | 1. Extract some funtions into NativeLauncherUtil.java So that they can also be used by Python and Java launcher. 2. Derive runfiles directory from mainExectuable yielding "%{name}.cmd.runfiles" or "%{name}.exe.runfiles" 3. Removed bash_main_file key, we can assume the main file is next the launcher just without .exe suffix. By doing this, we don't have to worry about passing RunfilesPath or ExecPath. RunfilesPath has ../ prefix for external file, ExecPath contians ./bazel-out/... for generated file. If main file is a generated file from external repository, neither of them are correct. Change-Id: Ie0c35f6030f6229c28d935d8fb3cb6a8af5af29c PiperOrigin-RevId: 165699975
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* 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
* Use RequiredProviders to validate rule prerequisites in RuleContext.Gravatar dslomov2017-08-03
| | | | | | | | | We now use a unified way to check provider requirements everywhere. Reland of https://github.com/bazelbuild/bazel/commit/c32e1b1efcd703b3780de47fba62974123593d71. RELNOTES: None. PiperOrigin-RevId: 164038621
* Automated rollback of commit c32e1b1efcd703b3780de47fba62974123593d71.Gravatar dslomov2017-08-02
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks depot b/64250728 *** Original change description *** Use RequiredProviders to validate rule prerequisites in RuleContext. We now use a unified way to check provider requirements everywhere. RELNOTES: None. PiperOrigin-RevId: 163862067
* Make list EMPTY instance work like tuplesGravatar brandjon2017-08-02
| | | | | | | I.e., use an accessor for type inference. The EMPTY field will be made private in a future CL. RELNOTES: None PiperOrigin-RevId: 163843569
* 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