aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
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 option to disable critical path computation in Bazel. While this ↵Gravatar janakr2017-03-31
| | | | | | | | | | information is useful, the critical path computer retains references to objects that could otherwise be cleared to save memory. This change is probably not worth submitting on its own -- the benefit it provides is too slight. But my follow-up change unknown commit needs this option to be effective -- the critical path currently hangs on to references to every action in the graph, so we can't drop references to actions if it's enabled. The critical path could probably be reworked in the future to not hang onto those references. PiperOrigin-RevId: 151747605
* 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
* Small documentation fix.Gravatar Googler2017-03-31
| | | | | | RELNOTES: none PiperOrigin-RevId: 151746179
* 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
* Improve glob prefetching performance by providing a more realistic environment.Gravatar laurentlb2017-03-31
| | | | | | | | | | | | That means the prefetching execution is more similar to the real execution, it will fetch more globs and throw less exceptions. In the code path, one exception was thrown for almost each statement. With this change, many BUILD files can be evaluated without an exception. RELNOTES: None. PiperOrigin-RevId: 151740684
* Add workspace_file and workspace_file_content attributes to ↵Gravatar jcater2017-03-31
| | | | | | | | new_foo_repository rules. Change-Id: Iadcc24bb2a207126cec9aa31faba6d76ee80da41 PiperOrigin-RevId: 151739968
* 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
* Make apkbuilder attribute of android_sdk optional.Gravatar ajmichael2017-03-31
| | | | | | | | This change is one step towards removing --nouse_singlejar_apkbuilder. RELNOTES: None PiperOrigin-RevId: 151730390
* Change the tag experimental_testrunner into a couple of flags.Gravatar kush2017-03-31
| | | | | | | | | | | | | | | Note 1) Explanation of the flags: --explicit_java_test_deps: This is a flag independent of the others, and forces users to specify the JUnit deps. We should try to make this flag default to true in a future release, irrespective of the work around persistent java tests. --experimental_testrunner: Bazel-only flag affecting switching from the BazelTestRunner to the ExperimentalTestRunner which will run the tests in a separate classloader. --explicit_java_test_deps is desired for this to ensure once we split the classpaths of the TestRunner and the TestTarget, the TestTarget does not hit a ClassNotFoundException, due to missing JUnit deps. --test_strategy=experimental_worker: This is the existing flag, which in turn depends on --experimental_testrunner flag, since only the ExperimentalTestRunner is capable to running java tests persistently. Note 2) There was no clean way to check for the flags defined in JavaOptions within TestActionBuilder (as I was checking the "tag=experimental_testrunner" before), without making TeasActionBuilder's build rules depend on java rules (yikes!). Hence, I created a new method compatibleWithStrategy() within each fragment, so I could check if WorkerTestStrategy could be compatible with the user specified flags. Thanks to Greg for suggesting this approach! RELNOTES: None PiperOrigin-RevId: 151729869
* Remove some unused bookkeeping things about the no-longer-existent PackageCache.Gravatar nharmata2017-03-31
| | | | | | RELNOTES: None PiperOrigin-RevId: 151729291
* Also report starting times of test actionsGravatar aehlig2017-03-31
| | | | | | | | | Record the starting times of test actions, so that they can be reported in the build event protocol. Change-Id: I28e8d7d6ad39d91f4ffdd8a6161a5fc30f9a39b8 PiperOrigin-RevId: 151724760
* Suffix fingerprint of iterable with lengthGravatar michajlo2017-03-31
| | | | | | | This should be morally equivalent to prefixing, with the benefit that we won't prematurely expand NestedSets (not cheap) to get the length. PiperOrigin-RevId: 151721361
* Modify AndroidSemantics#addMainDexListActionArguments to take proguard map ↵Gravatar Googler2017-03-31
| | | | | | | | | | as argument. This is needed because which proguard map that gets added as an argument to mainDexListAction depends on whether or not Rex is enabled RELNOTES: None PiperOrigin-RevId: 151720305
* 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
* Bazel client: simplify ReadDirectorySymlinkGravatar laszlocsomor2017-03-31
| | | | | | | | | | | | | | | This is a bugfixed version of https://cr.bazel.build/9520 which broke some Google-internal tests. This change allows removing duplicate code: ReadDirectorySymlink was implemented on Windows as a junction resolver, which is also implemented in file_windows.cc. Now it uses the JunctionResolver. RELNOTES: none PiperOrigin-RevId: 151691895
* 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
* Actually clear the per-build syscall cache after loading. Setting it to null ↵Gravatar janakr2017-03-31
| | | | | | doesn't work because the PackageFactory keeps a reference to it. PiperOrigin-RevId: 151632473
* 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
* 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
* fix typo in Bazel documentationGravatar steren2017-03-29
| | | | PiperOrigin-RevId: 151574562
* 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
* Bazel client, Windows: fix version check []Gravatar laszlocsomor2017-03-29
| | | | | | | GetVersionEx is discouraged by MSDN, so use the recommended method to check the Windows version. PiperOrigin-RevId: 151553827
* Stop returning JavaSourceJarsProvider from java_libraryGravatar elenairina2017-03-29
| | | | | | since it's already returned via JavaProvider. PiperOrigin-RevId: 151550286
* Add JavaRunfilesProvider to JavaProvider.Gravatar elenairina2017-03-29
| | | | PiperOrigin-RevId: 151547892
* 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
* Remove configurability of abrupt exit code behavior.Gravatar ccalvarin2017-03-29
| | | | | | | | Ability to configure this was added to provide an easy correction in case writing the exit code to a file proved problematic. This feature has been out for 3 months with no reported issues, no reason to keep the extraneous flag. PiperOrigin-RevId: 151496431
* Log the server pid to java logging.Gravatar janakr2017-03-29
| | | | PiperOrigin-RevId: 151489034
* 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
* Actions arising from experimental_objc_library in opt mode do not use "-g0" ifGravatar cpeyser2017-03-29
| | | | | | --apple_generate_dsym is set, as in the legacy case. PiperOrigin-RevId: 151468688
* Apple binary configures actions not just with it's child's config and provider,Gravatar Cal Peyser2017-03-28
| | | | | | | | but also its toolchain. -- PiperOrigin-RevId: 151444602 MOS_MIGRATED_REVID=151444602
* Dump the classpaths in a separate file and read the classpaths from that ↵Gravatar Kush Chakraborty2017-03-28
| | | | | | | | | | file, so that each test run can have the latest version of the Classpaths. This does not tackle the case where runfiles are not present, such as windows. -- PiperOrigin-RevId: 151440999 MOS_MIGRATED_REVID=151440999
* Refactor simple distributed caching support Gravatar Alpha Lam2017-03-28
| | | | | | | | | | | | | | | | | | | The simple distributed caching in Bazel used ConcurrentMap as a blob store. It is incorrect to use an overloaded interface for this purpose. This change defines a SimpleBlobStore interface that only has put(), get() and containsKey() methods and allows a simple implementation of a blob store as remote cache for Bazel. Also updated documentation to summarize the options available in the remote spwan strategy. There is no functional change. TESTED=shell integration tests -- Change-Id: Iedff0bc4f06c4a93c398c53801014d998c3df13b Reviewed-on: https://cr.bazel.build/9330 PiperOrigin-RevId: 151439467 MOS_MIGRATED_REVID=151439467
* Bazel client, Windows: path casing bugfixes Gravatar László Csomor2017-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | Change blaze::ConvertPath to lower-case its result for sake of deterministic comparison later. Change blaze::CompareAbsolutePaths to call blaze::ConvertPath before comparison. The ConvertPath method normalizes its input then converts it to lowercase, meaning ConvertPath("c:/Foo") and ConvertPath("C:\FOO\.") will give the same result. Thanks to this we will no longer kill the Bazel server if the --output_user_root changes but only in casing, or by adding/removing trailing slash/backslash. Fixes https://github.com/bazelbuild/bazel/issues/2714 -- Change-Id: I36c13378a9e3567862ee1c611f56b0c3ab465da8 Reviewed-on: https://cr.bazel.build/9517 PiperOrigin-RevId: 151425571 MOS_MIGRATED_REVID=151425571
* Description redacted.Gravatar Adam Michael2017-03-28
| | | | | | -- PiperOrigin-RevId: 151407958 MOS_MIGRATED_REVID=151407958
* Sign all android_binarys with both the v1 and v2 signature schemes by default.Gravatar Adam Michael2017-03-28
| | | | | | | | RELNOTES: All android_binarys are now signed with both Apk Signature V1 and V2. See https://source.android.com/security/apksigning/v2.html for more details. -- PiperOrigin-RevId: 151404899 MOS_MIGRATED_REVID=151404899
* 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
* BEP: Unconditionally report ExtraActions Gravatar Klaus Aehlig2017-03-28
| | | | | | | | | | | | ...irrespective of their success status. While a build typically contains too many successful actions to report them all, extra actions included in a build are worth reporting. -- Change-Id: I6b20935895aa7b16836d6271f456176a7113317e Reviewed-on: https://cr.bazel.build/9519 PiperOrigin-RevId: 151328633 MOS_MIGRATED_REVID=151328633