Skip to content

Commit 955efa8

Browse files
authored
Merge pull request ClickHouse#79560 from ClickHouse/fix-rust-src-vendoring
Fix Rust src vendoring
2 parents 07e3405 + f8d5d89 commit 955efa8

File tree

7 files changed

+315
-292
lines changed

7 files changed

+315
-292
lines changed

contrib/corrosion-cmake/config.toml.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ lto = true
99

1010
[source.crates-io]
1111
registry = 'sparse+https://index.crates.io/'
12-
replace-with = 'local-registry'
12+
replace-with = 'vendored-sources'
1313

1414
[source."git+https://github.com/azat-rust/tuikit.git?rev=e1994c0e03ff02c49cf1471f0cc3cbf185ce0104"]
1515
git = "https://github.com/azat-rust/tuikit.git"
1616
rev = "e1994c0e03ff02c49cf1471f0cc3cbf185ce0104"
1717
replace-with = "vendored-sources"
1818

19-
[source.local-registry]
20-
local-registry = "@RUST_VENDOR_DIR@"
21-
2219
[source.vendored-sources]
2320
directory = "@RUST_VENDOR_DIR@"

contrib/delta-kernel-rs

contrib/delta-kernel-rs-cmake/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ endif()
2424
# * default-engine: Needed for its s3 client (we can't pass our own s3 client via ffi)
2525
# * delta_kernel/cloud: s3 client
2626
clickhouse_import_crate(
27-
MANIFEST_PATH "${DELTA_KERNEL_RS_SOURCE_DIR}/ffi/Cargo.toml"
28-
FEATURES "default-engine, delta_kernel/cloud")
27+
MANIFEST_PATH "${DELTA_KERNEL_RS_SOURCE_DIR}/ffi/Cargo.toml"
28+
FEATURES "default-engine, delta_kernel/cloud"
29+
)
2930
clickhouse_config_crate_flags(delta_kernel_ffi)
3031

3132
# We use our own OpenSSL headers and libs

contrib/rust_vendor

Submodule rust_vendor updated 29136 files

rust/VENDOR.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,7 @@ so you need to install `rustup component add rust-src` for the specific version.
1010
cargo generate-lockfile
1111
```
1212

13-
* Generate the local registry:
14-
15-
Note that we use both commands to vendor both registry and crates. No idea why both are necessary.
16-
17-
* First we need to install the tool if you don't already have it:
18-
```bash
19-
cargo install --version 0.2.7 cargo-local-registry
20-
```
21-
22-
* Now add the local packages:
13+
* Generate the vendor dir:
2314

2415
```bash
2516
export CH_TOP_DIR=$(git rev-parse --show-toplevel)
@@ -31,33 +22,16 @@ export DELTA_LAKE_DIR="$CH_TOP_DIR"/contrib/delta-kernel-rs
3122
rm -rf "$CH_TOP_DIR"/contrib/rust_vendor/*
3223

3324
cd "$CH_TOP_DIR"/rust/workspace
34-
cargo local-registry --git --sync Cargo.lock "$CH_TOP_DIR"/contrib/rust_vendor
25+
cargo vendor --no-delete --locked --versioned-dirs --manifest-path Cargo.toml "$CH_TOP_DIR"/contrib/rust_vendor
3526

3627
# Now handle delta-lake
3728
cd "$DELTA_LAKE_DIR"
38-
cargo local-registry --no-delete --git --sync "$DELTA_LAKE_DIR/Cargo.lock" "$CH_TOP_DIR"/contrib/rust_vendor
29+
cargo vendor --no-delete --locked --versioned-dirs --manifest-path Cargo.toml "$CH_TOP_DIR"/contrib/rust_vendor
3930

4031
# Standard library deps
41-
cp "$RUSTC_ROOT"/lib/rustlib/src/rust/library/Cargo.lock "$RUSTC_ROOT"/lib/rustlib/src/rust/library/std/
42-
cargo local-registry --no-delete --git --sync "$RUSTC_ROOT"/lib/rustlib/src/rust/library/std/Cargo.lock "$CH_TOP_DIR"/contrib/rust_vendor
43-
cp "$RUSTC_ROOT"/lib/rustlib/src/rust/library/Cargo.lock "$RUSTC_ROOT"/lib/rustlib/src/rust/library/test/
44-
cargo local-registry --no-delete --git --sync "$RUSTC_ROOT"/lib/rustlib/src/rust/library/test/Cargo.lock "$CH_TOP_DIR"/contrib/rust_vendor
45-
46-
# Now we vendor the modules themselves
47-
cd "$CH_TOP_DIR"/rust/workspace
48-
cargo vendor --no-delete --locked "$CH_TOP_DIR"/contrib/rust_vendor
49-
cd "$DELTA_LAKE_DIR"
50-
cargo vendor --no-delete --locked "$CH_TOP_DIR"/contrib/rust_vendor
51-
cd "$RUSTC_ROOT"/lib/rustlib/src/rust/library/std/
52-
cargo vendor --no-delete "$CH_TOP_DIR"/contrib/rust_vendor
53-
cd "$RUSTC_ROOT"/lib/rustlib/src/rust/library/test/
54-
cargo vendor --no-delete "$CH_TOP_DIR"/contrib/rust_vendor
55-
56-
# Remove windows only dependencies (which are really heavy and we don't want in the repo)
57-
rm -rf "$CH_TOP_DIR"/contrib/rust_vendor/winapi* "$CH_TOP_DIR"/contrib/rust_vendor/windows*
32+
cargo vendor --no-delete --locked --versioned-dirs --manifest-path "$RUSTC_ROOT"/lib/rustlib/src/rust/library/std/Cargo.toml "$CH_TOP_DIR"/contrib/rust_vendor
33+
cargo vendor --no-delete --locked --versioned-dirs --manifest-path "$RUSTC_ROOT"/lib/rustlib/src/rust/library/test/Cargo.toml "$CH_TOP_DIR"/contrib/rust_vendor
5834

59-
# Cleanup the lock files we copied
60-
rm "$RUSTC_ROOT"/lib/rustlib/src/rust/library/std/Cargo.lock "$RUSTC_ROOT"/lib/rustlib/src/rust/library/test/Cargo.lock
6135
cd "$CH_TOP_DIR"/rust/workspace
6236
```
6337

0 commit comments

Comments
 (0)