Use an escape sequence for space characters in depfiles generated by the copy_tree script

Change-Id: I60473b9729b310bd3909c98607ccb708c52dac15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357500
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
This commit is contained in:
Jason Simmons
2024-03-14 15:45:55 +00:00
committed by Commit Queue
parent 963448ff2f
commit 5ed896c9ae
+2
View File
@@ -107,6 +107,8 @@ def WriteDepfile(depfile, stamp, dep_list):
cwd = os.getcwd()
relstamp = os.path.relpath(stamp, cwd)
reldep_list = [os.path.relpath(d, cwd) for d in dep_list]
# Depfile paths must use an escape sequence for space characters.
reldep_list = [path.replace(" ", r"\ ") for path in reldep_list]
with open(depfile, 'w') as f:
print("{0}: {1}".format(relstamp, " ".join(reldep_list)), file=f)