Search in sources :

Example 1 with Reply

use of com.google.devtools.build.lib.rules.cpp.CppCompileActionContext.Reply in project bazel by bazelbuild.

the class CppCompileAction method execute.

@Override
@ThreadCompatible
public void execute(ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException {
    setModuleFileFlags();
    Executor executor = actionExecutionContext.getExecutor();
    CppCompileActionContext.Reply reply;
    try {
        reply = executor.getContext(actionContext).execWithReply(this, actionExecutionContext);
    } catch (ExecException e) {
        throw e.toActionExecutionException("C++ compilation of rule '" + getOwner().getLabel() + "'", executor.getVerboseFailures(), this);
    }
    ensureCoverageNotesFilesExist();
    // This is the .d file scanning part.
    IncludeScanningContext scanningContext = executor.getContext(IncludeScanningContext.class);
    Path execRoot = executor.getExecRoot();
    NestedSet<Artifact> discoveredInputs = discoverInputsFromDotdFiles(execRoot, scanningContext.getArtifactResolver(), reply);
    // Clear in-memory .d files early.
    reply = null;
    // Post-execute "include scanning", which modifies the action inputs to match what the compile
    // action actually used by incorporating the results of .d file parsing.
    updateActionInputs(discoveredInputs);
    // HeadersCheckingMode.NONE should only be used for ObjC build actions.
    if (cppSemantics.needsIncludeValidation()) {
        validateInclusions(discoveredInputs, actionExecutionContext.getArtifactExpander(), executor.getEventHandler());
    }
}
Also used : Reply(com.google.devtools.build.lib.rules.cpp.CppCompileActionContext.Reply) Path(com.google.devtools.build.lib.vfs.Path) Executor(com.google.devtools.build.lib.actions.Executor) ExecException(com.google.devtools.build.lib.actions.ExecException) Artifact(com.google.devtools.build.lib.actions.Artifact) ThreadCompatible(com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible)

Aggregations

Artifact (com.google.devtools.build.lib.actions.Artifact)1 ExecException (com.google.devtools.build.lib.actions.ExecException)1 Executor (com.google.devtools.build.lib.actions.Executor)1 ThreadCompatible (com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible)1 Reply (com.google.devtools.build.lib.rules.cpp.CppCompileActionContext.Reply)1 Path (com.google.devtools.build.lib.vfs.Path)1