This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 70a8be7286e [doc](build) Install LLVM 22 and LLVM 20 for building
Doris on macOS (#4180)
70a8be7286e is described below
commit 70a8be7286e78e07333f1e461445a553ab1a06a9
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Tue Sep 29 23:55:01 2026 +0800
[doc](build) Install LLVM 22 and LLVM 20 for building Doris on macOS (#4180)
## Summary
apache/doris#68595 splits the macOS toolchain in two:
- The BE builds with `llvm@22`, which `env.sh` selects. LLVM 22.1.8 is
the first release whose AddressSanitizer runtime no longer deadlocks at
startup on macOS 26.4 and later.
- The third-party libraries stay on `llvm@20`. clang 22 turns
`-Wincompatible-pointer-types` into an error and stops at unixODBC, so
`thirdparty/build-thirdparty.sh` requires `llvm@20` on macOS and exits
if it is missing.
The macOS build guide installs only `llvm@20`. After that change, a
developer who follows it has no `llvm@22`: `env.sh` finds nothing under
`$(brew --prefix)/opt/llvm@22/bin`, and the BE silently builds with
Apple clang from `/usr/bin`. Listing only `llvm@22` would be wrong the
other way. `build.sh` rebuilds the third-party libraries from source
whenever `thirdparty/installed` lacks one it checks for, and that build
stops at the `llvm@20` check. This is not rare: on an Intel Mac today,
the darwin-x86_64 prebuilt predates the paimon-rust libraries that
master checks for, so every build on master rebuilds from source.
## Changes
In `community/source-install/compilation-mac.md` and its zh-CN
counterpart:
- `brew install … llvm@20 …` becomes `brew install … llvm@22 llvm@20 …`,
followed by a note on what each version is for.
- `export PATH="/opt/homebrew/opt/llvm/bin:$PATH"` is removed. It points
to the unversioned `llvm` formula, which the guide does not install. It
also never affected which compiler the build uses, because `env.sh` puts
its own LLVM directory and `/usr/bin` ahead of the user's `PATH`. The
new note says the build scripts find both LLVMs through Homebrew.
## Merge order
Merge this together with apache/doris#68595 or after it. Installing both
versions before then does no harm, since master's `env.sh` still selects
`llvm@20`, but the new note describes the behavior after #68595.
## Versions and languages
- Community docs, which are not versioned.
- [x] Chinese
- [x] English
## Validation
- `git diff --check` is clean, and the English and Chinese pages carry
the same content.
- The site build was not run.
Co-authored-by: morningman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
---
community/source-install/compilation-mac.md | 5 +++--
.../current/source-install/compilation-mac.md | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/community/source-install/compilation-mac.md
b/community/source-install/compilation-mac.md
index 5e74a50b115..401d1239864 100644
--- a/community/source-install/compilation-mac.md
+++ b/community/source-install/compilation-mac.md
@@ -55,15 +55,16 @@ Install the base dependencies with Homebrew:
```Shell
brew install automake autoconf libtool pkg-config texinfo coreutils gnu-getopt
\
-python@3 cmake ninja ccache bison byacc gettext wget pcre maven llvm@20
openjdk@17 npm
+python@3 cmake ninja ccache bison byacc gettext wget pcre maven llvm@22
llvm@20 openjdk@17 npm
```
+> Both LLVM versions are needed. `llvm@22` compiles the BE (LLVM 22.1.8 is the
first release whose AddressSanitizer runtime starts on macOS 26.4 and later).
`llvm@20` compiles the third-party libraries when they are built from source:
`thirdparty/build-thirdparty.sh` stops if it is missing, and `build.sh` starts
such a build by itself when `thirdparty/installed` lacks a library it needs.
The build scripts find both through Homebrew, so neither has to be added to
`PATH`.
+
> The arm64 version of brew on macOS does not include JDK 8 by default, so
> `openjdk@17` is recommended. If you need JDK 8, install [Zulu JDK
> 8](https://www.azul.com/downloads/?version=java-8-lts&os=macos&package=jdk#zulu)
> manually. Maven can also be downloaded separately from the [Maven
> website](https://maven.apache.org/download.cgi) and configured via
> environment variables.
Some dependencies on Apple Silicon also require manual environment variable
configuration:
```Shell
-export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export PATH="/opt/homebrew/opt/texinfo/bin:$PATH"
ln -s -f /opt/homebrew/bin/python3 /opt/homebrew/bin/python
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/source-install/compilation-mac.md
b/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/source-install/compilation-mac.md
index d82bceb9631..c660b76b60a 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/source-install/compilation-mac.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/source-install/compilation-mac.md
@@ -55,15 +55,16 @@ under the License.
```Shell
brew install automake autoconf libtool pkg-config texinfo coreutils gnu-getopt
\
-python@3 cmake ninja ccache bison byacc gettext wget pcre maven llvm@20
openjdk@17 npm
+python@3 cmake ninja ccache bison byacc gettext wget pcre maven llvm@22
llvm@20 openjdk@17 npm
```
+> 两个版本的 LLVM 都需要安装。`llvm@22` 用于编译 BE(LLVM 22.1.8 是第一个能在 macOS 26.4 及以上版本正常启动
AddressSanitizer 运行时的版本)。`llvm@20` 用于从源码编译第三方库:缺少它时
`thirdparty/build-thirdparty.sh` 会直接退出;当 `thirdparty/installed`
缺少所需的库时,`build.sh` 会自动发起这样的源码编译。构建脚本会通过 Homebrew 找到这两个版本,无需手动加入 `PATH`。
+
> macOS 上 arm64 版本的 brew 默认没有 JDK 8,因此推荐使用 `openjdk@17`。如需 JDK 8,可手动安装 [Zulu
> JDK
> 8](https://www.azul.com/downloads/?version=java-8-lts&os=macos&package=jdk#zulu);Maven
> 也可从 [Maven 官网](https://maven.apache.org/download.cgi) 单独下载并配置环境变量。
部分依赖在 Apple Silicon 上还需要手动配置环境变量:
```Shell
-export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export PATH="/opt/homebrew/opt/texinfo/bin:$PATH"
ln -s -f /opt/homebrew/bin/python3 /opt/homebrew/bin/python
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]