morningman opened a new pull request, #69584:
URL: https://github.com/apache/doris/pull/69584

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #69070
   
   Problem Summary:
   
   **In short.** Since #69070, the BE unit tests no longer compile on macOS: 
three ANN tests pass `std::vector<size_t>::data()` where the writer now takes 
`const uint64_t*`. The tests now use `std::vector<uint64_t>`.
   
   **Background.** #69070 changed the offsets parameter of the ANN index 
writers' `add_array_values()` from `const uint8_t*` to `const uint64_t*`. The 
`vector_search_test` library, which holds the ANN tests, is force-loaded into 
`doris_be_test`.
   
   **The problem, and what it cost.** `ann_index_writer_test.cpp` (15 places), 
`ann_index_edge_case_test.cpp` and `snii_ann_container_test.cpp` still build 
their offsets as `std::vector<size_t>`. On Linux `size_t` and `uint64_t` are 
both `unsigned long`, so they compile. On macOS `size_t` is `unsigned long` and 
`uint64_t` is `unsigned long long`, and the build stops at:
   
   ```
   ann_index_edge_case_test.cpp:274:55: error: cannot initialize a parameter of 
type 'const uint64_t *' (aka 'const unsigned long long *') with an rvalue of 
type 'value_type *' (aka 'unsigned long *')
   ```
   
   Because `vector_search_test` is linked into `doris_be_test`, no BE unit test 
can be built on macOS. The macOS CI pipeline builds the BE without tests, so CI 
does not report it.
   
   **How this PR fixes it.** The 17 offsets vectors in those tests are declared 
as `std::vector<uint64_t>`, the type the writer takes. Production code is 
unchanged.
   
   **Results.**
   
   | | macOS BE UT build |
   |---|---|
   | Before | stops at `ann_index_edge_case_test.cpp` |
   | After | links `doris_be_test`; the ANN tests pass |
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
           - macOS (clang 22, ASAN): `AnnIndexWriterTest` (27), 
`VectorSearchTest` (66) and `SniiAnnContainerTest` (20) pass.
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   


-- 
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]

Reply via email to