From c93ef9b96b5df11276de183dae517815bf330f63 Mon Sep 17 00:00:00 2001 From: "Adam C. Foltzer" Date: Wed, 12 Jul 2017 10:28:36 -0700 Subject: [PATCH] Use normal depfile rules for Rust targets The `deps = gcc` rules delete the depfile after it has been read into Ninja's database. This conflicts with the fact that `rustc` puts a target for the depfile itself within the depfile, and so the deleted depfile triggers a rebuild of the whole target. Ninja's normal depfile rules suffice, but won't perform as well for large Rust targets. The alternative seems to be modifying the depfile, though, which seems more gross. --- mesonbuild/backend/ninjabackend.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 2f545d0bd515..fd5b1d2f663b 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1505,13 +1505,10 @@ def generate_rust_compile_rules(self, compiler, outfile): command = ' command = %s $ARGS $in\n' % invoc description = ' description = Compiling Rust source $in.\n' depfile = ' depfile = $targetdep\n' - - depstyle = ' deps = gcc\n' outfile.write(rule) outfile.write(command) outfile.write(description) outfile.write(depfile) - outfile.write(depstyle) outfile.write('\n') def generate_swift_compile_rules(self, compiler, outfile):