Add the system image test to the bazel sandwich

Also make -test.sh files executable, while we wait for a bazel update
that will tell us which FileWrite actions should be executable.

Bug: 297268692
Test: m bazel_sandwich
Change-Id: I60498577ba12813bff8bbdbc1b997ea4addefd17
This commit is contained in:
Cole Faust
2023-08-23 16:11:26 -07:00
parent 573eabaa62
commit 39b614af17
3 changed files with 19 additions and 6 deletions

View File

@@ -1382,7 +1382,14 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
WriteFileRuleVerbatim(ctx, out, "")
case "FileWrite", "SourceSymlinkManifest":
out := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents)
// TODO(b/297366783) This is a hack to make files from skylib's diff_test executable.
// We need to update bazel to have aquery tell us whether a file is supposed to be
// executable or not.
if strings.HasSuffix(buildStatement.OutputPaths[0], "-test.sh") {
WriteExecutableFileRuleVerbatim(ctx, out, buildStatement.FileContents)
} else {
WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents)
}
case "SymlinkTree":
// build-runfiles arguments are the manifest file and the target directory
// where it creates the symlink tree according to this manifest (and then