Search in sources :

Example 21 with Fingerprint

use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.

the class TemplateExpansionAction method computeKey.

@Override
protected String computeKey() {
    Fingerprint f = new Fingerprint();
    f.addString(GUID);
    f.addString(String.valueOf(makeExecutable));
    f.addString(template.getKey());
    f.addInt(substitutions.size());
    for (Substitution entry : substitutions) {
        f.addString(entry.getKey());
        f.addString(entry.getValue());
    }
    return f.hexDigestAndReset();
}
Also used : Fingerprint(com.google.devtools.build.lib.util.Fingerprint)

Example 22 with Fingerprint

use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.

the class ParameterFileWriteAction method computeKey.

@Override
protected String computeKey() {
    Fingerprint f = new Fingerprint();
    f.addString(GUID);
    f.addString(String.valueOf(makeExecutable));
    f.addString(type.toString());
    f.addStrings(commandLine.arguments());
    return f.hexDigestAndReset();
}
Also used : Fingerprint(com.google.devtools.build.lib.util.Fingerprint)

Example 23 with Fingerprint

use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.

the class PopulateTreeArtifactAction method computeKey.

@Override
protected String computeKey() {
    Fingerprint f = new Fingerprint();
    f.addString(GUID);
    f.addString(getMnemonic());
    f.addStrings(spawnCommandLine());
    f.addPaths(zipper.getRunfilesSupplier().getRunfilesDirs());
    List<Artifact> runfilesManifests = zipper.getRunfilesSupplier().getManifests();
    f.addInt(runfilesManifests.size());
    for (Artifact manifest : runfilesManifests) {
        f.addPath(manifest.getExecPath());
    }
    return f.hexDigestAndReset();
}
Also used : Fingerprint(com.google.devtools.build.lib.util.Fingerprint) Artifact(com.google.devtools.build.lib.actions.Artifact) TreeFileArtifact(com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)

Example 24 with Fingerprint

use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.

the class SpawnAction method computeKey.

@Override
protected String computeKey() {
    Fingerprint f = new Fingerprint();
    f.addString(GUID);
    f.addStrings(argv.arguments());
    f.addString(getMnemonic());
    // We don't need the toolManifests here, because they are a subset of the inputManifests by
    // definition and the output of an action shouldn't change whether something is considered a
    // tool or not.
    f.addPaths(getRunfilesSupplier().getRunfilesDirs());
    ImmutableList<Artifact> runfilesManifests = getRunfilesSupplier().getManifests();
    f.addInt(runfilesManifests.size());
    for (Artifact runfilesManifest : runfilesManifests) {
        f.addPath(runfilesManifest.getExecPath());
    }
    f.addStringMap(getEnvironment());
    f.addStrings(getClientEnvironmentVariables());
    f.addStringMap(getExecutionInfo());
    return f.hexDigestAndReset();
}
Also used : Fingerprint(com.google.devtools.build.lib.util.Fingerprint) Artifact(com.google.devtools.build.lib.actions.Artifact)

Example 25 with Fingerprint

use of com.google.devtools.build.lib.util.Fingerprint in project bazel by bazelbuild.

the class SymlinkAction method computeKey.

@Override
protected String computeKey() {
    Fingerprint f = new Fingerprint();
    f.addString(GUID);
    // We don't normally need to add inputs to the key. In this case, however, the inputPath can be
    // different from the actual input artifact.
    f.addPath(inputPath);
    return f.hexDigestAndReset();
}
Also used : Fingerprint(com.google.devtools.build.lib.util.Fingerprint)

Aggregations

Fingerprint (com.google.devtools.build.lib.util.Fingerprint)38 Artifact (com.google.devtools.build.lib.actions.Artifact)9 IOException (java.io.IOException)6 Map (java.util.Map)6 PathFragment (com.google.devtools.build.lib.vfs.PathFragment)5 RepositoryFunctionException (com.google.devtools.build.lib.rules.repository.RepositoryFunction.RepositoryFunctionException)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 Rule (com.google.devtools.build.lib.packages.Rule)2 InputStream (java.io.InputStream)2 TreeMap (java.util.TreeMap)2 Nullable (javax.annotation.Nullable)2 Test (org.junit.Test)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1 TreeFileArtifact (com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)1 BlazeDirectories (com.google.devtools.build.lib.analysis.BlazeDirectories)1 RunUnder (com.google.devtools.build.lib.analysis.config.RunUnder)1 MavenServerRule (com.google.devtools.build.lib.bazel.rules.workspace.MavenServerRule)1 AspectDescriptor (com.google.devtools.build.lib.packages.AspectDescriptor)1 NoSuchThingException (com.google.devtools.build.lib.packages.NoSuchThingException)1