aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/skylark
Commit message (Collapse)AuthorAge
* Fix "Deprecated API" headerGravatar laurentlb2018-08-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 208661270
* Automatic code cleanup.Gravatar Googler2018-07-26
| | | | PiperOrigin-RevId: 206124597
* Remove cookbookGravatar laurentlb2018-07-25
| | | | | | | The cookbook was not maintained and was replaced by https://github.com/bazelbuild/examples RELNOTES: None. PiperOrigin-RevId: 206046316
* fix typo: "how to creates" -> "how to create"Gravatar Vladimir Rutsky2018-07-23
| | | | | | Closes #5649. PiperOrigin-RevId: 205662376
* Rules are no longer experimental.Gravatar laurentlb2018-07-20
| | | | | | | | | Exact API will continue to evolve, some specific functions are experimental, but we can't really say that the concept of rule is experimental. RELNOTES: None. PiperOrigin-RevId: 205383939
* Remove stray backticks to fix end of code block in testing documentation.Gravatar Googler2018-07-18
| | | | | | Also replaced ```` with ``` in other document where it didn't cause a visible change. PiperOrigin-RevId: 205112255
* [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
* Clarify documentation for implicit deps and default attr valuesGravatar brandjon2018-07-06
| | | | | RELNOTES: None PiperOrigin-RevId: 203466429
* Skylark spec: -x is not an Operand, but a UnaryExprGravatar laurentlb2018-07-03
| | | | PiperOrigin-RevId: 203167019
* Clarify attr documentationGravatar brandjon2018-07-03
| | | | | | | Fixes #5335 RELNOTES: None PiperOrigin-RevId: 203148338
* PiperOrigin-RevId: 203116395Gravatar brandjon2018-07-03
|
* Remove outdated cfg=data"Gravatar gregce2018-06-27
| | | | PiperOrigin-RevId: 202386041
* Fix minor errors in[]Gravatar Googler2018-06-26
| | | | PiperOrigin-RevId: 202161910
* Clarify that depset order is deterministicGravatar brandjon2018-06-25
| | | | | | | In response to https://github.com/bazelbuild/rules_scala/issues/531 RELNOTES: PiperOrigin-RevId: 201966809
* If a dictionary is used as a general set, the keys should be mapped to ↵Gravatar Googler2018-06-21
| | | | | | | | | | `True` instead of `None`. dict has a get() method that defaults to `None`. Checking for a key in the dictionary with get() will always return `None` in the given example. Using `True` is better. RELNOTES: None. PiperOrigin-RevId: 201551896
* repository_rules.md: update documentation on return valuesGravatar Klaus Aehlig2018-06-15
| | | | | | | | | Since commit 97132c0925031e1b1fb8e9e5dde2233daef9d97b, repository rule implementations are allowed to return other values than `None`. Describe the currently supported values and their intended meaning. Change-Id: I63dbbff4b232b36861aa2a6cfdc69352fa971f4d PiperOrigin-RevId: 200707564
* 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
* Fix string.title and string.upper documentation.Gravatar Googler2018-06-01
| | | | | | | Cut and paste errors left references to lower in descriptions. RELNOTES: None. PiperOrigin-RevId: 198903374
* Provide more details on the transition to Skylark {git,http}_repositoryGravatar Klaus Aehlig2018-05-30
| | | | | | | | In the description of incompatible changes, provide more information on the how to transition to the Skylark versions of the deprecated native rules. Change-Id: I30c6ee6560a4aed0d6d8356b00e6c1afec460f22 PiperOrigin-RevId: 198544104
* De-document the Skylark "data" transition.Gravatar gregce2018-05-23
| | | | | | This is going away with the removal of C++ LIPO support. PiperOrigin-RevId: 197779736
* Recommend 4 spaces for indentation in the style guide.Gravatar laurentlb2018-05-09
| | | | | | | | Users shouldn't worry too much about it, we will soon recommend using Buildifier. RELNOTES: None. PiperOrigin-RevId: 196025297
* Update recursive glob docs.Gravatar Googler2018-05-03
| | | | PiperOrigin-RevId: 195288040
* Add --incompatible_disallow_legacy_javainfo flag.Gravatar tomlu2018-05-02
| | | | | | | | When set to true, old-style JavaInfo provider construction methods become an error. RELNOTES[INC]: Add --incompatible_disallow_legacy_javainfo flag. PiperOrigin-RevId: 195104452
* Fix code blocks in the documentationGravatar vladmos2018-05-02
| | | | | | "shell" is an unknown lexer for Jekyll, "bash" should be used instead. PiperOrigin-RevId: 195075891
* Externalize testing guidance for Skylark codeGravatar brandjon2018-04-23
| | | | | | | Mainly this is about using unittest.bzl to test rules or helper functions. RELNOTES: PiperOrigin-RevId: 193973496
* Update backward-compatibility.md with missing flag docsGravatar brandjon2018-04-20
| | | | | RELNOTES: None PiperOrigin-RevId: 193677877
* Make some links absoluteGravatar brandjon2018-04-19
| | | | | | | | | This was breaking an internal version of the documentation, though the public version worked correctly. Now it works both ways. Also link directly to flag instead of section. RELNOTES: None PiperOrigin-RevId: 193554278
* Fix anchors for docstring sectionGravatar brandjon2018-04-18
| | | | | RELNOTES: None PiperOrigin-RevId: 193354556
* Clarify 1st arg of load()Gravatar brandjon2018-04-17
| | | | | RELNOTES: None PiperOrigin-RevId: 193206695
* Introduce `--incompatible_disallow_filetype` to remove the `FileType` function.Gravatar laurentlb2018-04-13
| | | | | | | | RELNOTES: `FileType` is deprecated and will be removed soon. Try the `--incompatible_disallow_filetype` flag to ensure your code is forward-compatible. PiperOrigin-RevId: 192758063
* Update the markdown headerGravatar laurentlb2018-04-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 192754490
* Document the new ctx.actions.args() APIGravatar brandjon2018-04-12
| | | | | | RELNOTES: Args objects (ctx.actions.args()) have new methods add_all() and add_joined() for building command lines using depsets. RELNOTES[INC]: Added flag --incompatible_disallow_old_style_args_add to help migrate from args.add() to args.add_all() / args.add_joined() where appropriate. PiperOrigin-RevId: 192633763
* Remove flag `incompatible_disallow_toplevel_if_statement`.Gravatar laurentlb2018-04-12
| | | | | | RELNOTES: Removed flag `--incompatible_disallow_toplevel_if_statement`. PiperOrigin-RevId: 192621765
* Fix bad formattingGravatar brandjon2018-04-12
| | | | | | | Language type for code blocks should be "python", not "skylark". RELNOTES: None PiperOrigin-RevId: 192608419
* Update ctx.action.args() docs.Gravatar tomlu2018-04-11
| | | | | RELNOTES: None PiperOrigin-RevId: 192479130
* Introduce `--incompatible_disallow_slash_operator` to disable `/` operator.Gravatar laurentlb2018-04-11
| | | | | | | | RELNOTES: The `/` operator is deprecated in favor of `//` (floor integer division). Try the `--incompatible_disallow_slash_operator` flag to ensure your code is forward-compatible. PiperOrigin-RevId: 192430310
* Add "--detach" to tap_presubmit command. Without it, TAP warned it may not haltGravatar Googler2018-04-10
| | | | | | | | if some test runs forever. Correct code snippet labels. RELNOTES: Add "--detach" to tap_presubmit command. PiperOrigin-RevId: 192314988
* Update repository-rule documentation on restartsGravatar Klaus Aehlig2018-04-10
| | | | | | | | | | Update documentation of repository rules to reflect the recent change that label arguments are prefetched. Related to #4533. Change-Id: I765b3d030ca3e6bf0cca7e18f4bfcc17d1d5aea3 PiperOrigin-RevId: 192258022
* Fix the definition of Argument in the Skylark specificationGravatar vladmos2018-04-05
| | | | PiperOrigin-RevId: 191717115
* Fix incorrect int() exampleGravatar brandjon2018-03-26
| | | | | | | Also add tests for leading "+" in int(<string>) form. RELNOTES: None PiperOrigin-RevId: 190507678
* Fix typo in linkGravatar brandjon2018-03-26
| | | | | RELNOTES: None PiperOrigin-RevId: 190470599
* Remove the --incompatible_disallow_uncalled_set_constructor flagGravatar vladmos2018-03-22
| | | | | | | | RELNOTES[INC]: The --incompatible_disallow_uncalled_set_constructor flag is no longer available, the `set` constructor` is completely removed from Skylark. Use `depset` instead. PiperOrigin-RevId: 190053331
* Remove the flag --incompatible_show_all_print_messagesGravatar vladmos2018-03-22
| | | | | | | | RELNOTES[INC]: The flag --incompatible_show_all_print_messages is removed. Messages generated by `print` statements from any package will be displayed as DEBUG messages. PiperOrigin-RevId: 190043451
* Clarify migration instructions for providersGravatar brandjon2018-03-21
| | | | | | | | | This makes legacy providers a subsection so it can be referenced from linter error messages. It also adds some prose explaining the exact correspondence between legacy provider field keys and modern providers. RELNOTES: None PiperOrigin-RevId: 189980562
* Remove features that actually don't exist from the specGravatar laurentlb2018-03-19
| | | | | | | | | | - Changes in the int() function. - Changes in the string interpolation operator. Fixes #4862 RELNOTES: None. PiperOrigin-RevId: 189626007
* Rename a few pagesGravatar brandjon2018-03-19
| | | | | | | | | Prefer "Extension" over "Skylark" when referring specifically to Bazel's use of Skylark. Follow-up to https://github.com/bazelbuild/bazel/commit/3ef60b7cdcf8826102ec42a77183645ab0cafcf7. RELNOTES: None PiperOrigin-RevId: 189602396
* Split off troubleshooting section into a FAQ pageGravatar brandjon2018-03-18
| | | | | | | | | Rewrite/add to the contents of this section. Also updated the page titles / navbar entries of Skylark documentation to make them more uniform (title case, avoid redundancy). RELNOTES: None PiperOrigin-RevId: 189503729
* Recommend against writing "boolattr = 1" in style guideGravatar brandjon2018-03-12
| | | | | RELNOTES: None PiperOrigin-RevId: 188730878
* Fix broken links and formattingGravatar brandjon2018-03-10
| | | | | RELNOTES: None PiperOrigin-RevId: 188625855
* Update links to examplesGravatar brandjon2018-03-10
| | | | | | | See changes in https://github.com/bazelbuild/examples/pull/56 RELNOTES: None PiperOrigin-RevId: 188601311