Search in sources :

Example 1 with ExecutorInitException

use of com.google.devtools.build.lib.actions.ExecutorInitException in project bazel by bazelbuild.

the class ExecutionTool method startLocalOutputBuild.

/**
   * Prepare for a local output build.
   */
private void startLocalOutputBuild(String workspaceName) throws ExecutorInitException {
    try (AutoProfiler p = AutoProfiler.profiled("Starting local output build", ProfilerTask.INFO)) {
        Path outputPath = env.getDirectories().getOutputPath(workspaceName);
        Path localOutputPath = env.getDirectories().getLocalOutputPath();
        if (outputPath.isSymbolicLink()) {
            try {
                // Remove the existing symlink first.
                outputPath.delete();
                if (localOutputPath.exists()) {
                    // Pre-existing local output directory. Move to outputPath.
                    localOutputPath.renameTo(outputPath);
                }
            } catch (IOException e) {
                throw new ExecutorInitException("Couldn't handle local output directory symlinks", e);
            }
        }
    }
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) AutoProfiler(com.google.devtools.build.lib.profiler.AutoProfiler) IOException(java.io.IOException) ExecutorInitException(com.google.devtools.build.lib.actions.ExecutorInitException)

Example 2 with ExecutorInitException

use of com.google.devtools.build.lib.actions.ExecutorInitException in project bazel by bazelbuild.

the class ExecutionTool method prepare.

private void prepare(ImmutableMap<PackageIdentifier, Path> packageRoots, String workspaceName) throws ExecutorInitException {
    // Prepare for build.
    Profiler.instance().markPhase(ProfilePhase.PREPARE);
    // Create some tools symlinks / cleanup per-build state
    createActionLogDirectory();
    // Plant the symlink forest.
    try {
        new SymlinkForest(packageRoots, getExecRoot(), runtime.getProductName(), workspaceName).plantSymlinkForest();
    } catch (IOException e) {
        throw new ExecutorInitException("Source forest creation failed", e);
    }
}
Also used : IOException(java.io.IOException) ExecutorInitException(com.google.devtools.build.lib.actions.ExecutorInitException)

Aggregations

ExecutorInitException (com.google.devtools.build.lib.actions.ExecutorInitException)2 IOException (java.io.IOException)2 AutoProfiler (com.google.devtools.build.lib.profiler.AutoProfiler)1 Path (com.google.devtools.build.lib.vfs.Path)1