Skip to content

Commit 80f464d

Browse files
agrieveCommit bot
authored and
Commit bot
committed
Add work-around to symlink.gni to avoid "not up-to-date" ninja errors
Ninja bug: ninja-build/ninja#1186 BUG=646165 Review-Url: https://codereview.chromium.org/2344243002 Cr-Commit-Position: refs/heads/master@{#419751}
1 parent df157d9 commit 80f464d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

build/symlink.gni

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ template("symlink") {
1919
]
2020
script = "//build/symlink.py"
2121
args = [
22+
"--update-target-mtimes",
2223
"-f",
2324
rebase_path(invoker.source, get_path_info(invoker.output, "dir")),
2425
rebase_path(invoker.output, root_build_dir),

build/symlink.py

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def Main(argv):
2424
parser = optparse.OptionParser()
2525
parser.add_option('-f', '--force', action='store_true')
2626
parser.add_option('--touch')
27+
parser.add_option('--update-target-mtimes', action='store_true')
2728

2829
options, args = parser.parse_args(argv[1:])
2930
if len(args) < 2:
@@ -49,6 +50,10 @@ def Main(argv):
4950
os.symlink(s, t)
5051
else:
5152
raise
53+
if options.update_target_mtimes:
54+
# Work-around for ninja bug:
55+
# https://github.com/ninja-build/ninja/issues/1186
56+
os.utime(s, None)
5257

5358

5459
if options.touch:

0 commit comments

Comments
 (0)