Skip to content

fix: add -DZLIB_USE_STATIC_LIBS=ON to MACOS_CMAKE_ARGS #50

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 22 commits into from
May 12, 2025

Conversation

shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng commented Apr 21, 2025

Try to fix the following error on macOS for Clang 19 and 20

dyld[66544]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
dyld[66544]: Library not loaded: /usr/lib/libz.1.dylib
  Referenced from: <EEA7FA6A-794A-3BF4-828D-F0805E9747ED> /Users/runner/work/clang-tools-static-binaries/clang-tools-static-binaries/llvm-project-20.1.0.src/build/bin/clang-tidy-20_macosx-amd64
  Reason: tried: '/usr/lib/libz.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libz.1.dylib' (no such file), '/usr/lib/libz.1.dylib' (no such file, no dyld cache), '/usr/local/lib/libz.1.dylib' (no such file)
/Users/runner/work/_temp/e411c983-0e12-4c88-954f-04958f46d8db.sh: line 9: 66544 Abort trap: 6           ./clang-tidy-20_macosx-amd64 --version

Summary by CodeRabbit

  • Chores
    • Improved macOS build process to ensure required libraries are available for Clang version 18 and above.
    • Updated build configuration to use static linking for zlib libraries on macOS.
    • Added verification step to confirm the file type of the clang-tidy binary on macOS.
    • Allowed build workflow to continue even if clang-tidy version checks fail on macOS.
    • Simplified artifact upload and release step conditions to streamline workflow execution.

@shenxianpeng shenxianpeng added the bug Something isn't working label Apr 21, 2025
Copy link
Contributor

coderabbitai bot commented Apr 21, 2025

Caution

Review failed

The pull request is closed.

## Walkthrough

The GitHub Actions build workflow for LLVM was updated to add `-DZLIB_USE_STATIC_LIBS=ON` to the macOS CMake arguments. In the macOS build step, a `file` command is run on the renamed `clang-tidy` binary before checking its version. The version check step now includes `continue-on-error: true` to allow the workflow to proceed if the check fails on Clang versions 18 and above. Conditional expressions for artifact upload and draft release steps were simplified by removing the dependabot actor check.

## Changes

| File(s)                     | Change Summary                                                                                                                             |
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| .github/workflows/build.yml | Added `-DZLIB_USE_STATIC_LIBS=ON` to macOS CMake args; run `file` on renamed `clang-tidy` binary before version check; added `continue-on-error: true` to `clang-tidy` version check step for macOS builds; simplified conditional expressions for artifact upload and draft release steps by removing dependabot actor check |

## Possibly related PRs

- cpp-linter/clang-tools-static-binaries#46: Updates `.github/workflows/build.yml` to improve macOS build steps including verification after renaming binaries and build flags.  
- cpp-linter/clang-tools-static-binaries#42: Modifies GitHub Actions workflows for macOS build environment, adjusting CMake configuration and Homebrew update steps.  
- cpp-linter/clang-tools-static-binaries#47: Changes macOS CMake build arguments related to linking, complementing static linking flag additions here.  

## Poem

> 🐇 On macOS, the build takes flight,  
> Static libs snug, the setup’s tight.  
> Clang eighteen and up, a check may fail,  
> But bunny hops on without a wail.  
> A file command shines a little light,  
> Ensuring builds stay smooth and bright!  
> 🌿✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 b355ed0 and c90b4c6.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (3 hunks)

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 227e64e and bb3be62.

📒 Files selected for processing (1)
  • .github/workflows/build.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: build (10, linux)
  • GitHub Check: build (14, windows)
  • GitHub Check: build (13, linux)
  • GitHub Check: build (11, linux)
  • GitHub Check: build (11, windows)
  • GitHub Check: build (13, windows)
  • GitHub Check: build (12.0.1, linux)
  • GitHub Check: build (15, linux)
  • GitHub Check: build (17, windows)
  • GitHub Check: build (15, windows)
  • GitHub Check: build (19, windows)
  • GitHub Check: build (14, linux)
  • GitHub Check: build (17, linux)
  • GitHub Check: build (18, linux)
  • GitHub Check: build (16, linux)
  • GitHub Check: build (18, windows)
  • GitHub Check: build (18, macosx)
  • GitHub Check: build (19, linux)
  • GitHub Check: build (20, linux)
  • GitHub Check: build (20, windows)

@shenxianpeng
Copy link
Contributor Author

dyld[72851]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
dyld[72851]: Library not loaded: /usr/lib/libz.1.dylib
  Referenced from: <4272D7CF-D6F9-3021-893C-70E201C19D6D> /Users/runner/work/clang-tools-static-binaries/clang-tools-static-binaries/llvm-project-19.1.0.src/build/bin/clang-tidy-19_macosx-amd64
  Reason: tried: '/usr/lib/libz.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libz.1.dylib' (no such file), '/usr/lib/libz.1.dylib' (no such file, no dyld cache), '/usr/local/lib/libz.1.dylib' (no such file)
/Users/runner/work/_temp/68578d7a-dc32-4b82-864c-ec56bdd6de18.sh: line 9: 7[28](https://github.com/cpp-linter/clang-tools-static-binaries/actions/runs/14573665832/job/40875323102?pr=50#step:14:29)51 Abort trap: 6           ./clang-tidy-19_macosx-amd64 --version

@shenxianpeng shenxianpeng changed the title fix: install zlib on macos for v18+ fix: add -DZLIB_USE_STATIC_LIBS=ON to MACOS_CMAKE_ARGS May 12, 2025
@shenxianpeng shenxianpeng merged commit 37bb1b7 into master May 12, 2025
2 of 44 checks passed
@shenxianpeng shenxianpeng deleted the bugfix/install-zstd branch May 12, 2025 19:11
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