odrefresh: log an error if updatable_bcp_packages file is missing
Compilation of system_server JARs will fail if
updatable_bcp_packages file is missing.
Bug: 187494247
Test: manual ART APEX update
Change-Id: I9e8ead0d42ff889bdcb99042c5c83fd581be4f75
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index a1d4e54..218e07e 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -1157,7 +1157,14 @@
args.emplace_back("--oat-location=" + artifacts.OatPath());
if (!config_.GetUpdatableBcpPackagesFile().empty()) {
- args.emplace_back("--updatable-bcp-packages-file=" + config_.GetUpdatableBcpPackagesFile());
+ const std::string& bcp_packages = config_.GetUpdatableBcpPackagesFile();
+ if (!OS::FileExists(bcp_packages.c_str())) {
+ *error_msg = "Cannot compile system_server JARs: missing " + QuotePath(bcp_packages);
+ metrics.SetStatus(OdrMetrics::Status::kIoError);
+ EraseFiles(staging_files);
+ return false;
+ }
+ args.emplace_back("--updatable-bcp-packages-file=" + bcp_packages);
}
args.emplace_back("--runtime-arg");