aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
Commit message (Collapse)AuthorAge
* Build android_binary APKs with Singlejar by default.Gravatar ajmichael2017-03-31
| | | | | | | | | This will improve android_binary build times and allow Bazel to remove a dependency on our forked version of the deprecated ApkBuilderMain. RELNOTES: None PiperOrigin-RevId: 151749709
* Add the config_feature_flag rule.Gravatar mstaib2017-03-31
| | | | | | | | | | | | | | This rule allows users to define flags as part of the Bazel configuration. These flags will be select-able through a new attribute on config_setting, and settable through transitions within certain special rules. This rule is currently not supported by any other rules, not even config_setting, and its values cannot be set; accordingly, it's not very useful yet. RELNOTES: None. PiperOrigin-RevId: 151746523
* Add ctx.experimental_new_directory (undocumented) to create tree artifacts ↵Gravatar allevato2017-03-31
| | | | | | | | in Skylark. RELNOTES: None. PiperOrigin-RevId: 151744710
* Automated g4 rollback of commit 05300b5945286f6063afbf1d16c9c8e5621c4828.Gravatar jmmv2017-03-31
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks inclusion of C++ system headers. *** Original change description *** Extract --sysroot flag from blaze and move it into crosstool RELNOTES: None. PiperOrigin-RevId: 151742077
* Delete STRING_DICT_UNARYGravatar michajlo2017-03-31
| | | | | | | This isn't used anymore, it's the same as STRING_DICT, deleting so no one tries to use it. PiperOrigin-RevId: 151738915
* Watch for --no and --no_ flag name conflicts.Gravatar ccalvarin2017-03-31
| | | | | | | | | Prevent OptionsBases with conflicting names due to --no boolean flag aliases to successfully combine into parser. Also remove the comment about --no_ not being documented, since it has been documented since Bazel was open-sourced. PiperOrigin-RevId: 151738453
* Move ResourceFilter into AndroidConfigurationGravatar Googler2017-03-31
| | | | | | | | | Once the ResourceFilter object is in AndroidConfiguration, we can start tweaking it using dynamic configuration (next review). RELNOTES: none PiperOrigin-RevId: 151737284
* Expand Invocation FlagPolicies on expansion flags.Gravatar ccalvarin2017-03-31
| | | | | | | | For SetValue and UseDefault policies on expansion flags or flags with implicitRequirements, expand the policy into policy for each of its sub-flags. For SetValue, this addresses the issue with policies on expansion flags with overridable=true not actually letting user flags overrride the expansion. For UseDefault, this formalizes the behavior where UseDefault will wipe all user-provided flags that expand from a banned expansion flag, and will allow later work to guarantee that a later policy can override the expansion policy's subflags. Since expansion flags do not have value, break if the invocation policy uses AllowValue or DisallowValue on an expansion flag. PiperOrigin-RevId: 151718539
* Remove RuleContext from ResourceFilter stateGravatar Googler2017-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RuleContext object is not available when creating dynamic configuration transitions. Removing it from ResourceFilter's state allows us to work with ResourceFilter objects while creating those transitions. If we didn't do this, we'd need to seperate the rest of ResourceFilter's state into a seperate class so that we could work with it as part of doing dynamic configurations. In the next reviews, I'll start actually creating dynamic configurations based on ResourceFilter state. Also, create a withAttrsFrom method that can be used in dynamic configuration transitions, and generally migrate methods that work with attributes from RuleContext to AttributeMap when practical. To support these changes: No longer keep the parsed lists of FolderConfiguration and Density objects as fields of the ResourceFilter, instead, write functions that get them when needed. We want to have access to a RuleContext when we initialize them to avoid errors, and we don't have one in the withAttrsFrom method which will be called as part of transitioning with dynamic configurations. We no longer have those parsed lists to represent whether the object filters during execution or analysis, so replace them with a seperate enum field for filter behavior. Include a FILTER_IN_ANALYSIS_WITH_DYNAMIC_CONFIGURATION option, even though it won't fully be used until the dynamic configuration transition is taken advantage of in the next few reviews. RELNOTES: none PiperOrigin-RevId: 151715400
* Symlink output directories to the correct directory nameGravatar kchodorow2017-03-31
| | | | | | | | | | If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 151712384
* Extract --sysroot flag from blaze and move it into crosstoolGravatar hlopko2017-03-31
| | | | | | RELNOTES: None. PiperOrigin-RevId: 151688820
* Drop loading-phase values if --discard_analysis_cache is true and we're not ↵Gravatar janakr2017-03-31
| | | | | | keeping incremental state. PiperOrigin-RevId: 151639711
* Partial rollback of commit 5e1a420f1b385382a2df5359faf3ae773aa8d61e.Gravatar Googler2017-03-31
| | | | | | | | | | *** Reason for rollback *** Breaks tests that expected previous id generation order. RELNOTES: None. PiperOrigin-RevId: 151638886
* BuildView#getConfiguredTargetForTesting respects null transitions.Gravatar mstaib2017-03-31
| | | | | | | | RuleTransitionFactory#buildTransitionFor is @Nullable, but the SkyframeExecutor expects a non-null Transition. If the factory returns null, the SkyframeExecutor should be passed NONE, not null. PiperOrigin-RevId: 151615724
* Move more Android tools' tests into Bazel.Gravatar ajmichael2017-03-31
| | | | | | RELNOTES: None PiperOrigin-RevId: 151602497
* Make Bazel resilient to files in /sdk/system-images.Gravatar ajmichael2017-03-31
| | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/2739. RELNOTES: None PiperOrigin-RevId: 151592983
* Clone the remote execution implementation into a new classGravatar ulfjack2017-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new RemoteExecutionClient class only performs remote execution, and nothing else; all higher-level functions, local rety, etc. will live outside of the client. In order to add unit tests, I had to add another layer of indirection between the Grpc{RemoteExecutor,ActionCache} and GRPC, since GRPC generates final, non-mockable classes. While a testing approach that uses a fake server can also get some test coverage (as in GrpcActionCacheTest), it doesn't allow us to test the full range of bad things that can happen at the GRPC layer. The cloned implementation uses a single GRPC channel, as was recommended to me by Jakob, who worked on GRPC. A single channel should be sufficiently scalable, it's thread-safe, and it performs chunking internally. On the server-side, the requests from a single channel can be dispatched to a thread pool, so this should not be a blocker for server-side parallelism. I also changed it to throw an exception whenever anything bad happens - this makes it much more obvious if there's still bug in this code; the old code silently swallows many errors, falling back to local execution, which papers over many issues. Furthermore, we now return a RemoteExecutionResult to indicate whether the action ran at all (regardless of exit code), as well as the exit code. All in all, this implementation is closer to the production code we're using internally, although quite a few things are still missing. The cloned implementation is not hooked up to RemoteSpawnStrategy yet. It also does not support combining remote caching with local execution, but note that RemoteSpawnStrategy regressed in that respect and currently also does not support that mode. PiperOrigin-RevId: 151578409
* Init absent action configs for CppCompile actionsGravatar hlopko2017-03-29
| | | | | | | | | | | So far only link actions were initialized in CppLinkActionConfigs. This cl changes this class to also initialize CppCompile actions. This is needed for our ongoing work removing hard-coded flags from Bazel and moving them into Crosstool. RELNOTES: None. PiperOrigin-RevId: 151575045
* Resolve special provider names when checking for mandatory providersGravatar vladmos2017-03-29
| | | | | | | | | | If a rule requires a special provider that's (maybe) not provided explicitly but nevertheless available from a target, i.e. "files", the mandatory providers check should pass. Fixes #1490 PiperOrigin-RevId: 151571187
* Change print(artifact) to return "File" instead of "Artifact"Gravatar vladmos2017-03-29
| | | | | | | | | RELNOTES[INC]: Converting artifacts to strings and printing them now return "File" instead of "Artifact" to be consistent with the type name. Fixes #2715 PiperOrigin-RevId: 151563252
* Stop returning JavaSourceJarsProvider from java_libraryGravatar elenairina2017-03-29
| | | | | | since it's already returned via JavaProvider. PiperOrigin-RevId: 151550286
* Clear AspectValues when discarding analysis cache, along with ↵Gravatar janakr2017-03-29
| | | | | | | | ConfiguredTargetValues. Also clear transitive packages for both, even for top-level targets. This is not expected to save significant memory, but is expected to reduce the number of references to Packages, allowing them to be dropped more easily when discarding analysis cache and running in batch mode. PiperOrigin-RevId: 151508877
* Fix downloader so reset connections can resumeGravatar jart2017-03-29
| | | | | | RELNOTES: A downloader bug was fixed that prevented RFC 7233 Range connection resumes from working with certain HTTP servers PiperOrigin-RevId: 151508000
* Catch cases where exec fails before WaitForCompletionCommand starts.Gravatar mstaib2017-03-29
| | | | | | | | | | | | | | | | | It's possible for cases to happen where the BlazeCommandDispatcher fails before starting the WaitForCompletionCommand. In these cases, the test's command state handoff will never take place because no command state will be created to be handed off (obviously). This means that runIn will wait forever. Instead, if the command completes and the command state has still not been handed off, set an exception into the command state so that the test will fail without further troubles. RELNOTES: None. PiperOrigin-RevId: 151495494
* Add a disabled test that will be enabled once #2709 is fixed.Gravatar ajmichael2017-03-29
| | | | PiperOrigin-RevId: 151486661
* Split out the InvocationPolicy parser from the enforcer.Gravatar ccalvarin2017-03-29
| | | | | | The encapsulation was off, since the format in which we accept policy has nothing to do with how we then enforce the policy. PiperOrigin-RevId: 151471747
* DataSource FixesGravatar Googler2017-03-28
| | | | | | | | | | * Fix the overwrite algorithm to be handled entirely in the accumulators. * Improve the conflict error messages for attributes and simple values. * Refactor the UnwrittenDataSubject to top level for reuse. -- PiperOrigin-RevId: 151439084 MOS_MIGRATED_REVID=151439084
* A flag to control the outputs that cc_proto_library expects from proto-compiler.Gravatar Carmi Grushko2017-03-28
| | | | | | -- PiperOrigin-RevId: 151381769 MOS_MIGRATED_REVID=151381769
* Genrules only depend on the C++ toolchain if they have C++ make variables. Gravatar Greg Estren2017-03-28
| | | | | | | | | | e.g.: cmd = "$(CC) foo.cc > $@" Fixes #2729 -- PiperOrigin-RevId: 151369889 MOS_MIGRATED_REVID=151369889
* Rename ToolchainLookup rule to ToolchainType, to better explain the usage ofGravatar John Cater2017-03-28
| | | | | | | | | | | | | | | | | | | | the rule. Example: tools/newlang/BUILD: toolchain_type(name = "toolchain_type") Allows users to refer to //tools/newlang:toolchain_type when discussing the newlang toolchain. The previous usage: tools/newlang/BUILD: toolchain_lookup(name = "lookup") Lead to labels like //tools/newlang:lookup, which was unclear that each language's toolchain needs one unique instance of toolchain_(lookup|type). -- PiperOrigin-RevId: 151326827 MOS_MIGRATED_REVID=151326827
* Move -Wl,--gdb-index into crosstoolGravatar Marcel Hlopko2017-03-27
| | | | | | -- PiperOrigin-RevId: 151302418 MOS_MIGRATED_REVID=151302418
* introduce hidden flag to configure bytecode optimizersGravatar Kevin Bierhoff2017-03-27
| | | | | | -- PiperOrigin-RevId: 151170448 MOS_MIGRATED_REVID=151170448
* Stop setting -isystem for gcc builtin include directories.Gravatar Adam Michael2017-03-27
| | | | | | | | | | | Note that this is not quite a no-op. Setting -isystem puts these directories at the beginning of the search list, whereas not setting them results in them being near the end. However, this code is unnecessary and confusing and caused a bug with the clang toolchains so it is best to remove it. -- PiperOrigin-RevId: 151140445 MOS_MIGRATED_REVID=151140445
* Deja-vu: Using an ActionInputFileCache for SHA1 digests used with remote ↵Gravatar Ola Rozenfeld2017-03-27
| | | | | | | | | | | | | execution. If you're feeling like you've already seen this, that's correct, these were the exact contents of commit e860316559eac366d47923a8eb4b5489a661aa35... and then, on Nov 15, something unclear happened and the code disappeared! Perhaps it was the result of a faulty sync. In any case, nobody noticed, and the CL went in. It was later rolloed back and resubmitted, but the crucial code changes were gone. TESTED=local server with profiling for SHA1 specifically RELNOTES: n/a -- PiperOrigin-RevId: 151139685 MOS_MIGRATED_REVID=151139685
* Fix more cases of PathPackageLocator test flakiness on Windows due to ↵Gravatar John Cater2017-03-27
| | | | | | | | case-insensitive paths. -- PiperOrigin-RevId: 151137308 MOS_MIGRATED_REVID=151137308
* Unit tests respect top-level rule-class transitions.Gravatar Cal Peyser2017-03-27
| | | | | | -- PiperOrigin-RevId: 151129669 MOS_MIGRATED_REVID=151129669
* Un-rollback and fix bugs in resource density filteringGravatar Googler2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rollback of commit df366408188f0451bae9b2ed079c795a4beb2e2b. In addition to undoing the rollback of my previous change, fix the bugs it introduced and add tests for those bugs. Always ignore empty filters. Empty filters are always useless or counterproductive. Before the original change, empty filters as a single item within the list of filters (e.g., ["en", ""]) were ignored, but empty filters as a portion of a string in the list (e.g., ["en,"]) were not. I can't imagine any reason people would actually want the empty filter (if it were handled correctly, it would effectively tell Bazel to just ignore every other filter the user passed in). Since it makes more sense with the new code, represent the stringified filters as a list of strings, rather than a single string of comma-seperated values. Manually trim whitespace from each token. Before the original change, the code trimmed whitespace following commas (e.g., ["en, es"] -> ["en,es"]) but not otherwise. If we're allowing whitespace in filter strings anyway, there doesn't seem to be any reason to allow it in some places but not others. -- PiperOrigin-RevId: 151128685 MOS_MIGRATED_REVID=151128685
* Rollback of commit bd40871283a54268945dcb0c47c0326645ffda18.Gravatar Googler2017-03-24
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with the correct changes to the AndroidResourceMergingAction. Tested manually. *** Original change description *** Automated [] rollback of commit a58f245a4b40c0ef961b1f30d96b16a9349711c3. *** Reason for rollback *** broke over 100k targets, in the depot, see [] *** Original change description *** Move library R generation to a separate action, ensuring the merging happens off the java critical path. -- PiperOrigin-RevId: 151087737 MOS_MIGRATED_REVID=151087737
* Stop storing reverse deps to signal in BuildingState. Instead, re-use the ↵Gravatar Janak Ramakrishnan2017-03-24
| | | | | | | | | | | | | | reverseDepsToConsolidate field in InMemoryNodeEntry. As part of that, revamp our logic of how we store pending operations: store adds bare on initial evaluations, and checks bare on incremental evaluations and operations on done nodes. This should improve performance in two ways: BuildingState loses two fields, saving working memory intra-build. Storing pending reverse dep operations bare also saves memory intra-build. Note that neither of these changes helps resting memory state, only while a node is still evaluating. Because of this, we can simplify ReverseDepsUtil a bit, making ReverseDepsUtilImpl a static class, which it always wanted to be (what it really wants to be is a superclass of InMemoryNodeEntry, but I don't want to spend the object alignment bits). Finally, this makes it pretty tempting to get rid of BuildingState altogether on initial evaluations. We'd still keep DirtyBuildingState, but we could save another ~24 bytes by storing BuildingState's one remaining field, signaledDeps, directly inside InMemoryNodeEntry. -- PiperOrigin-RevId: 151048879 MOS_MIGRATED_REVID=151048879
* FlagSet.with_feature can be used to condition the application of the FlagSet ↵Gravatar Cal Peyser2017-03-24
| | | | | | | | on the presence of features. -- PiperOrigin-RevId: 151038811 MOS_MIGRATED_REVID=151038811
* Add new utility function to encode options as argument list Gravatar Klaus Aehlig2017-03-23
| | | | | | | | | | | ...in a way preserving the list structure and without escaping. In other words, return the options as needed for an execve(3) call. -- Change-Id: Ifb168d2e720392fb3a97d557960e0c1f1a83f543 Reviewed-on: https://cr.bazel.build/9458 PiperOrigin-RevId: 151019830 MOS_MIGRATED_REVID=151019830
* Remove provider safety check and make all old ctx objects featurelessGravatar Vladimir Moskva2017-03-23
| | | | | | | | | | | | It's now allowed to return anything from a rule implementation function. If a ctx object is returned it becomes featureless and cannot be used from anywhere else (i.e. from an implementation function of another rule). Fixes #2319 -- PiperOrigin-RevId: 151015919 MOS_MIGRATED_REVID=151015919
* Rollback of commit 1e18045ed9d6ab9c945cec69286a7d8bd288a507.Gravatar Tobias Werth2017-03-23
| | | | | | -- PiperOrigin-RevId: 151000602 MOS_MIGRATED_REVID=151000602
* Open source some Android tools' tests.Gravatar Adam Michael2017-03-23
| | | | | | -- PiperOrigin-RevId: 150881315 MOS_MIGRATED_REVID=150881315
* Add an optional coverage_files argument to cc_toolchainGravatar Googler2017-03-22
| | | | | | | | | | | | Allow toolchains to specify precisely the files required to run code coverage tools (e.g. gcov). If not specifed, default to the existing behaviour of supplying the whole crosstool. RELNOTES[NEW]: Optional coverage_files attribute to cc_toolchain -- PiperOrigin-RevId: 150878146 MOS_MIGRATED_REVID=150878146
* Enable SkylarkCallable methods to be used on ClassObjects.Gravatar Michael Staib2017-03-22
| | | | | | | | | | | | | | | Previously, ClassObjects' SkylarkCallable struct fields worked as expected (with values of the struct taking precedence), but calling methods annotated with SkylarkCallable did not work at all; methods were treated as if they were not present in the struct. This adds some tests for the various ways of looking up fields and methods, and rearranges the logic in FuncallExpression to allow for callable methods on SkylarkClassObject's descendants. -- PiperOrigin-RevId: 150876181 MOS_MIGRATED_REVID=150876181
* Filter android_binary resources by screen density in the analysis phaseGravatar Googler2017-03-22
| | | | | | | | | | | | | | In addition to filtering android_binary resources by resource_configuration_filters, we also filter by densities. Doing this in analysis rather than execution should also result in a speed-up as there's no need to copy files unwanted for actions to use. This behavior is controlled by the same object and flags that already control resource configuration filtering, simplifying the code. -- PiperOrigin-RevId: 150871620 MOS_MIGRATED_REVID=150871620
* Fix dir() on Targets with aspects applied.Gravatar Dmitry Lomov2017-03-22
| | | | | | -- PiperOrigin-RevId: 150869561 MOS_MIGRATED_REVID=150869561
* Add expansion functions to options parserGravatar Jon Brandvein2017-03-22
| | | | | | | | | | | | This provides a way to programmatically define expansions of options based on what other options are defined for the parser. In particular, it will be used for the --incompatible_* changes mechanism, to turn on all incompatible change flags. Expansion functions are specified in the @Option annotation, similar to converters. They are computed when an OptionsParser is constructed, and inspect a preliminary version of its OptionsData to determine the expansion result. This is then cached in the final OptionsData used by the parser. Expansion information for usage strings is available, but only when the usage strings are obtained via the parser. -- PiperOrigin-RevId: 150817553 MOS_MIGRATED_REVID=150817553
* Remove only-in-tests null checks in SkyframeActionExecutor.Gravatar Janak Ramakrishnan2017-03-22
| | | | | | | | Still on step -0.5, let's be honest. -- PiperOrigin-RevId: 150783638 MOS_MIGRATED_REVID=150783638