diff --git a/Cargo.lock b/Cargo.lock index 50ed7e89ee7..84ead8cd6ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,7 +125,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -136,7 +136,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -983,6 +983,39 @@ dependencies = [ "libbz2-rs-sys", ] +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "cargo_metadata" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.18", +] + [[package]] name = "cast" version = "0.3.0" @@ -1183,7 +1216,7 @@ checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" dependencies = [ "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width 0.2.2", ] [[package]] @@ -3268,7 +3301,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -3463,7 +3496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3884,7 +3917,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows-link 0.1.3", + "windows-link 0.2.1", "windows-result 0.4.1", ] @@ -4682,7 +4715,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -4763,7 +4796,7 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6106,7 +6139,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -7948,7 +7981,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -8991,7 +9024,7 @@ dependencies = [ "getrandom 0.4.1", "once_cell", "rustix 1.1.3", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -11172,7 +11205,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -11744,6 +11777,7 @@ name = "xtask" version = "0.1.0" dependencies = [ "anyhow", + "cargo_metadata", "clap", "prost-build", "public-api", diff --git a/Cargo.toml b/Cargo.toml index 50d6bebe4d5..f405b89db88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,7 @@ rust-version = "1.89" version = "0.1.0" [workspace.dependencies] -anyhow = "1.0.95" +anyhow = "1.0.97" arbitrary = "1.3.2" arc-swap = "1.8" arcref = "0.2.0" @@ -108,6 +108,7 @@ bit-vec = "0.8.0" bitvec = "1.0.1" bytes = "1.11.1" bzip2 = "0.6.0" +cargo_metadata = "0.23.1" cbindgen = "0.29.0" cc = "1.2" cfg-if = "1.0.1" diff --git a/vortex-compute/src/take/slice/mod.rs b/vortex-compute/src/take/slice/mod.rs index 43c7755443c..56f4f649724 100644 --- a/vortex-compute/src/take/slice/mod.rs +++ b/vortex-compute/src/take/slice/mod.rs @@ -10,6 +10,7 @@ use vortex_dtype::UnsignedPType; use crate::take::Take; #[doc(hidden)] +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] pub mod avx2; pub mod portable; diff --git a/vortex-cuda/Cargo.toml b/vortex-cuda/Cargo.toml index b17c6b75694..5aa33fb19b0 100644 --- a/vortex-cuda/Cargo.toml +++ b/vortex-cuda/Cargo.toml @@ -12,6 +12,7 @@ readme = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } +publish = false [lints] workspace = true diff --git a/vortex-cuda/cub/Cargo.toml b/vortex-cuda/cub/Cargo.toml index 1c92776ddb7..5b5154841cb 100644 --- a/vortex-cuda/cub/Cargo.toml +++ b/vortex-cuda/cub/Cargo.toml @@ -15,6 +15,7 @@ readme = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } +publish = false [lints] workspace = true diff --git a/vortex-cuda/nvcomp/Cargo.toml b/vortex-cuda/nvcomp/Cargo.toml index 9fd64640641..a0b3cb49de5 100644 --- a/vortex-cuda/nvcomp/Cargo.toml +++ b/vortex-cuda/nvcomp/Cargo.toml @@ -12,6 +12,7 @@ readme = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } +publish = false [lints] workspace = true diff --git a/vortex-tui/public-api.lock b/vortex-tui/public-api.lock new file mode 100644 index 00000000000..5722fa9cb89 --- /dev/null +++ b/vortex-tui/public-api.lock @@ -0,0 +1,739 @@ +pub mod vortex_tui + +pub mod vortex_tui::browse + +pub mod vortex_tui::browse::app + +pub enum vortex_tui::browse::app::KeyMode + +pub vortex_tui::browse::app::KeyMode::Normal + +pub vortex_tui::browse::app::KeyMode::Search + +impl core::cmp::Eq for vortex_tui::browse::app::KeyMode + +impl core::cmp::PartialEq for vortex_tui::browse::app::KeyMode + +pub fn vortex_tui::browse::app::KeyMode::eq(&self, other: &vortex_tui::browse::app::KeyMode) -> bool + +impl core::default::Default for vortex_tui::browse::app::KeyMode + +pub fn vortex_tui::browse::app::KeyMode::default() -> vortex_tui::browse::app::KeyMode + +impl core::marker::StructuralPartialEq for vortex_tui::browse::app::KeyMode + +pub enum vortex_tui::browse::app::Tab + +pub vortex_tui::browse::app::Tab::Layout + +pub vortex_tui::browse::app::Tab::Query + +pub vortex_tui::browse::app::Tab::Segments + +impl core::clone::Clone for vortex_tui::browse::app::Tab + +pub fn vortex_tui::browse::app::Tab::clone(&self) -> vortex_tui::browse::app::Tab + +impl core::cmp::Eq for vortex_tui::browse::app::Tab + +impl core::cmp::PartialEq for vortex_tui::browse::app::Tab + +pub fn vortex_tui::browse::app::Tab::eq(&self, other: &vortex_tui::browse::app::Tab) -> bool + +impl core::default::Default for vortex_tui::browse::app::Tab + +pub fn vortex_tui::browse::app::Tab::default() -> vortex_tui::browse::app::Tab + +impl core::marker::Copy for vortex_tui::browse::app::Tab + +impl core::marker::StructuralPartialEq for vortex_tui::browse::app::Tab + +pub struct vortex_tui::browse::app::AppState<'a> + +pub vortex_tui::browse::app::AppState::current_tab: vortex_tui::browse::app::Tab + +pub vortex_tui::browse::app::AppState::cursor: vortex_tui::browse::app::LayoutCursor + +pub vortex_tui::browse::app::AppState::file_path: alloc::string::String + +pub vortex_tui::browse::app::AppState::filter: core::option::Option> + +pub vortex_tui::browse::app::AppState::frame_size: ratatui_core::layout::size::Size + +pub vortex_tui::browse::app::AppState::key_mode: vortex_tui::browse::app::KeyMode + +pub vortex_tui::browse::app::AppState::layouts_list_state: ratatui_widgets::list::state::ListState + +pub vortex_tui::browse::app::AppState::query_state: vortex_tui::browse::ui::QueryState + +pub vortex_tui::browse::app::AppState::search_filter: alloc::string::String + +pub vortex_tui::browse::app::AppState::segment_grid_state: vortex_tui::browse::ui::SegmentGridState<'a> + +pub vortex_tui::browse::app::AppState::session: &'a vortex_session::VortexSession + +pub vortex_tui::browse::app::AppState::tree_scroll_offset: u16 + +pub vortex_tui::browse::app::AppState::vxf: vortex_file::file::VortexFile + +impl<'a> vortex_tui::browse::app::AppState<'a> + +pub fn vortex_tui::browse::app::AppState<'a>::clear_search(&mut self) + +pub async fn vortex_tui::browse::app::AppState<'a>::new(session: &'a vortex_session::VortexSession, path: impl core::convert::AsRef) -> vortex_error::VortexResult> + +pub fn vortex_tui::browse::app::AppState<'a>::reset_layout_view_state(&mut self) + +pub struct vortex_tui::browse::app::LayoutCursor + +impl vortex_tui::browse::app::LayoutCursor + +pub fn vortex_tui::browse::app::LayoutCursor::child(&self, n: usize) -> Self + +pub fn vortex_tui::browse::app::LayoutCursor::dtype(&self) -> &vortex_dtype::dtype::DType + +pub fn vortex_tui::browse::app::LayoutCursor::flat_layout_metadata_info(&self) -> alloc::string::String + +pub fn vortex_tui::browse::app::LayoutCursor::flatbuffer_size(&self) -> usize + +pub fn vortex_tui::browse::app::LayoutCursor::is_stats_table(&self) -> bool + +pub fn vortex_tui::browse::app::LayoutCursor::layout(&self) -> &vortex_layout::layout::LayoutRef + +pub fn vortex_tui::browse::app::LayoutCursor::new(footer: vortex_file::footer::Footer, segment_source: alloc::sync::Arc) -> Self + +pub fn vortex_tui::browse::app::LayoutCursor::new_with_path(footer: vortex_file::footer::Footer, segment_source: alloc::sync::Arc, path: alloc::vec::Vec) -> Self + +pub fn vortex_tui::browse::app::LayoutCursor::parent(&self) -> Self + +pub fn vortex_tui::browse::app::LayoutCursor::segment_spec(&self, id: vortex_layout::segments::SegmentId) -> &vortex_file::footer::segment::SegmentSpec + +pub fn vortex_tui::browse::app::LayoutCursor::total_size(&self) -> usize + +pub mod vortex_tui::browse::ui + +pub enum vortex_tui::browse::ui::QueryFocus + +pub vortex_tui::browse::ui::QueryFocus::ResultsTable + +pub vortex_tui::browse::ui::QueryFocus::SqlInput + +impl core::clone::Clone for vortex_tui::browse::ui::QueryFocus + +pub fn vortex_tui::browse::ui::QueryFocus::clone(&self) -> vortex_tui::browse::ui::QueryFocus + +impl core::cmp::Eq for vortex_tui::browse::ui::QueryFocus + +impl core::cmp::PartialEq for vortex_tui::browse::ui::QueryFocus + +pub fn vortex_tui::browse::ui::QueryFocus::eq(&self, other: &vortex_tui::browse::ui::QueryFocus) -> bool + +impl core::default::Default for vortex_tui::browse::ui::QueryFocus + +pub fn vortex_tui::browse::ui::QueryFocus::default() -> vortex_tui::browse::ui::QueryFocus + +impl core::fmt::Debug for vortex_tui::browse::ui::QueryFocus + +pub fn vortex_tui::browse::ui::QueryFocus::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl core::marker::Copy for vortex_tui::browse::ui::QueryFocus + +impl core::marker::StructuralPartialEq for vortex_tui::browse::ui::QueryFocus + +pub enum vortex_tui::browse::ui::SortDirection + +pub vortex_tui::browse::ui::SortDirection::Ascending + +pub vortex_tui::browse::ui::SortDirection::Descending + +pub vortex_tui::browse::ui::SortDirection::None + +impl vortex_tui::browse::ui::SortDirection + +pub fn vortex_tui::browse::ui::SortDirection::cycle(self) -> Self + +pub fn vortex_tui::browse::ui::SortDirection::indicator(self) -> &'static str + +impl core::clone::Clone for vortex_tui::browse::ui::SortDirection + +pub fn vortex_tui::browse::ui::SortDirection::clone(&self) -> vortex_tui::browse::ui::SortDirection + +impl core::cmp::Eq for vortex_tui::browse::ui::SortDirection + +impl core::cmp::PartialEq for vortex_tui::browse::ui::SortDirection + +pub fn vortex_tui::browse::ui::SortDirection::eq(&self, other: &vortex_tui::browse::ui::SortDirection) -> bool + +impl core::default::Default for vortex_tui::browse::ui::SortDirection + +pub fn vortex_tui::browse::ui::SortDirection::default() -> vortex_tui::browse::ui::SortDirection + +impl core::fmt::Debug for vortex_tui::browse::ui::SortDirection + +pub fn vortex_tui::browse::ui::SortDirection::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl core::marker::Copy for vortex_tui::browse::ui::SortDirection + +impl core::marker::StructuralPartialEq for vortex_tui::browse::ui::SortDirection + +pub struct vortex_tui::browse::ui::QueryState + +pub vortex_tui::browse::ui::QueryState::base_query: alloc::string::String + +pub vortex_tui::browse::ui::QueryState::current_page: usize + +pub vortex_tui::browse::ui::QueryState::cursor_position: usize + +pub vortex_tui::browse::ui::QueryState::error: core::option::Option + +pub vortex_tui::browse::ui::QueryState::focus: vortex_tui::browse::ui::QueryFocus + +pub vortex_tui::browse::ui::QueryState::horizontal_scroll: usize + +pub vortex_tui::browse::ui::QueryState::order_clause: core::option::Option + +pub vortex_tui::browse::ui::QueryState::page_size: usize + +pub vortex_tui::browse::ui::QueryState::results: core::option::Option + +pub vortex_tui::browse::ui::QueryState::running: bool + +pub vortex_tui::browse::ui::QueryState::sort_column: core::option::Option + +pub vortex_tui::browse::ui::QueryState::sort_direction: vortex_tui::browse::ui::SortDirection + +pub vortex_tui::browse::ui::QueryState::sql_input: alloc::string::String + +pub vortex_tui::browse::ui::QueryState::table_state: ratatui_widgets::table::state::TableState + +pub vortex_tui::browse::ui::QueryState::total_row_count: core::option::Option + +impl vortex_tui::browse::ui::QueryState + +pub fn vortex_tui::browse::ui::QueryState::apply_sort(&mut self, session: &vortex_session::VortexSession, column: usize, file_path: &str) + +pub fn vortex_tui::browse::ui::QueryState::clear_input(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::column_count(&self) -> usize + +pub fn vortex_tui::browse::ui::QueryState::delete_char(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::delete_char_forward(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::execute_initial_query(&mut self, session: &vortex_session::VortexSession, file_path: &str) + +pub fn vortex_tui::browse::ui::QueryState::insert_char(&mut self, c: char) + +pub fn vortex_tui::browse::ui::QueryState::move_cursor_end(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::move_cursor_left(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::move_cursor_right(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::move_cursor_start(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::next_page(&mut self, session: &vortex_session::VortexSession, file_path: &str) + +pub fn vortex_tui::browse::ui::QueryState::prev_page(&mut self, session: &vortex_session::VortexSession, file_path: &str) + +pub fn vortex_tui::browse::ui::QueryState::selected_column(&self) -> usize + +pub fn vortex_tui::browse::ui::QueryState::toggle_focus(&mut self) + +pub fn vortex_tui::browse::ui::QueryState::total_pages(&self) -> usize + +impl core::default::Default for vortex_tui::browse::ui::QueryState + +pub fn vortex_tui::browse::ui::QueryState::default() -> Self + +pub struct vortex_tui::browse::ui::SegmentGridState<'a> + +pub vortex_tui::browse::ui::SegmentGridState::horizontal_scroll: usize + +pub vortex_tui::browse::ui::SegmentGridState::horizontal_scroll_state: ratatui_widgets::scrollbar::ScrollbarState + +pub vortex_tui::browse::ui::SegmentGridState::max_horizontal_scroll: usize + +pub vortex_tui::browse::ui::SegmentGridState::max_vertical_scroll: usize + +pub vortex_tui::browse::ui::SegmentGridState::segment_tree: core::option::Option<(taffy::tree::taffy_tree::TaffyTree<()>, taffy::tree::node::NodeId, vortex_utils::aliases::hash_map::HashMap>)> + +pub vortex_tui::browse::ui::SegmentGridState::vertical_scroll: usize + +pub vortex_tui::browse::ui::SegmentGridState::vertical_scroll_state: ratatui_widgets::scrollbar::ScrollbarState + +impl vortex_tui::browse::ui::SegmentGridState<'_> + +pub fn vortex_tui::browse::ui::SegmentGridState<'_>::scroll_down(&mut self, amount: usize) + +pub fn vortex_tui::browse::ui::SegmentGridState<'_>::scroll_left(&mut self, amount: usize) + +pub fn vortex_tui::browse::ui::SegmentGridState<'_>::scroll_right(&mut self, amount: usize) + +pub fn vortex_tui::browse::ui::SegmentGridState<'_>::scroll_up(&mut self, amount: usize) + +impl<'a> core::clone::Clone for vortex_tui::browse::ui::SegmentGridState<'a> + +pub fn vortex_tui::browse::ui::SegmentGridState<'a>::clone(&self) -> vortex_tui::browse::ui::SegmentGridState<'a> + +impl<'a> core::default::Default for vortex_tui::browse::ui::SegmentGridState<'a> + +pub fn vortex_tui::browse::ui::SegmentGridState<'a>::default() -> vortex_tui::browse::ui::SegmentGridState<'a> + +impl<'a> core::fmt::Debug for vortex_tui::browse::ui::SegmentGridState<'a> + +pub fn vortex_tui::browse::ui::SegmentGridState<'a>::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub fn vortex_tui::browse::ui::render_app(app: &mut vortex_tui::browse::app::AppState<'_>, frame: &mut ratatui_core::terminal::frame::Frame<'_>) + +pub async fn vortex_tui::browse::exec_tui(session: &vortex_session::VortexSession, file: impl core::convert::AsRef) -> vortex_error::VortexResult<()> + +pub mod vortex_tui::convert + +pub enum vortex_tui::convert::Strategy + +pub vortex_tui::convert::Strategy::Btrblocks + +pub vortex_tui::convert::Strategy::Compact + +impl clap_builder::derive::ValueEnum for vortex_tui::convert::Strategy + +pub fn vortex_tui::convert::Strategy::to_possible_value<'a>(&self) -> core::option::Option + +pub fn vortex_tui::convert::Strategy::value_variants<'a>() -> &'a [Self] + +impl core::clone::Clone for vortex_tui::convert::Strategy + +pub fn vortex_tui::convert::Strategy::clone(&self) -> vortex_tui::convert::Strategy + +impl core::default::Default for vortex_tui::convert::Strategy + +pub fn vortex_tui::convert::Strategy::default() -> vortex_tui::convert::Strategy + +impl core::fmt::Debug for vortex_tui::convert::Strategy + +pub fn vortex_tui::convert::Strategy::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl core::marker::Copy for vortex_tui::convert::Strategy + +pub struct vortex_tui::convert::ConvertArgs + +pub vortex_tui::convert::ConvertArgs::file: std::path::PathBuf + +pub vortex_tui::convert::ConvertArgs::quiet: bool + +pub vortex_tui::convert::ConvertArgs::strategy: vortex_tui::convert::Strategy + +impl clap_builder::derive::Args for vortex_tui::convert::ConvertArgs + +pub fn vortex_tui::convert::ConvertArgs::augment_args<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::convert::ConvertArgs::augment_args_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::convert::ConvertArgs::group_id() -> core::option::Option + +impl clap_builder::derive::CommandFactory for vortex_tui::convert::ConvertArgs + +pub fn vortex_tui::convert::ConvertArgs::command<'b>() -> clap_builder::builder::command::Command + +pub fn vortex_tui::convert::ConvertArgs::command_for_update<'b>() -> clap_builder::builder::command::Command + +impl clap_builder::derive::FromArgMatches for vortex_tui::convert::ConvertArgs + +pub fn vortex_tui::convert::ConvertArgs::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::convert::ConvertArgs::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::convert::ConvertArgs::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::convert::ConvertArgs::update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Parser for vortex_tui::convert::ConvertArgs + +impl core::clone::Clone for vortex_tui::convert::ConvertArgs + +pub fn vortex_tui::convert::ConvertArgs::clone(&self) -> vortex_tui::convert::ConvertArgs + +impl core::fmt::Debug for vortex_tui::convert::ConvertArgs + +pub fn vortex_tui::convert::ConvertArgs::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub const vortex_tui::convert::BATCH_SIZE: usize + +pub async fn vortex_tui::convert::exec_convert(session: &vortex_session::VortexSession, flags: vortex_tui::convert::ConvertArgs) -> anyhow::Result<()> + +pub mod vortex_tui::datafusion_helper + +pub fn vortex_tui::datafusion_helper::arrow_value_to_json(array: &dyn arrow_array::array::Array, idx: usize) -> serde_json::value::Value + +pub async fn vortex_tui::datafusion_helper::create_vortex_context(session: &vortex_session::VortexSession, file_path: &str) -> core::result::Result + +pub async fn vortex_tui::datafusion_helper::execute_vortex_query(session: &vortex_session::VortexSession, file_path: &str, sql: &str) -> core::result::Result, alloc::string::String> + +pub fn vortex_tui::datafusion_helper::json_value_to_display(value: serde_json::value::Value) -> alloc::string::String + +pub mod vortex_tui::inspect + +pub enum vortex_tui::inspect::InspectMode + +pub vortex_tui::inspect::InspectMode::Eof + +pub vortex_tui::inspect::InspectMode::Footer + +pub vortex_tui::inspect::InspectMode::Postscript + +impl clap_builder::derive::FromArgMatches for vortex_tui::inspect::InspectMode + +pub fn vortex_tui::inspect::InspectMode::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::inspect::InspectMode::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::inspect::InspectMode::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::inspect::InspectMode::update_from_arg_matches_mut<'b>(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Subcommand for vortex_tui::inspect::InspectMode + +pub fn vortex_tui::inspect::InspectMode::augment_subcommands<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::inspect::InspectMode::augment_subcommands_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::inspect::InspectMode::has_subcommand(__clap_name: &str) -> bool + +impl core::fmt::Debug for vortex_tui::inspect::InspectMode + +pub fn vortex_tui::inspect::InspectMode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub struct vortex_tui::inspect::EofInfoJson + +pub vortex_tui::inspect::EofInfoJson::current_version: u16 + +pub vortex_tui::inspect::EofInfoJson::magic_bytes: alloc::string::String + +pub vortex_tui::inspect::EofInfoJson::postscript_size: u16 + +pub vortex_tui::inspect::EofInfoJson::valid_magic: bool + +pub vortex_tui::inspect::EofInfoJson::version: u16 + +impl serde_core::ser::Serialize for vortex_tui::inspect::EofInfoJson + +pub fn vortex_tui::inspect::EofInfoJson::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::inspect::FooterInfoJson + +pub vortex_tui::inspect::FooterInfoJson::segments: alloc::vec::Vec + +pub vortex_tui::inspect::FooterInfoJson::total_data_size: u64 + +pub vortex_tui::inspect::FooterInfoJson::total_segments: usize + +impl serde_core::ser::Serialize for vortex_tui::inspect::FooterInfoJson + +pub fn vortex_tui::inspect::FooterInfoJson::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::inspect::FooterSegmentJson + +pub vortex_tui::inspect::FooterSegmentJson::alignment: usize + +pub vortex_tui::inspect::FooterSegmentJson::end_offset: u64 + +pub vortex_tui::inspect::FooterSegmentJson::index: usize + +pub vortex_tui::inspect::FooterSegmentJson::length: u32 + +pub vortex_tui::inspect::FooterSegmentJson::offset: u64 + +pub vortex_tui::inspect::FooterSegmentJson::path: core::option::Option + +impl serde_core::ser::Serialize for vortex_tui::inspect::FooterSegmentJson + +pub fn vortex_tui::inspect::FooterSegmentJson::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::inspect::InspectArgs + +pub vortex_tui::inspect::InspectArgs::file: std::path::PathBuf + +pub vortex_tui::inspect::InspectArgs::json: bool + +pub vortex_tui::inspect::InspectArgs::mode: core::option::Option + +impl clap_builder::derive::Args for vortex_tui::inspect::InspectArgs + +pub fn vortex_tui::inspect::InspectArgs::augment_args<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::inspect::InspectArgs::augment_args_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::inspect::InspectArgs::group_id() -> core::option::Option + +impl clap_builder::derive::CommandFactory for vortex_tui::inspect::InspectArgs + +pub fn vortex_tui::inspect::InspectArgs::command<'b>() -> clap_builder::builder::command::Command + +pub fn vortex_tui::inspect::InspectArgs::command_for_update<'b>() -> clap_builder::builder::command::Command + +impl clap_builder::derive::FromArgMatches for vortex_tui::inspect::InspectArgs + +pub fn vortex_tui::inspect::InspectArgs::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::inspect::InspectArgs::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::inspect::InspectArgs::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::inspect::InspectArgs::update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Parser for vortex_tui::inspect::InspectArgs + +impl core::fmt::Debug for vortex_tui::inspect::InspectArgs + +pub fn vortex_tui::inspect::InspectArgs::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub struct vortex_tui::inspect::InspectOutput + +pub vortex_tui::inspect::InspectOutput::eof: vortex_tui::inspect::EofInfoJson + +pub vortex_tui::inspect::InspectOutput::file_path: alloc::string::String + +pub vortex_tui::inspect::InspectOutput::file_size: u64 + +pub vortex_tui::inspect::InspectOutput::footer: core::option::Option + +pub vortex_tui::inspect::InspectOutput::postscript: core::option::Option + +impl serde_core::ser::Serialize for vortex_tui::inspect::InspectOutput + +pub fn vortex_tui::inspect::InspectOutput::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::inspect::PostscriptInfoJson + +pub vortex_tui::inspect::PostscriptInfoJson::dtype: core::option::Option + +pub vortex_tui::inspect::PostscriptInfoJson::footer: vortex_tui::inspect::SegmentInfoJson + +pub vortex_tui::inspect::PostscriptInfoJson::layout: vortex_tui::inspect::SegmentInfoJson + +pub vortex_tui::inspect::PostscriptInfoJson::statistics: core::option::Option + +impl serde_core::ser::Serialize for vortex_tui::inspect::PostscriptInfoJson + +pub fn vortex_tui::inspect::PostscriptInfoJson::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::inspect::SegmentInfoJson + +pub vortex_tui::inspect::SegmentInfoJson::alignment: usize + +pub vortex_tui::inspect::SegmentInfoJson::length: u32 + +pub vortex_tui::inspect::SegmentInfoJson::offset: u64 + +impl serde_core::ser::Serialize for vortex_tui::inspect::SegmentInfoJson + +pub fn vortex_tui::inspect::SegmentInfoJson::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub async fn vortex_tui::inspect::exec_inspect(session: &vortex_session::VortexSession, args: vortex_tui::inspect::InspectArgs) -> anyhow::Result<()> + +pub mod vortex_tui::query + +pub struct vortex_tui::query::QueryArgs + +pub vortex_tui::query::QueryArgs::file: std::path::PathBuf + +pub vortex_tui::query::QueryArgs::sql: alloc::string::String + +impl clap_builder::derive::Args for vortex_tui::query::QueryArgs + +pub fn vortex_tui::query::QueryArgs::augment_args<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::query::QueryArgs::augment_args_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::query::QueryArgs::group_id() -> core::option::Option + +impl clap_builder::derive::CommandFactory for vortex_tui::query::QueryArgs + +pub fn vortex_tui::query::QueryArgs::command<'b>() -> clap_builder::builder::command::Command + +pub fn vortex_tui::query::QueryArgs::command_for_update<'b>() -> clap_builder::builder::command::Command + +impl clap_builder::derive::FromArgMatches for vortex_tui::query::QueryArgs + +pub fn vortex_tui::query::QueryArgs::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::query::QueryArgs::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::query::QueryArgs::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::query::QueryArgs::update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Parser for vortex_tui::query::QueryArgs + +impl core::fmt::Debug for vortex_tui::query::QueryArgs + +pub fn vortex_tui::query::QueryArgs::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub async fn vortex_tui::query::exec_query(session: &vortex_session::VortexSession, args: vortex_tui::query::QueryArgs) -> vortex_error::VortexResult<()> + +pub mod vortex_tui::segment_tree + +pub struct vortex_tui::segment_tree::SegmentDisplay + +pub vortex_tui::segment_tree::SegmentDisplay::name: vortex_dtype::field_names::FieldName + +pub vortex_tui::segment_tree::SegmentDisplay::row_count: u64 + +pub vortex_tui::segment_tree::SegmentDisplay::row_offset: u64 + +pub vortex_tui::segment_tree::SegmentDisplay::spec: vortex_file::footer::segment::SegmentSpec + +pub struct vortex_tui::segment_tree::SegmentTree + +pub vortex_tui::segment_tree::SegmentTree::segment_ordering: alloc::vec::Vec + +pub vortex_tui::segment_tree::SegmentTree::segments: vortex_utils::aliases::hash_map::HashMap> + +pub fn vortex_tui::segment_tree::collect_segment_tree(root_layout: &dyn vortex_layout::layout::Layout, segments: &alloc::sync::Arc<[vortex_file::footer::segment::SegmentSpec]>) -> vortex_tui::segment_tree::SegmentTree + +pub mod vortex_tui::segments + +pub struct vortex_tui::segments::SegmentsArgs + +pub vortex_tui::segments::SegmentsArgs::file: std::path::PathBuf + +impl clap_builder::derive::Args for vortex_tui::segments::SegmentsArgs + +pub fn vortex_tui::segments::SegmentsArgs::augment_args<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::segments::SegmentsArgs::augment_args_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::segments::SegmentsArgs::group_id() -> core::option::Option + +impl clap_builder::derive::CommandFactory for vortex_tui::segments::SegmentsArgs + +pub fn vortex_tui::segments::SegmentsArgs::command<'b>() -> clap_builder::builder::command::Command + +pub fn vortex_tui::segments::SegmentsArgs::command_for_update<'b>() -> clap_builder::builder::command::Command + +impl clap_builder::derive::FromArgMatches for vortex_tui::segments::SegmentsArgs + +pub fn vortex_tui::segments::SegmentsArgs::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::segments::SegmentsArgs::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::segments::SegmentsArgs::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::segments::SegmentsArgs::update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Parser for vortex_tui::segments::SegmentsArgs + +impl core::fmt::Debug for vortex_tui::segments::SegmentsArgs + +pub fn vortex_tui::segments::SegmentsArgs::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub async fn vortex_tui::segments::exec_segments(session: &vortex_session::VortexSession, args: vortex_tui::segments::SegmentsArgs) -> vortex_error::VortexResult<()> + +pub mod vortex_tui::tree + +pub enum vortex_tui::tree::TreeMode + +pub vortex_tui::tree::TreeMode::Array + +pub vortex_tui::tree::TreeMode::Array::file: std::path::PathBuf + +pub vortex_tui::tree::TreeMode::Array::json: bool + +pub vortex_tui::tree::TreeMode::Layout + +pub vortex_tui::tree::TreeMode::Layout::file: std::path::PathBuf + +pub vortex_tui::tree::TreeMode::Layout::json: bool + +pub vortex_tui::tree::TreeMode::Layout::verbose: bool + +impl clap_builder::derive::FromArgMatches for vortex_tui::tree::TreeMode + +pub fn vortex_tui::tree::TreeMode::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::tree::TreeMode::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::tree::TreeMode::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::tree::TreeMode::update_from_arg_matches_mut<'b>(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Subcommand for vortex_tui::tree::TreeMode + +pub fn vortex_tui::tree::TreeMode::augment_subcommands<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::tree::TreeMode::augment_subcommands_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::tree::TreeMode::has_subcommand(__clap_name: &str) -> bool + +impl core::fmt::Debug for vortex_tui::tree::TreeMode + +pub fn vortex_tui::tree::TreeMode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub struct vortex_tui::tree::LayoutTreeNode + +pub vortex_tui::tree::LayoutTreeNode::children: alloc::vec::Vec + +pub vortex_tui::tree::LayoutTreeNode::dtype: alloc::string::String + +pub vortex_tui::tree::LayoutTreeNode::encoding: alloc::string::String + +pub vortex_tui::tree::LayoutTreeNode::metadata_bytes: usize + +pub vortex_tui::tree::LayoutTreeNode::row_count: u64 + +pub vortex_tui::tree::LayoutTreeNode::segment_ids: alloc::vec::Vec + +impl serde_core::ser::Serialize for vortex_tui::tree::LayoutTreeNode + +pub fn vortex_tui::tree::LayoutTreeNode::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::tree::LayoutTreeNodeWithName + +pub vortex_tui::tree::LayoutTreeNodeWithName::name: alloc::string::String + +pub vortex_tui::tree::LayoutTreeNodeWithName::node: vortex_tui::tree::LayoutTreeNode + +impl serde_core::ser::Serialize for vortex_tui::tree::LayoutTreeNodeWithName + +pub fn vortex_tui::tree::LayoutTreeNodeWithName::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde_core::ser::Serializer>::Ok, <__S as serde_core::ser::Serializer>::Error> where __S: serde_core::ser::Serializer + +pub struct vortex_tui::tree::TreeArgs + +pub vortex_tui::tree::TreeArgs::mode: vortex_tui::tree::TreeMode + +impl clap_builder::derive::Args for vortex_tui::tree::TreeArgs + +pub fn vortex_tui::tree::TreeArgs::augment_args<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::tree::TreeArgs::augment_args_for_update<'b>(__clap_app: clap_builder::builder::command::Command) -> clap_builder::builder::command::Command + +pub fn vortex_tui::tree::TreeArgs::group_id() -> core::option::Option + +impl clap_builder::derive::CommandFactory for vortex_tui::tree::TreeArgs + +pub fn vortex_tui::tree::TreeArgs::command<'b>() -> clap_builder::builder::command::Command + +pub fn vortex_tui::tree::TreeArgs::command_for_update<'b>() -> clap_builder::builder::command::Command + +impl clap_builder::derive::FromArgMatches for vortex_tui::tree::TreeArgs + +pub fn vortex_tui::tree::TreeArgs::from_arg_matches(__clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::tree::TreeArgs::from_arg_matches_mut(__clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result + +pub fn vortex_tui::tree::TreeArgs::update_from_arg_matches(&mut self, __clap_arg_matches: &clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +pub fn vortex_tui::tree::TreeArgs::update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap_builder::parser::matches::arg_matches::ArgMatches) -> core::result::Result<(), clap_builder::Error> + +impl clap_builder::derive::Parser for vortex_tui::tree::TreeArgs + +impl core::fmt::Debug for vortex_tui::tree::TreeArgs + +pub fn vortex_tui::tree::TreeArgs::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub async fn vortex_tui::tree::exec_tree(session: &vortex_session::VortexSession, args: vortex_tui::tree::TreeArgs) -> vortex_error::VortexResult<()> + +pub async fn vortex_tui::launch(session: &vortex_session::VortexSession) -> anyhow::Result<()> + +pub async fn vortex_tui::launch_from(session: &vortex_session::VortexSession, args: impl core::iter::traits::collect::IntoIterator + core::clone::Clone>) -> anyhow::Result<()> diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index e847ac1cf20..67352b40ec2 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -17,6 +17,7 @@ version = { workspace = true } [dependencies] anyhow = { workspace = true } +cargo_metadata = { workspace = true } clap = { workspace = true, features = ["derive"] } prost-build = { workspace = true } public-api = { workspace = true } diff --git a/xtask/src/public_api.rs b/xtask/src/public_api.rs index c0209aa24ee..1541b331d7a 100644 --- a/xtask/src/public_api.rs +++ b/xtask/src/public_api.rs @@ -4,13 +4,14 @@ use std::fs; use std::path::PathBuf; +use cargo_metadata::MetadataCommand; +use cargo_metadata::Package; use xshell::Shell; use xshell::cmd; -/// A published crate extracted from the workspace Cargo.toml. -struct PublishedCrate { - name: String, - path: String, +/// Returns true if the package is published to a registry (i.e. `publish` is not disabled). +fn is_published(pkg: &Package) -> bool { + pkg.publish.as_ref().map(|v| !v.is_empty()).unwrap_or(true) } /// Regenerate `public-api.lock` files for all published crates. @@ -22,19 +23,27 @@ pub fn public_api() -> anyhow::Result<()> { let repo_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(".."); let repo_root = repo_root.canonicalize()?; - // 1. Parse workspace Cargo.toml for published crates. - let cargo_toml = fs::read_to_string(repo_root.join("Cargo.toml"))?; - let crates = parse_published_crates(&cargo_toml)?; - println!("Found {} published crates.", crates.len()); + // 1. Use cargo metadata to discover published library crates. + let metadata = MetadataCommand::new().no_deps().exec()?; + + 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(); + + println!("Found {} published crates.", published.len()); // 2. Generate rustdoc JSON for all published crates in a single parallel invocation. // Uses -p flags (not --workspace) to exclude non-published crates that may // have special build requirements (CUDA, Python, etc.). let sh = Shell::new()?; sh.change_dir(&repo_root); - let pkg_flags: Vec = crates + let pkg_flags: Vec = published .iter() - .flat_map(|c| ["-p".to_string(), c.name.clone()]) + .flat_map(|c| ["-p".to_string(), c.name.to_string()]) .collect(); println!("Generating rustdoc JSON..."); cmd!(sh, "cargo +nightly doc {pkg_flags...} --no-deps") @@ -44,7 +53,7 @@ pub fn public_api() -> anyhow::Result<()> { // 3. For each published crate, build the public API from JSON and write the lock file. let doc_dir = repo_root.join("target/doc"); let mut updated = 0; - for krate in &crates { + for krate in &published { let json_name = krate.name.replace('-', "_"); let json_path = doc_dir.join(format!("{json_name}.json")); @@ -68,7 +77,11 @@ pub fn public_api() -> anyhow::Result<()> { .collect::>() .join("\n\n"); - let lock_path = repo_root.join(&krate.path).join("public-api.lock"); + let crate_dir = krate + .manifest_path + .parent() + .ok_or_else(|| anyhow::anyhow!("no parent dir for {}", krate.manifest_path))?; + let lock_path = crate_dir.join("public-api.lock"); fs::write(&lock_path, format!("{formatted}\n"))?; updated += 1; @@ -77,60 +90,3 @@ pub fn public_api() -> anyhow::Result<()> { println!("Done. Updated {updated} public-api.lock files."); Ok(()) } - -/// Extract published crate names and paths from workspace Cargo.toml. -/// -/// Looks for lines between `# BEGIN crates published` and `# END crates published` -/// markers. Each line has the form: -/// `vortex-alp = { version = "0.1.0", path = "./encodings/alp", ... }` -fn parse_published_crates(cargo_toml: &str) -> anyhow::Result> { - let mut in_section = false; - let mut crates = Vec::new(); - - for line in cargo_toml.lines() { - if line.starts_with("# BEGIN crates published") { - in_section = true; - continue; - } - if line.starts_with("# END crates published") { - break; - } - if !in_section { - continue; - } - - let line = line.trim(); - if line.is_empty() || line.starts_with('#') { - continue; - } - - // Parse: name = { ... path = "..." ... } - let name = line - .split('=') - .next() - .map(str::trim) - .ok_or_else(|| anyhow::anyhow!("failed to parse crate name from: {line}"))? - .to_string(); - - let path = line - .find("path") - .and_then(|i| { - let rest = &line[i..]; - let start = rest.find('"')? + 1; - let end = start + rest[start..].find('"')?; - Some(rest[start..end].to_string()) - }) - .ok_or_else(|| anyhow::anyhow!("failed to parse path from: {line}"))?; - - // Strip leading "./" if present. - let path = path.strip_prefix("./").unwrap_or(&path).to_string(); - - crates.push(PublishedCrate { name, path }); - } - - if crates.is_empty() { - anyhow::bail!("no published crates found between BEGIN/END markers in Cargo.toml"); - } - - Ok(crates) -}