Skip to content

[LLDB] Explicitly use python for version fixup #144217

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jun 14, 2025

On Windows, the post build command would open the script in the default editor, since it doesn't know about shebangs. This effectively adds python3 in front of the command.

Amends #142871 / #141116

@Nerixyz Nerixyz requested a review from JDevlieghere as a code owner June 14, 2025 10:29
@llvmbot llvmbot added the lldb label Jun 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2025

@llvm/pr-subscribers-lldb

Author: nerix (Nerixyz)

Changes

On Windows, the post build command would open the script in the default editor, since it doesn't know about shebangs. This effectively adds python3 in front of the command.


Full diff: https://github.com/llvm/llvm-project/pull/144217.diff

1 Files Affected:

  • (modified) lldb/source/API/CMakeLists.txt (+1-1)
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 2772aa920411f..f4a323aaf267c 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -326,7 +326,7 @@ foreach(header
 endforeach()
 
 add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${LLDB_SOURCE_DIR}/scripts/version-header-fix.py ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h ${lldb_header_staging_dir}/lldb-defines.h ${LLDB_VERSION_MAJOR} ${LLDB_VERSION_MINOR} ${LLDB_VERSION_PATCH}
+  COMMAND "${Python3_EXECUTABLE}" ${LLDB_SOURCE_DIR}/scripts/version-header-fix.py ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h ${lldb_header_staging_dir}/lldb-defines.h ${LLDB_VERSION_MAJOR} ${LLDB_VERSION_MINOR} ${LLDB_VERSION_PATCH}
 )
 add_custom_target(liblldb-header-staging DEPENDS ${lldb_staged_headers})
 add_dependencies(liblldb liblldb-header-staging)

Copy link
Contributor

@chelcassanova chelcassanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

(For future reference, we should also do this when we run the framework fixup Python script)

@JDevlieghere JDevlieghere merged commit d8924d4 into llvm:main Jun 20, 2025
9 checks passed
@Nerixyz Nerixyz deleted the fix/lldb-windows-version-fix branch June 20, 2025 19:58
Jaddyen pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 23, 2025
On Windows, the post build command would open the script in the default
editor, since it doesn't know about shebangs. This effectively adds
`python3` in front of the command.

Amends llvm#142871 /
llvm#141116
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants