Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 321f3b0b authored by Christopher Parsons's avatar Christopher Parsons Committed by Automerger Merge Worker
Browse files

Merge "Use hardlinks for Bazel's symlink actions" am: 9579f08f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1858158

Change-Id: I8cf598b1de51b3815313b6a5e5bb8c23d07aa873
parents d8d15b8f 9579f08f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -246,7 +246,8 @@ func AqueryBuildStatements(aqueryJsonProto []byte) ([]BuildStatement, error) {
			outDir := proptools.ShellEscapeIncludingSpaces(filepath.Dir(out))
			out = proptools.ShellEscapeIncludingSpaces(out)
			in := proptools.ShellEscapeIncludingSpaces(inputPaths[0])
			buildStatement.Command = fmt.Sprintf("mkdir -p %[1]s && rm -f %[2]s && ln -rsf %[3]s %[2]s", outDir, out, in)
			// Use hard links, because some soong actions expect real files (for example, `cp -d`).
			buildStatement.Command = fmt.Sprintf("mkdir -p %[1]s && rm -f %[2]s && ln -f %[3]s %[2]s", outDir, out, in)
			buildStatement.SymlinkPaths = outputPaths[:]
		} else if len(actionEntry.Arguments) < 1 {
			return nil, fmt.Errorf("received action with no command: [%v]", buildStatement)
+2 −2
Original line number Diff line number Diff line
@@ -859,7 +859,7 @@ func TestSimpleSymlink(t *testing.T) {
		BuildStatement{
			Command: "mkdir -p one/symlink_subdir && " +
				"rm -f one/symlink_subdir/symlink && " +
				"ln -rsf one/file_subdir/file one/symlink_subdir/symlink",
				"ln -f one/file_subdir/file one/symlink_subdir/symlink",
			InputPaths:   []string{"one/file_subdir/file"},
			OutputPaths:  []string{"one/symlink_subdir/symlink"},
			SymlinkPaths: []string{"one/symlink_subdir/symlink"},
@@ -923,7 +923,7 @@ func TestSymlinkQuotesPaths(t *testing.T) {
		BuildStatement{
			Command: "mkdir -p 'one/symlink subdir' && " +
				"rm -f 'one/symlink subdir/symlink' && " +
				"ln -rsf 'one/file subdir/file' 'one/symlink subdir/symlink'",
				"ln -f 'one/file subdir/file' 'one/symlink subdir/symlink'",
			InputPaths:   []string{"one/file subdir/file"},
			OutputPaths:  []string{"one/symlink subdir/symlink"},
			SymlinkPaths: []string{"one/symlink subdir/symlink"},