Skip to content

build(go): make bash build.sh work on macOS arm64 (Homebrew) - #15009

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
Zzappy24:pr/macos-arm64-build-fixes
May 21, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
Zzappy24:pr/macos-arm64-build-fixes

Conversation

@Zzappy24

Copy link
Copy Markdown
Contributor

Problem

The Go server build pipeline (build.sh + CMake + CGO bindings) was tested on Ubuntu only. On macOS arm64 with Homebrew it fails in five orthogonal places. None of these require platform-specific code paths — the same source builds on both Linux and Darwin after these fixes.

Reproduction (before)

$ uname -a
Darwin … 25.4.0 arm64
$ brew install cmake pcre2 simde
$ bash build.sh
…
error: 'simde/x86/sse4.1.h' file not found
error: implicit instantiation of undefined template 'std::basic_istringstream<char>'
error: no matching function for call to 'Join'
…
clang: error: no such file or directory: '/usr/local/lib/libpcre2-8.a'

Fix (5 small, orthogonal changes)

1. internal/cpp/CMakeLists.txt — find Homebrew + libpcre2-8 portably

  • Detect Apple platforms via if(APPLE), call brew --prefix once, add ${HOMEBREW_PREFIX}/include and ${HOMEBREW_PREFIX}/lib. No effect on Linux.
  • Replace the literal libpcre2-8.a link token (which only the Linux linker finds in /usr/local/lib by default) with find_library(PCRE2_LIB NAMES pcre2-8 REQUIRED). Works on /usr/lib/x86_64-linux-gnu (Debian/Ubuntu), /usr/local/lib (Intel Mac & legacy Linux), /opt/homebrew/lib (Apple Silicon).

2. internal/cpp/wordnet_lemmatizer.cpp + internal/cpp/rag_analyzer.cpp — explicit #include <sstream>

libstdc++ (Linux) pulls <sstream> in transitively via <fstream>; libc++ (Apple Clang) doesn't, so the existing std::istringstream / std::ostringstream uses fail to compile on macOS. One-line include in each file.

3. internal/cpp/rag_analyzer.cpp — Join template overload fix

Join(tokens, start, tokens.size(), delim) at line 146 passes size_t to an int parameter. C++23 strict mode in Apple Clang refuses the implicit narrowing and reports the 4-arg overload as a substitution failure, leaving the call ambiguous between the 3-arg and 4-arg templates. Fix: explicit static_cast<int>(tokens.size()). Behaviour identical on libstdc++ — the narrowing was always intentional.

4. internal/binding/rag_analyzer.go — split darwin CGO LDFLAGS

The existing #cgo darwin LDFLAGS: ... /usr/local/lib/libpcre2-8.a only matches Intel Macs. Apple Silicon Homebrew installs to /opt/homebrew. Split into darwin,arm64 and darwin,amd64 build constraints with the right absolute path on each.

5. build.sh — accept Homebrew path in the pcre2 sanity check

The sanity check looked at two Linux paths only and then fell through to sudo apt -y install libpcre2-dev on failure. Added /opt/homebrew/lib/libpcre2-8.a, and on Darwin failure now exits cleanly with the right brew install pcre2 hint instead of trying apt.

Verified

  • bash build.sh now completes on macOS arm64 (Apple Silicon, brew 4.x, cmake 4.x, Apple Clang 17, Go 1.25, pcre2 10.x, simde 0.8.x).
  • Produced binaries: bin/server_main, bin/admin_server, bin/ragflow_cli.
  • bin/server_main boots, connects MySQL, runs migrations, loads the 64 model provider configs cleanly.
  • Still builds on Linux — the CMake additions are inside an if(APPLE) guard, the find_library call matches Linux paths too, the build.sh check still tries apt when not on Darwin.

Out of scope

The Go server itself currently fails at runtime when not pointing at Elasticsearch (Failed to initialize doc engine: failed to ping Elasticsearch), but that's the placeholder Infinity engine documented in internal/engine/README.md — unrelated to this build patchset.


Happy to split this into smaller PRs if you'd prefer (one per file). The five changes are independent.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 19, 2026
@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8ddf46b0-23f4-4df2-b265-83930a20fd4a

📥 Commits

Reviewing files that changed from the base of the PR and between b6d01aa and c59a809.

📒 Files selected for processing (5)
  • build.sh
  • internal/binding/rag_analyzer.go
  • internal/cpp/CMakeLists.txt
  • internal/cpp/rag_analyzer.cpp
  • internal/cpp/wordnet_lemmatizer.cpp
✅ Files skipped from review due to trivial changes (1)
  • internal/cpp/wordnet_lemmatizer.cpp

📝 Walkthrough

Walkthrough

Cross-platform build improvements add portable PCRE2 discovery in CMake, architecture-specific macOS linking in cgo and build scripts, and explicit C++ includes/overload fix for libc++ compatibility.

Changes

Cross-Platform Build and Library Portability

Layer / File(s) Summary
PCRE2 cross-platform discovery and CMake linking
internal/cpp/CMakeLists.txt
CMakeLists.txt adds Homebrew-aware PCRE2 discovery with execute_process and find_library, then updates rag_tokenizer, rag_tokenizer_c_api, and rag_analyzer_c_test targets to link against the resolved ${PCRE2_LIB} instead of hardcoded libpcre2-8.a.
Platform and architecture-specific PCRE2 configuration
build.sh, internal/binding/rag_analyzer.go
build.sh expands the libpcre2-8.a dependency check to include /opt/homebrew/lib/ and exits with a Homebrew install instruction on macOS; rag_analyzer.go replaces a single darwin cgo LDFLAGS with per-architecture directives for darwin,arm64 and darwin,amd64 using the appropriate library paths.
C++ standard library portability fixes
internal/cpp/rag_analyzer.cpp, internal/cpp/wordnet_lemmatizer.cpp
rag_analyzer.cpp adds explicit <sstream> include and casts tokens.size() to int in the 3-argument Join overload to resolve C++23 overload ambiguity; wordnet_lemmatizer.cpp adds explicit <sstream> include for cross-platform header availability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through paths so fine,
Homebrew-aware, no static bind,
CMake seeks libraries near and far,
ARM and Intel linked beneath one star,
Headers explicit — build runs kind.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main objective: fixing the build script to work on macOS arm64 with Homebrew.
Description check ✅ Passed The description comprehensively covers the problem, reproduction steps, all five fixes with detailed explanations, and verification across platforms.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@JinHai-CN JinHai-CN added the ci Continue Integration label May 20, 2026
@JinHai-CN

Copy link
Copy Markdown
Member

@Zzappy24 Since previous PR includes a binary file which is very big. So, I reset the head of main branch. Would you please re-submit the commit from current HEAD of main branch? Thank you very much.

@Zzappy24

Copy link
Copy Markdown
Contributor Author

of course no problem, thank you for you response, I will re-submit as soon as possible

@Zzappy24
Zzappy24 force-pushed the pr/macos-arm64-build-fixes branch from 3263135 to b6d01aa Compare May 20, 2026 13:32
@Zzappy24

Copy link
Copy Markdown
Contributor Author

Re-submitted: rebased onto the current main HEAD (dc01e0e51) and force-pushed. The branch is now a single clean commit, thanks for your work, I will do my best to help if I can, have a nice day

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
build.sh (1)

36-41: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align check_cpp_deps pcre2 check with the updated build_go logic for macOS.

The check_cpp_deps function still only checks Linux paths and prints an apt-get warning. macOS users running ./build.sh --cpp will see misleading instructions, even though CMake (via the Homebrew detection you added in CMakeLists.txt) may successfully locate pcre2.

For consistency and better UX, consider updating check_cpp_deps to match the build_go approach:

Suggested alignment
     # Check for pcre2 library
-    if [ -f "/usr/lib/x86_64-linux-gnu/libpcre2-8.a" ] || [ -f "/usr/local/lib/libpcre2-8.a" ]; then
+    if [ -f "/usr/lib/x86_64-linux-gnu/libpcre2-8.a" ] \
+       || [ -f "/usr/local/lib/libpcre2-8.a" ] \
+       || [ -f "/opt/homebrew/lib/libpcre2-8.a" ]; then
         echo "✓ pcre2 library found"
     else
+        if [ "$(uname)" = "Darwin" ]; then
+            echo -e "${YELLOW}Warning: libpcre2-8.a not found. Install with: brew install pcre2${NC}"
+        else
             echo -e "${YELLOW}Warning: libpcre2-8.a not found. You may need to install libpcre2-dev:${NC}"
             echo "  sudo apt-get install libpcre2-dev"
+        fi
     fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@build.sh` around lines 36 - 41, The check_cpp_deps function currently only
checks Linux library paths and prints an apt-get instruction; update it to
detect macOS/Homebrew like the build_go logic/CMakeLists.txt does by checking
for Homebrew-installed pcre2 locations (e.g., /usr/local/opt/pcre2/lib or $(brew
--prefix)/opt/pcre2/lib) or using brew --prefix when available, and change the
warning text to show platform-appropriate install commands (apt-get for Linux,
brew install pcre2 for macOS) so macOS users running ./build.sh --cpp receive
correct instructions and the check aligns with CMakeLists.txt behavior.
🧹 Nitpick comments (2)
internal/cpp/CMakeLists.txt (2)

24-27: 💤 Low value

Clarify the comment about the previous linking approach.

The comment states "upstream used the literal token ${PCRE2_LIB}" but according to the AI summary and the change description, the old code used the literal string "libpcre2-8.a", not a variable. The phrasing is confusing.

Consider revising to:

-# Resolve libpcre2-8 portably — upstream used the literal token `${PCRE2_LIB}`
+# Resolve libpcre2-8 portably — upstream used the literal library name 'libpcre2-8.a'
 # which only works on systems whose default linker search path already
 # contains it. find_library picks it up from either /usr/local/lib (Linux)
 # or /opt/homebrew/lib (macOS).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cpp/CMakeLists.txt` around lines 24 - 27, The comment about
resolving libpcre2-8 should be clarified: replace the inaccurate phrase
referencing the literal token `${PCRE2_LIB}` with the actual prior approach (the
literal string "libpcre2-8.a") and explain that find_library is used instead to
portably locate the library (e.g., in /usr/local/lib or /opt/homebrew/lib);
update the comment near the PCRE2_LIB mention to reference "libpcre2-8.a" and
state that find_library is used to avoid relying on hard-coded filenames.

10-22: ⚡ Quick win

Consider adding HINTS parameter to find_library for more robust Homebrew path resolution.

The link_directories() call on line 20 affects only the linker, not find_library's search paths per CMake documentation. While the current code successfully builds on macOS arm64 with Homebrew (verified in commit b6d01aa), adding an explicit HINTS parameter makes the dependency resolution more robust and reduces reliance on platform-specific CMake heuristics:

Suggested change
find_library(PCRE2_LIB NAMES pcre2-8 HINTS "${HOMEBREW_PREFIX}/lib" REQUIRED)

This ensures find_library checks the Homebrew location first on all platforms, improving clarity and maintainability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/cpp/CMakeLists.txt` around lines 10 - 22, The CMake snippet sets
HOMEBREW_PREFIX and calls include_directories() and link_directories(), but
find_library isn't being guided to Homebrew's lib path; update the PCRE2 (and
other relevant) find_library calls to include HINTS "${HOMEBREW_PREFIX}/lib" so
CMake searches Homebrew first (e.g., modify the find_library call that defines
PCRE2_LIB to add HINTS "${HOMEBREW_PREFIX}/lib"), keeping the existing
include_directories(HOMEBREW_PREFIX/include) and link_directories intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@build.sh`:
- Around line 36-41: The check_cpp_deps function currently only checks Linux
library paths and prints an apt-get instruction; update it to detect
macOS/Homebrew like the build_go logic/CMakeLists.txt does by checking for
Homebrew-installed pcre2 locations (e.g., /usr/local/opt/pcre2/lib or $(brew
--prefix)/opt/pcre2/lib) or using brew --prefix when available, and change the
warning text to show platform-appropriate install commands (apt-get for Linux,
brew install pcre2 for macOS) so macOS users running ./build.sh --cpp receive
correct instructions and the check aligns with CMakeLists.txt behavior.

---

Nitpick comments:
In `@internal/cpp/CMakeLists.txt`:
- Around line 24-27: The comment about resolving libpcre2-8 should be clarified:
replace the inaccurate phrase referencing the literal token `${PCRE2_LIB}` with
the actual prior approach (the literal string "libpcre2-8.a") and explain that
find_library is used instead to portably locate the library (e.g., in
/usr/local/lib or /opt/homebrew/lib); update the comment near the PCRE2_LIB
mention to reference "libpcre2-8.a" and state that find_library is used to avoid
relying on hard-coded filenames.
- Around line 10-22: The CMake snippet sets HOMEBREW_PREFIX and calls
include_directories() and link_directories(), but find_library isn't being
guided to Homebrew's lib path; update the PCRE2 (and other relevant)
find_library calls to include HINTS "${HOMEBREW_PREFIX}/lib" so CMake searches
Homebrew first (e.g., modify the find_library call that defines PCRE2_LIB to add
HINTS "${HOMEBREW_PREFIX}/lib"), keeping the existing
include_directories(HOMEBREW_PREFIX/include) and link_directories intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5df6118d-9676-4591-925a-5a7071513e5d

📥 Commits

Reviewing files that changed from the base of the PR and between 3263135 and b6d01aa.

📒 Files selected for processing (5)
  • build.sh
  • internal/binding/rag_analyzer.go
  • internal/cpp/CMakeLists.txt
  • internal/cpp/rag_analyzer.cpp
  • internal/cpp/wordnet_lemmatizer.cpp

Upstream's Go server build pipeline (build.sh + CMake + CGO) was tested on
Ubuntu 22.04 only. On macOS arm64 with Homebrew it fails in five places,
none of which require any platform-specific code path — the same builds
now succeed on both Linux and Darwin. Each fix is small and targeted.

These patches are upstream-friendly and the intent is to PR them back to
infiniflow/ragflow so we don't have to carry the diff at each merge.

Changes
-------

1. internal/cpp/CMakeLists.txt — find Homebrew + libpcre2-8 portably.
   - Detect Apple platforms via if(APPLE), call `brew --prefix` once,
     add ${HOMEBREW_PREFIX}/include and ${HOMEBREW_PREFIX}/lib to the
     project's include/link paths. No effect on Linux.
   - Replace the literal `libpcre2-8.a` token (only found by the linker
     on Linux's default /usr/local/lib search path) with the result of
     `find_library(PCRE2_LIB NAMES pcre2-8 REQUIRED)`. Works on both
     /opt/homebrew/lib (Apple Silicon), /usr/local/lib (Intel Mac and
     legacy Linux) and /usr/lib/x86_64-linux-gnu (Debian/Ubuntu).

2. internal/cpp/wordnet_lemmatizer.cpp + internal/cpp/rag_analyzer.cpp —
   add explicit `#include <sstream>` next to the existing `<fstream>`
   include. libstdc++ (Linux) pulls in <sstream> transitively, libc++
   (Apple Clang) doesn't, so `std::istringstream` / `std::ostringstream`
   are unknown types on macOS without the include. Both files use these
   types directly.

3. internal/cpp/rag_analyzer.cpp — `Join(...)` template overload fix.
   Line 146 called `Join(tokens, start, tokens.size(), delim)` which
   passes `size_t` to an `int` parameter. C++23 strict mode in Apple
   Clang refuses the implicit narrowing and reports the 4-arg overload
   as a substitution failure, leaving the call ambiguous between the
   3-arg and 4-arg templates. Fix: explicit `static_cast<int>(...)`.
   Behaviour identical on libstdc++ — narrowing was always intentional.

4. internal/binding/rag_analyzer.go — split `darwin` CGO LDFLAGS into
   `darwin,arm64` and `darwin,amd64` build constraints. The previous
   `#cgo darwin LDFLAGS: ... /usr/local/lib/libpcre2-8.a` only worked on
   Intel Macs where Homebrew installs to /usr/local; Apple Silicon
   Homebrew installs to /opt/homebrew. Both constraints now resolve.

5. build.sh — pcre2 sanity-check accepts /opt/homebrew/lib in addition
   to the two existing Linux paths. On macOS without pcre2 installed it
   now fails cleanly with the right brew command instead of attempting
   `sudo apt -y install libpcre2-dev`.

Adopted from upstream main (post-2026-05-15 merge)
--------------------------------------------------
6. conf/models/zhipu-ai.json — invalid JSON (missing comma after
   "image2text") fixed upstream in a later commit. Adopting that
   version now so the Go binary can boot locally; the next merge
   upstream will be a no-op on this file.

Verified
--------
- `bash build.sh` completes on macOS arm64 (Apple Silicon, brew 4.x,
  cmake 4.x, Apple Clang 17, Go 1.25.0, pcre2 10.x, simde 0.8.x).
- Produced binaries: bin/server_main, bin/admin_server, bin/ragflow_cli.
- `bin/server_main` boots, connects MySQL, runs migrations, loads the
  64 model provider configs, fails only on `dial tcp [::1]:1200`
  because we run Infinity (port 23817) not Elasticsearch — orthogonal
  to this patchset; the build itself is now reproducible on Mac.

Not done in this commit
-----------------------
- Go server runtime on Infinity is blocked by upstream's own
  `internal/engine/README.md`: "Infinity implementation is a placeholder
  waiting for the official Infinity Go SDK. Only Elasticsearch is fully
  functional at this time." Our Cyllene stack runs on Infinity by
  design, so the Go façade migration plan (RBAC middleware + 128 route
  mappings already committed in d721502) is paused at Etape 3 until
  upstream ships the Infinity Go SDK. The build patches above are
  pre-requisite groundwork — they unblock local development on Mac for
  whichever team wants to contribute the SDK.
@Zzappy24
Zzappy24 force-pushed the pr/macos-arm64-build-fixes branch from b6d01aa to c59a809 Compare May 20, 2026 13:41
@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (dc01e0e) to head (c59a809).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15009   +/-   ##
=======================================
  Coverage   93.12%   93.12%           
=======================================
  Files          10       10           
  Lines         713      713           
  Branches      116      116           
=======================================
  Hits          664      664           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JinHai-CN
JinHai-CN merged commit a2369bc into infiniflow:main May 21, 2026
1 check passed
JinHai-CN pushed a commit that referenced this pull request May 21, 2026
## Problem

The Go server build pipeline (`build.sh` + CMake + CGO bindings) was
tested on Ubuntu only. On macOS arm64 with Homebrew it fails in five
orthogonal places. None of these require platform-specific code paths —
the same source builds on both Linux and Darwin after these fixes.

## Reproduction (before)

```
$ uname -a
Darwin … 25.4.0 arm64
$ brew install cmake pcre2 simde
$ bash build.sh
…
error: 'simde/x86/sse4.1.h' file not found
error: implicit instantiation of undefined template 'std::basic_istringstream<char>'
error: no matching function for call to 'Join'
…
clang: error: no such file or directory: '/usr/local/lib/libpcre2-8.a'
```

## Fix (5 small, orthogonal changes)

### 1. `internal/cpp/CMakeLists.txt` — find Homebrew + libpcre2-8
portably

- Detect Apple platforms via `if(APPLE)`, call `brew --prefix` once, add
`${HOMEBREW_PREFIX}/include` and `${HOMEBREW_PREFIX}/lib`. No effect on
Linux.
- Replace the literal `libpcre2-8.a` link token (which only the Linux
linker finds in `/usr/local/lib` by default) with
`find_library(PCRE2_LIB NAMES pcre2-8 REQUIRED)`. Works on
`/usr/lib/x86_64-linux-gnu` (Debian/Ubuntu), `/usr/local/lib` (Intel Mac
& legacy Linux), `/opt/homebrew/lib` (Apple Silicon).

### 2. `internal/cpp/wordnet_lemmatizer.cpp` +
`internal/cpp/rag_analyzer.cpp` — explicit `#include <sstream>`

libstdc++ (Linux) pulls `<sstream>` in transitively via `<fstream>`;
libc++ (Apple Clang) doesn't, so the existing `std::istringstream` /
`std::ostringstream` uses fail to compile on macOS. One-line include in
each file.

### 3. `internal/cpp/rag_analyzer.cpp` — `Join` template overload fix

`Join(tokens, start, tokens.size(), delim)` at line 146 passes `size_t`
to an `int` parameter. C++23 strict mode in Apple Clang refuses the
implicit narrowing and reports the 4-arg overload as a substitution
failure, leaving the call ambiguous between the 3-arg and 4-arg
templates. Fix: explicit `static_cast<int>(tokens.size())`. Behaviour
identical on libstdc++ — the narrowing was always intentional.

### 4. `internal/binding/rag_analyzer.go` — split darwin CGO LDFLAGS

The existing `#cgo darwin LDFLAGS: ... /usr/local/lib/libpcre2-8.a` only
matches Intel Macs. Apple Silicon Homebrew installs to `/opt/homebrew`.
Split into `darwin,arm64` and `darwin,amd64` build constraints with the
right absolute path on each.

### 5. `build.sh` — accept Homebrew path in the pcre2 sanity check

The sanity check looked at two Linux paths only and then fell through to
`sudo apt -y install libpcre2-dev` on failure. Added
`/opt/homebrew/lib/libpcre2-8.a`, and on Darwin failure now exits
cleanly with the right `brew install pcre2` hint instead of trying
`apt`.

## Verified

- `bash build.sh` now completes on macOS arm64 (Apple Silicon, brew 4.x,
cmake 4.x, Apple Clang 17, Go 1.25, pcre2 10.x, simde 0.8.x).
- Produced binaries: `bin/server_main`, `bin/admin_server`,
`bin/ragflow_cli`.
- `bin/server_main` boots, connects MySQL, runs migrations, loads the 64
model provider configs cleanly.
- Still builds on Linux — the CMake additions are inside an `if(APPLE)`
guard, the `find_library` call matches Linux paths too, the build.sh
check still tries `apt` when not on Darwin.

## Out of scope

The Go server itself currently fails at runtime when not pointing at
Elasticsearch (`Failed to initialize doc engine: failed to ping
Elasticsearch`), but that's the placeholder Infinity engine documented
in `internal/engine/README.md` — unrelated to this build patchset.

---

Happy to split this into smaller PRs if you'd prefer (one per file). The
five changes are independent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants