Skip to content

Commit

Permalink
Add comments about "native deps".
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 413663203
  • Loading branch information
lberki authored and copybara-github committed Dec 2, 2021
1 parent 40c69ed commit a9573be
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,19 @@ public static NativeDepsRunfiles createNativeDepsAction(
}

/**
* Returns the path of the shared native library. The name must be generated based on the
* This method facilitates sharing C++ linking between multiple test binaries.
*
* <p>The theory is that since there are generally multiple test rules that test similar
* functionality, their native dependencies must be exactly the same and therefore running C++
* linking for each binary is wasteful.
*
* <p>The way this method gets around that is by computing a file name that depends on the
* contents of the eventual shared library (but not on the rule it is generated for). Test actions
* put their native dependencies at this place, so if multiple test rules have the same
* dependencies it will be a shared action and therefore be executed only once instead of once per
* test rule.
*
* <p>Returns the path of the shared native library. The name must be generated based on the
* rule-specific inputs to the link actions. At this point this includes order-sensitive list of
* linker inputs and options collected from the transitive closure and linkstamp-related artifacts
* that are compiled during linking. All those inputs can be affected by modifying target
Expand Down

0 comments on commit a9573be

Please sign in to comment.