From 0f4260bf916d70457f358a1f1dfbbd55d4c4b04c Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 16 Dec 2016 11:30:38 +0000 Subject: Add option to dynamically link in the compilation output of cc_test and cc_binary if we are doing dynamic linking anyway. The additional option is only for a smooth rollout and will go away once everything works as expected. The benefit is in an incremental save-build-test-cycle. When editing a test (or any of it's transitive headers), the linker input currently changes, meaning we need to do the full link again before the test can run. However, in conjunction with the option --interface_shared_objects, this actually isn't necessary. With this new option, the test source gets compiled into a .so file and while that file changes with each source change, the .ifso file often does not change. Thus, the costly link linking to gether all the .so and .ifso files can be retrieved from cache. Thus, this change should remove this linking step from the critical path of many save-build-test-cycles. -- PiperOrigin-RevId: 142244352 MOS_MIGRATED_REVID=142244352 --- .../java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java index 54be53e229..d7d2e7a08a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java @@ -274,10 +274,12 @@ public abstract class CcLibrary implements RuleConfiguredTargetFactory { .addProviders(info.getProviders()) .addSkylarkTransitiveInfo(CcSkylarkApiProvider.NAME, new CcSkylarkApiProvider()) .addOutputGroups(info.getOutputGroups()) - .add(InstrumentedFilesProvider.class, instrumentedFilesProvider) - .add(RunfilesProvider.class, RunfilesProvider.withData(staticRunfiles, sharedRunfiles)) + .addProvider(InstrumentedFilesProvider.class, instrumentedFilesProvider) + .addProvider( + RunfilesProvider.class, RunfilesProvider.withData(staticRunfiles, sharedRunfiles)) // Remove this? - .add(CppRunfilesProvider.class, new CppRunfilesProvider(staticRunfiles, sharedRunfiles)) + .addProvider( + CppRunfilesProvider.class, new CppRunfilesProvider(staticRunfiles, sharedRunfiles)) .addOutputGroup( OutputGroupProvider.HIDDEN_TOP_LEVEL, collectHiddenTopLevelArtifacts(ruleContext, info.getCcCompilationOutputs())) -- cgit v1.2.3