Skip to content

Commit

Permalink
ast-exporter: use major, not full, version for clang resource dir
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fw-immunant committed Apr 1, 2024
1 parent 4058b11 commit 2efae0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c2rust-ast-exporter/src/AstExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2735,7 +2735,7 @@ static std::vector<const char *> 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", CLANG_VERSION_MAJOR_STRING);
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);
Expand Down

0 comments on commit 2efae0d

Please sign in to comment.