fix generate-code caching by indicating that the binary is an executable

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79625

Per Josiah Gaskin's followup on
https://www.internalfb.com/intern/qa/365579, using $(exe ...) instead
of $(location ...) should address the caching behavior.

@override-unit-failures
(Note: this ignores all push blocking failures!)

Differential Revision: [D36970846](https://our.internmc.facebook.com/intern/diff/D36970846/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36970846/)!

Approved by: https://github.com/malfet
This commit is contained in:
Michael Andreas Dagitses
2022-06-15 17:36:30 -07:00
committed by PyTorch MergeBot
parent 18fcd4826f
commit 86606fbe22

View File

@ -99,7 +99,7 @@ def define_targets(rules):
], ],
tools = ["//tools/setup_helpers:generate_code"], tools = ["//tools/setup_helpers:generate_code"],
outs = GENERATED_AUTOGRAD_CPP + GENERATED_AUTOGRAD_PYTHON + GENERATED_TESTING_PY, outs = GENERATED_AUTOGRAD_CPP + GENERATED_AUTOGRAD_PYTHON + GENERATED_TESTING_PY,
cmd = "$(location //tools/setup_helpers:generate_code) " + cmd = "$(execpath //tools/setup_helpers:generate_code) " +
"--gen-dir=$(RULEDIR) " + "--gen-dir=$(RULEDIR) " +
"--native-functions-path $(location :native_functions.yaml) " + "--native-functions-path $(location :native_functions.yaml) " +
"--tags-path=$(location :tags.yaml) " + "--tags-path=$(location :tags.yaml) " +