diff options
author | Benjamin Peterson <bp@benjamin.pe> | 2018-05-28 08:37:15 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-28 08:39:17 -0700 |
commit | c868c47eaa14304fc223b93534c641c04d47d830 (patch) | |
tree | 356e0ddc647426520eb3eb13f1bb795e4602118b /src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java | |
parent | 0df597e5f920c605a0aae7e442b864bd5bf344d2 (diff) |
Treat runfiles middlemen as aggregating middlemen.
The goal is to, for an action execution, make only a single skyframe
edge to every required runfiles tree rather than an edge to every
runfiles artifact directly. We accomplish this by pulling the runfiles
artifacts' metadata for a particular runfiles tree through the
appropriate runfiles middlemen artifact in one batch. This CL fixes
https://github.com/bazelbuild/bazel/issues/3217.
This change makes runfiles middlemen more similar to aggregating
middlemen. We however continue to treat runfiles middlemen slightly
differently than true aggregating middlemen. Namely, we do not expand
runfiles middlemen into the final action inputs. The reasons for this
are:
1. It can make latent bugs like
https://github.com/bazelbuild/bazel/issues/4033 more severe.
2. The runfiles tree builder action's output MANIFEST contains
absolute paths, which interferes with remote execution if its metadata
is added to a cache hash.
3. In the sandbox, it causes the runfiles artifacts to be mounted at
their exec path locations in addition to within the runfiles
trees. This makes the sandbox less strict. (Perhaps tolerably?)
4. It saves a modicum of (transient) memory and time to not expand.
If the first two issues are fixed, it could be a nice simplification
to completely replace runfiles middlemen with aggregating middlemen.
Change-Id: I2d2148297f897af4c4c6dc055d87f8a6fad0061e
PiperOrigin-RevId: 198307109
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java new file mode 100644 index 0000000000..8969a2cbc6 --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/skyframe/RunfilesArtifactValue.java @@ -0,0 +1,26 @@ +// Copyright 2018 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.lib.skyframe; + +import com.google.common.collect.ImmutableList; +import com.google.devtools.build.lib.actions.Artifact; +import com.google.devtools.build.lib.util.Pair; + +/** The artifacts behind a runfiles middleman. */ +class RunfilesArtifactValue extends AggregatingArtifactValue { + RunfilesArtifactValue( + ImmutableList<Pair<Artifact, FileArtifactValue>> inputs, FileArtifactValue selfData) { + super(inputs, selfData); + } +} |