-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-37767: [C++][CMake] Don't touch .git/index #38003
Conversation
We run "git describe --tag --dirty" implicitly in cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty". We can avoid changing .git/index's owner by not using "--dirty".
|
@@ -747,7 +747,7 @@ if(NOT ARROW_GIT_ID) | |||
OUTPUT_STRIP_TRAILING_WHITESPACE) | |||
endif() | |||
if(NOT ARROW_GIT_DESCRIPTION) | |||
execute_process(COMMAND "git" "describe" "--tags" "--dirty" | |||
execute_process(COMMAND "git" "describe" "--tags" |
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.
Are you sure this fixes the issue reliably? Is it just an implementation detail in 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.
It's an implementation detail.
The git describe
document doesn't explain this behavior: https://git-scm.com/docs/git-describe
Here is the implementation with --dirty
:
It touches .git/index
(*_index()
functions are used).
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.
wow great investigation!
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.
+1 from me
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 277b168. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them. |
### Rationale for this change We run "git describe --tag --dirty" implicitly in cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty". We can avoid changing .git/index's owner by not using "--dirty". ### What changes are included in this PR? Remove "--dirty". ### Are these changes tested? Yes. I used "strace git describe ...". ### Are there any user-facing changes? No. * Closes: apache#37767 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Jacob Wujciak-Jens <[email protected]>
### Rationale for this change We run "git describe --tag --dirty" implicitly in cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty". We can avoid changing .git/index's owner by not using "--dirty". ### What changes are included in this PR? Remove "--dirty". ### Are these changes tested? Yes. I used "strace git describe ...". ### Are there any user-facing changes? No. * Closes: apache#37767 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Jacob Wujciak-Jens <[email protected]>
### Rationale for this change We run "git describe --tag --dirty" implicitly in cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty". We can avoid changing .git/index's owner by not using "--dirty". ### What changes are included in this PR? Remove "--dirty". ### Are these changes tested? Yes. I used "strace git describe ...". ### Are there any user-facing changes? No. * Closes: apache#37767 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Jacob Wujciak-Jens <[email protected]>
Rationale for this change
We run "git describe --tag --dirty" implicitly in
cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty".
We can avoid changing .git/index's owner by not using "--dirty".
What changes are included in this PR?
Remove "--dirty".
Are these changes tested?
Yes. I used "strace git describe ...".
Are there any user-facing changes?
No.
.git
ownership #37767