Use aquery results to determine if a file should be executable
Now that aquery includes this information. Also added rm -f $out to some rules, because since they write files by shell redirection, if the file existed before and was executable, they wouldn't make the file non-executable and visa versa. Fixes: 297366783 Test: m bazel_sandwich Change-Id: Ie5b6c4275b162601f51deaec9912eea4be16988d
This commit is contained in:
@@ -1382,10 +1382,7 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
|
||||
WriteFileRuleVerbatim(ctx, out, "")
|
||||
case "FileWrite", "SourceSymlinkManifest":
|
||||
out := PathForBazelOut(ctx, buildStatement.OutputPaths[0])
|
||||
// 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") {
|
||||
if buildStatement.IsExecutable {
|
||||
WriteExecutableFileRuleVerbatim(ctx, out, buildStatement.FileContents)
|
||||
} else {
|
||||
WriteFileRuleVerbatim(ctx, out, buildStatement.FileContents)
|
||||
|
Reference in New Issue
Block a user