15 Commits
Author SHA1 Message Date
ef166a673a enhance: support building core on macOS (Apple Silicon) with clang 19 (#50616)
issue: #50615

## What this PR does
Makes the C++ core build cleanly on **macOS (Apple Silicon) with
Homebrew LLVM/clang 19**.

> [!IMPORTANT]
> **Scope / impact is NOT macOS-only.** Although this PR is framed as
macOS/clang-19 enablement, two of the changes are **top-level
`requires(...)` in `internal/core/conanfile.py`, so they apply to every
platform, including Linux production builds:**
> - **`azure-sdk-for-cpp` `1.11.3@milvus/dev` → `1.16.0@milvus/dev`** (5
minor versions, `force=True`). This is the SDK Arrow uses for the
**Azure Blob remote-storage path**, so this is effectively a major Azure
SDK bump on the **production Azure object-storage path for Linux
deployments** too.
> - **`arrow` recipe `17.0.0@milvus/dev-2.6#c743ea7a…` →
`17.0.0@milvus/dev#f411aa73…`** — same Arrow version, but **rebuilt
against azure 1.16.0** with a patched `FindAzure.cmake`. The Arrow
**`package_id` (recipe revision) DID change**; it is not the same binary
as before.
> - **`libbson/1.30.6@milvus/dev`** added (also global, but new — no
pre-existing behavior to regress).
>
> **Testing blind spot:** CI green proves compile/link/UT/e2e pass, but
the UT and integration suites **do not exercise real Azure Blob
read/write**, so the Azure object-storage path is **not covered** by
this PR's CI. A real Azure Blob remote-storage regression is recommended
before merge (see Verification).

### Why the dependency bumps are required for clang 19
- **azure 1.16.0**: azure 1.11.3 bundles an older `nlohmann/json` that
uses `std::char_traits<unsigned char>`, which was **removed in libc++
19** → 1.11.3 fails to compile on clang 19. 1.16.0 fixes this.
- **arrow rebuilt against azure 1.16.0**: when Arrow is built from
source on clang 19 it must link the same azure 1.16.0; the recipe also
patches `FindAzure.cmake` to the monolithic `Azure` config so
`find_package(Azure)` resolves. Hence a new Arrow recipe revision.

### Toolchain / build enablement
- **`scripts/setenv.sh`**: probe LLVM 19/20/21 first (libc++ 17/18
`chrono operator<<` clashes with Arrow's vendored `date`; libc++ 19
fixes it).
- **`scripts/3rdparty_build.sh`**: arm64 `-march=armv8-a+crypto+crc` so
folly's F14 (SimdAndCrc on Apple Silicon) matches core/knowhere — fixes
`F14LinkCheck` undefined-symbol link errors.
- **`InvertedIndexTantivy.cpp`**: drop spurious `->template` on
non-template members (clang 19
`-Wmissing-template-arg-list-after-template-kw`).

### Drop bsoncxx / libmongoc → libbson only
The BSON layer used the **bsoncxx** C++ driver, whose CMake
unconditionally builds mongo-cxx-driver → **libmongoc** → bundled
**utf8proc**, which fails to configure under newer CMake/clang on macOS.
Milvus only needs BSON (de)serialization.

- New Conan package **`libbson/1.30.6@milvus/dev`** (libbson-only,
`ENABLE_MONGOC=OFF`; recipe published to milvus conanfiles &
production).
- New **`src/common/bson_shim.h`** — a thin `milvus::bson` C++ layer
over libbson's C API.
- Migrated `bson_view.h`, `bson_builder.{h,cpp}`, json_stats consumers
and unit tests off bsoncxx.
- CMake: `find_package(bson-1.0)` + link `mongo::bson_shared`; removed
FetchContent `thirdparty/bsoncxx`.

All three global Conan requires (arrow / libbson / azure) pin an
explicit recipe `#revision` for reproducibility.

## Verification
- Full clean rebuild on macOS arm64 / clang 19: `bin/milvus` builds;
`libmilvus_core` links **only `libbson-1.0.dylib`** (no
libmongoc/mongocxx/utf8proc).
- libbson / arrow / azure resolve from production Conan at the pinned
revisions.
- All 21 BSON unit tests (BsonView / BsonBuilder / DomNode) pass.
- Full ci-v2 suite green on Linux (build / build-ut-cov / ut-cpp / ut-go
/ integration / e2e / go-sdk).
- **TODO before merge:** real Azure Blob remote-storage read/write
regression to cover the azure-1.16.0 / arrow-rebuild blast radius (not
exercised by UT/integration).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: xiaofanluan <xf@hjjaq.com>
Co-authored-by: xiaofanluan <xf@hjjaq.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 20:27:10 -07:00
grootandGitHub 499619033f enhance: Migrate to Conan 2.x (#48165)
new JFrog artifactory for conan 2.x:
https://milvus01.jfrog.io/ui/repos/tree/General/default-conan-local2

issue: https://github.com/milvus-io/milvus/issues/47425

conanfiles pr: https://github.com/milvus-io/conanfiles/pull/92
milvus-common: https://github.com/zilliztech/milvus-common/pull/69
milvus-storage: https://github.com/milvus-io/milvus-storage/pull/445
knowhere: https://github.com/zilliztech/knowhere/pull/1495

Signed-off-by: yhmo <yihua.mo@zilliz.com>
2026-04-16 18:31:42 +08:00
sijie-ni-0214andGitHub 8900b46f45 fix: split macOS RPATH into separate -r flags for linker compatibility (#48241)
## Summary
- macOS `ld` treats each `-r` flag as a single directory path, unlike
Linux `ld` which accepts colon-separated paths
- Since d69bdd288c added `cmake_build/lib` to `DYLD_LIBRARY_PATH`,
`RPATH=$DYLD_LIBRARY_PATH` produces a colon-separated value like
`path1:path2`
- The Makefile's `-r $RPATH` embeds this as a single invalid path in the
binary, causing `Library not loaded: @rpath/libmilvus-storage.dylib` at
runtime
- Fix: emit two separate `-r` flags so the Makefile expands to `-r path1
-r path2`

## Test plan
- [x] Verified `RPATH` variable output: `path1 -r path2` (correct)
- [x] Verified binary loads correctly after fix (`otool -l` shows two
separate `LC_RPATH` entries)
- [x] Verified Milvus standalone starts and serves requests successfully

issue: #47809

Signed-off-by: sijie-ni-0214 <sijie.ni@zilliz.com>
2026-03-18 00:43:30 +08:00
Buqian ZhengandGitHub 0689bdb7c6 fix: renamed plan-parser-so to plan-parser-lib to allow compilation on mac (#48068)
issue: #44452

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
2026-03-09 11:57:25 +08:00
d69bdd288c fix: fix macOS 15 ARM64 compilation issues (#7437) (#47810)
issue: #47809

---------

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:19:21 +08:00
Markus BoehmeandGitHub 6291a51a61 fix: avoid current working directory in library search path (#47818)
On Linux, setenv.sh accidentally sets LD_LIBRARY_PATH and RPATH to look
up shared objects in the current working directory first if nothing
explicitly set an LD_LIBRARY_PATH already, because an empty path on
either variable is interpreted as the current working directory. This
results in races during parallel builds (e.g. tools invoked by Conan
finding corrupt shared libraries, because said libraries are currently
compiled and written out by another process in the build). Since the
LD_LIBRARY_PATH is also used as the RPATH, the compiled Milvus binary
also looks up shared objects in the current working directory,
potentially picking up unintended versions of a shared object.

Fix this and similar "empty path" problems for other environment
variables on Linux, macOS, and Windows by placing the path separator
only if there are pre-existing paths.

issue: #47828

Signed-off-by: Markus Boehme <markus.boehme@chainguard.dev>
2026-02-27 08:37:21 +08:00
XiaofanandGitHub 4f902f1f21 fix: Fix macOS 15+ build compatibility for Apple Silicon (#47466)
issue: #47460

---------

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
2026-02-07 09:07:07 +08:00
fc876639cf enhance: support json stats with shredding design (#42534)
#42533

Co-authored-by: luzhang <luzhang@zilliz.com>
2025-09-01 10:49:52 +08:00
Zhen YeandGitHub ecb24e7232 enhance: use multi-process framework in integration test (#42976)
issue: #41609

- add env `MILVUS_NODE_ID_FOR_TESTING` to set up a node id for milvus
process.
- add env `MILVUS_CONFIG_REFRESH_INTERVAL` to set up the refresh
interval of paramtable.
- Init paramtable when calling `paramtable.Get()`.
- add new multi process framework for integration test.
- change all integration test into multi process.
- merge some test case into one suite to speed up it.
- modify some test, which need to wait for issue #42966, #42685.
- remove the waittssync for delete collection to fix issue: #42989

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-06-30 14:22:43 +08:00
8902e2220e enhance: enable asan for cpp unittest (#37041)
https://github.com/milvus-io/milvus/issues/35854

Signed-off-by: chyezh <chyezh@outlook.com>
Co-authored-by: chyezh <chyezh@outlook.com>
2024-10-23 17:21:27 +08:00
Enwei JiaoandGitHub 42db013a7b Support llvm17 on MacOS (#27582)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2023-10-11 02:47:33 +08:00
Enwei JiaoandGitHub f97d5a7d08 Fix compile failed with llvm16 (#26112)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2023-08-03 17:29:07 +08:00
Enwei JiaoandGitHub 2ced6660e2 Simplify makefile (#23583)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2023-04-21 14:16:33 +08:00
Enwei JiaoandGitHub d553b5108e Fix jemalloc.so not found (#21106)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>

Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2022-12-13 11:27:21 +08:00
Enwei JiaoandGitHub ea901393ef fix windows ldflags (#17807)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
2022-06-28 19:58:25 +08:00