use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class ExtraActionSpec method getActionId.
/**
* Creates a unique id for the action shadowed by this extra_action.
*
* We need to have a unique id for the extra_action to use. We build this
* from the owner's label and the shadowed action id (which is only
* guaranteed to be unique per target). Together with the subfolder
* matching the original target's package name, we believe this is enough
* of a uniqueness guarantee.
*/
@VisibleForTesting
public static String getActionId(ActionOwner owner, Action action) {
Fingerprint f = new Fingerprint();
f.addString(owner.getLabel().toString());
ImmutableList<AspectDescriptor> aspectDescriptors = owner.getAspectDescriptors();
f.addInt(aspectDescriptors.size());
for (AspectDescriptor aspectDescriptor : aspectDescriptors) {
f.addString(aspectDescriptor.getDescription());
}
f.addString(action.getKey());
return f.hexDigestAndReset();
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class TestAction method computeKey.
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addPaths(Artifact.asSortedPathFragments(getOutputs()));
f.addPaths(Artifact.asSortedPathFragments(getMandatoryInputs()));
return f.hexDigestAndReset();
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class SymlinkTreeAction method computeKey.
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addString(GUID);
f.addInt(filesetTree ? 1 : 0);
return f.hexDigestAndReset();
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class FileWriteAction method computeKey.
/**
* Computes the Action key for this action by computing the fingerprint for
* the file contents.
*/
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addString(GUID);
f.addString(String.valueOf(makeExecutable));
f.addString(getFileContents());
return f.hexDigestAndReset();
}
use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.
the class SourceManifestAction method computeKey.
@Override
protected String computeKey() {
Fingerprint f = new Fingerprint();
f.addString(GUID);
f.addBoolean(runfiles.getLegacyExternalRunfiles());
f.addPath(runfiles.getSuffix());
Map<PathFragment, Artifact> symlinks = runfiles.getSymlinksAsMap(null);
f.addInt(symlinks.size());
for (Map.Entry<PathFragment, Artifact> symlink : symlinks.entrySet()) {
f.addPath(symlink.getKey());
f.addPath(symlink.getValue().getPath());
}
Map<PathFragment, Artifact> rootSymlinks = runfiles.getRootSymlinksAsMap(null);
f.addInt(rootSymlinks.size());
for (Map.Entry<PathFragment, Artifact> rootSymlink : rootSymlinks.entrySet()) {
f.addPath(rootSymlink.getKey());
f.addPath(rootSymlink.getValue().getPath());
}
for (Artifact artifact : runfiles.getArtifactsWithoutMiddlemen()) {
f.addPath(artifact.getRootRelativePath());
f.addPath(artifact.getPath());
}
return f.hexDigestAndReset();
}
Aggregations