Skip to content

Commit a899262

Browse files
lxy-9602suxiaogang223lszskyezjw1111liangjie3138
authored
feat: migrate Paimon C++ 0.3 development history (#161)
* feat: Add metadata system tables * fix: add break for CHAR_END_SUBTYPE * fix: Fix MemorySegment::Compare to use big-endian byte-order comparison semantics * chore(license): refine build support notices * fix: Fix undefined behavior in BinarySection bitmask constants caused by signed left shift * refactor: ColumnarArray: change constructor parameter to raw pointer to clarify non-owning semantics * feat: Support macOS builds with AppleClang and Homebrew Clang * fix: fix undefined behavior in bitwise left-shift operations across codebase * feat: optimize parquet reads with page-level filtering * fix: add ScopeGuard to wait async tasks before early return in OrphanFilesCleanerImpl::Clean() * feat(lumina): support null values in vector column during index building * chore: modify comment in RecordBatch & add check in GenericRow * fix: fix clang-tidy issues * chore: add check scale in BinaryRowWriter * fix: fix ub in Blob * refact: Refactor Literal operator== to delegate to CompareTo for consistent equality semantics * refactor: Reuse RowGroupPageIndexReader across columns to improve page-level predicate pushdown performance * feat(blob): Support blob-descriptor-field for inline blob descriptor storage * fix: Like::TestString to align with Java LIKE semantics * chore: update LICENSE with additional PyTorch copyright information * fix: date validation reject invalid dates instead of silent normalization * fix: fix thread-safe problem for file store path factory * feat: Improve PK MOR read performance with batch queue and cached column metadata * fix: avoid signed integer overflow UB in BloomFilter and DeltaVarintCompressor * feat: optimize count(*) for pk/append table Co-authored-by: dalingmeng <menglingda.mld@alibaba-inc.com> * feat(blob): support blob-view-field for cross-table blob reference re… * fix: fix unstable prefetch reader case * feat: remove support for FLOAT/DOUBLE type partition field * fix: skip object store check when UseRESTCatalogCommit is enabled * feat: add Bucket() virtual interface to DataSplit base class * fix(fs): normalize local filesystem paths and some refactoring * fix(fs): normalize local paths * fix(fs): simplify external path position update * fix(schema): treat rowkind as special field * refactor(fs): return LocalFile create as unique ptr * feat(benchmark): add append/pk table benchmark * Allow FileStoreCommit for PK tables with postpone bucket mode * Allow FileStoreCommit for PK tables with postpone bucket mode Postpone bucket mode (bucket=-2) writes data like an append table: all files go to bucket--2/ directory and the REST catalog server handles bucket redistribution during background compaction. The commit logic (manifest and snapshot generation) is identical to append tables, so there is no reason to block it. See: https://paimon.apache.org/docs/master/primary-key-table/data-distribution/#postpone-bucket Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Address review feedback: use NumBuckets() and Options::BUCKET constant - Replace raw schema options map lookup with TableSchema::NumBuckets() for postpone bucket check - Use Options::BUCKET constant instead of hardcoded "bucket" in tests - Add IsNotImplemented() status kind assertion in rejection test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: Avoid signed overflow UB in BSI index and null-deref in bloom filter index * fix: LZ4 block compressor/decompressor safety issues * fix(avro): format avro types in decoder errors * fix: override CachedInputStream::Advance to avoid real I/O for skipped pages * fix: replace arrow type DECIMAL to DECIMAL128 * fix: remove trailing semicolons from statement-like macro definitions * fix: change FileStorePathFactory::Create() to return shared_ptr * refactor(blob): refactor BlobFileContext to honor the actual schema when classifying BLOB fields * fix: address ubsan findings * fix(build): make package config relocatable * fix(parquet): fix incorrect chunk_end calculation in ComputePageRanges when dictionary page is present * feat(fs): support int64 file IO sizes * fix: small fixes for parquet reader including RowRanges, PreBuffer, ColumnIndexFilter and code cleanup * feat(blob view): support multi-thread reading upstream table & add inte test * test: add blob compatible test * refractor(parquet): simplify FileReaderWrapper and PageFilteredRowGroupReader with unified TargetRowGroup structure * fix(scan): fix dangling reference and unsigned overflow in FileStoreScan * feat(shredding): Add infrastructure for shared-shredding MAP storage layout * fix: make byte hashing independent of char signedness * feat(shared-shredding): support nested field projection in ORC format reader * fix: prevent zero-thread DefaultExecutor and validate FileSystem/SchemeMap conflict * fix: small fixes for AI reviewing feedback * feat: Optimize PK MOR read performance by reduce per-row object allocation and improve merge read performance. * feat: Add manifests and files system tables * fix: canonicalize NaN for Hive bucket hash * feat(cache): support manifest file cache * feat(schema): support pk table schema evolution * fix: fix min/max row id serialize bug * feat: update lumina lib to v0.3.0-rc1 * feat(shredding): support shared-shredding map write * fix(parquet): fallback nested field reading to RowGroup reading (walkaround) * feat(tantivy): add Tantivy full-text global index via Rust FFI * feat(parquet): support parquet metadata cache * fix(format): reset avro reader on schema change * feat(shredding): support shared shredding file reader * fix: address avro blob and executor review issues * feat(shredding): improve shared-shredding adaptive width restore & refactor write * feat: support read for nested type sub column * fix: close input/output streams when remote lookup file read/write failed * fix(testing): address review issues * feat(shared_shredding): add read inte test for shared_shredding * feat: add CreateReader api with field_name & index_type * feat(shredding): add shared-shredding map placement policies * feat(types): support CHAR/VARCHAR/BINARY/VARBINARY in data type json parser * fix: align duplicate-key replacement semantics with Java Paimon * fix: handle non-contiguous RowRanges when resolving global row IDs * test: add tests for executor * fix: release global index writer before reader to avoid mem issue when write index failed * fix: fix IsThreadSafe() in UnionGlobalIndexReader * test: add map shared-shredding tests for compaction and alter table and predicates * feat(blob): Remove blob external storage mode * feat(schema): scan context support set table schema * feat(manifest): support snapshot live manifest cache * feat(parquet): support pushing bitmaps down to page-level filtering (except for nested columns) * chore: adjust set read_ranges_freshed_ in SetReadRanges * docs: add coding agent guidelines * fix: compile with correct flags with AppleClang * feat(shared-shredding): Expose shared-shredding utilities * feat(blob view): support blob-view.resolve.enabled to preserve blob view references at read time * fix(build): disable glog unwind without libunwind * fix(avro): include headers used by file batch reader * fix(orc): avoid removed Arrow bitmap append API * feat(commit): align functionality with java paimon commit * feat: add read-optimized system table * feat(blob): support blob.split-by-file-size to weigh blob files in scan splitting * feat(blob): support blob-write-null-on-missing-file and blob-write-null-on-fetch-failure options * fix(commit): fix changelogRecordCount nullopt and add ut * fix(fs): create parent directories before opening Jindo writers * fix(jindo): make async reads concurrency-safe * fix: enable TSAN and resolve detected data races * feat(parquet): support configurable bitmap row-range refining strategies (coalesce and trim) * feat(commit): support TruncateTable/Abort/RollbackToAsLatest and add ut * build: fetch Lumina from release package * fix(blob): identify a missing blob file with FileSystem::Exists * fix(btree): preserve empty keys in index metadata & disable global bitmap index * feat(variant): support variant data type * build: fetch Boost from OSS and define network test macro globally * build: fetch Boost from OSS * build: define network test macro globally * feat: add metrics storage-read-bytes for parquet and fix clean inte test * feat(lumina): support Lumina tag filtering * fix(reader): ensure batch readers return zero-offset Arrow arrays * feat: add global system tables framework under `sys` database * refactor(format): remove Lance support * refactor(tantivy): move FFI crate under crates * chore: clean up attribution and test data whitespace * fix(blob): support blob-only writes and reject nested blob fields * fix: nested list schema evolution * fix(abi): dynamic_cast error on Predicate across shared libraries * feat(fs): add object store and S3 file systems Add a reusable read-only object store layer with a curl-based HTTP transport. Use the AWS C authentication components for credential resolution and request signing while keeping S3 data access independent of the full AWS SDK. * feat(parquet): support page-level (page index) filtering for nested column types (patch arrow) * test: add test for test coverage * test: add ut for release-0.3 * chore: remove Git LFS and refresh documentation * fix(blob): allow blob files across schema IDs * fix(core): support fallback keys for ignore-delete option * feat(shredding): support adaptive schemas across rolling files * fix(lucene): normalize prefix and wildcard queries * chore: update version to 0.3.0 * feat(blob): support placeholder fallback for partial updates * feat(parquet): support configuring Arrow pre-buffer hole-size-limit for range coalescing * fix: align floating-point semantics with Java * chore: remove target-only migration leftover * fix(release): align documentation version * ci: add consolidated build and test workflow * fix: align source archive and integration tests * ci: disable clang-tidy --------- Co-authored-by: Socrates <suxiaogang223@icloud.com> Co-authored-by: lszskye <57179283+lszskye@users.noreply.github.com> Co-authored-by: Zhang Jiawei <30893610+zjw1111@users.noreply.github.com> Co-authored-by: liangjie <liangjie.liang@antgroup.com> Co-authored-by: Zhou Hongfeng <87103887+zhf999@users.noreply.github.com> Co-authored-by: dalingmeng <49717204+dalingmeng@users.noreply.github.com> Co-authored-by: Yonghao Fang <yonghao.fyh@alibaba-inc.com> Co-authored-by: dalingmeng <menglingda.mld@alibaba-inc.com> Co-authored-by: Joey <liujiayi771@apache.org> Co-authored-by: fourier307 <8501328+fourier307@users.noreply.github.com> Co-authored-by: Joey <joey.ljy@alibaba-inc.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gang Wu <ustcwg@gmail.com> Co-authored-by: gripleaf <425797155@qq.com> Co-authored-by: spaces-x <dlut.weixiang@gmail.com> Co-authored-by: Nicholas Jiang <programgeek@163.com> Co-authored-by: Xiaoguang Zhu <smdsbz@qq.com> Co-authored-by: Mr Dk. <mrdrivingduck@gmail.com> Co-authored-by: Zouxxyy <zouxinyu.zxy@alibaba-inc.com> Co-authored-by: XiaoHongbo <1346652787@qq.com> Co-authored-by: Wei Zhang <zhangweilst@gmail.com>
1 parent 90b231b commit a899262

951 files changed

Lines changed: 91944 additions & 6489 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.devcontainer/Dockerfile.template‎

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,35 @@
1717

1818
# Adapted from Apache Iceberg C++
1919
# https://github.com/apache/iceberg-cpp/blob/v0.2.0/.devcontainer/Dockerfile.template
20-
20+
#
2121
# This Dockerfile is used to build a development container for Paimon C++.
22-
# It is based on the Ubuntu image and installs necessary dependencies.
22+
# Base: Ubuntu 24.04. Rust toolchain is installed via Dev Container
23+
# Feature `ghcr.io/devcontainers/features/rust:1` (see devcontainer.json),
24+
# so it does NOT appear in this Dockerfile.
2325

2426
FROM ubuntu:24.04
2527

28+
# Optional apt mirror. Defaults to the upstream Ubuntu mirrors so builds work
29+
# everywhere; pass --build-arg APT_MIRROR=<host> (e.g. http://mirrors.aliyun.com)
30+
# to use a regional mirror for faster downloads inside mainland China.
31+
ARG APT_MIRROR=
32+
RUN if [ -n "${APT_MIRROR}" ]; then \
33+
sed -i \
34+
-e "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}/ubuntu|g" \
35+
-e "s|http://security.ubuntu.com/ubuntu|${APT_MIRROR}/ubuntu|g" \
36+
-e "s|http://ports.ubuntu.com/ubuntu-ports|${APT_MIRROR}/ubuntu-ports|g" \
37+
/etc/apt/sources.list.d/ubuntu.sources; \
38+
fi
39+
40+
# Optional rustup mirror for the Dev Container Feature
41+
# `ghcr.io/devcontainers/features/rust:1` (and any later `rustup` calls).
42+
# Defaults to the upstream static.rust-lang.org; pass
43+
# --build-arg RUST_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static for a
44+
# China-friendly CDN. Set as ENV so it is inherited by every subsequent layer.
45+
ARG RUST_DIST_SERVER=https://static.rust-lang.org
46+
ENV RUSTUP_DIST_SERVER=${RUST_DIST_SERVER} \
47+
RUSTUP_UPDATE_ROOT=${RUST_DIST_SERVER}/rustup
48+
2649
# Install necessary packages
2750
RUN apt update && \
2851
apt install -y \
@@ -48,6 +71,16 @@ RUN apt update && \
4871
vim \
4972
wget \
5073
sudo \
74+
# ---- additions for tantivy-fts migration (Rust + Sanitizer + LLVM) ----
75+
clang \
76+
clang-format \
77+
clang-tidy \
78+
lld \
79+
llvm \
80+
libclang-rt-dev \
81+
gdb \
82+
lldb \
83+
valgrind \
5184
&& rm -rf /var/lib/apt/lists/*
5285

5386
# Add a user for development

‎.devcontainer/centos7/Dockerfile‎

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# CentOS 7 cross-build verification image for paimon-cpp + tantivy-fts.
18+
#
19+
# Purpose:
20+
# Prove the tantivy-fts stack builds on the OLDEST reasonable Linux target
21+
# (glibc 2.17, EOL 2024-06-30). The default Ubuntu 24.04 dev container
22+
# proves nothing about glibc compatibility; this image does.
23+
#
24+
# Build:
25+
# docker build -t paimon-cpp-centos7:latest -f .devcontainer/centos7/Dockerfile .
26+
#
27+
# Run:
28+
# docker run -d --name paimon-centos7 \
29+
# --privileged \
30+
# -v "$(pwd):/workspaces/paimon-cpp" \
31+
# paimon-cpp-centos7:latest sleep infinity
32+
# docker exec -it paimon-centos7 bash -l
33+
#
34+
# Inside the container:
35+
# scl enable devtoolset-11 rh-python38 -- bash # activate modern gcc + python
36+
# source /opt/paimon-env.sh # PATH for rust, cmake
37+
# cd /workspaces/paimon-cpp
38+
#
39+
# Run ./.devcontainer/centos7/run.sh smoke from the host for the full check.
40+
41+
# ---------- Base ----------
42+
# CentOS 7 reached EOL 2024-06-30; its default mirrorlist.centos.org is down.
43+
# Pin to vault.centos.org (Red Hat's archived location) via the `linuxserver/centos`
44+
# vault image to avoid retired-mirror failures on `yum install`.
45+
#
46+
# Base image: we pull from quay.io (CentOS community's canonical registry post
47+
# Docker Hub deprecation). Override with CENTOS7_IMAGE build arg when behind a
48+
# firewall that can't reach quay.io (e.g. registry.aliyuncs.com/library/centos:7).
49+
ARG CENTOS7_IMAGE=quay.io/centos/centos:centos7
50+
FROM ${CENTOS7_IMAGE}
51+
52+
# Repoint yum at aliyun's CentOS 7 vault mirror — vault.centos.org itself
53+
# works but is slow/blocked from many CN networks; the aliyun mirror is a
54+
# complete rsync and reliably fast. We overwrite CentOS-Base.repo rather
55+
# than sed-patch it so the result is deterministic regardless of what the
56+
# upstream image ships. fastestmirror plugin is disabled because its ping
57+
# probes against the retired mirror list add ~60s to every `yum install`.
58+
RUN echo -e '[base]\n\
59+
name=CentOS-7 - Base - aliyun vault\n\
60+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/\n\
61+
gpgcheck=0\n\
62+
enabled=1\n\
63+
\n\
64+
[updates]\n\
65+
name=CentOS-7 - Updates - aliyun vault\n\
66+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/\n\
67+
gpgcheck=0\n\
68+
enabled=1\n\
69+
\n\
70+
[extras]\n\
71+
name=CentOS-7 - Extras - aliyun vault\n\
72+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/\n\
73+
gpgcheck=0\n\
74+
enabled=1\n\
75+
\n\
76+
[centosplus]\n\
77+
name=CentOS-7 - Plus - aliyun vault\n\
78+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/centosplus/$basearch/\n\
79+
gpgcheck=0\n\
80+
enabled=0\n' > /etc/yum.repos.d/CentOS-Base.repo \
81+
&& rm -f /etc/yum.repos.d/CentOS-CR.repo \
82+
/etc/yum.repos.d/CentOS-Debuginfo.repo \
83+
/etc/yum.repos.d/CentOS-Media.repo \
84+
/etc/yum.repos.d/CentOS-Sources.repo \
85+
/etc/yum.repos.d/CentOS-Vault.repo \
86+
/etc/yum.repos.d/CentOS-fasttrack.repo \
87+
/etc/yum.repos.d/CentOS-x86_64-kernel.repo \
88+
&& if [ -f /etc/yum/pluginconf.d/fastestmirror.conf ]; then \
89+
sed -i 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf; \
90+
fi \
91+
&& yum clean all \
92+
&& yum makecache
93+
94+
# ---------- Base toolchain ----------
95+
# EPEL provides ninja-build and a newer python3 than the base 3.6.
96+
# SCL (Software Collections) provides devtoolset-11 (gcc 11) and rh-python38
97+
# without overriding the system gcc/python. CentOS 7's default gcc 4.8 is
98+
# too old for C++17/20 used by lucene++ and our tantivy wrapper.
99+
#
100+
# Same story as CentOS-Base.repo: both epel + SCL default to mirrorlist
101+
# endpoints that are effectively dead; overwrite with aliyun URLs that we
102+
# know respond.
103+
RUN yum install -y epel-release centos-release-scl \
104+
&& echo -e '[epel]\n\
105+
name=Extra Packages for Enterprise Linux 7 - aliyun\n\
106+
baseurl=https://mirrors.aliyun.com/epel/7/$basearch\n\
107+
gpgcheck=0\n\
108+
enabled=1\n' > /etc/yum.repos.d/epel.repo \
109+
&& rm -f /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel.repo.rpmnew \
110+
&& rm -f /etc/yum.repos.d/CentOS-SCLo-*.repo \
111+
/etc/yum.repos.d/CentOS-SCLo-*.repo.rpmnew \
112+
&& echo -e '[centos-sclo-rh]\n\
113+
name=CentOS-7 - SCLo rh - aliyun vault\n\
114+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/sclo/$basearch/rh/\n\
115+
gpgcheck=0\n\
116+
enabled=1\n\
117+
\n\
118+
[centos-sclo-sclo]\n\
119+
name=CentOS-7 - SCLo sclo - aliyun vault\n\
120+
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/sclo/$basearch/sclo/\n\
121+
gpgcheck=0\n\
122+
enabled=1\n' > /etc/yum.repos.d/CentOS-SCLo-scl.repo \
123+
&& yum clean all && yum makecache \
124+
&& yum install -y \
125+
devtoolset-11-gcc \
126+
devtoolset-11-gcc-c++ \
127+
devtoolset-11-binutils \
128+
devtoolset-11-libasan-devel \
129+
devtoolset-11-libubsan-devel \
130+
rh-python38 \
131+
rh-python38-python-pip \
132+
git \
133+
ninja-build \
134+
make \
135+
patch \
136+
curl \
137+
wget \
138+
unzip \
139+
which \
140+
file \
141+
sudo \
142+
openssl-devel \
143+
zlib-devel \
144+
libffi-devel \
145+
bzip2-devel \
146+
xz-devel \
147+
perl-IPC-Cmd \
148+
&& yum clean all
149+
150+
# Enable the SCL collections for all subsequent shells (including RUN).
151+
ENV BASH_ENV=/etc/profile.d/scl-enable.sh
152+
SHELL ["/bin/bash", "-c"]
153+
RUN printf '%s\n' \
154+
'source scl_source enable devtoolset-11' \
155+
'source scl_source enable rh-python38' \
156+
> /etc/profile.d/scl-enable.sh \
157+
&& chmod +x /etc/profile.d/scl-enable.sh
158+
159+
# ---------- CMake (must be >= 3.22 for Corrosion) ----------
160+
# CentOS 7's cmake package is 2.8.12; EPEL cmake3 is 3.17 — still too old.
161+
# Install via pip in the rh-python38 SCL so we get a modern CMake without
162+
# touching the system /usr/bin. Point pip at aliyun's pypi mirror: default
163+
# pypi.org is 10-30s per request from CN, aliyun responds in <1s.
164+
ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
165+
PIP_TRUSTED_HOST=mirrors.aliyun.com
166+
RUN source /etc/profile.d/scl-enable.sh \
167+
&& python3 -m pip install --upgrade pip \
168+
&& python3 -m pip install 'cmake==3.28.*' ninja
169+
170+
# ---------- Rust toolchain ----------
171+
# Install rustup as root into /opt/rust so all users share the same toolchain.
172+
# Use the USTC mirror to keep downloads fast in CN; the CI runner version of
173+
# this is mirrored in ci/scripts/setup_rust.sh.
174+
ENV RUSTUP_HOME=/opt/rust/rustup \
175+
CARGO_HOME=/opt/rust/cargo \
176+
RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static \
177+
RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
178+
# In-container network for Docker Desktop builds is unreliable through many
179+
# CN mirrors (observed: curl 7.29 on CentOS 7 + rsproxy.cn HTTP/2 path ⇒
180+
# partial-read truncations; USTC ⇒ 5xx; rustup sh installer ⇒ 403 from
181+
# legacy cipher). The most reliable fix is to sidestep the issue entirely:
182+
# pre-download rustup-init on the host (where network is solid) and COPY it
183+
# into the image. See .devcontainer/centos7/run.sh for the prefetch step.
184+
COPY .devcontainer/centos7/rustup-init.bin /tmp/rustup-init
185+
RUN chmod +x /tmp/rustup-init \
186+
&& /tmp/rustup-init -y --default-toolchain stable --profile minimal --no-modify-path \
187+
&& rm -f /tmp/rustup-init \
188+
&& mkdir -p $CARGO_HOME \
189+
&& echo -e '[source.crates-io]\n\
190+
replace-with = "rsproxy-sparse"\n\
191+
\n\
192+
[source.rsproxy]\n\
193+
registry = "https://rsproxy.cn/crates.io-index"\n\
194+
\n\
195+
[source.rsproxy-sparse]\n\
196+
registry = "sparse+https://rsproxy.cn/index/"\n\
197+
\n\
198+
[registries.rsproxy]\n\
199+
index = "https://rsproxy.cn/crates.io-index"\n\
200+
\n\
201+
[net]\n\
202+
git-fetch-with-cli = true\n' > $CARGO_HOME/config.toml \
203+
&& $CARGO_HOME/bin/cargo install cbindgen --version 0.29.2 --locked \
204+
&& chmod -R a+rwx /opt/rust \
205+
&& $CARGO_HOME/bin/rustc --version \
206+
&& $CARGO_HOME/bin/cargo --version \
207+
&& $CARGO_HOME/bin/cbindgen --version
208+
209+
# ---------- Environment file consumed by every shell ----------
210+
# Sets PATH for rust / cmake / cargo so `docker exec paimon-centos7 bash -l`
211+
# and interactive sessions have the toolchain on $PATH.
212+
RUN printf '%s\n' \
213+
'export PATH=/opt/rust/cargo/bin:$PATH' \
214+
'# cmake + ninja live under the rh-python38 SCL; path prefix differs by arch.' \
215+
'# `command -v cmake` confirms which one is in use.' \
216+
> /opt/paimon-env.sh \
217+
&& chmod +x /opt/paimon-env.sh \
218+
&& printf '%s\n' 'source /opt/paimon-env.sh' >> /etc/profile.d/scl-enable.sh
219+
220+
# ---------- Non-root user ----------
221+
# Build as `paimon` (uid 1000) so LFS objects under the mount stay owned by
222+
# your host user, matching the main Ubuntu dev container.
223+
RUN useradd -m -u 1000 -s /bin/bash paimon \
224+
&& echo 'paimon ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/paimon
225+
226+
USER paimon
227+
WORKDIR /workspaces/paimon-cpp
228+
229+
# Sanity check surfaces the tool versions in `docker run ... paimon-cpp-centos7 --version`.
230+
CMD ["bash", "-lc", "\
231+
echo '--- CentOS 7 cross-build image sanity check ---'; \
232+
cat /etc/centos-release; \
233+
echo '--- glibc ---'; ldd --version | head -1; \
234+
echo '--- gcc ---'; gcc --version | head -1; \
235+
echo '--- cmake ---'; cmake --version | head -1; \
236+
echo '--- ninja ---'; ninja --version; \
237+
echo '--- rust ---'; rustc --version; \
238+
echo '--- cargo ---'; cargo --version; \
239+
echo '--- cbindgen ---'; cbindgen --version; \
240+
echo 'Ready. From the host repository, run ./.devcontainer/centos7/run.sh smoke'"]

0 commit comments

Comments
 (0)