aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/packages/SkylarkSemanticsConsistencyTest.java
Commit message (Collapse)AuthorAge
* Put main repo remapping behind a flag.Gravatar dannark2018-08-07
| | | | | RELNOTES: None PiperOrigin-RevId: 207801155
* 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
* Removes serialization class that introduced bug.Gravatar plf2018-07-31
| | | | | RELNOTES:none PiperOrigin-RevId: 206767138
* [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
* [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
* 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
* 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
* Remove --incompatible_disable_glob_tracking flag.Gravatar laurentlb2018-05-16
| | | | | | RELNOTES: Flag `--incompatible_disable_glob_tracking` is removed. PiperOrigin-RevId: 196852718
* 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
* 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
* Remove flag `incompatible_disallow_toplevel_if_statement`.Gravatar laurentlb2018-04-12
| | | | | | RELNOTES: Removed flag `--incompatible_disallow_toplevel_if_statement`. PiperOrigin-RevId: 192621765
* 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
* Remove support for the --incompatible_disallow_three_arg_vardef command line ↵Gravatar lberki2018-04-10
| | | | | | | | | option. It was used for a migration, which is now done. RELNOTES: None. PiperOrigin-RevId: 192246659
* Split Args#add into three methods.Gravatar tomlu2018-04-05
| | | | | | | | | | | Args#add(value, *, arg, format) Args#add_all(value, *, arg, map_each, format_each, before_each, omit_if_empty, uniquify) Args#add_joined(value, *, arg, join_with, map_each, format_each, format_joined, omit_if_empty, uniquify) The old Args#add remains backwards compatible, but we add a flag to disable this compatibility mode. RELNOTES: None PiperOrigin-RevId: 191804482
* New incompatible flag to disable PACKAGE_NAME and REPOSITORY_NAME.Gravatar laurentlb2018-03-27
| | | | | | | | | RELNOTES[INC]: Variables PACKAGE_NAME and REPOSITORY_NAME are deprecated in favor of functions `package_name()` and `repository_name()`. https://docs.bazel.build/versions/master/skylark/lib/native.html#package_name PiperOrigin-RevId: 190657188
* 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
* Remove no-op flag 'incompatible_load_argument_is_label'.Gravatar laurentlb2018-03-21
| | | | | | | No relnotes, because deletion was already announced. RELNOTES: None. PiperOrigin-RevId: 189934041
* Add a command line option to disallow vardef()s with three arguments.Gravatar lberki2018-03-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 188038131
* Create --incompatible_disable_objc_provider_resources to disable deprecated ↵Gravatar cparsons2018-03-01
| | | | | | | | | objc provider skylark fields. This flag is not fully implemented -- there should also be a way to disable the provider getters using this flag, but, since @SkylarkCallable does not allow for evaluation of SkylarkSemantics, this is not yet possible. RELNOTES: None. PiperOrigin-RevId: 187542004
* Deprecate native git_repositoryGravatar Klaus Aehlig2018-03-01
| | | | | | | | | | | | | | The skylark implementation of git_repository is a drop-in replacement for the native workspace rule. So deprecate the latter to avoid having two implementations of the same. Also, the native rule pulls in quite some dependencies. RELNOTES: The native git_repository rule is deprecated. Use the Skylark version available via load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") instead. Change-Id: Id75d8e7b7377acd1092c4ba993f488be86c03fa0 PiperOrigin-RevId: 187466931
* Decprecate native http_archiveGravatar Klaus Aehlig2018-02-20
| | | | | | | | | | | | | | | Since the skylark implementation of http_archive provides all the features available in the native http_archive and a few more (patching), there is no need to have to rule implementations doing the same thing. Hence deprecate the native one as part of our plan of moving more functionality to skylark. RELNOTES: The native http_archive rule is deprecated. Use the Skylark version available via load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") instead. Change-Id: I107c2f25f5a37c67f56b4362e7c9d9ade8428c16 PiperOrigin-RevId: 186314624
* Remove old flags.Gravatar laurentlb2018-02-16
| | | | | | RELNOTES: Removed flags `--incompatible_checked_arithmetic`, `--incompatible_dict_literal_has_no_duplicates`, `--incompatible_disallow_keyword_only_args`, and ` --incompatible_comprehension_variables_do_not_leak`. PiperOrigin-RevId: 185977740
* Replaces InjectingObjectCodec with dependencies threaded through ↵Gravatar shahan2018-02-13
| | | | | | (Des|S)erializationContext. PiperOrigin-RevId: 185547740
* Remove testing flag --internal_do_not_export_builtinsGravatar brandjon2017-12-21
| | | | | | | Also add a @VisibleForTesting accessor to SkyframeExecutor. RELNOTES: None PiperOrigin-RevId: 179875655
* Add a new flag to disable glob tracking: --incompatible_disable_glob_trackingGravatar laurentlb2017-12-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 178760403
* Remove the --incompatible_list_plus_equals_inplace flagGravatar vladmos2017-12-08
| | | | | | | | RELNOTES[INC]: The flag --incompatible_list_plus_equals_inplace is removed, its default behavior is preserved. += on lists now always mutates the left hand side. PiperOrigin-RevId: 178359047
* New flag `--incompatible_depset_union` to disable old-style depset merging.Gravatar laurentlb2017-12-07
| | | | | | | RELNOTES: Using `+`, `|` or `.union` on depsets is now deprecated. Please use the new constructor instead (see https://docs.bazel.build/versions/master/skylark/depsets.html). PiperOrigin-RevId: 178262338
* Add SkylarkSemantics#toBuilder() and #builderWithDefaults()Gravatar brandjon2017-12-06
| | | | | | | This avoids having to inline a bunch of default values when you only want to change one flag. RELNOTES: None PiperOrigin-RevId: 178148057
* Do not filter debug messagesGravatar vladmos2017-11-30
| | | | | | | Debug messages (generated with Skylark's `print` function) used to be filtered out by the output filter: if such messages are generated during the analysis phase in a package different to the target package (e.g. if a user builds //foo:foo and the message is generated in a dependency //bar:bar), the message are not shown by default, which makes an erroneous impression that the code for //bar:bar hasn't been executed at all and interferes with debugging. Now the output filter doesn't affect debug messages at all. RELNOTES: Debug messages generated by `print()` are not being filtered out by --output_filter anymore, it's recommended not to use them in production code. PiperOrigin-RevId: 177431255
* Remove the deprecated set constructor from SkylarkGravatar vladmos2017-11-21
| | | | | | | | | | | | The `set` constructor used to be deprecated, but it was still possible to use it by providing --incompatible_disallow_set_constructor=false. It's still allowed to have `set` in parts of the code that are not executed, this will be deprecated later. You can check if your code is compatible with this future change by using the flag --incompatible_disallow_uncalled_set_constructor (currently the default is "false"). RELNOTES[INC]: The flag --incompatible_disallow_set_constructor is no longer available, the deprecated `set` constructor is not available anymore. PiperOrigin-RevId: 176491641
* Remove the deprecated set constructor from SkylarkGravatar vladmos2017-11-20
| | | | | | | | | | | | | The `set` constructor used to be deprecated, but it was still possible to use it by providing --incompatible_disallow_set_constructor=false. It's still allowed to have `set` in parts of the code that are not executed, this will be deprecated later. RELNOTES[INC]: The deprecated `set` constructor is removed, along with the migration flag --incompatible_disallow_set_constructor. It is still temporarily allowed to refer to `set` from within unexecuted code. PiperOrigin-RevId: 176375859
* 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
* 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
* 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
* 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