Skip to content

Commit fef37c4

Browse files
agrieveCommit bot
authored and
Commit bot
committed
Use a stamp file when symlinking in GN work around mtime issues
Ninja follows a symlink when stat'ing, so you can't use a symlink as an output and have dirty checking work properly. ninja-build/ninja#1186 BUG=646165 Review-Url: https://codereview.chromium.org/2348793002 Cr-Commit-Position: refs/heads/master@{#419156}
1 parent e580467 commit fef37c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build/symlink.gni

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ template("symlink") {
1414
"testonly",
1515
"visibility",
1616
])
17+
18+
# Can't use the symlink itself as an output since ninja does not properly
19+
# process the symlink's mtime.
20+
# https://github.com/ninja-build/ninja/issues/1186
1721
outputs = [
18-
invoker.output,
22+
"$target_gen_dir/$target_name.stamp",
1923
]
2024
script = "//build/symlink.py"
2125
args = [
26+
"--touch",
27+
rebase_path(outputs[0], root_build_dir),
2228
"-f",
2329
rebase_path(invoker.source, get_path_info(invoker.output, "dir")),
2430
rebase_path(invoker.output, root_build_dir),

0 commit comments

Comments
 (0)