aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
Commit message (Collapse)AuthorAge
* Refactor PrinterGravatar vladmos2017-07-03
| | | | | | | It's now easier to customize Printer if in different situations objects should be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str. PiperOrigin-RevId: 160635154
* Introduce ctx.actions.write in place of ctx.file_action.Gravatar dslomov2017-06-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 160630261
* Implement ctx.actions.do_nothing instead of ctx.empty_actionGravatar dslomov2017-06-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 160621674
* Implement retry logic for the gRPC calls in remote execution and caching. TheGravatar olaola2017-06-30
| | | | | | | | retry strategy may need tuning. Other behavior changes: swallowing gRPC CANCELLED errors when the thread is interrupted, as these are expected and just make debugging difficult. Also, distinguishing between the gRPC DEADLINE_EXCEEDED caused by the actual command timing out on the server vs. other causes (the former should not be retriable, while the latter should retry). TESTED=unit tests, remote worker on Bazel PiperOrigin-RevId: 160605830
* Slight refactoring, functional noop: uploadChunks will need to get a ↵Gravatar olaola2017-06-30
| | | | | | | Chunker.Builder in my next change, so all the from factory methods are removed. TESTED=unit test PiperOrigin-RevId: 160594730
* Add a #getBytes() method to DeterministicWriter that returns a ByteString. ↵Gravatar janakr2017-06-30
| | | | | | | | By default it just delegates to the existing #writeOutputFile, but implementations may choose to override if they have easy access to a ByteString. Also change some DeterministicWriter implementations that do have easy access to the ByteString. PiperOrigin-RevId: 160550028
* Explicitly state the default options categories for options used in blaze ↵Gravatar ccalvarin2017-06-29
| | | | | | | | testing. Unlike in the production flags, these flags are only used for internal testing. Tagged them as NO_OP instead of the default UNKNOWN to make it clear that we do not need these to become properly tagged. PiperOrigin-RevId: 160526472
* Remove resource_extractor from android_sdk rule.Gravatar ajmichael2017-06-29
| | | | | | | | | | resource_extractor has nothing to do with the Android SDK. Once upon a time, it was needed for jack support, so it was colocated with the jack attributes in android_sdk. Nowadays, it is used as a necessary step before singlejar can run to build the APK. RELNOTES: None PiperOrigin-RevId: 160479247
* Introduce new android_instrumentation_test rule.Gravatar ajmichael2017-06-29
| | | | | | | | | | | This rule works with the android_instrumentation, android_device_script_fixture and android_host_service_fixture rules to support testing Android applications. None of these rules are installed yet, because the forthcoming Android test runner is not yet open sourced. https://github.com/bazelbuild/bazel/issues/903. RELNOTES: None PiperOrigin-RevId: 160465920
* Add a FeaturePolicyConfiguration for supporting limited feature rollouts.Gravatar mstaib2017-06-29
| | | | | | | | | | A common need is to limit access to a rule or feature - restricting a feature which is being deprecated or controlling the rollout of a new feature. This change adds the feature_control_policy flag, which allows developers to easily manage this process. RELNOTES: None. PiperOrigin-RevId: 160454166
* Allow expansion flags to have values.Gravatar Googler2017-06-28
| | | | | | | This lets us change what it expands based on the argument passed to the flag. RELNOTES: Allows flags that expand to take values. PiperOrigin-RevId: 160298412
* Update the --incompatible_ flag requirements to use the metadata tag.Gravatar ccalvarin2017-06-28
| | | | | | Leave the category for now as the generated docs still do not use the new categorization. PiperOrigin-RevId: 160290297
* Add a pretty printer for Skylark ASTsGravatar brandjon2017-06-28
| | | | | | | This can be used to canonically compare ASTs for equality, e.g. in tests. RELNOTES: None PiperOrigin-RevId: 160283160
* Add the default category and tag to all options.Gravatar ccalvarin2017-06-28
| | | | | | | | Move the default from the annotation to every mention. This makes the incompleteness explicit. Will add the defaults to test targets in a separate change. Once all dependencies are cleaned up, the Option annotation will no longer allow options without the documentationCategory or effectTag, to prevent new options being added without categories while we migrate to the new option categorization. PiperOrigin-RevId: 160281252
* Add more helpers to ParserGravatar brandjon2017-06-28
| | | | | | | This simplifies parsing a lone statement or expression in unit tests. RELNOTES: None PiperOrigin-RevId: 160276410
* Tests + cleanup + docs for ctx.actions.declare_{file,directory}Gravatar dslomov2017-06-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 160273273
* Add 'ctx.actions.declare_directory'Gravatar dslomov2017-06-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 160267763
* Turn unary minus into a proper AST nodeGravatar brandjon2017-06-28
| | | | | | | This unifies unary minus with NotExpression, and moves the minus logic from a fake builtin function into the interpreter proper. RELNOTES: None PiperOrigin-RevId: 160266266
* Add 'ctx.actions' and implement 'ctx.action.declare_file'.Gravatar dslomov2017-06-27
| | | | | RELNOTES: None. PiperOrigin-RevId: 160264501
* Simplify the RemoteActionCache interfaceGravatar ulfjack2017-06-27
| | | | | | | | | | | | | | | | | | | - merge all the inputs upload functionality into a single ensureInputsPresent method - merge all of the action result upload functionality into a single upload method - merge all the download functionality into a single download method This significantly simplifies the caller of this interface, and opens the door for additional performance improvements in implementations which now have more control over the upload / download flows; in particular, in the gRPC case, we can upload stdout / stderr using the existing chunker - upload of stdout / stderr is no longer serialized with file upload. In particular, the CachedLocalSpawnRunner test becomes much simpler, since it no longer needs to handle the previous more complex upload code path. PiperOrigin-RevId: 160260161
* Add idl_preprocessed field to android_library.Gravatar Googler2017-06-27
| | | | | RELNOTES: Add idl_preprocessed attribute to android_library, so that preprocessed aidl files can be passed to android_library for compiling PiperOrigin-RevId: 160185474
* Add the ability to provide source_jars to java_common.create_providerGravatar Googler2017-06-27
| | | | | | | | This should allow macros using 'custom rule' + java_import to move the full java_import logic into their rule implementation. Also, fix the definition so that the default values work and the keyword args can be omitted. PiperOrigin-RevId: 160167191
* Forbid octal sequences greater than \377 (0xff) in strings.Gravatar laurentlb2017-06-26
| | | | | | | | RELNOTES[INC]: In strings, octal sequences greater than \377 are now forbidden (e.g. "\\600"). Previously, Blaze had the same behavior as Python 2, where "\\450" == "\050". PiperOrigin-RevId: 160147169
* Enabling Aapt2 processing:Gravatar corysmith2017-06-26
| | | | | | | | | | | | * Add a new aapt_version attribute to android_binary * Add a new android_aapt_version flag to control the version of aapt used. * Add a new implicit output for aapt2 produced static libraries. * Add a new implicit output for aapt2 produced .flat files zip. RELNOTES: New property on android_sdk: aapt2 Choose the version of aapt on android_binary PiperOrigin-RevId: 160145530
* ResourceFilter properly handles special language qualifiersGravatar Googler2017-06-26
| | | | | | | | | | | | | | | | | | | | Two special types of language qualifiers are commonly used: Serbian can be written in Latin or Cyrillic characters. Serbian in Latin characters is referred to as sr-Latn (or, with a misplaced region prefix, sr-rLatn, or with the permutation common in some code for the old verions of regions supported by Aapt, sr_Latn). Spanish spoken across Latin America and the Caribbean can be represented by es-419 (or, using the permutation for old qualifier formats, es_419). For both of these, transform the resource qualifier into an appropriate BCP-47 representation that can be handled by FolderConfiguration. Also, add attribute warnings when these qualifiers are used in their specially-handled form (instead of in BCP-47 form). RELNOTES: none PiperOrigin-RevId: 160143247
* Make BuildEventStreamer flushable before first eventGravatar Klaus Aehlig2017-06-26
| | | | | | | | | | | | | | | Make the BuildEventStreamer capable of handling the flush() method, even before the initial build event is seen. This happens, if a lot (more than 10240 bytes) of output is produced before the BuildStartingEvent is generated- This is not unlikely, as the whole option processing happens before the build starts. As the promise of flush() is that the OutErrProvider is cleared, and that all output between two flush() get into separate events, numbered in order, we have to temporarily store a list of stdout/stderr String pairs. RELNOTES: None. PiperOrigin-RevId: 160137478
* Make Metadata an interface for FileArtifactValueGravatar ulfjack2017-06-26
| | | | | | | | | | Replace all previous uses of Metadata with FileArtifactValue (or a simple inner class in the case of ActionCacheChecker.CONSTANT_METADATA). Care was taken to make the equals method obey the equals contract, even in the presence of multiple implementations. PiperOrigin-RevId: 160115080
* Fix NullPointerException when enable_data_binding is omitted.Gravatar gregce2017-06-26
| | | | | | | | | DataBinding.isEnabled has outdated logic that enabled data binding for a rule even if only its deps use data binding. It's now required for all rules up the dependency chain to explictily enable data binding. RELNOTES: None. PiperOrigin-RevId: 159998478
* Forbid 'in' operator on depset with --incompatible_depset_is_not_iterableGravatar laurentlb2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159948522
* Forbid duplicate keys in dictionary literalsGravatar laurentlb2017-06-26
| | | | | | | RELNOTES: When using the dictionary literal syntax, it is now an error to have duplicated keys (e.g. {'ab': 3, 'ab': 5}). PiperOrigin-RevId: 159945431
* Make len(depset()) fail when --incompatible_depset_is_not_iterable is setGravatar laurentlb2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159945244
* Do not use link_dynamic_library.sh when toolchain doesn't support interface ↵Gravatar hlopko2017-06-26
| | | | | | | | | | | | | | | libraries Before, Bazel would always use link_dynamic_library.sh, even though the toolchain doesn't support interface libraries and therefore its arguments would always be "no ignored ignored ignored". And since link_dynamic_library.sh is a shell script, it unnecessarily complicates the Windows toolchain. This cl also removes the script as a dependency of the toolchain (so it won't be set as an input of c++ actions). RELNOTES: None. PiperOrigin-RevId: 159827038
* Make Metadata fields privateGravatar ulfjack2017-06-22
| | | | | | | | | | | | | Adjust the interface of Metadata to match the interface of FileArtifactValue. These classes are almost the same, but not quite, so we currently have to create and return new objects whenever the MetadataHandler is called; by making the interfaces identical, we can just return a FileArtifactValue instead (in a future change). This is in preparation for merging the ActionInputFileCache and MetadataHandler interfaces. PiperOrigin-RevId: 159802834
* Fix source jars no longer being exposed to Skylark from java_library.Gravatar tomlu2017-06-22
| | | | | | | | | | Regression test added for java_library. Unfortunately, due to the nature of the skylark provider, similar regression tests should probably be added to every Java providing rule. In the long term, the better solution is to expose JavaProvider directly and remove JavaSkylarkApiProvider. Fixes #3238 PiperOrigin-RevId: 159748655
* Update testSpecialMandatoryProviderMissing to cover more casesGravatar vladmos2017-06-22
| | | | | | | | | The test didn't check for rules from the //external virtual package, that caused Bazel to be broken at some point: https://stackoverflow.com/questions/44398080/cc-grpc-library-for-bazel-0-5-1-fails-due-to-mandatory-files-to-run-provider-m/44671719 The original problem has been fixed in https://github.com/bazelbuild/bazel/commit/211a3ba2303c1df97383c810e17a031106c7271b. PiperOrigin-RevId: 159703445
* Change CAS URI to use the "bytestream" scheme instead of being scheme-lessGravatar ulfjack2017-06-22
| | | | | | This makes the URIs absolute, which makes them easier to process server-side. PiperOrigin-RevId: 159694335
* Allow "[", "]", "{", and "}" in globs in BUILD files. (#3048)Gravatar Jonathan Bluett-Duncan2017-06-22
| | | | | | | | | | | | PR #2679 allowed parentheses ("(" and ")") in globs, but other bracket style characters were not allowed at the time. It was decided in issues #2583 and #3048 that other bracket characters should be allowed as well, since there is no apparent historical reason for disallowing them in the first place. Closes #3166. PiperOrigin-RevId: 159691498
* Use getopt to parse process-wrapper's command-line.Gravatar philwo2017-06-22
| | | | | | | | This will allow us to add new and optional flags like selecting a strategy used to spawn / wait for the child process. No one except Bazel should be calling "process-wrapper" and I couldn't find any references, so this breaking change should be fine. PiperOrigin-RevId: 159685867
* Introduce --incompatible_depset_is_not_iterableGravatar laurentlb2017-06-21
| | | | | | | RELNOTES: Iterating on a `depset` object is deprecated. If you need an iterable, call the `.to_list()` method first. PiperOrigin-RevId: 159672887
* ActionMetadataHandler: proper metadata even for the volatile workspace statusGravatar ulfjack2017-06-21
| | | | | | | | | | | | | | This is part of cleaning up the ActionInputFileCache / MetadataHandler split. Both classes generally store and return identical information, except the MetadataHandler lies about constant metadata artifacts. Instead of lying here, update the ActionCacheChecker, which is the only place where we actually want constant metadata. Additionally, remove getMetadataMaybe; again, the only caller that needs special casing is the ActionCacheChecker, so we move the special casing there instead of having it in the MetadataHandler. PiperOrigin-RevId: 159665345
* Fix Android data binding for rules with no direct resources.Gravatar gregce2017-06-21
| | | | | | | | | | | | | | This essentially works by activating the annotation processor over such rules, even though technically that's unnecessary (since there are no new resources to process). But running the annotation processor guarantees we still process deps' resources, which guarantees the Java compiler references any Java classes mentioned in those resources. This prevents JavaBuilder's ---reduce_classpath from pruning these files out of the compilation classpath because "they were never used". PiperOrigin-RevId: 159597671
* Introduce is_cc_test build variable so we can migrate away from ↵Gravatar hlopko2017-06-20
| | | | | | | | | | | | | is_not_cc_test_link_action If only hlopko@ used brain when he introduced is_not_cc_test_link_action he would realize that the current values make it impossible to migrate away from them. This cl introduces new build variable with boolean value. Then I can update internal crosstools to use expand_if_true/false, and then I can remove is_not_cc_test_link_action. RELNOTES: None. PiperOrigin-RevId: 159549814
* Extract ImmutableSharedKeysMap class from TransitiveInfoProviderMap.Gravatar Googler2017-06-20
| | | | PiperOrigin-RevId: 159498323
* Adding support for SHA256 for remote execution. Switch remote execution to useGravatar olaola2017-06-20
| | | | | | | | | the currently defined hash function for blobs. Some refactoring. Adding an option to set the hash function in the remote worker, defaulting to the current behavior (unfortunately it is a build option, have not found a clean way to specify it at runtime). BUG=62622420 TESTED=remote worker RELNOTES: none PiperOrigin-RevId: 159473116
* Rule functions should return None instead of internal Rule objectsGravatar vladmos2017-06-20
| | | | PiperOrigin-RevId: 159438112
* Move some Skylark tests out of Java.Gravatar laurentlb2017-06-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 159436969
* Extract ActionContext to a top-level classGravatar ulfjack2017-06-19
| | | | PiperOrigin-RevId: 159423459
* Make equality, comparison and 'in' operators not associative.Gravatar laurentlb2017-06-19
| | | | | | | | | | | | I'm not using a --incompatible-change flag because it's not available in the parser. We could pass it, but I think this is trivial to fix and unlikely to happen in real code (if it does, there was most likely a bug). RELNOTES[INC]: Operators for equality, comparison, 'in' and 'not in' are no longer associative, e.g. x < y < z is now a syntax error. Before, it was parsed as: (x < y) < z. PiperOrigin-RevId: 159422042
* Rewrite the Executor/ActionExecutionContext splitGravatar ulfjack2017-06-19
| | | | | | | Move everything to ActionExecutionContext, and drop Executor whereever possible. This clarifies the API, makes it simpler to test, and simplifies the code. PiperOrigin-RevId: 159414816
* Close file handles in ActionCache before bazel cleanGravatar Yun Peng2017-06-19
| | | | | | | Fixed https://github.com/bazelbuild/bazel/issues/3043 Change-Id: Ibbe6ba945bbd439cd84676fcb7fd7ecbbb99e5f0 PiperOrigin-RevId: 159261292