use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class NativeDepsHelper method getSharedNativeDepsPath.
/**
* 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 attributes (srcs/deps/stamp/etc). However, target build
* configuration can be ignored since it will either change output directory
* (in case of different configuration instances) or will not affect anything
* (if two targets use same configuration). Final goal is for all native
* libraries that use identical linker command to use same output name.
*
* <p>TODO(bazel-team): (2010) Currently process of identifying parameters that can
* affect native library name is manual and should be kept in sync with the
* code in the CppLinkAction.Builder/CppLinkAction/Link classes which are
* responsible for generating linker command line. Ideally we should reuse
* generated command line for both purposes - selecting a name of the
* native library and using it as link action payload. For now, correctness
* of the method below is only ensured by validations in the
* CppLinkAction.Builder.build() method.
*/
private static PathFragment getSharedNativeDepsPath(Iterable<Artifact> linkerInputs, Collection<String> linkopts, Iterable<Artifact> linkstamps, Iterable<Artifact> buildInfoArtifacts, Collection<String> features) {
Fingerprint fp = new Fingerprint();
for (Artifact input : linkerInputs) {
fp.addString(input.getExecPathString());
}
fp.addStrings(linkopts);
for (Artifact input : linkstamps) {
fp.addString(input.getExecPathString());
}
for (Artifact input : buildInfoArtifacts) {
fp.addString(input.getExecPathString());
}
for (String feature : features) {
fp.addString(feature);
}
return new PathFragment("_nativedeps/" + fp.hexDigestAndReset());
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class JavaCompileAction method computeKey.
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addString(GUID);
f.addStrings(commandLine.arguments());
return f.hexDigestAndReset();
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class InstrumentedFileManifestAction method computeKey.
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addString(GUID);
// Not sorting here is probably cheaper, though it might lead to unnecessary re-execution.
f.addStrings(Iterables.transform(files, TO_EXEC_PATH));
return f.hexDigestAndReset();
}
Aggregations