versioner: remove parsing of platforms.
Leave the machinery to use a symbol database around so that we can
switch over to parsing libc.map.txt in the future.
Test: tools/versioner/run_tests.py
Change-Id: Ifa8899b698764e4aeb6aa8bb2cdb2d44a67b863f
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index a082f07..efb39bd 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -33,6 +33,7 @@
#include <iostream>
#include <map>
#include <memory>
+#include <optional>
#include <set>
#include <sstream>
#include <string>
@@ -614,9 +615,6 @@
std::string versioner_dir = to_string(top) + "/bionic/tools/versioner";
location.header_path = versioner_dir + "/current";
location.dependency_dir = versioner_dir + "/dependencies";
- if (platform_dir.empty()) {
- platform_dir = versioner_dir + "/platforms";
- }
} else {
if (!android::base::Realpath(argv[optind], &location.header_path)) {
err(1, "failed to get realpath for path '%s'", argv[optind]);
@@ -653,16 +651,10 @@
}
std::set<CompilationType> compilation_types;
- NdkSymbolDatabase symbol_database;
+ std::optional<NdkSymbolDatabase> symbol_database;
compilation_types = generateCompilationTypes(selected_architectures, selected_levels);
- // Do this before compiling so that we can early exit if the platforms don't match what we
- // expect.
- if (!platform_dir.empty()) {
- symbol_database = parsePlatforms(compilation_types, platform_dir);
- }
-
auto start = std::chrono::high_resolution_clock::now();
std::unique_ptr<HeaderDatabase> declaration_database =
compileHeaders(compilation_types, location);
@@ -682,8 +674,8 @@
failed = true;
}
- if (!platform_dir.empty()) {
- if (!checkVersions(compilation_types, declaration_database.get(), symbol_database)) {
+ if (symbol_database) {
+ if (!checkVersions(compilation_types, declaration_database.get(), *symbol_database)) {
printf("versioner: version check failed\n");
failed = true;
}