Doris-Breakwater commented on issue #68404: URL: https://github.com/apache/doris/issues/68404#issuecomment-5788369550
## Initial maintainer triage **Assessment: valid and actionable build-portability regression (high confidence).** I inspected the exact reported revision `1a3772ff041630444eab49b98eaccbc90fabbe8e`. I could not execute a Darwin build on this Linux host, but the reported diagnostics match the source and Darwin ABI/API differences. The impact is currently limited to building the monolithic `doris_be_test` target on macOS; the production BE build is not implicated. The issue is open, unassigned, and currently has no labels. ### Verified facts - `be/test/CMakeLists.txt` glob-adds these sources to one `doris_be_test` executable, while `.github/workflows/be-ut-mac.yml` configures `MAKE_TEST=OFF`. Therefore any one compile failure blocks every filtered local UT run, and current macOS CI cannot detect it. - On an arm64 Darwin target, Clang defines `int64_t`/`uint64_t` as `long long`/`unsigned long long`, while `size_t` is `unsigned long`. This directly explains the `printf`, initializer-list, and `std::min` failures. Use `PRIi64`/`PRIu64` (or type-safe formatting) rather than hard-coding `%lld`/`%llu`, which would merely move the mismatch to platforms where `int64_t` is `long`. - `snii_vs_v3_benchmark_test.cpp` unconditionally calls Linux-only `posix_fadvise(..., POSIX_FADV_DONTNEED)`, and passes `unsigned char*` to Darwin's `mincore(..., char*)` signature. - The libc++ heterogeneous-lookup error is consistent with the test's `Equal`: it has `(string_view, uint32_t)` but not `(uint32_t, string_view)`. The production `OwnedVocabEq` in `spimi_term_buffer.h` already provides both directions and is the appropriate local pattern. - `ip_address_cidr.h` uses `std::from_chars` but does not include `<charconv>`; successful Linux builds currently depend on a transitive include. - The Faiss failure has a concrete CMake dependency-path explanation. `function_map_inner_product_test.cpp` includes `function_inner_product.h`, which includes `function_array_distance.h` and therefore Faiss headers. On non-Apple builds, `doris_be_test` links the `vector_search_test` target and inherits its transitive `ann_index -> faiss` usage requirements. The Apple branch instead links `$<TARGET_FILE:vector_search_test>` via `-force_load`; that archive path does not propagate target usage requirements to compilation of `doris_be_test`. - The `__COUNTER__` error is separate and not macOS-specific. The token is defined in `runtime_profile.h`; it is expanded by `SCOPED_TIMER`/`SCOPED_RAW_TIMER` call sites in the two reported headers. New Clang versions diagnose that extension through `-Wcounter-extension` under `-Wpedantic`, and Doris promotes it with `-Werror`. ### Recommended direction 1. Prefer portable source fixes for the integer formatting/types, initializer lists, `std::min`, symmetric comparator, and direct `<charconv>` include. These are small correctness/build-hygiene fixes and preserve useful macOS coverage. 2. Treat `snii_vs_v3_benchmark_test.cpp` specially. A Darwin no-op around `posix_fadvise` would compile but would violate the benchmark's explicit “cold page cache” contract. Either implement a verified Darwin-equivalent cold-read path (and keep the existing `mincore` residency check meaningful), or exclude only this disabled benchmark TU on macOS. 3. Fix the Faiss dependency at the target/CMake level rather than excluding `function_map_inner_product_test.cpp`. The Apple whole-archive linkage should retain `vector_search_test`/`ann_index`/`faiss` usage requirements, or `doris_be_test` should receive the required dependency explicitly. 4. Handle `__COUNTER__` as a toolchain-compatibility item, ideally with narrowly scoped handling of `-Wcounter-extension` for Clang rather than relaxing `-Wpedantic` globally. 5. Add at least a compile-only `doris_be_test` step to macOS CI. Running all UTs can remain a separate policy decision, but compiling the target is needed to prevent the same class of regression. ### Missing information / acceptance checks No additional information is required to accept and assign this issue. If a maintainer cannot reproduce the two configuration-sensitive failures, the only useful additions would be the corresponding `ninja -v` compile commands for the Faiss and `__COUNTER__` TUs. Before closing, verify a clean `./run-be-ut.sh -j 4` build on arm64 macOS with the reported Clang 23 toolchain, run representative filters for the enabled affected tests, and confirm the Linux BE UT build remains clean. The author's prepared patch is a reasonable starting point, but the cold-cache semantics and Apple CMake usage-requirement propagation should be reviewed as above. Breakwater-GitHub-Analysis-Slot: slot_088b0c303f7b -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
