Skip to content

Conversation

@16bit-ykiko
Copy link
Member

@16bit-ykiko 16bit-ykiko commented Nov 7, 2025

Summary by CodeRabbit

  • Chores
    • CI workflows expanded to add additional build matrix entries, including LTO-enabled variants and adjusted runtime choices for Windows to broaden build coverage.
    • Build configuration simplified to disable many optional components, enable IDE integration, and produce leaner, more focused builds for faster, smaller artifacts.

@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

Activated releasedbg/LTO matrix variants across Linux and macOS CI; switched Windows releasedbg to MT runtime with LTO enabled. xmake.lua pins LLVM to a commit, removes some subdirectory inclusions, and disables many optional LLVM/Clang components, narrowing the build scope.

Changes

Cohort / File(s) Summary
CI - Linux & macOS matrix
.github/workflows/linux.yml, .github/workflows/macos.yml
Uncovered/added build_type: releasedbg, lto: "y" matrix entries so releasedbg runs with both lto: "n" and lto: "y" alongside debug.
CI - Windows matrix
.github/workflows/windows.yml
Replaced prior releasedbg variant with one using runtimes: MT and lto: "y" (switches runtime to MT and enables LTO for that combination).
Build system - LLVM/Clang config
xmake.lua
Pinned LLVM to commit 222fc11..., added third-party to sparse checkout, removed/disabled several subdirectory inclusions and many optional LLVM/Clang components/tools (multiple CMake flags set OFF/ON), narrowing built targets.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Matrix as Job Matrix
  participant Runner as Build Runner

  rect rgb(245,250,255)
    Note over GH,Matrix: Matrix expanded to include\nreleasedbg (lto:"n") and releasedbg (lto:"y")
  end

  GH->>Matrix: expand matrix combinations
  Matrix->>Runner: dispatch jobs per combination

  alt Windows releasedbg job
    Runner->>Runner: run releasedbg (runtime=MT, LTO=y)
  else Linux/macOS releasedbg jobs
    Runner->>Runner: run releasedbg (LTO=n) or (LTO=y)
  end

  Runner->>GH: upload artifacts / report status
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect xmake.lua changes carefully (commit pin, many CMake toggles, removed subdirs).
  • Verify CI matrix duplication/conflict and concurrency/group naming.
  • Confirm Windows runtime MT + LTO interactions and packaging implications.

Possibly related PRs

  • 21.1.4 #8 — overlaps CI matrix changes (releasedbg/LTO) and xmake.lua build-configuration updates.
  • fix: llvm 21.1.4 build #9 — related edits to LLVM/CMake configuration and target selection in xmake.lua.

Suggested reviewers

  • aurora0x27

Poem

🐰 I hopped through matrix rows tonight,

LTO sparkles in releasedbg light,
Windows dons MT for the run,
xmake trimmed till builds weigh none,
Little paws cheer — CI done! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 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.
Title check ✅ Passed The title 'add lto release build' accurately reflects the primary change: enabling LTO (Link Time Optimization) for releasedbg build configurations across all workflow files (linux.yml, macos.yml, windows.yml), which is the main focus of the changeset.
✨ 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 21.1.4-lto

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

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f68dc00 and f932795.

📒 Files selected for processing (4)
  • .github/workflows/linux.yml (1 hunks)
  • .github/workflows/macos.yml (1 hunks)
  • .github/workflows/windows.yml (1 hunks)
  • xmake.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). (8)
  • GitHub Check: build (releasedbg, MT, y)
  • GitHub Check: build (releasedbg, MD, n)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (debug, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (debug, n)
  • GitHub Check: build (releasedbg, n)
🔇 Additional comments (4)
.github/workflows/windows.yml (1)

16-18: LGTM! Matrix entry properly configured.

The new releasedbg build with MT runtime and LTO enabled complements the existing MD runtime configuration. The concurrency grouping and artifact naming will correctly differentiate these two variants.

.github/workflows/linux.yml (1)

17-18: LGTM! Consistent matrix expansion.

The new releasedbg configuration with LTO enabled aligns with the PR objectives and maintains consistency with the macOS and Windows workflow changes.

.github/workflows/macos.yml (1)

17-18: LGTM! Cross-platform consistency achieved.

The macOS workflow now matches the Linux and Windows configurations with the addition of releasedbg with LTO enabled, providing consistent build options across all platforms.

xmake.lua (1)

130-140: LGTM! Platform-specific configurations are appropriate.

The platform-specific compiler and linker settings are well-configured:

  • Windows: clang-cl for MSVC ABI compatibility
  • Linux: lld for faster linking with LTO
  • macOS: arm64 architecture with appropriate Homebrew tool paths and lld linker

These settings align well with the PR's goal of supporting LTO builds across platforms.

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)
xmake.lua (1)

76-86: Remove duplicate configuration flags.

The duplicate CMake flags identified in a previous review are still present:

  • LLVM_ENABLE_ZSTD=OFF appears on both lines 77 and 81
  • LLVM_ENABLE_LIBXML2=OFF appears on both lines 78 and 85

Apply this diff to remove the duplicates:

             "-DLLVM_ENABLE_ZLIB=OFF",
             "-DLLVM_ENABLE_ZSTD=OFF",
             "-DLLVM_ENABLE_LIBXML2=OFF",
             "-DLLVM_ENABLE_BINDINGS=OFF",
             "-DLLVM_ENABLE_IDE=ON",
-            "-DLLVM_ENABLE_ZSTD=OFF",
             "-DLLVM_ENABLE_Z3_SOLVER=OFF",
             "-DLLVM_ENABLE_LIBEDIT=OFF",
             "-DLLVM_ENABLE_LIBPFM=OFF",
-            "-DLLVM_ENABLE_LIBXML2=OFF",
             "-DLLVM_ENABLE_OCAMLDOC=OFF",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7533f18 and 14f6535.

📒 Files selected for processing (1)
  • xmake.lua (2 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). (8)
  • GitHub Check: build (releasedbg, MT, y)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (releasedbg, MD, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (debug, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (debug, n)
🔇 Additional comments (2)
xmake.lua (2)

72-73: Clarify the removal of LTO tools while enabling LTO in the build.

These lines remove the lto tool subdirectory and implicit projects. However, line 129 enables LTO for the build (-DLLVM_ENABLE_LTO=...). While this is likely intentional (disabling the standalone LTO tools while using LTO compiler optimization), please confirm this doesn't impact the LTO build functionality that the PR objectives require.


102-102: Typo fixed - LGTM!

The typo in CLANG_TOOL_LIBCLANG_BUILD that was flagged in a previous review has been corrected. The value is now properly set to OFF instead of the incomplete O.

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 (2)
xmake.lua (2)

28-28: Past comment still applies: Incorrect commit hash for LLVM 21.1.4.

This issue was previously flagged and remains unresolved. The commit hash 222fc11f2b8f25f6a0f4976272ef1bb7bf49521d does not correspond to the llvmorg-21.1.4 tag.


79-91: Past comment still applies: Remove duplicate configuration flags.

The duplicate flags issue previously identified remains unresolved:

  • LLVM_ENABLE_ZSTD=OFF appears on both lines 80 and 84
  • LLVM_ENABLE_LIBXML2=OFF appears on both lines 81 and 88
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14f6535 and 4f2a0cd.

📒 Files selected for processing (1)
  • xmake.lua (2 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: build (releasedbg, y)
  • GitHub Check: build (releasedbg, MD, n)
  • GitHub Check: build (releasedbg, MT, y)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (debug, n)
🔇 Additional comments (1)
xmake.lua (1)

72-73: Verify that removing the LTO tool is intentional.

Given the PR title mentions "lto", removing add_llvm_tool_subdirectory(lto) might seem contradictory. However, this removes the llvm-lto command-line tool (which is separate from enabling LTO for the LLVM build itself via -DLLVM_ENABLE_LTO). Since line 97 already sets LLVM_BUILD_TOOLS=OFF and the goal appears to be a minimal build, this is likely intentional.

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: 0

🧹 Nitpick comments (1)
xmake.lua (1)

76-105: Configuration flags appropriately narrow the build scope.

The CMake flags correctly disable docs, tests, examples, benchmarks, and most tools, which aligns with building only the specific targets listed in lines 150-171. The approach of disabling unused components should reduce build time and resource usage.

Note: Line 96 has a commented-out flag. Consider either removing it or documenting why it's preserved.

If the commented flag is no longer needed, apply this diff:

             "-DLLVM_INCLUDE_DOCS=OFF",
             "-DLLVM_BUILD_UTILS=OFF",
             "-DLLVM_BUILD_TOOLS=OFF",
-            -- "-DLLVM_INCLUDE_TOOLS=OFF",
             "-DCLANG_BUILD_TOOLS=OFF",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f2a0cd and ad7575b.

📒 Files selected for processing (1)
  • xmake.lua (3 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). (8)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (debug, n)
  • GitHub Check: build (debug, n)
  • GitHub Check: build (releasedbg, n)
  • GitHub Check: build (releasedbg, y)
  • GitHub Check: build (releasedbg, MT, y)
  • GitHub Check: build (releasedbg, MD, n)
🔇 Additional comments (3)
xmake.lua (3)

17-17: LGTM – Adding third-party checkout.

Including "third-party" in the sparse checkout is reasonable for the updated build configuration.


81-81: Verify LLVM_ENABLE_IDE=ON is intentional for CI builds.

Enabling IDE support generates IDE-specific project files, which is typically unnecessary for CI/headless builds. Confirm this is intended (e.g., if developers will use these artifacts locally).


71-74: Subdirectory removals are isolated and align with narrowed build scope.

The removal of tool-template, lto tool subdirectory, and implicit projects is consistent with LLVM_BUILD_TOOLS=OFF (line 95). Verification confirms these removals have no other references in the codebase. Note that line 73 removes the LTO tool subdirectory, not LTO compilation mode itself (controlled by line 130).

@16bit-ykiko 16bit-ykiko changed the title build 21.1.4 lto dbg update to llvm 20.1.5 Nov 8, 2025
@16bit-ykiko 16bit-ykiko changed the title update to llvm 20.1.5 add lto release build Nov 8, 2025
@16bit-ykiko 16bit-ykiko merged commit b45924c into main Nov 8, 2025
9 checks passed
@star-hengxing star-hengxing deleted the 21.1.4-lto branch November 8, 2025 14:45
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.

3 participants