File tree 1 file changed +13
-1
lines changed
src/main/java/com/google/devtools/build/lib/rules/nativedeps
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,19 @@ public static NativeDepsRunfiles createNativeDepsAction(
293
293
}
294
294
295
295
/**
296
- * Returns the path of the shared native library. The name must be generated based on the
296
+ * This method facilitates sharing C++ linking between multiple test binaries.
297
+ *
298
+ * <p>The theory is that since there are generally multiple test rules that test similar
299
+ * functionality, their native dependencies must be exactly the same and therefore running C++
300
+ * linking for each binary is wasteful.
301
+ *
302
+ * <p>The way this method gets around that is by computing a file name that depends on the
303
+ * contents of the eventual shared library (but not on the rule it is generated for). Test actions
304
+ * put their native dependencies at this place, so if multiple test rules have the same
305
+ * dependencies it will be a shared action and therefore be executed only once instead of once per
306
+ * test rule.
307
+ *
308
+ * <p>Returns the path of the shared native library. The name must be generated based on the
297
309
* rule-specific inputs to the link actions. At this point this includes order-sensitive list of
298
310
* linker inputs and options collected from the transitive closure and linkstamp-related artifacts
299
311
* that are compiled during linking. All those inputs can be affected by modifying target
You can’t perform that action at this time.
0 commit comments