diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-08-29 00:45:10 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-29 12:05:58 -0400 |
commit | a63d794c7fa6fe4a1178be0f2e8c9389da9435ca (patch) | |
tree | 10f49ca5407753599712b3b62b312aff6562920c | |
parent | 0c2abb9339b3b24080c7a5371421379874754f6d (diff) |
Fix lastchange rebuild problem.
lastchange.py is causing a full rebuild on every commit. This is a
temporary workaround.
-rwxr-xr-x | tools/setup.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/setup.py b/tools/setup.py index 2721a5355..9dff9eb20 100755 --- a/tools/setup.py +++ b/tools/setup.py @@ -25,11 +25,23 @@ def main(): gn_gen("debug") +def write_if_not_exists(filename, contents): + if not os.path.exists(filename): + with open(filename, "w+") as f: + f.write(contents) + + def write_lastchange(): - run([ - sys.executable, "build/util/lastchange.py", "-o", - "build/util/LASTCHANGE", "--source-dir", root_path, "--filter=" - ]) + write_if_not_exists( + "build/util/LASTCHANGE", + "LASTCHANGE=c42e4ddbb7973bfb0c57a49ab6bf6dc432baad7e-\n") + write_if_not_exists("build/util/LASTCHANGE.committime", "1535518087") + # TODO Properly we should call the following script, but it seems to cause + # a rebuild on every commit. + # run([ + # sys.executable, "build/util/lastchange.py", "-o", + # "build/util/LASTCHANGE", "--source-dir", root_path, "--filter=" + # ]) def get_gn_args(): |