starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

fix the compile error on mac m1

Open zhangm365 opened this issue 3 weeks ago • 2 comments

Why I'm doing:

when I compile the main branch, it occurs some errors.

What I'm doing:

Please review if the fix is reasonable.

Fixes #issue

What type of PR is this:

  • [x] BugFix
  • [ ] Feature
  • [ ] Enhancement
  • [ ] Refactor
  • [ ] UT
  • [ ] Doc
  • [ ] Tool

Does this PR entail a change in behavior?

  • [x] Yes, this PR will result in a change in behavior.
  • [ ] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • [ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • [ ] Parameter changes: default values, similar parameters but with different default values
  • [ ] Policy changes: use new policy to replace old one, functionality automatically enabled
  • [ ] Feature removed
  • [ ] Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • [ ] I have added test cases for my bug fix or my new feature
  • [ ] This pr needs user documentation (for new or modified features or behaviors)
    • [ ] I have added documentation for my new feature or new function
  • [ ] This is a backport pr

Bugfix cherry-pick branch check:

  • [ ] I have checked the version labels which the pr will be auto-backported to the target branch
    • [ ] 4.0
    • [ ] 3.5
    • [ ] 3.4
    • [ ] 3.3

[!NOTE] Fixes macOS ARM64 build by falling back to pre-generated thrift/protobuf sources when gensrc is missing and enforcing system binutils across third-party builds; also relaxes RawString ABI guard for libc++.

  • Build (macOS)
    • Fallback to checked-in generated sources when ${GENSRC_DIR}/gen_cpp or AgentService_types.cpp is missing in be/src/gen_cpp/CMakeLists.txt and build-mac/CMakeLists.txt, with warnings and hard errors if still absent.
    • Add sentinel checks for thrift outputs and ensure generated dirs exist before proceeding.
  • Third-party build script (build-mac/build_thirdparty.sh)
    • Force macOS system binutils (/usr/bin/ar, ranlib, strip) via env and cmake_toolchain_args; pass these to all CMake-based builds (gflags, glog, brpc, rocksdb, velocypack, vectorscan, simdutf, fmt, roaring, etc.).
    • Patch Boost build to use a custom clang toolset and system binutils; adjust b2 invocation accordingly.
    • Use system binutils when injecting libc++ __hash_memory shims into archives (protobuf, vectorscan, roaring).
  • C++ source tweaks
    • Add be/src/gen_cpp/common/env_config.h (generated config stub).
    • Update be/src/util/raw_container.h to allow RawString optimization under libc++ by guarding only against legacy libstdc++ ABI.

Written by Cursor Bugbot for commit ba5b8e5f8b1ea30a4930fb87266154ffd51241b8. This will update automatically on new commits. Configure here.

zhangm365 avatar Dec 06 '25 06:12 zhangm365

🧪 CI Insights

Here's what we observed from your CI run for ba5b8e5f.

🟢 All jobs passed!

But CI Insights is watching 👀

mergify[bot] avatar Dec 06 '25 06:12 mergify[bot]

@cursor review

alvin-celerdata avatar Dec 12 '25 07:12 alvin-celerdata