aboutsummaryrefslogtreecommitdiff
path: root/Coordinator.cpp
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-02-16 13:51:33 -0800
committerSteven Moreland <smoreland@google.com>2018-02-16 13:53:19 -0800
commit566b0e9c839422b39309f7a5bf304f37335240e1 (patch)
tree463df2df4267a7390600d93d0ca6c1dec248af87 /Coordinator.cpp
parent3d846994f9b1b455276dce569d3161a9cb7b0bd8 (diff)
downloadhidl-566b0e9c839422b39309f7a5bf304f37335240e1.tar.gz
Fix incremental builds (when missing a current.txt)
hidl-gen is trying to read some current.txt files that don't exist. These are newly added in the depfiles. In the future, two solutions are possible: - require current.txt in all locations - build system keeps track of which files are deleted so that we can declare a dependency on files we *would* read Fixes: 73352417 Test: hidl_hash_test Test: m <interface> && m <interface> w/ missing current.txt file doesn't rebuild the interface the second time. Change-Id: Id8b83cf988693d50c7f519513a8c26fe17985a00
Diffstat (limited to 'Coordinator.cpp')
-rw-r--r--Coordinator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Coordinator.cpp b/Coordinator.cpp
index 6110c23a..28447784 100644
--- a/Coordinator.cpp
+++ b/Coordinator.cpp
@@ -736,8 +736,10 @@ Coordinator::HashStatus Coordinator::checkHash(const FQName& fqName) const {
std::string hashPath = makeAbsolute(getPackageRootPath(fqName)) + "/current.txt";
std::string error;
- onFileAccess(hashPath, "r");
- std::vector<std::string> frozen = Hash::lookupHash(hashPath, fqName.string(), &error);
+ bool fileExists;
+ std::vector<std::string> frozen =
+ Hash::lookupHash(hashPath, fqName.string(), &error, &fileExists);
+ if (fileExists) onFileAccess(hashPath, "r");
if (error.size() > 0) {
std::cerr << "ERROR: " << error << std::endl;