Skip to content

Commit c436250

Browse files
committed
Remove hardcoded mirrors, keep env var support
1 parent a565133 commit c436250

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

BUILD_CHINA.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,45 @@
1919

2020
# Building in China
2121

22+
This guide helps developers in China who may experience network issues when downloading dependencies from GitHub or international mirrors.
23+
24+
## Using Custom Mirror URLs
25+
26+
If you experience download timeouts, you can override the default dependency URLs using environment variables:
27+
28+
```bash
29+
export ICEBERG_ARROW_URL="<your-mirror-url>/apache-arrow-22.0.0.tar.gz"
30+
export ICEBERG_NANOARROW_URL="<your-mirror-url>/apache-arrow-nanoarrow-0.7.0.tar.gz"
31+
export ICEBERG_CROARING_URL="<your-mirror-url>/CRoaring-v4.3.11.tar.gz"
32+
export ICEBERG_NLOHMANN_JSON_URL="<your-mirror-url>/json-v3.11.3.tar.xz"
33+
export ICEBERG_SPDLOG_URL="<your-mirror-url>/spdlog-v1.15.3.tar.gz"
34+
export ICEBERG_CPR_URL="<your-mirror-url>/cpr-1.12.0.tar.gz"
35+
36+
# For Avro (git repository):
37+
export ICEBERG_AVRO_GIT_URL="<your-git-mirror>/avro.git"
38+
# Or if you have a tarball:
39+
export ICEBERG_AVRO_URL="<your-mirror-url>/avro.tar.gz"
40+
```
41+
42+
Then build as usual:
43+
44+
```bash
45+
cmake -S . -B build
46+
cmake --build build
47+
```
48+
49+
## Alternative Solutions
50+
51+
1. **Use system packages**: Install dependencies via your system package manager
52+
2. **Use a proxy**: Set `https_proxy` environment variable
53+
3. **Pre-download**: Manually download tarballs to `~/.cmake/Downloads/`
54+
55+
## Getting Help
56+
57+
If you continue experiencing build issues, please open an issue at https://github.com/apache/iceberg-cpp/issues with details about which dependency failed.
58+
59+
# Building in China
60+
2261
This guide helps developers in China build iceberg-cpp when network access to GitHub and other international sites is limited.
2362

2463
## Mirror Support

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ else()
3333
set(ARROW_SOURCE_URL
3434
"https://www.apache.org/dyn/closer.lua?action=download&filename=/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
3535
"https://downloads.apache.org/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
36-
"https://mirrors.tuna.tsinghua.edu.cn/apache/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
37-
"https://mirrors.ustc.edu.cn/apache/arrow/arrow-${ICEBERG_ARROW_BUILD_VERSION}/apache-arrow-${ICEBERG_ARROW_BUILD_VERSION}.tar.gz"
3836
)
3937
endif()
4038

@@ -253,9 +251,6 @@ function(resolve_nanoarrow_dependency)
253251
else()
254252
set(NANOARROW_URL
255253
"https://dlcdn.apache.org/arrow/apache-arrow-nanoarrow-0.7.0/apache-arrow-nanoarrow-0.7.0.tar.gz"
256-
"https://downloads.apache.org/arrow/apache-arrow-nanoarrow-0.7.0/apache-arrow-nanoarrow-0.7.0.tar.gz"
257-
"https://mirrors.tuna.tsinghua.edu.cn/apache/arrow/apache-arrow-nanoarrow-0.7.0/apache-arrow-nanoarrow-0.7.0.tar.gz"
258-
"https://mirrors.ustc.edu.cn/apache/arrow/apache-arrow-nanoarrow-0.7.0/apache-arrow-nanoarrow-0.7.0.tar.gz"
259254
)
260255
endif()
261256

@@ -312,9 +307,7 @@ function(resolve_croaring_dependency)
312307
set(CROARING_URL "$ENV{ICEBERG_CROARING_URL}")
313308
else()
314309
set(CROARING_URL
315-
"https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.3.11.tar.gz"
316-
"https://gitee.com/mirrors/CRoaring/repository/archive/v4.3.11.tar.gz"
317-
"https://hub.fastgit.xyz/RoaringBitmap/CRoaring/archive/refs/tags/v4.3.11.tar.gz")
310+
"https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.3.11.tar.gz")
318311
endif()
319312

320313
fetchcontent_declare(croaring
@@ -369,9 +362,7 @@ function(resolve_nlohmann_json_dependency)
369362
set(NLOHMANN_JSON_URL "$ENV{ICEBERG_NLOHMANN_JSON_URL}")
370363
else()
371364
set(NLOHMANN_JSON_URL
372-
"https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz"
373-
"https://gitee.com/mirrors/JSON-for-Modern-CPP/releases/download/v3.11.3/json.tar.xz"
374-
"https://hub.fastgit.xyz/nlohmann/json/releases/download/v3.11.3/json.tar.xz")
365+
"https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz")
375366
endif()
376367

377368
fetchcontent_declare(nlohmann_json
@@ -437,10 +428,7 @@ function(resolve_spdlog_dependency)
437428
if(DEFINED ENV{ICEBERG_SPDLOG_URL})
438429
set(SPDLOG_URL "$ENV{ICEBERG_SPDLOG_URL}")
439430
else()
440-
set(SPDLOG_URL
441-
"https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz"
442-
"https://gitee.com/mirrors/spdlog/repository/archive/v1.15.3.tar.gz"
443-
"https://hub.fastgit.xyz/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz")
431+
set(SPDLOG_URL "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz")
444432
endif()
445433

446434
fetchcontent_declare(spdlog
@@ -508,10 +496,7 @@ function(resolve_cpr_dependency)
508496
if(DEFINED ENV{ICEBERG_CPR_URL})
509497
set(CPR_URL "$ENV{ICEBERG_CPR_URL}")
510498
else()
511-
set(CPR_URL
512-
"https://github.com/libcpr/cpr/archive/refs/tags/1.12.0.tar.gz"
513-
"https://gitee.com/mirrors/cpr/repository/archive/1.12.0.tar.gz"
514-
"https://hub.fastgit.xyz/libcpr/cpr/archive/refs/tags/1.12.0.tar.gz")
499+
set(CPR_URL "https://github.com/libcpr/cpr/archive/refs/tags/1.12.0.tar.gz")
515500
endif()
516501

517502
fetchcontent_declare(cpr

0 commit comments

Comments
 (0)