Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ jobs:
- name: Install cargo-public-api
run: cargo install cargo-public-api --locked
- name: Regenerate public API lock files
run: bash scripts/public-api.sh
run: cargo run -p lockfiles
- name: Verify lock files are up to date
run: |
git diff --name-only
Expand Down
75 changes: 69 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ members = [
"benchmarks/datafusion-bench",
"benchmarks/duckdb-bench",
"benchmarks/random-access-bench",
"vortex-sqllogictest",
"vortex-sqllogictest", "lockfiles",
]
exclude = ["java/testfiles", "wasm-test"]
resolver = "2"
Expand Down
23 changes: 23 additions & 0 deletions lockfiles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "lockfiles"
description = "Build lockfiles for all workspace projects"
publish = false
authors.workspace = true
categories.workspace = true
edition.workspace = true
homepage.workspace = true
include.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
cargo_metadata = "0.23"
indicatif = { version = "0.17", features = ["rayon"] }
rayon = "1"

[lints]
workspace = true
94 changes: 94 additions & 0 deletions lockfiles/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#![allow(clippy::expect_used)]

use std::fs::File;
use std::io::Write;
use std::process::Command;

use cargo_metadata::MetadataCommand;
use cargo_metadata::Package;
use cargo_metadata::PackageName;
use cargo_metadata::camino::Utf8PathBuf;
use indicatif::ParallelProgressIterator;
use indicatif::ProgressBar;
use indicatif::ProgressStyle;
use rayon::prelude::*;

pub fn main() {
let metadata = MetadataCommand::new()
.no_deps()
.exec()
.expect("cargo metadata");

let published: Vec<_> = metadata
.workspace_packages()
.into_iter()
.filter(|v| is_published(v))
// Only keep crates that publish Rust libs
.filter(|p| p.targets.iter().any(|target| target.is_lib()))
.collect();

// Skip binary packages

let progress = ProgressBar::new(published.len() as u64);
progress.set_style(
ProgressStyle::default_bar()
.template("{spinner:.green} [{bar:40.cyan/blue}] {pos}/{len} ({eta}) {msg}")
.expect("valid template")
.progress_chars("=>-"),
);

published
.par_iter()
.progress_with(progress)
.for_each(|pkg| {
let job = LockfileJob {
name: pkg.name.clone(),
manifest_path: pkg.manifest_path.clone(),
};

job.execute().expect("lockfile");
});
}

struct LockfileJob {
name: PackageName,
manifest_path: Utf8PathBuf,
}

impl LockfileJob {
fn execute(self) -> std::io::Result<()> {
let LockfileJob {
name,
manifest_path,
} = self;

let lockfile_path = manifest_path.with_file_name("public-api.lock");

let mut cmd = Command::new("cargo");
let output = cmd
.arg("+nightly")
.arg("public-api")
.arg("--manifest-path")
.arg(manifest_path)
.args(["--omit", "blanket-impls,auto-trait-impls"])
.output()?;

if !output.status.success() {
eprintln!(
"FAILED: {name}:\n===============\n\n{}\n\n===============\n\n",
String::from_utf8_lossy(&output.stdout)
);

return Err(std::io::Error::other("failed to execute"));
}

// Write lockfile contents
File::create(&lockfile_path)?.write_all(&output.stdout)?;

Ok(())
}
}

fn is_published(pkg: &Package) -> bool {
pkg.publish.as_ref().map(|v| !v.is_empty()).unwrap_or(true)
}
57 changes: 0 additions & 57 deletions scripts/public-api.sh

This file was deleted.

1 change: 1 addition & 0 deletions vortex-cuda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "vortex-cuda"
authors.workspace = true
description = "CUDA compute for Vortex"
publish = false
edition = { workspace = true }
homepage = { workspace = true }
categories = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions vortex-cuda/cub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name = "vortex-cub"
authors.workspace = true
description = "Rust bindings to NVIDIA CUB library for Vortex GPU operations"
publish = false
edition = { workspace = true }
homepage = { workspace = true }
categories = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions vortex-cuda/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "vortex-cuda-macros"
authors.workspace = true
description = "Proc macros for CUDA conditional compilation in Vortex"
publish = false
edition = { workspace = true }
homepage = { workspace = true }
categories = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions vortex-cuda/nvcomp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "vortex-nvcomp"
authors.workspace = true
description = "Rust bindings to NVIDIA nvCOMP compression library"
publish = false
edition = { workspace = true }
homepage = { workspace = true }
categories = { workspace = true }
Expand Down
Loading
Loading