Skip to content

update build pipeline to fix macos build #56

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
May 28, 2025
Merged

Conversation

shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng commented May 27, 2025

Summary by CodeRabbit

  • Chores
    • Improved build workflow for Linux and macOS by reorganizing CMake argument handling and simplifying compiler flags.
    • Enhanced macOS compatibility by updating the deployment target to 10.15 and streamlining patching steps.
    • Added explicit smoke tests for clang tools on all platforms during the build process.
    • Introduced a new test job to verify release artifacts work correctly on Linux, macOS, and Windows.
    • Simplified the draft release step in the workflow.

@shenxianpeng shenxianpeng added the bug Something isn't working label May 27, 2025
@shenxianpeng shenxianpeng changed the title update build pipeline update build pipeline to fix macos build May 27, 2025
Copy link
Contributor

coderabbitai bot commented May 27, 2025

Walkthrough

The GitHub Actions workflow for building and releasing binaries was refactored to reorganize CMake argument handling, simplify macOS patching, and add explicit smoke test steps for Linux, macOS, and Windows. A new test-release job was introduced to verify build artifacts, and the draft release step was streamlined.

Changes

File(s) Change Summary
.github/workflows/build.yml Refactored CMake argument variables, simplified macOS patching, added explicit smoke test steps for all platforms, introduced a new test-release job, and simplified the draft-release step by removing release name/tag inputs.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Build Job
    participant Test-Release Job
    participant Draft-Release Job

    GitHub Actions->>Build Job: Start build matrix (Linux, macOS, Windows)
    Build Job->>Build Job: Set CMake args and environment variables
    Build Job->>Build Job: Patch macOS CMake files (if macOS)
    Build Job->>Build Job: Build binaries
    Build Job->>Build Job: Run smoke tests per OS (pre-rename)
    Build Job->>Build Job: Rename binaries
    Build Job->>Artifacts: Upload build artifacts

    GitHub Actions->>Test-Release Job: Start test-release matrix (Linux, macOS, Windows)
    Test-Release Job->>Artifacts: Download build artifacts
    Test-Release Job->>Test-Release Job: Run smoke tests (--version) on binaries

    GitHub Actions->>Draft-Release Job: Start draft-release
    Draft-Release Job->>Artifacts: Download build artifacts
    Draft-Release Job->>Draft-Release Job: Upload release (no name/tag input)
Loading

Possibly related PRs

Suggested labels

enhancement


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (2)
.github/workflows/build.yml (2)

137-137: Simplify macOS CMake patch scope.

The sed command applies to all matching files under Homebrew’s Cellar, generating .backup files. Consider cleaning up these backups or limiting the scope to the LLVM Cellar formula to avoid unintended edits:

-run: sed -i.backup 's/gcc_eh.*|/gcc_eh.*|gcc_ext.*|/g' $(find /usr/local/Cellar -name CMakeParseImplicitLinkInfo.cmake)
+run: >-
+  find /usr/local/Cellar/llvm* -name CMakeParseImplicitLinkInfo.cmake \
+    -exec sed -i '' 's/gcc_eh.*|/gcc_eh.*|gcc_ext.*|/g' {} \; \
+    -exec rm -f {}.backup \;

280-280: Refine release upload pattern & fix EOF.

  • Confirm that file_glob: true and file: clang-*/**/* correctly captures all intended binaries (and excludes backups or mismatches).
  • Add a newline at EOF to satisfy YAML lint (new-line-at-end-of-file).
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 280-280: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2200605 and be5b146.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (5 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/build.yml

[error] 280-280: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: build (9, linux)
  • GitHub Check: build (11, linux)
  • GitHub Check: build (12.0.1, linux)
  • GitHub Check: build (10, windows)
  • GitHub Check: build (10, linux)
  • GitHub Check: build (14, linux)
  • GitHub Check: build (12.0.1, macosx)
  • GitHub Check: build (15, windows)
  • GitHub Check: build (16, linux)
  • GitHub Check: build (18, linux)
  • GitHub Check: build (18, macosx)
  • GitHub Check: build (17, linux)
  • GitHub Check: build (15, macosx)
  • GitHub Check: build (16, windows)
  • GitHub Check: build (19, windows)
  • GitHub Check: build (16, macosx)
  • GitHub Check: build (19, linux)
  • GitHub Check: build (20, windows)
  • GitHub Check: build (20, linux)
  • GitHub Check: build (20, macosx)
🔇 Additional comments (10)
.github/workflows/build.yml (10)

65-66: Ensure macOS compiler variables match preinstalled toolchain.

The macOS runner is now macos-13, but g++-14/gcc-14 may not be available by default. Verify these compilers are installed (e.g., via Homebrew) or switch to the default Apple Clang on the runner.


83-84: Review custom compiler overrides.

You're defining LINUX_CMAKE_ARGS and MACOS_CMAKE_ARGS to override the default compilers. Confirm that both g++-10/gcc-10 and g++-14/gcc-14 exist on the respective runners, or add installation steps.


85-85: Separate build-type argument clearly.

Extracting -DCMAKE_BUILD_TYPE=MinSizeRel into POSIX_CMAKE_ARGS improves readability and consistency across POSIX platforms.


145-152: Add pre-rename smoke tests for POSIX builds.

Running each Clang tool’s --version before renaming ensures early detection of broken binaries on macOS/Linux. Nice enhancement!


153-160: Add pre-rename smoke tests for Windows builds.

Verifying each .exe with --version prior to renaming improves cross-platform reliability. Looks solid.


187-197: Introduce dedicated test-release job with OS matrix.

Adding a separate job to smoke-test downloaded artifacts on Linux, macOS, and Windows isolates validation from the build step and reduces flakiness.


198-207: Validate artifact download configuration.

Using actions/download-artifact with pattern: '**/*${{ env.suffix }}' scopes the files correctly. Ensure this matches the suffix environment variable (_${{ matrix.os }}-amd64).


208-229: Loop-based smoke-tests for POSIX artifacts.

The find … -type f loop skipping *.sha512sum files is a robust way to exercise all binaries. Good use of chmod +x and version checks.


230-256: PowerShell-based smoke-tests for Windows artifacts.

Using pwsh with Get-ChildItem and try/catch provides clear diagnostics for Windows executables. This enhances reliability across platforms.


59-59:

❓ Verification inconclusive

Verify compiler availability on Linux runner.

The os-cmake-args for Linux includes -DCMAKE_CXX_COMPILER=g++-10 and -DCMAKE_C_COMPILER=gcc-10, but Ubuntu 22.04 runners default to GCC 11. Please ensure that GCC 10 is installed or adjust to a supported compiler version.


🏁 Script executed:

#!/bin/bash
# Show definition of LINUX_CMAKE_ARGS and POSIX_CMAKE_ARGS, and any compiler flags in the workflow
grep -R "LINUX_CMAKE_ARGS" -n .github/workflows/build.yml || true
grep -R "POSIX_CMAKE_ARGS" -n .github/workflows/build.yml || true
grep -R "CMAKE_C_COMPILER" -n .github/workflows/build.yml || true
grep -R "CMAKE_CXX_COMPILER" -n .github/workflows/build.yml || true

Length of output: 1122


🏁 Script executed:

#!/bin/bash
# Check for any compiler installation or setup steps in the workflow
grep -R "apt" -n .github/workflows/build.yml || true
grep -R "actions/setup" -n .github/workflows/build.yml || true

Length of output: 113


Confirm GCC-10 Availability on Ubuntu 22.04 Runner

It looks like we’re passing -DCMAKE_CXX_COMPILER=g++-10 / -DCMAKE_C_COMPILER=gcc-10 but there’s no step in the workflow that installs or sets up GCC 10. On Ubuntu 22.04 runners the default toolchain is GCC 11, and while older versions may be present in the toolcache, it’s safest to either explicitly install GCC 10 or switch to the default compiler.

Please verify one of the following:

  • Add an installation step before invoking CMake, for example:
    - name: Install GCC 10
      run: sudo apt-get update && sudo apt-get install -y gcc-10 g++-10
  • Or update LINUX_CMAKE_ARGS to use GCC 11:
    LINUX_CMAKE_ARGS: '-DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11'
  • If you’re relying on the pre-installed toolcache, confirm that gcc-10/g++-10 are available by adding a quick version check:
    - name: Check compiler version
      run: |
        gcc-10 --version
        g++-10 --version

Locations to update:

  • .github/workflows/build.yml at lines 83–84 (definition of LINUX_CMAKE_ARGS)

@shenxianpeng shenxianpeng merged commit 11dfa47 into master May 28, 2025
52 checks passed
@shenxianpeng shenxianpeng deleted the fix-macos-build branch May 28, 2025 03:43
@coderabbitai coderabbitai bot mentioned this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant