-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
WalkthroughThe 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 Changes
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)
Possibly related PRs
Suggested labels
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 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
andfile: 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
📒 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
, butg++-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
andMACOS_CMAKE_ARGS
to override the default compilers. Confirm that bothg++-10
/gcc-10
andg++-14
/gcc-14
exist on the respective runners, or add installation steps.
85-85
: Separate build-type argument clearly.Extracting
-DCMAKE_BUILD_TYPE=MinSizeRel
intoPOSIX_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 dedicatedtest-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
withpattern: '**/*${{ env.suffix }}'
scopes the files correctly. Ensure this matches thesuffix
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 ofchmod +x
and version checks.
230-256
: PowerShell-based smoke-tests for Windows artifacts.Using
pwsh
withGet-ChildItem
andtry
/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 || trueLength 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 || trueLength 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 --versionLocations to update:
.github/workflows/build.yml
at lines 83–84 (definition ofLINUX_CMAKE_ARGS
)
Summary by CodeRabbit