Skip to content

Conversation

@oraluben
Copy link
Collaborator

@oraluben oraluben commented Dec 21, 2025

Fix the problem that #1485 trying to notify in a more elegant way.

cc @kurisu6912

Summary by CodeRabbit

  • Chores
    • Z3 runtime library is now copied into the build output so it’s available at runtime, improving local build/test reliability.
    • Runtime library lookup behavior adjusted per platform for more predictable and consistent library loading.
    • Install/runtime-path settings consolidated across targets to simplify deployment and reduce unexpected linkage issues.

✏️ Tip: You can customize this high-level summary in your review settings.

@oraluben oraluben requested a review from LeiWang1999 December 21, 2025 12:37
@github-actions
Copy link

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

📝 Walkthrough

Walkthrough

CMakeLists.txt now copies the Z3 library into the build tvm directory when USE_Z3 and USE_PYPI_Z3 are enabled, sets platform-specific BUILD_RPATH (@loader_path on macOS, $ORIGIN on other systems), removes legacy augmentation with Python z3 paths, and consolidates INSTALL_RPATH updates across public targets instead of per-target RPATH entries.

Changes

Cohort / File(s) Change Summary
Z3 Library Handling & BUILD_RPATH Configuration
CMakeLists.txt
Removed legacy augmentation of TVM target RPATH with Python z3 paths. Added copying of z3::libz3 into ${CMAKE_BINARY_DIR}/tvm when USE_Z3 and USE_PYPI_Z3 are set, set BUILD_RPATH to @loader_path on APPLE or $ORIGIN on non-APPLE, removed per-target explicit BUILD_RPATH entries for tvm in the Z3 case, and consolidated INSTALL_RPATH updates into a multi-target set (tilelang, tilelang_module, tvm, tvm_runtime).
Install block / RPATH cleanup
CMakeLists.txt (final install section)
Updated final install block to reflect the new rpath behavior, removed explicit per-target per-path RPATH entries, and retained the consolidated multi-target INSTALL_RPATH approach.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged a z3 into the build's warm den,
No more wandering through Python's glen;
On macOS branches, loaders softly call,
Elsewhere origins stand proud and tall —
A cozy hop, a library home for all.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '[Dev] Fix when build local version with isolated build' is related to the changeset, referring to build configuration fixes, but uses awkward phrasing ('when build local version') and lacks specificity about what is actually being fixed. Consider rephrasing to be more specific and grammatically clear, such as '[Dev] Fix Z3 library path handling for local isolated builds' or '[Dev] Fix RPATH configuration for local build with Z3'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7ad8b0 and b75cfb9.

📒 Files selected for processing (1)
  • CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.1 (on self-hosted-amd)
  • GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
  • GitHub Check: Test for Python 3.12 with CUDA-12.8 (on self-hosted-nvidia)
  • GitHub Check: Build wheels for Python 3.9 on ubuntu-latest with CUDA-12.8
  • GitHub Check: Build wheels for Python 3.9 on macos-latest with Metal
  • GitHub Check: Build wheels for Python 3.9 on ubuntu-24.04-arm with CUDA-12.8
  • GitHub Check: Build SDist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
CMakeLists.txt (1)

326-332: Optional: Simplify redundant conditional check.

The if(USE_Z3 AND USE_PYPI_Z3) check on line 326 is redundant if the previous fix is applied, since this entire block would already be inside the same conditional. The BUILD_RPATH logic itself is correct.

🔎 Suggested simplification (if previous fix applied)
 if(USE_Z3 AND USE_PYPI_Z3)
   # Copy libz3 library to build folder to workaround isolated build env issue
   get_target_property(Z3_LIBRARY_PATH z3::libz3 IMPORTED_LOCATION)
   file(COPY "${Z3_LIBRARY_PATH}" DESTINATION "${CMAKE_BINARY_DIR}/tvm")
   
-  if(USE_Z3 AND USE_PYPI_Z3)
-    if(APPLE)
-      set_target_properties(tvm PROPERTIES BUILD_RPATH "@loader_path")
-    else()
-      set_target_properties(tvm PROPERTIES BUILD_RPATH "\$ORIGIN")
-    endif()
+  if(APPLE)
+    set_target_properties(tvm PROPERTIES BUILD_RPATH "@loader_path")
+  else()
+    set_target_properties(tvm PROPERTIES BUILD_RPATH "\$ORIGIN")
   endif()
 endif()
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a874e4e and 8d05316.

📒 Files selected for processing (1)
  • CMakeLists.txt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Test for Python 3.12 with Nightly-ROCm-7.1 (on self-hosted-amd)
  • GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
  • GitHub Check: Test for Python 3.12 with CUDA-12.8 (on self-hosted-nvidia)
  • GitHub Check: Build wheels for Python 3.9 on macos-latest with Metal
  • GitHub Check: Build wheels for Python 3.9 on ubuntu-24.04-arm with CUDA-12.8
  • GitHub Check: Build wheels for Python 3.9 on ubuntu-latest with CUDA-12.8
  • GitHub Check: Build SDist

@kurisu6912
Copy link
Collaborator

Thanks @oraluben, concise and effective!

I'll check the cutedsl CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants