aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp
Commit message (Collapse)AuthorAge
* 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
* LLVM FDO zipped profiles contain the LLVM raw profile file whose contentsGravatar Googler2017-06-27
| | | | | | | | | | | | | are named fdocontrolz_gen_profile.profraw. LLVM zipped profiles are obtained via fdocontrolz which names the raw profile file fdocontrol_gen_profile.profraw. Previously, this file was named to be identical to the zip file but that had to be changed as users want to retain the ability to rename the zip file. RELNOTES[NEW]: Change to handle LLVM FDO zipped profile contents correctly. PiperOrigin-RevId: 160230719
* 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 FakeCppCompileAction.LOG lowercaseGravatar hlopko2017-06-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 159811352
* Fix LIPO to ThinLTO mapping to work with AutoFDO.Gravatar Googler2017-06-22
| | | | | | | | LIPO to ThinLTO mapping was added in https://github.com/bazelbuild/bazel/commit/c61f86f56b86e442369725ad79299ccc5519b000. This fixes a bug to ignore lipo context when compiler is LLVM. RELNOTES:None PiperOrigin-RevId: 159776286
* Add back --sysroot argument for objc compile actions when grte_top is specified.Gravatar rduan2017-06-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 159740106
* Use tool from action_config for link-executable and link-dynamic-lib actionsGravatar hlopko2017-06-21
| | | | | | | | | | This cl finishes the last bit of c++ linking actions migration to crosstool's action_configs. From now on, the action_config { tool_path: ... } will be used, instead of top level tool { path: ... }. RELNOTES: Bazel now uses tools from action_configs in Crosstool by default (as oposed to using top level tools). PiperOrigin-RevId: 159677525
* 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 ActionContext to a top-level classGravatar ulfjack2017-06-19
| | | | PiperOrigin-RevId: 159423459
* 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
* Mitigate GC churn in module map file writes: No need to pin entire contents ↵Gravatar felly2017-06-16
| | | | | | in memory. Instead, write to the output stream incrementally. PiperOrigin-RevId: 159046844
* Map LIPO to ThinLTO when LLVM compiler is used.Gravatar Googler2017-06-14
| | | | | | | | | | | | This change maps LIPO to ThinLTO when a LLVM compiler is used for building, with a warning. This change is necessary for the following reason. The compiler team is planning to flip the default compiler from GCC to LLVM and this change will migrate all LIPO users of GCC to LLVM with ThinLTO + FDO (LIPO equivalent) without any changes to build scripts. RELNOTES[NEW]: LIPO maps to ThinLTO for LLVM builds. PiperOrigin-RevId: 158875330
* Add support for zipped LLVM profile files.Gravatar Googler2017-06-14
| | | | | | | | | | | | | | | | | | | This change is a follow-up to a recent change which allowed LLVM raw profile files to be directly used with blaze. This change allows zipped LLVM raw profile files. This uses //tools/zip:zipper to extract the zipped file contents. This also adds a new option to //tools/zip:zipper, 'j', to junk directories while unzipping. Tested: blaze test //devtools/blaze/integration:fdo_test blaze test //third_party/ijar/test:zip_test RELNOTES[NEW]: Zipped LLVM profiles are now supported. PiperOrigin-RevId: 158849516
* Also filter stderr when parse_showincludes feature is enabledGravatar Yun Peng2017-06-13
| | | | | | | | | | On Windows, cl.exe generates include information to stdout. But when using the cuda compiler(nvcc.exe) to invoke cl.exe, it's redirected to stderr. So we need to parse the output of stderr as well. Change-Id: I9a763a6eefa531932bf1077ef4155f6bda934240 PiperOrigin-RevId: 158842448
* Init absent action configs for CppCompile actionsGravatar hlopko2017-06-12
| | | | | | | | | | 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: 158715986
* Introduce CompileCommandLineBuilder and CompileCommandLineTestGravatar hlopko2017-06-12
| | | | | RELNOTES: NONE. PiperOrigin-RevId: 158703123
* Fix a bug in ShowIncludesFilter.javaGravatar Yun Peng2017-06-08
| | | | | | | | | | | | | | | | Don't flush when buffer is a prefix of SHOW_INCLUDES_PREFIX or sourceFileName eg. Since we are looking for a line starting with "Note: including file:", when buffer equals "Note: i", when should not flush the buffer, but wait until the whole line is read or we are sure they won't match. Also, we need to reset the buffer after write to out. Added test for ShowIncludesFilter.java Change-Id: I58ebd0bfd5a3e2c9973c8bd910e2e5b85a545c21 PiperOrigin-RevId: 158297616
* Make the error message when a file is not found in the profile zip more ↵Gravatar lberki2017-06-08
| | | | | | | indicative of the probable cause of the error. RELNOTES: None. PiperOrigin-RevId: 158286091
* PiperOrigin-RevId: 158274860Gravatar carmi2017-06-08
|
* Do not add archiver_flags feature when crosstool already has one.Gravatar hlopko2017-06-07
| | | | | | | This is needed for migrating one of the internal crosstools RELNOTES: None. PiperOrigin-RevId: 158176295
* Move ExecutionRequirements to the lib.actions packageGravatar ulfjack2017-06-06
| | | | | | | | | It was previously the odd-one out in lib.analysis.actions, due to other code that wanted to depend on it without pulling in all of analysis. However, it's needed to interpret Spawn instances, and Spawn lives in lib.actions, so it makes more sense to move it there, and remove the special-casing. PiperOrigin-RevId: 158116684
* Automated g4 rollforward of commit b71e99b1f3746103e5d6802eebc24096b3494959.Gravatar gregce2017-06-05
| | | | | | | | | | | | | | | | | | | | | | | | (Automated g4 rollback of commit de92f9d8ea093416fae999073bbfcf3cf501ab55). *** Reason for rollback *** The problems that forced commit de92f9d8ea093416fae999073bbfcf3cf501ab55 were fixed in commit e6392cd380fce14d719890c78d5eb2657e8a6cfc . *** Original change description being rolled forward *** Implement dynamically configured LIPO builds. Quick overview: - provide a dynamic interface for getting the artifact owner configuration - provide a (dynamic) RuleTransitionFactory LIPO_ON_DEMAND to replace the (static) RuleClass.Configurator LIPO_ON_DEMAND. Eventually we'll remove the rule class configurator interface entirely.... *** ROLLBACK_OF=156180015 PiperOrigin-RevId: 157865224
* Add .equals(), .hashCode() to EnableLipoTransition.Gravatar gregce2017-06-02
| | | | | | | | | | | | This fixes a subtle integration bug between PatchTransition, ConfiguredTargetFunction, and DependencyResolver. Short story: ConfiguredTargetFunction.getDynamicConfigurations assumes at most one <Attribute, Label, Transition> entry per configured target dep. DependencyResolver.dependentNodeMap faithfully supplies this by returning an OrderedSetMultimap<Attribute, Dependency>, where each Dependency is a <Label, Transition>. OrderedSetMultimap guarantees no <key, value> repeats, but if you have two semantically equal EnableLipoTransition instances that don't satisfy .equals(), deduping fails. Most PatchTransitions don't have this problem because they're singletons. But each EnableLipoTransition is instantiated with a Rule, so singletons don't work here. This problem can only happen when a rule has multiple instances of the same C++ dep under the same attribute. But this isn't actually possible for normal attributes like "deps" because they don't allow duplicates (see RuleClass#checkForDuplicateLabels). Only non-LABEL_LIST attributes can trigger this. PiperOrigin-RevId: 157733284
* Make C++ archiving use action_configs instead of hardcoded flagsGravatar hlopko2017-06-01
| | | | | RELNOTES: Use action_config in crosstool for static library archiving, remove ar_flag. PiperOrigin-RevId: 157685703
* Don't add -g0 as host copt when host platform is WindowsGravatar pcloudy2017-05-31
| | | | | RELNOTES: None PiperOrigin-RevId: 157578255
* Add FeatureSpecification.Gravatar hlopko2017-05-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 157450873
* Use FeatureConfiguration to compute value of CC_FLAGS make variableGravatar hlopko2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | This cl introduces new action_config type for Crosstool named 'generic'. This can be used to set the value of CC_FLAGS make variable using much more expressive mechanism (action_configs + features) than previous make_variable Crosstool messages. This has been requested by the C++ LPT. However, as FeatureConfiguration needs RuleContext, CC_FLAGS cannot be computed using configuration only anymore. Also, FeatureConfiguration is C++ rules specific class, and Bazel build-base cannot depend on it. Therefore we cannot use FeatureConfiguration for ExtraActions, for example. Because it cannot be made perfect, this cl is not updating all the possible places that expand make variables but limits the scope to: * genrule (the only widely used rule that often expands make variables) * *_test (CC_FLAGS is used by Tensorflow in the 'args' attribute) * cc_rules (people sometimes set 'copts' to something like: "-DCC_STRING=\\\"$(CC)\\\" -DCC_FLAGS_STRING=\"$(CC_FLAGS)\"" The long term plan is to use Skylark C++ API to get C++ command lines, so CC_FLAGS together with this inconsistent solution will be removed. RELNOTES: CC_FLAGS can be defined using 'generic' action_config in CROSSTOOL PiperOrigin-RevId: 157202883
* Automated g4 rollback of commit c4134802dd15d6ef5cca6521f6bf6aac395ee2ad.Gravatar kchodorow2017-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll forward of directory name change *** Original change description *** Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b. *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name 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: 156892980
* Don't de-duplicate linkopts from two different configured targets that have ↵Gravatar lberki2017-05-23
| | | | | | | the same value. RELNOTES: None. PiperOrigin-RevId: 156837699
* Fix ordering of -fPIC for PIC compiles in the LTOBackendActionGravatar Googler2017-05-23
| | | | | | | | | | For compiles that the CppConfiguration flags as needing PIC, the -fPIC option needs to be added after the other compile options so that it cannot be overridden (e.g. with a --copt). This is consistent with the way the CppCompileAction compile options are ordered. RELNOTES: None. PiperOrigin-RevId: 156746218
* Extract :cc_toolchain as constantGravatar hlopko2017-05-22
| | | | | | | | And while at it cleanup all the calls of CppHelper.getToolchain and CppHelper.getFdoSupport. RELNOTES: None. PiperOrigin-RevId: 156716291
* Automated g4 rollback of commit b71e99b1f3746103e5d6802eebc24096b3494959.Gravatar mstaib2017-05-17
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Causes crash bug in certain circumstances. *** Original change description *** Implement dynamically configured LIPO builds. Quick overview: - provide a dynamic interface for getting the artifact owner configuration - provide a (dynamic) RuleTransitionFactory LIPO_ON_DEMAND to replace the (static) RuleClass.Configurator LIPO_ON_DEMAND. Eventually we'll remove the rule class configurator interface entirely. This doesn't actually turn dynamic LIPO on. So the direct effect of this change should be a no-op. The flip will come in a followup change. For now, dynamic... PiperOrigin-RevId: 156180015
* Implement 'provides' for crosstool.Gravatar cpeyser2017-05-15
| | | | PiperOrigin-RevId: 156086443
* Remove methods from CommandLine, making it a simple argument list interface.Gravatar Googler2017-05-15
| | | | | | | * isShellCommand is now passed directly to SpawnAction * Getting the associated params file action was a test-only thing. We can pull this out of the action graph instead. PiperOrigin-RevId: 156060366
* Automated g4 rollback of commit 34fe247448a9be13fc41f93ac78a071ec157f434.Gravatar Googler2017-05-12
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward after fixing issues in http://b/38171368 *** Original change description *** Automated g4 rollback of commit 006a80425e7dd521634c5735d2730f40e9e82e06. *** Reason for rollback *** Need to roll this back as part of http://b/38171368 *** Original change description *** Make the cc_toolchain libc_top use the target configuration The removes redundancy from the logic around calculating the sysroot (and was been a TODO since 2014!) RELNOTES: None PiperOrigin-RevId: 155787049
* Automated g4 rollback of commit 6879d7ceff0e118fdecb0cabe5134979030b7cb8.Gravatar Googler2017-05-11
| | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Fixes memory issue that caused this CL to be rolled back. *** Original change description *** Automated g4 rollback of commit cbbb423663b154d82e3dfa5e9a56839583987999. *** Reason for rollback *** Need to roll this back as part of http://b/38171368 *** Original change description *** RELNOTES: Effectively remove sysroot from CppConfiguration and allow it to use select statements. PiperOrigin-RevId: 155651879
* Automated g4 rollback of commit cbbb423663b154d82e3dfa5e9a56839583987999.Gravatar Googler2017-05-10
| | | | | | | | | | | *** Reason for rollback *** Need to roll this back as part of http://b/38171368 *** Original change description *** RELNOTES: Effectively remove sysroot from CppConfiguration and allow it to use select statements. PiperOrigin-RevId: 155547813
* Automated g4 rollback of commit 006a80425e7dd521634c5735d2730f40e9e82e06.Gravatar Googler2017-05-10
| | | | | | | | | | | | | | | *** Reason for rollback *** Need to roll this back as part of http://b/38171368 *** Original change description *** Make the cc_toolchain libc_top use the target configuration The removes redundancy from the logic around calculating the sysroot (and was been a TODO since 2014!) RELNOTES: None PiperOrigin-RevId: 155545887
* Make the cc_toolchain libc_top use the target configurationGravatar Googler2017-05-09
| | | | | | | The removes redundancy from the logic around calculating the sysroot (and was been a TODO since 2014!) RELNOTES: None PiperOrigin-RevId: 155506682
* RELNOTES: Effectively remove sysroot from CppConfiguration and allow it to ↵Gravatar Googler2017-05-09
| | | | | | use select statements. PiperOrigin-RevId: 155480011
* Add dynamic config support for top-level configuration hooks.Gravatar gregce2017-05-05
| | | | PiperOrigin-RevId: 155223580
* Make TransitiveInfoMap interface narrower.Gravatar Googler2017-05-05
| | | | | | This constrains implementations less, allowing for greater freedom when optimizing. PiperOrigin-RevId: 155203001
* Give RuleContext the ability to add make variables.Gravatar lberki2017-05-05
| | | | | | This CL also makes CcToolchain responsible for adding the sysroot to CC_FLAGS. PiperOrigin-RevId: 155171725
* Make TransitiveInfoProviderMap an interface.Gravatar Googler2017-05-04
| | | | PiperOrigin-RevId: 155125357
* Implement dynamically configured LIPO builds.Gravatar gregce2017-05-04
| | | | | | | | | | | | | | | Quick overview: - provide a dynamic interface for getting the artifact owner configuration - provide a (dynamic) RuleTransitionFactory LIPO_ON_DEMAND to replace the (static) RuleClass.Configurator LIPO_ON_DEMAND. Eventually we'll remove the rule class configurator interface entirely. This doesn't actually turn dynamic LIPO on. So the direct effect of this change should be a no-op. The flip will come in a followup change. For now, dynamic LIPO can be triggered with --experimental_dynamic_configs=notrim. PiperOrigin-RevId: 155096056
* Cleanup SolibSymlinkAction: "target" is never null, and no need to ↵Gravatar felly2017-05-04
| | | | | | | re-implement what we get for free in the base class. RELNOTES: None PiperOrigin-RevId: 155080289
* Add patch transitions for DATA -> TARGET and LIPO_COLLECTOR -> TARGET.Gravatar gregce2017-05-04
| | | | | | | | | EnableLipoTransition provides the dynamic equivalent for LIPO_ON_DEMAND. ContextCollectorOwnerTransition provides the ability to get the "owner" configuration from the LIPO collector configuration. PiperOrigin-RevId: 155079187
* BuildOptions cleanup:Gravatar gregce2017-05-04
| | | | | | | | | | | | | | | | | | | | | 1) Remove obsolete originalOptions field. This was originally added to support "parent" transitions, which supported config1 -> config2 -> config1 transitions by having config2 store config1's options. The purpose of this feature was to support LIPO (which has a DATA -> TARGET transition). But https://github.com/bazelbuild/bazel/commit/ff29c0b39cf936a2699b05edd54f483f1a037d93 makes this unnecessary. 2) Support the "disable actions" feature of the LIPO context collector configuration. Putting this in BuildOptions make this dynamic config-compatible. This change intentionally doesn't add disableOptions to BuildOptions.equals() or BuildOptions.hashCode(). It'd be great to do that. But that has semantic consequences. And we've run into really tricky bugs in the past with dynamic configurations and BuildOptions.equals / BuildConfiguration.equals. So it's best to experiment with that in its own change. PiperOrigin-RevId: 154999718
* Make SkyKey an interface, and start the migration of not creating SkyKey ↵Gravatar janakr2017-05-04
| | | | | | wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries. PiperOrigin-RevId: 154989520
* Automated g4 rollback of commit ce33ab7a49126a513d7d5a6bc16f86154d9a85b6.Gravatar plf2017-05-03
| | | | PiperOrigin-RevId: 154931201