-
Notifications
You must be signed in to change notification settings - Fork 2
21.1.4 #8
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
21.1.4 #8
Conversation
WalkthroughCI matrices replace Changes
Sequence DiagramsequenceDiagram
participant CI as CI Matrix
participant GH as GitHub Actions
participant Runner as Job Runner
participant XMake as xmake (llvm)
participant CMake as CMake
Note over CI,GH #E8F5E9: matrix entries use build_type = releasedbg / release / debug
CI->>GH: select matrix entry (matrix.build_type)
GH->>Runner: start job, pass matrix.build_type
Runner->>Runner: Setup xmake
alt Linux job
Runner->>Runner: Increase Swap Space (swapoff, create /mnt/swapfile 16G, mkswap, swapon, report)
end
alt macOS job
Runner->>Runner: brew install llvm@20 lld@20
Runner->>Runner: export SDKROOT via xcrun --sdk macosx --show-sdk-path
end
alt Windows job
Runner->>GH: enforce concurrency (cancel-in-progress)
Runner->>XMake: invoke xmake config --mode=${{ matrix.build_type }}
else non-Windows job
Runner->>XMake: invoke xmake config (mode from get_config)
end
XMake->>XMake: read package:config("mode") / get_config("mode")
XMake->>CMake: configure with -DCMAKE_BUILD_TYPE = map(mode)
Note right of CMake #FFF3E0: Debug / Release / RelWithDebInfo
CMake->>XMake: build artifacts
XMake->>GH: upload artifacts (names include mode, compressed)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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). (5)
🔇 Additional comments (15)
Comment |
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/windows.yml (1)
34-37: Missing --mode causes wrong build type on WindowsBoth matrix entries currently build with the package’s default mode (releasedbg). Pass the matrix build_type explicitly.
Apply this diff:
- xmake config --yes --verbose --runtimes=${{ matrix.runtimes }} --policies=build.optimization.lto:${{ matrix.lto }} + xmake config --yes --verbose --mode=${{ matrix.build_type }} --runtimes=${{ matrix.runtimes }} --policies=build.optimization.lto:${{ matrix.lto }}xmake.lua (1)
98-103: LTO knob is referenced but never defined/passed
package:config("lto")is always nil, so LLVM is built without LTO regardless of the CI matrix. Define and pass anltoconfig.Apply these diffs:
- Expose
ltoto the package (near other configs):- add_configs("mode", {description = "Build type", default = "releasedbg", type = "string", values = {"debug", "release", "releasedbg"}}) + add_configs("mode", {description = "Build type", default = "releasedbg", type = "string", values = {"debug", "release", "releasedbg"}}) + add_configs("lto", {description = "Enable LTO for LLVM build", default = false, type = "boolean"})
- Pass
ltofrom project config into add_requires (top block):- mode = get_config("mode"), + mode = get_config("mode"), + lto = get_config("lto"),
- Update CI to propagate matrix LTO to xmake (Linux/macOS/Windows “Package” step):
- xmake config ... --policies=build.optimization.lto:${{ matrix.lto }} + xmake config ... --lto=${{ matrix.lto }} --policies=build.optimization.lto:${{ matrix.lto }}
🧹 Nitpick comments (3)
xmake.lua (3)
91-97: Use canonical CMake build type casingCMake’s canonical name is
RelWithDebInfo. Uppercase usually works, but prefer the standard form to avoid edge cases in tooling.Apply this diff:
- ["releasedbg"] = "RELWITHDEBINFO", + ["releasedbg"] = "RelWithDebInfo",
168-178: Avoid shadowing the globalformatfunction
local formatshadows the commonly used formatting helper; it’s easy to misuse later. Rename toarchive_ext.Example change:
- local format + local archive_ext if package:is_plat("windows") then abi = "msvc" - format = ".7z" + archive_ext = ".7z" elseif package:is_plat("linux") then abi = "gnu" - format = ".tar.xz" + archive_ext = ".tar.xz" elseif package:is_plat("macosx") then abi = "apple" - format = ".tar.xz" + archive_ext = ".tar.xz" endAnd later:
local archive_file = path.join(os.scriptdir(), "build/package", archive_name .. archive_ext)
180-186: Artifact name doesn’t reflect the new “releasedbg” modeArchive name collapses releasedbg into “release”. Include
package:config("mode")to prevent ambiguity.Minimal tweak:
local archive_name = table.concat({ package:arch(), package:plat(), abi, package:config("mode") -- debug | release | releasedbg }, "-")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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(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 (release, y)
- GitHub Check: build (release, y)
- GitHub Check: build (releasedbg, n)
- GitHub Check: build (debug, n)
- GitHub Check: build (releasedbg, n)
- GitHub Check: build (releasedbg, MD, n)
- GitHub Check: build (release, MT, y)
- GitHub Check: build (debug, n)
🔇 Additional comments (5)
.github/workflows/linux.yml (1)
13-18: Matrix change to releasedbg looks goodAligns with xmake.lua’s new mode mapping;
--mode=${{ matrix.build_type }}already propagates it. No further action..github/workflows/macos.yml (1)
13-18: Consistent switch to releasedbgMatches the new mode-driven build;
--mode=${{ matrix.build_type }}ensures correct CMake build type..github/workflows/windows.yml (1)
9-9: Confirm runner image availabilityPlease verify
runs-on: windows-2025is available in your org; fallback is commonlywindows-2022.xmake.lua (2)
6-9: Mode propagation into package configs — LGTM
mode = get_config("mode")plusadd_configs("mode", ...)correctly wires debug/release/releasedbg through.
27-31: Versioning and default mode — LGTMGit-tagged versions and default mode "releasedbg" look correct.
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
xmake.lua (2)
19-22: Sparse checkout not respecting custom mode config.The sparse checkout list uses
is_mode("debug")to conditionally includeruntimesandcompiler-rt, but this checks the xmake mode (-m debug) rather than the custom mode config (--mode=debug). This means--mode=debugwon't include these directories in the sparse checkout, which could cause build failures when ASAN is needed.Update to use the custom mode config:
-- Enable asan -if is_mode("debug") then +if get_config("mode") == "debug" then table.insert(sparse_checkout_list, "runtimes") table.insert(sparse_checkout_list, "compiler-rt") end
108-114: ASAN enablement not respecting custom mode config.Line 108 uses
package:is_debug()which reads thedebugconfig set at line 7. Since line 7 usesis_mode("debug")instead of checking the custom mode config, ASAN won't be enabled when building with--mode=debugunless-m debugis also set.This is a consequence of the inconsistency flagged at lines 6-9.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/windows.yml(2 hunks)xmake.lua(4 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 (release, y)
- GitHub Check: build (debug, n)
- GitHub Check: build (release, MT, y)
- GitHub Check: build (debug, n)
- GitHub Check: build (releasedbg, n)
- GitHub Check: build (release, y)
- GitHub Check: build (releasedbg, MD, n)
🔇 Additional comments (6)
.github/workflows/windows.yml (2)
13-18: LGTM! Matrix configuration aligns with new mode-based build system.The updated matrix correctly defines two build variants with the new
releasedbgmode, and the configurations are appropriate for each variant.
36-36: LGTM! Mode flag correctly passed to xmake.The
--mode=${{ matrix.build_type }}flag properly passes the build type to xmake, which aligns with the new mode configuration in xmake.lua.xmake.lua (4)
25-28: LGTM! Git-based versioning correctly configured.The switch to git URLs with sparse checkout and the addition of versioned git tags is appropriate and correctly formatted.
30-30: Verify default mode choice.The new mode config defaults to
"releasedbg"(RelWithDebInfo). Most projects default to"release". While this provides better debugging experience with optimizations, ensure this aligns with your intended default build behavior.
91-96: LGTM! Build type mapping is correct.The mapping from mode values to CMAKE_BUILD_TYPE is accurate:
- debug → Debug
- release → Release
- releasedbg → RelWithDebInfo
184-185: LGTM! Archive naming correctly uses custom mode config.The archive naming correctly references
package:config("mode")to include the build type in the filename.
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
xmake.lua (1)
6-9: Inconsistency between custom mode config and xmake mode checks.The same issue flagged in the previous review remains: line 6 uses
get_config("mode")while lines 7-8 still useis_mode("debug"). These check different things, causingdebugandsharedto remain false even when--mode=debugis passed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/linux.yml(2 hunks)xmake.lua(5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/linux.yml
🔇 Additional comments (6)
xmake.lua (6)
26-31: LGTM!The migration to git URLs with sparse checkout is properly configured, and the new
modeconfig correctly defines the three build types with a sensible default of "releasedbg".
90-99: LGTM!The OOM mitigation flags (
LLVM_PARALLEL_LINK_JOBS=1andCMAKE_JOB_POOL_LINK=console) and native-only target build are sensible additions that align with the Linux workflow's swap space increase.
101-106: LGTM!The build type mapping correctly translates the custom
modevalues to CMake build types, and the implementation properly usespackage:config("mode").
110-112: LGTM!The ASAN check correctly uses
package:config("mode")for consistency with the new mode-driven build approach.
186-186: LGTM!The archive naming correctly uses
package:config("mode")for consistency with the new mode-driven build approach.
119-122: Verify hardcoded libtool path is appropriate for your build environments.The hardcoded path
/opt/homebrew/opt/llvm@20/bin/llvm-libtool-darwinappears only once in the codebase with no fallback mechanism. Confirm this is:
- Intentional for CI-only or all macOS builds
- Documented in build/setup instructions
- Acceptable if llvm@20 is not installed in local development environments
If this should work across different environments, consider detecting or making this path configurable.
Summary by CodeRabbit
New Features
Chores