Skip to content

Commit

Permalink
TODO: write description
Browse files Browse the repository at this point in the history
  • Loading branch information
tjgq committed Dec 13, 2022
1 parent e4aa622 commit 6969acb
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.devtools.build.lib.actions.Artifact.ArchivedTreeArtifact;
import com.google.devtools.build.lib.actions.Artifact.DerivedArtifact;
import com.google.devtools.build.lib.actions.Artifact.SpecialArtifact;
import com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact;
import com.google.devtools.build.lib.actions.FileArtifactValue;
import com.google.devtools.build.lib.actions.FilesetOutputSymlink;
import com.google.devtools.build.lib.analysis.actions.SymlinkAction;
Expand Down Expand Up @@ -120,16 +121,31 @@ static void addToMap(
/*depOwner=*/ key);
consumer.accumulate(treeArtifactValue);
} else if (value instanceof ActionExecutionValue) {
FileArtifactValue metadata = ((ActionExecutionValue) value).getExistingFileArtifactValue(key);
inputMap.put(key, metadata, key);
if (key.isFileset()) {
ImmutableList<FilesetOutputSymlink> filesets = getFilesets(env, (SpecialArtifact) key);
if (filesets != null) {
topLevelFilesets.put(key, filesets);
consumer.accumulate(filesets);
}
if (key instanceof TreeFileArtifact) {
SpecialArtifact treeArtifact = key.getParent();
TreeArtifactValue treeArtifactValue = ((ActionExecutionValue) value)
.getTreeArtifactValue(treeArtifact);
expandTreeArtifactAndPopulateArtifactData(
treeArtifact,
treeArtifactValue,
expandedArtifacts,
archivedTreeArtifacts,
inputMap,
/*depOwner=*/ key);
consumer.accumulate(treeArtifactValue);
} else {
consumer.accumulate(metadata);
FileArtifactValue metadata = ((ActionExecutionValue) value).getExistingFileArtifactValue(
key);
inputMap.put(key, metadata, key);
if (key.isFileset()) {
ImmutableList<FilesetOutputSymlink> filesets = getFilesets(env, (SpecialArtifact) key);
if (filesets != null) {
topLevelFilesets.put(key, filesets);
consumer.accumulate(filesets);
}
} else {
consumer.accumulate(metadata);
}
}
} else {
Preconditions.checkArgument(value instanceof FileArtifactValue, "Unexpected value %s", value);
Expand Down
40 changes: 31 additions & 9 deletions src/test/shell/bazel/remote/build_without_the_bytes_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,7 @@ else
declare -r EXE_EXT=""
fi

function test_cc_tree() {
if [[ "$PLATFORM" == "darwin" ]]; then
# TODO(b/37355380): This test is disabled due to RemoteWorker not supporting
# setting SDKROOT and DEVELOPER_DIR appropriately, as is required of
# action executors in order to select the appropriate Xcode toolchain.
return 0
fi

function setup_cc_tree() {
mkdir -p a
cat > a/BUILD <<EOF
load(":tree.bzl", "mytree")
Expand All @@ -93,11 +86,40 @@ def _tree_impl(ctx):
mytree = rule(implementation = _tree_impl)
EOF
}

function test_cc_tree_remote_executor() {
if [[ "$PLATFORM" == "darwin" ]]; then
# TODO(b/37355380): This test is disabled due to RemoteWorker not supporting
# setting SDKROOT and DEVELOPER_DIR appropriately, as is required of
# action executors in order to select the appropriate Xcode toolchain.
return 0
fi

setup_cc_tree

bazel build \
--remote_executor=grpc://localhost:${worker_port} \
--remote_download_minimal \
//a:tree_cc >& "$TEST_log" \
|| fail "Failed to build //a:tree_cc with minimal downloads"
|| fail "Failed to build //a:tree_cc with remote executor and minimal downloads"
}

function test_cc_tree_remote_cache() {
if [[ "$PLATFORM" == "darwin" ]]; then
# TODO(b/37355380): This test is disabled due to RemoteWorker not supporting
# setting SDKROOT and DEVELOPER_DIR appropriately, as is required of
# action executors in order to select the appropriate Xcode toolchain.
return 0
fi

setup_cc_tree

bazel build \
--remote_cache=grpc://localhost:${worker_port} \
--remote_download_minimal \
//a:tree_cc >& "$TEST_log" \
|| fail "Failed to build //a:tree_cc with remote cache and minimal downloads"
}

function test_cc_include_scanning_and_minimal_downloads() {
Expand Down

0 comments on commit 6969acb

Please sign in to comment.