aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules
Commit message (Collapse)AuthorAge
* Expose [AndroidAssetsInfo].local_assets, [AndroidAssetsInfo].local_asset_dir ↵Gravatar Googler2018-05-24
| | | | | | | and [AndroidResourcesInfo].r_txt to Skylark. RELNOTES: none PiperOrigin-RevId: 197902129
* PiperOrigin-RevId: 197857419Gravatar plf2018-05-24
|
* For compilations with C++ modules, treat private headers (header files inGravatar Googler2018-05-23
| | | | | | | | | | | | | | | 'srcs') as textually included headers. A private header is never exported to a different module and thus cannot be used by a different module. We never need to compile a module just because one of it's private headers is used from somewhere else. There must be a different cc_library (and thus module) that exports the header. At the same time, being compiled into a module doesn't provide benefits for the compilation of that cc_library itself, because a module created for a cc_library A is never used when compiling any of A's srcs. PiperOrigin-RevId: 197846388
* Rename some instances of overloaded skylark-accessible methodsGravatar cparsons2018-05-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 197799961
* Simplify split transition semantics: noops now return the input build options.Gravatar gregce2018-05-23
| | | | | | This results in less special logic in the implementation and a simpler API. PiperOrigin-RevId: 197772283
* Rename PatchTransition.apply to PatchTransiton.patch.Gravatar gregce2018-05-23
| | | | | | | This unclashes with the incoming ConfigurationTransition.apply method described in https://docs.google.com/document/d/1_UJKmAQ9EE8i3Pl0il3YLTYr-Q9EKYYyLatt2zohfyM/edit#heading=h.96gongkwg852. PiperOrigin-RevId: 197769784
* Restrict module usage to C++ actions. Other actions don't support compilingGravatar Googler2018-05-23
| | | | | | | | using C++ modules (yet) and thus we are paying some of the cost such as building transitive modules and a taller critical path without reaping any benefits. PiperOrigin-RevId: 197768129
* Rename an AppleToolchain method to prevent overloading a skylark-exposed methodGravatar cparsons2018-05-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 197744356
* Remove FlagListGravatar hlopko2018-05-23
| | | | | | | This abstraction is not needed anymore. RELNOTES: None. PiperOrigin-RevId: 197739700
* Expose the runtime output jars in the JavaInfo provider to Skylark. This willGravatar Googler2018-05-23
| | | | | | | | | | the mobile-install aspect to pickup and desugar+dex only runtime jars without running a manual filter step (which breaks transitive_runtime_jars depset at every level). NOTE: The method that this one wraps was originially created for the native dex aspect which will eventually be migrated to Skylark too. PiperOrigin-RevId: 197739483
* C++: Expose additional methods for CcCompilationInfo and CcLinkingInfoGravatar plf2018-05-23
| | | | | | | This is needed for re-writing match_clif in Skylark. RELNOTES:none PiperOrigin-RevId: 197738067
* Stop passing RuleContext to all of the Android Data Skylark APIGravatar asteinb2018-05-23
| | | | | RELNOTES: none PiperOrigin-RevId: 197735344
* Move resource busybox actions to BusyBoxActionBuilder and AndroidDataContextGravatar asteinb2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | BusyBoxActionBuilder makes much cleaner action builders while making it harder to do Bad Things (like collapsing NestedSets in analysis, or adding an artifact to one of the command line and the inputs but not both). Also: - In merging, simplify the code somewhat by removing unneeded conditionals - for example, the parsed merging action will always be built given the current code. - In the few builders where we aren't doing so already, parameter files should always be shell quoted and always be used when the OS is Windows. The BusyBox should always support the former and require the latter (although sufficiently large inputs may have masked this by triggering parameter files in Windows anyway). - In the builder for linking (within validation), no longer collapse the NestedSet of transitiveCompiledSymbols when adding them to the inputs. Using the new BusyBoxActionBuilder code, trying to do this would throw an IllegalStateException. RELNOTES: none PiperOrigin-RevId: 197728382
* Rollforward of CL/197136304:Gravatar tomlu2018-05-23
| | | | | | | | | | | | | | Remove java support from proto_library. NEW: Allow java_* rules to depend on proto_libraries via runtime_deps and exports. This should avoid the breakage that caused the original rollback. The edges are no-ops and could be removed. *** Reason for rollback *** Targets in the repository are still able to depend on proto_library rules even after the --noemit_proto_java_outputs flag flip. Removal of the Java support from proto_library breaks them. PiperOrigin-RevId: 197725926
* Windows: Fix link parameter file for dynamic linkingGravatar pcloudy2018-05-23
| | | | | | | | Related issue: https://github.com/bazelbuild/bazel/issues/1013 Fix https://github.com/bazelbuild/bazel/issues/5243 RELNOTES: PiperOrigin-RevId: 197715690
* Add a flag to disallow LIPO to aid in the rollout of the removal of LIPO ↵Gravatar lberki2018-05-23
| | | | | | | support. RELNOTES: None. PiperOrigin-RevId: 197708692
* Rename CcRunfiles fields one more time to be perfectly accurate.Gravatar hlopko2018-05-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 197707463
* Migrate JavaInfo's provider to use the new provider pattern.Gravatar cparsons2018-05-22
| | | | | | | This dramatically improves documentation generation for JavaInfo and it makes it far more maintainable and extensible going forward. RELNOTES: None. PiperOrigin-RevId: 197619040
* Move non-resource busybox actions to BusyBoxActionBuilder and AndroidDataContextGravatar asteinb2018-05-22
| | | | | | | | | | | | | BusyBoxActionBuilder makes much cleaner action builders while making it harder to do Bad Things (like collapsing NestedSets in analysis, or adding an artifact to one of the command line and the inputs but not both). Remaining action builders will be moved in the next change. Add old manifest merger tool to AndroidDataContext. RELNOTES: none PiperOrigin-RevId: 197607155
* Add additional methods to BusyBoxActionBuilderGravatar asteinb2018-05-22
| | | | | | | | | | | | | Many of the Busybox action building classes rely heavily on RuleContext. While we're migrating them to AndroidDataContext, we may as well also move them to use the BusyBoxAxtionBuilder, which removes a lot of boilerplate and makes bad practices (like collapsing NestedSets) harder to do by accident. The BusyBoxActionBuilder needs some more methods to cover all the behavior seen in various action builders, so update it in one change now rather than scattering these changes across many different reviews. RELNOTES: none PiperOrigin-RevId: 197584157
* Rename staticRunfiles and dynamicRunfiles in CcRunfilesGravatar hlopko2018-05-22
| | | | | | | | New names are dynamicLibrariesForLinkingStatically and dynamicLibrariesForLinkindDynamically respsectively. RELNOTES: None. PiperOrigin-RevId: 197579028
* Pass AndroidDataContext to remaining non-ActionBuilder codeGravatar asteinb2018-05-22
| | | | | | | | | | | | Now that the AndroidDataContext is passed everywhere, we can begin modifying action builders. This includes removing Label information from Proguard artifact paths. getUniqueDirectoryArtifact() already included label earlier in the path, so this information was redundant anyway. RELNOTES: none PiperOrigin-RevId: 197576210
* Split user_link_flags from legacy_link_flagsGravatar hlopko2018-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The difference between them is that user_link_flags will stay after we remove legacy fields from the crosstool. This is an encore of https://github.com/bazelbuild/bazel/commit/2661abb96b1fe51fb726a63eb08698564a82eb20 after mitigating the memory regression. Original cl regressed 12mb (on a big enough internal project :): objsize chg instances space KB class name ------------------------------------------------------ 24 +0 190265 4459 KB com.google.common.collect.ImmutableMapEntry 40 +0 95154 3716 KB com.google.common.collect.RegularImmutableMap 47 -2 95154 2230 KB [Ljava.util.Map$Entry; 44 -1 95154 2230 KB [Lcom.google.common.collect.ImmutableMapEntry; 24 +0 95149 2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$MapVariables 16 +0 95149 1486 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$StringSequence 89 +0 3188 176 KB [B 64 -8 0 -743 KB com.google.devtools.build.lib.rules.cpp.LinkCommandLine 76 +0 -1918 -1323 KB [Ljava.lang.Object; 24 +0 -95149 -2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$SingleVariables ------------------------------------------------------ The reason was that before legacy_link_flags were the only build variable patched because of thinlto in CppLinkActionBuilder, so it used optimized SingleVariables subclass. With the split, the patched variables instance had 2 variables therefore it received the full blown Variables instance. That accounted for the ~7mb. The fix was to move the patching logic to the initial link variables creation and not to create patched variables at all. Now the regression is ~4.8mb, which is perfectly expected since I introduce another variable and this is the overhead of additional hashmap entry: objsize chg instances space KB class name ------------------------------------------------------ 24 +0 190418 4462 KB com.google.common.collect.ImmutableMapEntry 44 +1 31 1487 KB [Lcom.google.common.collect.ImmutableMapEntry; 16 +0 95149 1486 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$StringSequence 47 +0 31 744 KB [Ljava.util.Map$Entry; 89 +0 5723 315 KB [B 24 +0 5721 134 KB java.lang.String 64 -8 0 -743 KB com.google.devtools.build.lib.rules.cpp.LinkCommandLine 76 +0 -2387 -840 KB [Ljava.lang.Object; 24 +0 -95149 -2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$SingleVariables ------------------------------------------------------ I'll pay this dept back once we get rid of legacy crosstool fields (= removal of legacy_link_flags variable). RELNOTES: None. PiperOrigin-RevId: 197574153
* Remove special handling of SpawnActionContext in Executor/ActionExecContextGravatar ulfjack2018-05-22
| | | | | | | | Instead, internally look up the correct context by mnemonic. This simplifies all the callers. We still need a little bit of special casing when constructing the action context map. PiperOrigin-RevId: 197572357
* Pass AndroidDataContext through manifest processing methodsGravatar asteinb2018-05-22
| | | | | | | | | | | | | | | Manifest processing methods are particularly messy for this migration, since the old ApplicationManifest class is still around. Anyway, pass around AndroidDataContext instead of RuleContext everywhere we can. Note that the built-in expander does not seem able to be modified to support decoupling attributes and other information, and thus really can't be done once we get rid of RuleContext. Instead, for Skylark rules, document that expansion must happen outside of the Android data Skylark method calls (for example, for manifest_values and nocompress_extensions). RELNOTES: none PiperOrigin-RevId: 197567541
* Pass through AndroidDataContext in more placesGravatar asteinb2018-05-22
| | | | | | | | As before, actual action builders will be changed in a future CL; this just starts moving AndroidDataContext in so it's available. RELNOTES: none PiperOrigin-RevId: 197561737
* Pass AndroidDataContext through new asset and resource pipelinesGravatar asteinb2018-05-22
| | | | | | | | | | | | | | This is the first step towards using AndroidDataContext in all of Android data processing. This change does not actually modify the asset and resource processing action builders themselves - they will be migrated in an upcoming change. Also, add AndroidSemantics to some rules so they can make an AndroidDataContext. RELNOTES: none PiperOrigin-RevId: 197555938
* CROSSTOOL: Make C++ compiled and linked artifact name pattern configurableGravatar Yun Peng2018-05-22
| | | | | | | | | | | | This change makes Bazel respect artifact name patterns specified in CROSSTOOL. Users cannot specify any arbitrary name pattern, it must ends with allowed extensions. For example, for dynamic library, it can only ends with .so, .dylib or .dll, otherwise Bazel throws an error. Change-Id: I21d9e6fa7c3a282e1a9b8ff29679b00925cddb33 PiperOrigin-RevId: 197553413
* Create AndroidDataContext to wrap context needed when working with Android dataGravatar asteinb2018-05-22
| | | | | | | | | | | | | | | | | | | This new object wraps Label, ActionConstructionContext, and various data-related tools (currently, just the resource Busybox and the Android SDK). All three of these things are required for creating pretty much any action for working with Android assets, resources, and manifests, so it makes sense to pass them around together. Eventually, we'll use this class instead of RuleContext in any code called from the Skylark APIs. For now, though, just have it wrap a RuleContext - the migration away from that will happen in future changes. Change the current Skylark API to take this class, rather than a SkylarkRuleContext. This is the first step towards not passing RuleContext (or SkylarkRuleContext) into the Skylark API. RELNOTES: none PiperOrigin-RevId: 197549155
* Make SymlinkTreeAction properly use the configuration's environmentGravatar ulfjack2018-05-22
| | | | | | | | In particular, fix its use of client make variables. Fixes #4750. PiperOrigin-RevId: 197545415
* Rename CcLinkingOutputs.dynamicLibraries and executionDynamicLibrariesGravatar hlopko2018-05-22
| | | | | | | | | New names are dynamicLibrariesForLinking and dynamicLibrariesForRuntime respectively. This is just a cleanup to make the code more understandable. RELNOTES: None. PiperOrigin-RevId: 197535811
* Automated rollback of commit 7a71ce816bc8a67a63c2d147ac953ac451ebd23b.Gravatar jmmv2018-05-21
| | | | | | | | | | *** Reason for rollback *** Targets in the repository are still able to depend on proto_library rules even after the --noemit_proto_java_outputs flag flip. Removal of the Java support from proto_library breaks them. PiperOrigin-RevId: 197442659
* Set up only one link action for JavaBinary launcher with fissionGravatar Googler2018-05-21
| | | | | | | | | | | | | | | This is a fixed version of https://github.com/bazelbuild/bazel/commit/4ba134f008719a52c1f74dc070121017d0b08f44, along with new tests for the issue provoking the rollback. Original description: Change getLauncher to return both a stripped and unstripped launcher binary artifact under fission, instead of invoking getLauncher twice. This was setting up two identical link actions that required later work to filter out the redundant action in filterSharedActionsAndThrowActionConflict. This becomes extremely inefficient under ThinLTO, where each launcher link is actually 1 LTO indexing action, N LTO Backend actions, and 1 native link action. PiperOrigin-RevId: 197391873
* Partial rollback of commit 2661abb96b1fe51fb726a63eb08698564a82eb20.Gravatar hlopko2018-05-18
| | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks perf regtest *** Original change description *** Split user_link_flags from legacy_link_flags The difference between them is that user_link_flags will stay after we remove legacy fields from the crosstool. RELNOTES: None. PiperOrigin-RevId: 197180518
* Delete Java support from proto_library.Gravatar tomlu2018-05-18
| | | | | RELNOTES: None PiperOrigin-RevId: 197136304
* C++: Add more parameters to Skylark API needed for match_clifGravatar plf2018-05-18
| | | | | RELNOTES:none PiperOrigin-RevId: 197132493
* Add support of empty target to LateBoundAlias.Gravatar dbabkin2018-05-18
| | | | | RELNOTES:none PiperOrigin-RevId: 197132230
* Refactor artifact_name_pattern in CROSSTOOLGravatar pcloudy2018-05-18
| | | | | | | | Instead of using a string pattern, we replace it with a prefix and an extension. RELNOTES: NONE PiperOrigin-RevId: 197132215
* Support for ThinLTO to be enabled implicitly with FDOGravatar Googler2018-05-17
| | | | | | | | | | Allows for ThinLTO to be enabled once the --features=fdo_implicit_thinlto feature is enabled in the crosstool. Also allows for --features=-thin_lto to override and prevent ThinLTO from being enabled. This is essentially the same as https://github.com/bazelbuild/bazel/commit/8e3afccd8bea45105752ddeb33bde111c556fb8b but for instrumentation FDO instead of AFDO. RELNOTES: None. PiperOrigin-RevId: 197038710
* Rename CommandAction.getEnvironment, add AbstractAction.getEnvironmentGravatar ulfjack2018-05-17
| | | | | | | | | | | | | | | This is a cleanup to clarify the code. 1. The getEnvironment method in the CommandAction interface does not have access to the clientEnv, so it's return value is necessarily incomplete. Rename to getIncompleteEnvironmentForTesting. 2. Add a final getEnvironment method to AbstractAction, which returns the ActionEnvironment, which is intended to be a complete description of the intended final environment of the action (technically, of any spawn running within the action). This is not currently used, but is provided to prevent action subclasses to add such a method (it may be used in the future). PiperOrigin-RevId: 196991091
* Fix Cpp{Compile,Link}Action environment and cache key computationGravatar ulfjack2018-05-17
| | | | | | | | | | These were previously ignoring the inhertied environment, i.e., --action_env=PATH did _not_ result in the PATH variable being forwarded from the client environment. Fixes #5142. PiperOrigin-RevId: 196966822
* Automated rollback of commit 4ba134f008719a52c1f74dc070121017d0b08f44.Gravatar hlopko2018-05-17
| | | | | RELNOTES: None. PiperOrigin-RevId: 196953169
* Split user_link_flags from legacy_link_flagsGravatar hlopko2018-05-16
| | | | | | | | The difference between them is that user_link_flags will stay after we remove legacy fields from the crosstool. RELNOTES: None. PiperOrigin-RevId: 196940832
* Build support for passing a software cache prefetching hints file.Gravatar Googler2018-05-16
| | | | | | | | | This flag assumes llvm supports an experimental 'prefetch-hints-flag' flag. The Bazel support simply plumbs the provided file through to the compiler. The flag is independent from the other fdo_ flags, and may be applied in any combination with them. RELNOTES: Introduce build support for providing cache prefetch hints. PiperOrigin-RevId: 196916547
* Replace use of output_object_file with output_file in CROSSTOOLS.Gravatar hlopko2018-05-16
| | | | | RELNOTES: None. PiperOrigin-RevId: 196870840
* Make ImportDepsCheckingLevel.ERROR essentially the same as STRICT_ERROR, ↵Gravatar cnsun2018-05-16
| | | | | | | checking direct dependencies. RELNOTES: None. PiperOrigin-RevId: 196860008
* Enable manual trimming of config_feature_flags.Gravatar mstaib2018-05-16
| | | | | | | This enables users of config_feature_flags to specify the flags used by the transitive closure of a particular target in the transitive_configs attribute of all targets. It also adds a flag - --enforce_transitive_configs_for_config_feature_flag - which enforces this specification and uses it to trim the set of flags available to that target. RELNOTES: None. PiperOrigin-RevId: 196846092
* Add libc_top attribute to cc_toolchain in preparation for moving config data ↵Gravatar jcater2018-05-16
| | | | | | out of CppConfiguration. PiperOrigin-RevId: 196838680
* Support .afdo profiles in fdo_profileGravatar rosica2018-05-16
| | | | | RELNOTES: None. PiperOrigin-RevId: 196825564
* Expose local_proguard_specs to Skylark.Gravatar Googler2018-05-16
| | | | | RELNOTES: none PiperOrigin-RevId: 196824775