Skip to content

Commit

Permalink
Use normal depfile rules for Rust targets
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Adam C. Foltzer committed Jul 12, 2017
1 parent 1e4cddc commit c93ef9b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c93ef9b

Please sign in to comment.