morningman opened a new pull request, #67011:
URL: https://github.com/apache/doris/pull/67011
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
`branch-4.1` does not compile on macOS / arm64 with clang 20. Most of these
are
platform assumptions that master already fixed but this branch did not pick
up;
three of them are latent portability bugs rather than macOS-only cosmetics.
| File | Problem | Fix |
|---|---|---|
| `common/phdr_cache.h` | `_previous` is only used on Linux, so it trips
`-Werror,-Wunused-private-field` elsewhere | guard it, same as master |
| `exec/connector/jni_connector.cpp` | `int64_t` is `long long` on macOS
while `jlong` is `long`, so `FunctionCall::call()` rejects `int64_t*` via its
`requires(std::is_same_v<RETURN_TYPE, ReturnType>)` constraint | use `jlong`,
matching the other call sites in the same file |
| `exec/operator/scan_operator.h` | `atomic_shared_ptr<T> x = nullptr` needs
two user-defined conversions, which is ill-formed | declare without
initializer, same as master |
| `exec/operator/scan_operator.cpp` | the class exposes `store()`, not
`operator=` | assign through `store()`, same as master |
| `exprs/aggregate/aggregate_function_java_udaf.h` | same `jlong` mismatch
as above | `cast_set<jlong>`, exactly as master does |
| `io/cache/block_file_cache_factory.cpp` | `statfs::f_frsize` is a Linux
field and does not exist on macOS | select `f_bsize` under `__APPLE__`, same as
master |
| `util/md5.cpp` | the MD5 constants and the padding helper are only
referenced from the AVX2 path, so on arm64 they trip `-Wunused-const-variable`
/ `-Wunused-function` | move them inside the existing `#ifdef __AVX2__` block,
matching master's layout |
| `CMakeLists.txt` | `ld` on macOS does not accept `--whole-archive` | use
`-Wl,-force_load` under `APPLE`, same as master |
| `CMakeLists.txt` | the Rust `sysinfo` crate inside `liblance_c.a` calls
into IOKit, which is not linked | link `IOKit` |
Everything above except the IOKit link is a straight port of what master
already
does; master simply has not been picked back to this branch.
Three of them are worth calling out as real portability issues rather than
macOS-only noise:
- `statfs::f_frsize` does not exist outside Linux at all;
- `atomic_shared_ptr<T> x = nullptr` is ill-formed C++ regardless of
platform (it
only survives on Linux because that build selects the
`std::atomic<shared_ptr>`
alias instead of the hand-rolled libc++ fallback);
- `-Wl,--whole-archive` is GNU-ld specific.
With these, `DISABLE_BUILD_UI=ON bash build.sh --fe --be` completes on macOS
arm64
and produces a working BE.
### Release note
None
### Check List (For Author)
- Test
- [ ] Regression test
- [ ] Unit Test
- [x] Manual test (add detailed scripts or steps below)
Built on macOS 26.5 / arm64 with clang 20:
```
DISABLE_BUILD_UI=ON bash build.sh --fe --be
```
completes with `Successfully build Doris`, and the resulting BE starts
and
serves queries in a local cluster. **Not verified on Linux/x86** - the
`md5.cpp` change moves code inside the existing `#ifdef __AVX2__`
block, so CI
coverage on x86 is the check that matters there.
- [ ] No need to test or manual test. Explain why:
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [x] Confirm the release note
- [x] Confirm test cases
- [x] Confirm document
- [x] Add branch pick label
--
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]