Skip to content

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented Oct 16, 2025

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

Summary by CodeRabbit

  • New Features

    • LLVM 21.1.0 available with prebuilt binaries for Windows (32/64-bit), Linux, macOS, and BSD.
  • Build Improvements

    • Platform detection/config updated (macOS targets normalized).
    • Runtime handling refined: compiler-rt moved to runtimes and its description updated.
  • Bug Fixes

    • Package version parsing refined to better attach versions to existing package entries.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @waruqi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the latest LLVM version, 21.1.0, into the package management system. This update ensures that users can leverage the newest features and improvements offered by LLVM across different operating systems. Additionally, a minor adjustment was made to the macOS platform detection logic to streamline the installation process.

Highlights

  • New LLVM Version: Added support for LLVM version 21.1.0 across various platforms (Windows, macOS, Linux/BSD) by including its version and corresponding checksums in the xmake.lua configuration.
  • Platform Specification Update: Refined the on_install function's platform specification for macOS, simplifying it from macosx|x86_64 to macosx for potentially broader compatibility.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for LLVM version 21.1.0. The changes correctly add the new version for various platforms and build types. I've also noticed a change that enables source builds on all macOS architectures, which is a good improvement.

My main feedback is about the significant code duplication in packages/l/llvm/xmake.lua. The new version information is added in six different places. This is due to the file structure having separate logic for modern and legacy xmake versions. While this PR continues an existing pattern, it exacerbates a maintainability issue. I've left specific comments on the duplicated lines with suggestions to refactor this in the future to make the package script easier to manage.

package:add("versions", "16.0.6", "5e1f560f75e7a4c7a6509cf7d9a28b4543e7afcb4bcf4f747e9f208f0efa6818")
package:add("versions", "17.0.6", "ce78b510603cb3b347788d2f52978e971cf5f55559151ca13a73fd400ad80c41")
package:add("versions", "18.1.1", "1e21b088b1f86aebb4a2e4ad473d1892dccab53ecbe06947f31c6fa56a078bf5")
package:add("versions", "21.1.0", "36b9a55e237b2db404aa621aacb8538b56dabc6f49b8927dc1109e8123524d5f")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line adds the new version for Windows x86. However, the same version and hash are also added on line 76 for older xmake versions. This duplication makes maintenance harder and the script more error-prone. It would be better to define versions in a shared data structure (like a table) and populate them in both code paths to avoid redundancy.

package:add("versions", "16.0.6", "7adb1a630b6cc676a4b983aca9b01e67f770556c6e960e9ee9aa7752c8beb8a3")
package:add("versions", "17.0.6", "c480a4c280234b91f7796a1b73b18134ae62fe7c88d2d0c33312d33cb2999187")
package:add("versions", "18.1.1", "7040c7a02529bc0c683896d4f851138b700d8aa8f40c5f48503b10f4cc2dc180")
package:add("versions", "21.1.0", "130d0067de849be36c0ec84c6d515bd310cab324a4cc95d8cc71a1d3c6c730f4")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the win32 case, this line adds the new version for Windows x64, which is duplicated on line 86. This redundancy increases the maintenance burden and risk of inconsistencies. Consolidating version definitions would improve the script's maintainability.

package:add("versions", "16.0.6", "ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e")
package:add("versions", "17.0.6", "58a8818c60e6627064f312dbf46c02d9949956558340938b71cf731ad8bc0813")
package:add("versions", "18.1.1", "8f34c6206be84b186b4b31f47e1b52758fa38348565953fad453d177ef34c0ad")
package:add("versions", "21.1.0", "1672e3efb4c2affd62dbbe12ea898b28a451416c7d95c1bd0190c26cbe878825")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line adds the new source version, which is also duplicated on line 99. To avoid maintenance issues, it's recommended to define all versions in a single, shared data structure and reference it from both the modern on_source block and the legacy else block.

@coderabbitai
Copy link

coderabbitai bot commented Oct 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Moves compiler-rt from LLVM projects to runtimes, adds LLVM 21.1.0 across multiple prebuilt variants and install paths, adjusts macOS platform filter, and changes test.lua logic to append or update package versions based on token count.

Changes

Cohort / File(s) Summary
LLVM config: prebuilt variants & platforms
packages/l/llvm/xmake.lua
Adds LLVM 21.1.0 to Windows prebuilt variants (win32, win64) and non‑Windows prebuilt lists; extends backports variants with 21.1.0; adjusts install platform filter from `macosx
LLVM config: projects → runtimes
packages/l/llvm/xmake.lua
Removes compiler-rt from the LLVM projects array and adds compiler-rt to the runtimes array; updates its configuration description to "Enable compiler-rt runtime."
Test script behavior
scripts/test.lua
Modifies get_modified_packages so when adding a version token it updates the last package entry in-place if that entry is a single token; otherwise it appends a new package entry with the version.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant T as test.lua
  participant L as line input
  participant P as packages list

  Note over T: process each modified line
  L->>T: read line (package / +version)
  alt lastEntry tokens > 1
    T->>P: append new entry with version
    Note right of P: new package element created
  else lastEntry tokens == 1
    T->>P: update last entry by attaching version
    Note right of P: existing element modified
  end
  T->>P: continue processing
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check correctness of moving compiler-rt between arrays and the updated description.
  • Verify added 21.1.0 entries' URLs/paths and variant naming consistency.
  • Review get_modified_packages token-count logic for edge cases (empty lines, multi-token package names, whitespace).

Poem

🐰 New builds hop in with zest,
Compiler runtimes find their nest,
Versions jump to twenty-one,
Scripts decide when to append or run,
I nibble changes — code looks blessed. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "add llvm 21.1.0" is directly related to the primary objective of the changeset. The raw summary shows that the majority of changes across both modified files involve adding support for LLVM version 21.1.0, including adding it to multiple platforms, installation paths, and prebuilt variants in the xmake.lua configuration. The title is concise, specific, and clearly communicates the main change without being vague or generic. While the changeset also includes secondary modifications like rearranging compiler-rt configuration and updating test scripts, the title appropriately focuses on the most significant change from the developer's perspective.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch llvm

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10e39cd and d311453.

📒 Files selected for processing (2)
  • packages/l/llvm/xmake.lua (9 hunks)
  • scripts/test.lua (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). (20)
  • GitHub Check: build (windows-11-arm, shared, arm64, MD)
  • GitHub Check: build (windows-11-arm, shared, arm64, MT)
  • GitHub Check: build (windows-2025, shared, x86, MT)
  • GitHub Check: build (windows-2025, static, x64, MD)
  • GitHub Check: build (ubuntu-latest, arm64-v8a, r22, 30)
  • GitHub Check: build (windows-2025, static, arm64, MD)
  • GitHub Check: build (MINGW64, shared, x86_64, /mingw64)
  • GitHub Check: build (ubuntu-latest, armeabi-v7a, r22, 30)
  • GitHub Check: build (MINGW32, shared, i686, /mingw32)
  • GitHub Check: build (windows-latest, armeabi-v7a, r22, 30)
  • GitHub Check: build (windows-latest, arm64-v8a, r27, 30)
  • GitHub Check: build (ubuntu-24.04-arm, static, release)
  • GitHub Check: build (ubuntu-24.04-arm, shared, release)
  • GitHub Check: build (ubuntu-latest, shared)
  • GitHub Check: build (ubuntu-latest, static)
  • GitHub Check: build (ubuntu-latest, shared)
  • GitHub Check: build (ubuntu-latest, shared)
  • GitHub Check: build (macos-15-intel, x86_64, static)
  • GitHub Check: build (macos-15-intel, x86_64, shared)
  • GitHub Check: build (macos-14, arm64, shared)
🔇 Additional comments (4)
packages/l/llvm/xmake.lua (3)

19-19: Config description properly updated.

The description now correctly reflects that compiler-rt is a runtime library, consistent with its relocation to the runtimes list at line 161. This addresses the previous review feedback.


135-135: Based on verification findings:

  1. xmake's on_install("linux", "macosx", function() filters packages by platform, where architecture can be optionally specified with the format "platform|arch"
  2. LLVM versions 11 and higher support ARM64 on macOS
  3. The git log showed precedent for ARM64 macOS support in this codebase (commit 1b0137c: "usd: support arm64 macosx")

The change from on_install("linux", "macosx|x86_64", "bsd") to on_install("linux", "macosx", "bsd") correctly removes the x86_64-only architecture restriction, enabling Apple Silicon support across all supported LLVM versions. This aligns with modern macOS hardware landscape and the repository's existing ARM64 support patterns.

No issues identified.


161-161: compiler-rt correctly classified as a runtime library.

compiler-rt is an LLVM subproject that implements runtime libraries (builtins, sanitizer runtimes, profiling, etc.), so the reclassification at line 161 is architecturally sound. The config description at line 19 correctly identifies it as a runtime, and this classification is consistent across the codebase (also present in libllvm).

scripts/test.lua (1)

283-287: Conditional version consolidation logic is correct and well-protected.

The code properly distinguishes between packages with existing versions (creating a separate entry) and bare package names (updating in place). The guard on line 282 prevents null reference issues, and the whitespace split correctly extracts the base package name. The logic appropriately consolidates version information without creating duplicates.


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

@waruqi waruqi force-pushed the llvm branch 2 times, most recently from 73fb095 to 10e39cd Compare October 25, 2025 14:33
Copy link

@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

♻️ Duplicate comments (1)
packages/l/llvm/xmake.lua (1)

38-38: Version additions are correct; duplication is a known concern.

The new LLVM 21.1.0 version entries follow the established pattern and include proper checksums. The duplication between modern (on_source) and legacy blocks has been noted in previous reviews as a maintenance concern.

Also applies to: 48-48, 61-61, 76-76, 86-86, 99-99

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af695e2 and 10e39cd.

📒 Files selected for processing (2)
  • packages/l/llvm/xmake.lua (8 hunks)
  • scripts/test.lua (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). (20)
  • GitHub Check: build (ubuntu-latest, shared)
  • GitHub Check: build (windows-2025, shared, x86, MT)
  • GitHub Check: build (windows-2025, static, arm64, MT)
  • GitHub Check: build (windows-2025, shared, arm64, MD)
  • GitHub Check: build (windows-2025, static, x64, MD)
  • GitHub Check: build (ubuntu-latest, static)
  • GitHub Check: build (ubuntu-latest, shared)
  • GitHub Check: build (macos-15-intel, x86_64, shared)
  • GitHub Check: build (windows-11-arm, shared, arm64, MD)
  • GitHub Check: build (ubuntu-latest, shared, release)
  • GitHub Check: build (ubuntu-latest, static, release)
  • GitHub Check: build (MINGW32, shared, i686, /mingw32)
  • GitHub Check: build (MINGW64, static, x86_64, /mingw64)
  • GitHub Check: build (macos-14, arm64, static)
  • GitHub Check: build (windows-latest, armeabi-v7a, r27, 30)
  • GitHub Check: build (ubuntu-latest, static)
  • GitHub Check: build (ubuntu-24.04-arm, static, debug)
  • GitHub Check: build (ubuntu-24.04-arm, static, release)
  • GitHub Check: build (ubuntu-24.04-arm, shared, debug)
  • GitHub Check: build (ubuntu-24.04-arm, shared, release)
🔇 Additional comments (2)
scripts/test.lua (1)

283-287: LGTM! Correct handling of multiple version additions.

The conditional logic correctly handles the case where a package might already have a version string in the list. By checking token count, it prevents overwriting existing package+version entries when multiple versions are added in the same diff.

packages/l/llvm/xmake.lua (1)

135-135: LGTM! Expands macOS support to all architectures.

Removing the |x86_64 restriction enables LLVM installation on all macOS architectures, including Apple Silicon (ARM64). This is a beneficial change for broader platform support.

@waruqi waruqi merged commit cb5e61b into dev Oct 26, 2025
62 checks passed
@waruqi waruqi deleted the llvm branch October 26, 2025 00:05
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