Skip to content

Commit

Permalink
[InstallAPI] Pass explicit module cache to avoid permissions issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyndyishida committed May 11, 2024
1 parent f8063ff commit 504cf55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions clang/test/InstallAPI/project-header-only-args.test
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
; RUN: rm -rf %t
; RUN: split-file %s %t
; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
; RUN: mkdir -p %t/modules.cache

; RUN: clang-installapi \
; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \
; RUN: -current_version 1 -compatibility_version 1 \
; RUN: -Xproject -fmodules -I%t/usr/include \
; RUN: -Xproject -fmodules-cache-path=%t/modules.cache \
; RUN: -F %S/Inputs/Foundation/ \
; RUN: -exclude-public-header %t/usr/include/public.h \
; RUN: -extra-project-header %t/project.h -I%t -dynamiclib \
Expand All @@ -17,6 +19,7 @@
; RUN: -target arm64-apple-macos12 -install_name @rpath/libfoo.dylib \
; RUN: -current_version 1 -compatibility_version 1 \
; RUN: -Xproject -fmodules -I%t/usr/include \
; RUN: -Xproject -fmodules-cache-path=%t/modules.cache \
; RUN: -extra-project-header %t/project.h \
; RUN: -F %S/Inputs/Foundation/ \
; RUN: %t/inputs.json \
Expand Down
7 changes: 5 additions & 2 deletions clang/tools/clang-installapi/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,11 @@ bool Options::processXprojectOption(InputArgList &Args, arg_iterator Curr) {
return false;
}

ProjectLevelArgs.push_back(NextA->getSpelling().str());
llvm::copy(NextA->getValues(), std::back_inserter(ProjectLevelArgs));
std::string ArgString = NextA->getSpelling().str();
for (const StringRef Val : NextA->getValues())
ArgString += Val.str();

ProjectLevelArgs.push_back(ArgString);
A->claim();
NextA->claim();

Expand Down

0 comments on commit 504cf55

Please sign in to comment.