From f3b5623b75127e38ba685faa06ee714dc2904ffb Mon Sep 17 00:00:00 2001 From: fw Date: Mon, 1 Apr 2024 17:33:59 -0400 Subject: [PATCH] ast-exporter: use major, not full, version for clang resource dir on my (Arch) Clang 17 installation there is no directory named the full version number in /usr/lib/clang I don't know if this is better guaranteed but it seems on Donna we have directories there named after both major and entire version numbers for Clangs 11-14, so using only major seems the safest bet hopefully if this is a mistake CI will notice --- c2rust-ast-exporter/src/AstExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2rust-ast-exporter/src/AstExporter.cpp b/c2rust-ast-exporter/src/AstExporter.cpp index d98d4ff041..a9183cdfd8 100644 --- a/c2rust-ast-exporter/src/AstExporter.cpp +++ b/c2rust-ast-exporter/src/AstExporter.cpp @@ -2735,7 +2735,7 @@ static std::vector augment_argv(int argc, const char *argv[]) { // the path to the tool (in this case, the binary running the AST Exporter). SmallString<128> P("-extra-arg=-resource-dir=" CLANG_BIN_PATH); llvm::sys::path::append(P, "..", Twine("lib") + CLANG_LIBDIR_SUFFIX, - "clang", CLANG_VERSION_STRING); + "clang", std::to_string(CLANG_VERSION_MAJOR)); std::string resource_dir = P.str().str(); char *resource_dir_cstr = new char[resource_dir.length() + 1]; strncpy(resource_dir_cstr, resource_dir.c_str(), resource_dir.length() + 1);