-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not apply patches if sub non-git repo is located in a git repo. #545
Conversation
@@ -97,19 +97,20 @@ function(apply_patches repo_dir patches_dir base_revision target_branch ret) | |||
return() | |||
endif() | |||
|
|||
message(STATUS "[OPENCL-CLANG] Patching repository ${repo_dir}") | |||
# Check if it's a git repo | |||
if(EXISTS "${repo_dir}/.git") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can command in https://stackoverflow.com/questions/2044574/determine-if-directory-is-under-git-control/2044714#comment36357325_2044714 be used to detect if a folder is a git repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems git rev-parse --is-inside-work-tree
can't work. I copy opencl-clang source code to /export/users/haonanya/ocl-clang/llvm/projects/, and git rev-parse --is-inside-work-tree return true.
[haonanya@shliclel4059 opencl-clang]$ git rev-parse --is-inside-work-tree
true
[haonanya@shliclel4059 opencl-clang]$ pwd
/export/users/haonanya/ocl-clang/llvm/projects/opencl-clang
So when llvm is as a sub-dir in a repo, the command can't detect it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested and confirmed working as expected, I can now build with plain source tar ball and it stoped affecting my running (and unrelated) git repository. Still I suggest adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CMakeLists.txt
Outdated
${SPIRV_BASE_REVISION} | ||
${TARGET_BRANCH} | ||
ret) | ||
option(APPLY_PATCHES "option to apply patches" ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see options are scattered in this file, should we move them to a same place?
It is up to you and this can be done in a separate PR.
CMakeLists.txt
Outdated
@@ -40,6 +40,10 @@ if(LLVM_USE_HOST_TOOLS AND OPENCL_CLANG_BUILD_EXTERNAL) | |||
llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) | |||
endif() | |||
|
|||
option(LLVMSPIRV_INCLUDED_IN_LLVM | |||
"Set to ON if libLLVMSPIRVLib is linked into libLLVM" ON) | |||
option(APPLY_PATCHES "option to apply patches" ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Apply local patches"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…it repo. (#541) [Backport] Do not apply patches if repo is a not a git repo. #539 [Backport] Do not apply patches if sub non-git repo is located in a git repo. #545 Also add an option to control patch apply which is default on. Pass -DAPPLY_PATCHES=OFF will skip patch apply process. Update LLVM_BASE_REVISION.
…it repo. (#542) [Backport] Do not apply patches if repo is a not a git repo. #539 [Backport] Do not apply patches if sub non-git repo is located in a git repo. #545 Also add an option to control patch apply which is default on. Pass -DAPPLY_PATCHES=OFF will skip patch apply process. Update LLVM_BASE_REVISION.
…it repo. (#543) [Backport] Do not apply patches if repo is a not a git repo. #539 [Backport] Do not apply patches if sub non-git repo is located in a git repo. #545 Also add an option to control patch apply which is default on. Pass -DAPPLY_PATCHES=OFF will skip patch apply process. Update LLVM_BASE_REVISION.
follow up #539.
Also add an option to control patch apply which is default on. Pass -DAPPLY_PATCHES=OFF will skip patch apply process.