Skip to content

Commit c886f1c

Browse files
authored
feat: build with stable rust (#3881)
1 parent 5b0c86b commit c886f1c

File tree

52 files changed

+448
-362
lines changed

Some content is hidden

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

52 files changed

+448
-362
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: "Setup Rust"
22
description: "Toolchain setup and Initial compilation"
33

44
inputs:
5+
toolchain:
6+
description: "optional override for the toolchain version (e.g. nightly)"
7+
required: false
8+
components:
9+
description: "optional override for the components to install for the step (e.g. clippy, rustfmt, miri)"
10+
required: false
511
targets:
612
description: "optional targets override (e.g. wasm32-unknown-unknown)"
713
required: false
@@ -22,9 +28,9 @@ runs:
2228
uses: dtolnay/rust-toolchain@master
2329
if: steps.rustup-cache.outputs.cache-hit != 'true'
2430
with:
25-
toolchain: "${{ steps.rust-version.outputs.version }}"
31+
toolchain: "${{ inputs.toolchain || steps.rust-version.outputs.version }}"
2632
targets: "${{inputs.targets || ''}}"
27-
components: clippy, rustfmt, miri, llvm-tools-preview
33+
components: "${{ inputs.components || 'clippy, rustfmt' }}"
2834

2935
- name: Rust Dependency Cache
3036
uses: Swatinem/rust-cache@v2

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
- name: Rust Tests
315315
if: ${{ matrix.suite == 'tests' }}
316316
run: |
317-
cargo nextest run --locked --workspace --all-features --no-fail-fast
317+
cargo +nightly nextest run --locked --workspace --all-features --no-fail-fast
318318
- name: Run TPC-H
319319
if: ${{ matrix.suite == 'tpc-h' }}
320320
run: |
@@ -364,14 +364,17 @@ jobs:
364364
with:
365365
submodules: "recursive"
366366
- uses: ./.github/actions/setup-rust
367+
with:
368+
toolchain: nightly
369+
components: "rust-src, rustfmt, clippy, llvm-tools-preview"
367370
- name: Install nextest
368371
uses: taiki-e/install-action@v2
369372
with:
370373
371374
- name: Rust Tests
372375
# vortex-duckdb-ext currently fails linking for cargo test targets.
373376
run: |
374-
cargo nextest run --locked --workspace --all-features --no-fail-fast --target x86_64-unknown-linux-gnu
377+
cargo +nightly nextest run --locked --workspace --all-features --no-fail-fast --target x86_64-unknown-linux-gnu
375378
376379
build-java:
377380
name: "Java"
@@ -463,10 +466,12 @@ jobs:
463466
- uses: actions/checkout@v4
464467
- uses: ./.github/actions/setup-rust
465468
with:
469+
toolchain: nightly
466470
targets: "wasm32-wasip1"
471+
components: "rust-src"
467472
- name: Setup Wasmer
468473
uses: wasmerio/[email protected]
469-
- run: cargo -Zbuild-std=panic_abort,std build --target wasm32-wasip1
474+
- run: cargo +nightly -Zbuild-std=panic_abort,std build --target wasm32-wasip1
470475
working-directory: ./wasm-test
471476
- run: wasmer run ./target/wasm32-wasip1/debug/wasm-test.wasm
472477
working-directory: ./wasm-test
@@ -484,19 +489,14 @@ jobs:
484489
with:
485490
submodules: "recursive"
486491
- uses: ./.github/actions/setup-rust
492+
with:
493+
toolchain: nightly
494+
components: "rust-src, rustfmt, clippy, miri"
487495
- uses: taiki-e/install-action@v2
488496
with:
489497
490-
- name: Run all tests with Miri
491-
# For now, we only run Miri against known "fiddly" crates.
492-
if: false
493-
run: |
494-
cargo miri nextest run --no-fail-fast --workspace --exclude vortex-file --exclude vortex-layout \
495-
--exclude vortex-fsst --exclude vortex-array --exclude vortex-dtype --exclude vortex-expr \
496-
--exclude vortex-scalar --exclude vortex-duckdb --exclude vortex-ffi --exclude bench-vortex \
497-
--exclude vortex-python --exclude vortex-jni
498498
- name: Run Miri
499-
run: cargo miri nextest run --no-fail-fast -p vortex-buffer -p vortex-ffi
499+
run: cargo +nightly miri nextest run --no-fail-fast -p vortex-buffer -p vortex-ffi
500500

501501
generated-files:
502502
name: "Check generated proto/fbs files are up to date"

.github/workflows/fuzz.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
with:
2525
submodules: "recursive"
2626
- uses: ./.github/actions/setup-rust
27+
with:
28+
rust-version: nightly
2729
- name: Install cargo fuzz
2830
run: cargo install --locked cargo-fuzz
2931
- name: Restore corpus

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ keywords = ["vortex"]
5050
license = "Apache-2.0"
5151
readme = "README.md"
5252
repository = "https://github.com/spiraldb/vortex"
53-
rust-version = "1.86"
53+
rust-version = "1.87"
5454
version = "0.1.0"
5555

5656
[workspace.dependencies]
@@ -240,6 +240,10 @@ redundant_lifetimes = "deny"
240240
unsafe_op_in_unsafe_fn = "deny"
241241
unused_lifetimes = "deny"
242242
unused_qualifications = "deny"
243+
unexpected_cfgs = { level = "deny", check-cfg = [
244+
"cfg(codspeed)",
245+
"cfg(vortex_nightly)",
246+
] }
243247
warnings = "deny"
244248

245249
[workspace.lints.clippy]

bench-vortex/src/datasets/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl BenchmarkDataset {
106106
}
107107

108108
pub fn format_path(&self, format: Format, base_url: &Url) -> Result<Url> {
109-
Ok(base_url.join(&format!("{}/", format))?)
109+
Ok(base_url.join(&format!("{format}/"))?)
110110
}
111111

112112
pub async fn register_tables(

bench-vortex/src/engines/ddb/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl DuckDBCtx {
6666

6767
/// Execute DuckDB queries for benchmarks using the internal connection
6868
pub fn execute_query(&self, query: &str) -> Result<(Duration, usize)> {
69-
trace!("execute duckdb query: {}", query);
69+
trace!("execute duckdb query: {query}");
7070
let time_instant = Instant::now();
7171
let result = self.connection.query(query)?;
7272
let query_time = time_instant.elapsed();
@@ -104,7 +104,7 @@ impl DuckDBCtx {
104104
// Generate and execute table registration commands
105105
let commands = self.generate_table_commands(&effective_url, extension, dataset, object);
106106
self.execute_query(&commands)?;
107-
trace!("Executing table registration commands: {}", commands);
107+
trace!("Executing table registration commands: {commands}");
108108

109109
Ok(())
110110
}

bench-vortex/src/tpch/tpch_benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl TpcHBenchmark {
286286
ChangeTag::Insert => "+",
287287
ChangeTag::Equal => " ",
288288
};
289-
print!("{}{}", sign, change);
289+
print!("{sign}{change}");
290290
}
291291

292292
eprintln!("query output does not match the reference for {query_name}");

clippy.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ allow-dbg-in-tests = true
22
allow-expect-in-tests = true
33
allow-unwrap-in-tests = true
44
single-char-binding-names-threshold = 2
5-
# We prefer using parking_lot for improved ergonomics and performance.
6-
disallowed-types = ["std::collections::HashMap", "std::collections::HashSet", "std::sync::Mutex", "std::sync::RwLock"]
5+
disallowed-types = [
6+
{ path = "std::collections::HashMap", reason = "Use the HashMap in vortex_utils::aliases for better performance" },
7+
{ path = "std::collections::HashSet", reason = "Use the HashSet in vortex_utils::aliases for better performance" },
8+
{ path = "std::sync::Mutex", reason = "Prefer using parking_lot Mutex for improved ergonomics and performance" },
9+
{ path = "std::sync::RwLock", reason = "Prefer using parking_lot RwLock for improved ergonomics and performance" }]
710

811
disallowed-methods = [
9-
# It uses the default hasher and is very easy to just inline with a faster implementation
10-
"itertools::Itertools::counts"
11-
]
12+
{ path = "itertools::Itertools::counts", reason = "It uses the default hasher which is slow for primitives. Just inline the loop for better performance." }
13+
]

encodings/alp/src/alp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn encode_chunk_unchecked<T: ALPFloat>(
216216

217217
// encode the chunk, counting the number of patches
218218
let mut chunk_patch_count = 0;
219-
encoded_output.extend(chunk.iter().map(|&v| {
219+
encoded_output.extend_trusted(chunk.iter().map(|&v| {
220220
let encoded = T::encode_single_unchecked(v, exp);
221221
let decoded = T::decode_single(encoded, exp);
222222
let neq = !decoded.is_eq(v) as usize;

0 commit comments

Comments
 (0)