[chore](thirdparty) build only hadoop 3.4.2.4, build azure everywhere and slim it down, and add ccache - #66842
Open
morningman wants to merge 3 commits into
Open
Conversation
morningman
requested review from
Gabriel39,
gavinchou and
liaoxin01
as code owners
August 17, 2026 09:39
4 tasks
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Closed
3 tasks
gavinchou
approved these changes
Aug 17, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
…4 everywhere
The tree carried two libhdfs builds. `build_hadoop_libs` built the 3.3.6.6
fork into `installed/{include,lib}/hadoop_hdfs/`, `build_hadoop_libs_3_4`
built the 3.4.2.4 fork into `.../hadoop_hdfs_3_4/`, and on Linux both ran -
roughly 10 extra minutes of every third-party build for a fork only the cloud
module still consumed.
The two prefixes were also mixed up on the consumer side. BE linked
`hadoop_hdfs_3_4/native/libhdfs.a`, but `be/src/io/hdfs_builder.cpp` included
`hadoop_hdfs/hdfs.h` - the 3.3.6.6 header - while `be/src/io/fs/hdfs.h`
included the 3.4.2.4 one. Both headers share the LIBHDFS_HDFS_H include guard,
so that translation unit compiled against 3.3.6.6 and linked 3.4.2.4. The cloud
meta-service used 3.3.6.6 for both.
Build 3.4.2.4 only, and move the remaining 3.3.6.6 consumers onto it:
- thirdparty: drop `build_hadoop_libs` and the `HADOOP_LIBS_*` variables;
`hadoop_libs_3_4` now runs on Linux and macOS alike. The install prefix stays
`hadoop_hdfs_3_4/` so a build-env image from this change can still compile
older Doris branches.
- cloud: link `hadoop_hdfs_3_4/native/libhdfs.a` and include the matching header.
- `be/src/io/hdfs_builder.cpp`: drop the 3.3.6.6 include - `io/fs/hdfs.h`, two
lines below, already re-exports the 3.4.2.4 one.
- `build.sh`, `run-be-ut.sh`, `run-cloud-ut.sh` and the thirdparty lifecycle
test follow the same prefix.
…hat Doris does not link Two things about azure-sdk-for-cpp. It only ever got built on x86_64 Linux. env.sh forced DISABLE_BUILD_AZURE=ON on aarch64 and macOS, and build_azure skipped Darwin a second time, so BE and the cloud meta-service lost +AZURE_BLOB and +AZURE_STORAGE_VAULT on those platforms. Nothing in the recipe was actually x86_64-Linux-specific except two details: `-ldl`, which fails on Apple because there is no libdl there, and vcpkg needing VCPKG_FORCE_SYSTEM_BINARIES on aarch64 Linux, where it ships no prebuilt tools. Both are handled now, and the triplet is derived from uname instead of being left to vcpkg's host detection. And it was by far the most expensive package in the tree - 26m06s of the 2h43m x86_64 Linux third-party build in apache/doris-thirdparty run 31988123966 - almost none of it for Doris's benefit: - 22m of the 26m was `vcpkg install`, and 19m of that was opentelemetry-cpp (4m35s) plus the protobuf 5.29.3 (12m29s), abseil (1m58s) and utf8-range it drags in. Doris does not use azure's OpenTelemetry tracing at all; the dependency was in vcpkg.json unconditionally. - vcpkg builds every port twice, debug and release, and Doris links only the release halves. - The SDK builds appconfiguration, attestation, eventhubs, keyvault, tables, template, uAMQP, datalake, file shares and queues. Doris links azure-core, azure-identity, azure-storage-common and azure-storage-blobs. So the patch drops opentelemetry-cpp and the uAMQP C libraries from vcpkg.json, flips DISABLE_AMQP and DISABLE_AZURE_CORE_OPENTELEMETRY to ON, and trims the sub-projects to the four Doris links; build_azure adds an overlay triplet that sets VCPKG_BUILD_TYPE=release. What is left to build is curl, libxml2, openssl 1.1.1n and zlib, release only. Also add an opt-in ENABLE_THIRDPARTY_CCACHE. A third-party build is cold every time, so a warm ccache turns a rebuild triggered by one changed package into minutes rather than hours. It exports CMAKE_<LANG>_COMPILER_LAUNCHER, which CMake picks up from the environment, rather than prefixing CC/CXX - that would put the compiler name into CMAKE_<LANG>_FLAGS. Autotools packages are left alone, and it is off unless asked for.
…nd cache ccache Two of the four fixes in apache/doris-thirdparty#410 apply to this workflow too. thrift's configure finds the dotnet the runner images ship, so `make` runs `dotnet build -c Release` for lib/netstd. The build itself finishes in seconds and then the compiler server it leaves behind holds the stdout it inherited for its full keep-alive while nothing happens. Between "Build succeeded" and "Making install in compiler/cpp" in apache/doris-thirdparty run 31988123966: 600.03s on macos-14, 598.79s on macos-15-intel, 0.01s on Linux. Both macOS jobs here pay it. `UseSharedCompilation=false` and `MSBUILDDISABLENODEREUSE=1` stop the server from being started. And nothing was cached between runs: ccache is installed on every runner but nothing routed compilation through it, so a change to one package recompiled all ~80, at `-j 2` on two of the three jobs. Turn on ENABLE_THIRDPARTY_CCACHE and carry the cache with the ccache-action this repository already vendors. max-size is 1G per job so that all three together stay inside what is left of the repository's 10 GB Actions cache budget next to the 5G BE-UT-macOS cache. Note that a cache saved by a pull request run is only visible to that same pull request, so this pays off across pushes to one branch; sharing it across pull requests would need this workflow to run on master. The other two fixes in that PR do not apply here: there is no Docker job to decouple, and no macOS x86_64 job to build less often.
morningman
force-pushed
the
thirdparty-hadoop-azure-ccache
branch
from
August 17, 2026 13:01
98dea2d to
c596cd5
Compare
Contributor
Author
|
run compile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: apache/doris-thirdparty#410
Problem Summary:
Three related third-party build changes, all measured against
apache/doris-thirdparty run 31988123966.
Supersedes #66837 and #66839, which are now closed.
1. Only build hadoop-libs 3.4.2.4
The tree carried two libhdfs builds:
build_hadoop_libsbuilt the 3.3.6.6 forkinto
installed/{include,lib}/hadoop_hdfs/,build_hadoop_libs_3_4built the3.4.2.4 fork into
.../hadoop_hdfs_3_4/, and on Linux both ran - 11m38s of thex86_64 build and 10m00s of the arm64 one, for a fork only the cloud module still
consumed.
The two prefixes were also mixed up on the consumer side:
be/src/io/fs/hdfs.hhadoop_hdfs_3_4/hdfs.h(3.4.2.4)be/src/io/hdfs_builder.cpphadoop_hdfs/hdfs.h(3.3.6.6)be/CMakeLists.txthadoop_hdfs_3_4/native/libhdfs.a(3.4.2.4)cloud/src/recycler/hdfs_accessor.{h,cpp}hadoop_hdfs/hdfs.h(3.3.6.6)cloud/CMakeLists.txthadoop_hdfs/native/libhdfs.a(3.3.6.6)Both headers share the
LIBHDFS_HDFS_Hinclude guard, sohdfs_builder.cppcompiled against the 3.3.6.6 header (it came first) while BE linked the 3.4.2.4
archive.
3.4.2.4 stays where it is, under
hadoop_hdfs_3_4/, so a build-env image from thischange can still compile older Doris branches. The 3.3.6.6 build and its
hadoop_hdfs/prefix are gone, andcloud/,build.sh'sLAST_THIRDPARTY_LIBsentinel,
run-be-ut.sh,run-cloud-ut.shand the thirdparty lifecycle test moveto
hadoop_hdfs_3_4/. The unit-test runners still stage the jars atlib/hadoop_hdfs/, so the classpath loops below them are unchanged.2. Build azure everywhere, and stop building what Doris does not link
It was only ever built on x86_64 Linux.
env.shforcedDISABLE_BUILD_AZURE=ONon aarch64 and macOS, andbuild_azureskippedDarwinasecond time, so BE and the cloud meta-service lost
+AZURE_BLOBand+AZURE_STORAGE_VAULTthere. Nothing in the recipe was genuinely x86_64-Linux-only,just two details:
-ldlfails on Apple (there is no libdl; those symbols are inlibSystem), and vcpkg ships no prebuilt cmake/ninja/curl for aarch64 Linux so it
needs
VCPKG_FORCE_SYSTEM_BINARIES=1. The triplet is now derived fromunamerather than left to vcpkg's host detection.
It was the most expensive package in the tree - 26m06s of the 2h43m x86_64 Linux
build - almost none of it for Doris:
vcpkg installprotobuf, abseil and utf8-range were pulled in only because
vcpkg.jsondeclaredopentelemetry-cppunconditionally - roughly 19 of the 26 minutes. Doris does notuse azure's OpenTelemetry tracing. On top of that vcpkg builds every port twice
(
Building x64-linux-dbgthen-rel) and Doris links only the release halves, andthe SDK builds appconfiguration, attestation, eventhubs, keyvault, tables, template,
uAMQP, storage-files-datalake, storage-files-shares and storage-queues, while
be/cmake/thirdparty.cmakelinks exactly four targets:azure-core,azure-identity,azure-storage-blobs,azure-storage-common.So the patch drops
opentelemetry-cppand the uAMQP C libraries fromvcpkg.json,flips
DISABLE_AMQP/DISABLE_AZURE_CORE_OPENTELEMETRYtoONand trims thesub-projects to the four Doris links;
build_azurewrites an overlay triplet thatsets
VCPKG_BUILD_TYPE release. What is left for vcpkg to build is curl, libxml2,openssl 1.1.1n and zlib, release only.
3. ccache for the third-party build
ENABLE_THIRDPARTY_CCACHE=ON(off by default) exportsCMAKE_C_COMPILER_LAUNCHER/CMAKE_CXX_COMPILER_LAUNCHER, which CMake initialisesfrom the environment, so no cmake invocation in the script changes. It deliberately
does not prefix
CC/CXX: CMake splits"ccache clang"into the compiler plus aCMAKE_<LANG>_FLAGSentry, and that leaks into whatever a package exports.Autotools packages are left alone.
.github/workflows/build-thirdparty.ymlturns it on and carries the cache with theccache-actionthis repository already vendors. Today a change to one packagerecompiles all ~80, at
-j 2on two of the three jobs.max-sizeis 1G per job so the three together stay inside what is left of therepository's 10 GB Actions cache budget next to the 5G
BE-UT-macOScache. Notethat a cache saved by a pull request run is only visible to that same pull request,
so this pays off across pushes to one branch; sharing it across pull requests would
need this workflow to run on master, the way
be-ut-mac.ymluses a schedule forexactly that reason. Happy to drop this hunk if the cache budget is too tight.
Also: the macOS jobs stalled for 10 minutes each
Carried over from apache/doris-thirdparty#410. thrift's configure finds the dotnet
the runner images ship, so
makerunsdotnet build -c Releaseforlib/netstd.The build finishes in seconds and then the compiler server it leaves behind holds
the stdout it inherited for its full keep-alive while nothing happens:
UseSharedCompilation=falseandMSBUILDDISABLENODEREUSE=1stop the server frombeing started. Both macOS jobs in this workflow pay this today.
The other two fixes in apache/doris-thirdparty#410 do not apply here: there is no
Docker job to decouple, and no macOS x86_64 job to build less often.
Release note
Azure Blob Storage support (
+AZURE_BLOB,+AZURE_STORAGE_VAULT) is now built onaarch64 and macOS, not just x86_64 Linux.
Check List (For Author)
Test
Manual test (add detailed scripts or steps below)
This PR touches
thirdparty/**andenv.sh, so its ownBuild Third Party Librariesrun builds the whole tree on ubuntu-22.04,macos-15 and macos-14 - which is exactly where the hadoop change, the azure
slimming and, for the first time, azure on macOS arm64 get exercised.
aarch64 Linux is the one path this workflow does not cover; that is only
built in apache/doris-thirdparty.
The azure patch was verified to apply cleanly to a pristine
azure-sdk-for-cpp-azure-core_1.16.0tarball, and the resultingvcpkg.jsonparses and declares only
curl,libxml2,openssl,wil.actionlintisclean on the workflow.
Behavior changed:
installed/{include,lib}/hadoop_hdfs/no longer exists in the prebuiltthird-party archive; only
hadoop_hdfs_3_4/remains. Anything outside thisrepository reading the
hadoop_hdfs/prefix needs updating.prebuilt has to be rebuilt before this lands: BE/cloud on those platforms
will pass
-DBUILD_AZURE=ONand fail to link against an older prebuiltarchive that has no azure libraries.
DISABLE_BUILD_AZURE=ONstill opts out.installed/no longer contains the azure sub-libraries Doris does not link.Does this need documentation?