Skip to content

Commit

Permalink
chore: Update dependencies to latest possible version. In particular,…
Browse files Browse the repository at this point in the history
… update 'rustdoc-types' and the nightly version used by 'pavexc'
  • Loading branch information
LukeMathWalker committed Oct 14, 2024
1 parent b4ef664 commit a0017de
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 224 deletions.
176 changes: 53 additions & 123 deletions libs/Cargo.lock

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions libs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,105 +16,105 @@ license = "Apache-2.0"
version = "0.1.48"

[workspace.dependencies]
vergen-gitcl = { version = "1.0.0", features = ["build"] }
vergen-gitcl = { version = "1.0.1", features = ["build"] }
ahash = "0.8"
anstyle = "1.0.6"
anyhow = "1.0.79"
anstyle = "1.0.8"
anyhow = "1.0.89"
better-panic = "0.3.0"
bimap = "0.6.2"
bimap = "0.6.3"
bincode = "1"
biscotti = "0.3"
bytes = "1.5.0"
bytes = "1.7.2"
camino = "1"
cargo-like-utils = "0.1.2"
cargo_metadata = "0.18.0"
cargo-manifest = "0.14.0"
cargo-like-utils = "0.1.4"
cargo_metadata = "0.18.1"
cargo-manifest = "0.15.2"
clap = "4"
clap-stdin = "0.4.0"
clap-stdin = "0.5.1"
config = "0.14.0"
console = "0.15.1"
console = "0.15.8"
convert_case = "0.6"
xxhash-rust = "0.8.12"
elsa = "1.4.0"
elsa = "1.10.0"
fixedbitset = "0.4"
fs-err = "2.11.0"
futures-util = "0.3"
globwalk = "0.9.1"
guppy = "0.17"
heck = "0.5.0-rc.1"
heck = "0.5.0"
hex = "0.4.3"
http = "1"
http-body = "1"
http-body-util = "0.1"
hyper = "1"
hyper-util = "0.1"
include_dir = "0.7.3"
include_dir = "0.7.4"
indexmap = "2"
indicatif = "0.17.7"
insta = "1.29.0"
itertools = "0.12"
jsonwebtoken = "9.0.1"
indicatif = "0.17.8"
insta = "1.40.0"
itertools = "0.13"
jsonwebtoken = "9.3.0"
la-arena = "0.3"
libc = "0.2.152"
libtest-mimic = "0.7.0"
liquid = "0.26.4"
liquid-core = "0.26.4"
libc = "0.2.159"
libtest-mimic = "0.8.1"
liquid = "0.26.9"
liquid-core = "0.26.9"
matchit = "0.7"
miette = "7.2.0"
mime = "0.3"
num_cpus = "1.15.0"
object-pool = "0.5"
once_cell = "1.19.0"
num_cpus = "1.16.0"
object-pool = "0.6"
once_cell = "1.20.2"
paste = "1"
path-absolutize = "3.1.1"
pem = "3.0.4"
percent-encoding = "2"
petgraph = { version = "0.6.2", default-features = false }
petgraph = { version = "0.6.5", default-features = false }
pin-project-lite = "0.2"
prettyplease = "0.2"
proc-macro2 = "1.0.40"
quote = "1.0.20"
proc-macro2 = "1.0.87"
quote = "1.0.37"
r2d2 = "0.8"
r2d2_sqlite = "0.24.0"
rayon = "1.7"
redact = "0.1.9"
regex = "1.10.2"
r2d2_sqlite = "0.25.0"
rayon = "1.10"
redact = "0.1.10"
regex = "1.11.0"
relative-path = "1.9"
remove_dir_all = "0.8.2"
remove_dir_all = "0.8.4"
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
] }
reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
reqwest-tracing = "0.5.0"
ring = "0.17.3"
reqwest-middleware = "0.3.3"
reqwest-retry = "0.6.1"
reqwest-tracing = "0.5.3"
ring = "0.17.8"
ron = "0.8"
rusqlite = "0.31"
rustdoc-types = "0.28.1"
rusqlite = "0.32"
rustdoc-types = "0.31.0"
sanitize-filename = "0.5"
self-replace = "1.3.7"
semver = "1.0.21"
serde = "1.0.141"
self-replace = "1.5.0"
semver = "1.0.23"
serde = "1.0.210"
serde_html_form = "0.2"
serde_json = "1.0.111"
serde_json = "1.0.128"
serde_path_to_error = "0.1"
serde_stacker = "0.1"
sha2 = "0.10.8"
similar = "2.2.0"
similar = "2.6.0"
smallvec = "1"
socket2 = "0.5.3"
supports-color = "3.0.0"
socket2 = "0.5.7"
supports-color = "3.0.1"
supports-hyperlinks = "3.0.0"
supports-unicode = "3.0.0"
syn = "2.0"
tar = "0.4.40"
tempfile = "3.9.0"
terminal_size = "0.3"
textwrap = "0.16.0"
thiserror = "1.0.56"
tar = "0.4.42"
tempfile = "3.13.0"
terminal_size = "0.4"
textwrap = "0.16.1"
thiserror = "1.0.64"
time = "0.3.36"
tokio = "1.37.0"
toml = "0.8.8"
tokio = "1.40.0"
toml = "0.8.19"
toml_edit = "0.22"
tracing = { version = "0.1.40", default-features = false }
tracing-log = "0.2"
Expand All @@ -123,15 +123,15 @@ tracing-subscriber = "0.3"
trybuild = "1.0"
type-safe-id = "0.3"
ubyte = "0.10.4"
unicode-width = "0.1"
ureq = "2.9.1"
unicode-width = "0.2"
ureq = "2.10.1"
uuid = "1"
walkdir = "2.4.0"
windows-sys = "0.52.0"
xdg-home = "1.0.0"
walkdir = "2.5.0"
windows-sys = "0.59.0"
xdg-home = "1.3.0"
xz2 = "0.1.7"
zip = "2"
owo-colors = "4.0.0"
owo-colors = "4.1.0"
async-trait = "0.1"
humantime-serde = "1"

Expand Down
1 change: 0 additions & 1 deletion libs/pavex_test_runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ fn warm_up_rustdoc_cache(
// lock over the target directory.
println!("Pre-computing JSON documentation for relevant crates");
let crate_collection = CrateCollection::new(
runtime_directory.to_string_lossy().into_owned(),
DEFAULT_DOCS_TOOLCHAIN.to_owned(),
runtime_directory.to_path_buf(),
)?;
Expand Down
2 changes: 0 additions & 2 deletions libs/pavexc/src/compiler/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ impl App {
/// report all errors to the user, but it may not be able to do so in all cases.
pub fn build(
bp: Blueprint,
project_fingerprint: String,
docs_toolchain_name: String,
) -> Result<(Self, Vec<miette::Error>), Vec<miette::Error>> {
/// Exit early if there is at least one error.
Expand All @@ -81,7 +80,6 @@ impl App {
}

let krate_collection = CrateCollection::new(
project_fingerprint,
docs_toolchain_name,
std::env::current_dir().expect("Failed to determine the current directory"),
)
Expand Down
39 changes: 24 additions & 15 deletions libs/pavexc/src/compiler/resolvers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,26 @@ pub(crate) fn resolve_type(
) -> Result<ResolvedType, anyhow::Error> {
match type_ {
Type::ResolvedPath(rustdoc_types::Path { id, args, name }) => {
let re_exporter_crate_name = if id.0.starts_with("0:") {
// 0 is the crate index of local types.
None
} else {
// It is not guaranteed that this type will be from a direct dependency of `used_by_package_id`.
// It might be a re-export from a transitive dependency, done by a direct dependency.
// Unfortunately, `rustdoc` does not provide the package id of the crate where the type
// was re-exported from, creating a "missing link".
// We try to infer it from the `name` property, which is usually the fully qualified
// name of the type, e.g. `std::collections::HashMap`.
name.split("::").next()
let re_exporter_crate_name = {
let mut re_exporter = None;
if let Some(krate) = krate_collection.get_crate_by_package_id(used_by_package_id) {
if let Some(item) = krate.maybe_get_type_by_local_type_id(id) {
// 0 is the crate index of local types.
if item.crate_id == 0 {
re_exporter = Some(None);
}
}
}
if re_exporter.is_none() {
// It is not guaranteed that this type will be from a direct dependency of `used_by_package_id`.
// It might be a re-export from a transitive dependency, done by a direct dependency.
// Unfortunately, `rustdoc` does not provide the package id of the crate where the type
// was re-exported from, creating a "missing link".
// We try to infer it from the `name` property, which is usually the fully qualified
// name of the type, e.g. `std::collections::HashMap`.
re_exporter = Some(name.split("::").next());
}
re_exporter.unwrap()
};
let (global_type_id, base_type) = krate_collection
.get_canonical_path_by_local_type_id(
Expand Down Expand Up @@ -226,8 +235,8 @@ pub(crate) fn resolve_type(
}
Type::BorrowedRef {
lifetime,
mutable,
type_,
is_mutable,
} => {
let resolved_type = resolve_type(
type_,
Expand All @@ -236,7 +245,7 @@ pub(crate) fn resolve_type(
generic_bindings,
)?;
let t = TypeReference {
is_mutable: *mutable,
is_mutable: *is_mutable,
lifetime: lifetime.to_owned().into(),
inner: Box::new(resolved_type),
};
Expand Down Expand Up @@ -290,7 +299,7 @@ pub(crate) fn resolve_callable(
let (header, decl, fn_generics_defs, invocation_style) = match &callable_type.item.item.inner {
ItemEnum::Function(f) => (
&f.header,
&f.decl,
&f.sig,
&f.generics,
InvocationStyle::FunctionCall,
),
Expand Down Expand Up @@ -413,7 +422,7 @@ pub(crate) fn resolve_callable(
}
};
let callable = Callable {
is_async: header.async_,
is_async: header.is_async,
takes_self_as_ref,
output: output_type_path,
path: callable_path.to_owned(),
Expand Down
8 changes: 4 additions & 4 deletions libs/pavexc/src/compiler/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub(crate) fn implements_trait(
let item = type_definition_crate.get_type_by_local_type_id(impl_id);
let (trait_id, implementer_type) = match &item.inner {
ItemEnum::Impl(impl_) => {
if impl_.negative {
if impl_.is_negative {
continue;
}
(impl_.trait_.as_ref().map(|p| &p.id), &impl_.for_)
Expand Down Expand Up @@ -244,7 +244,7 @@ pub(crate) fn implements_trait(
let impl_item = trait_definition_crate.get_type_by_local_type_id(impl_id);
let implementer = match &impl_item.inner {
ItemEnum::Impl(impl_) => {
if impl_.negative {
if impl_.is_negative {
continue;
}
&impl_.for_
Expand Down Expand Up @@ -308,12 +308,12 @@ fn is_equivalent(
}
}
Type::BorrowedRef {
mutable,
is_mutable,
type_: inner_type,
..
} => {
if let ResolvedType::Reference(type_) = our_type {
return type_.is_mutable == *mutable
return type_.is_mutable == *is_mutable
&& is_equivalent(
inner_type,
&type_.inner,
Expand Down
2 changes: 1 addition & 1 deletion libs/pavexc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ mod utils;

/// The Rust toolchain used by `pavexc` to generate JSON docs, unless
/// overridden by the user.
pub static DEFAULT_DOCS_TOOLCHAIN: &str = "nightly-2024-08-12";
pub static DEFAULT_DOCS_TOOLCHAIN: &str = "nightly-2024-10-13";
16 changes: 8 additions & 8 deletions libs/pavexc/src/rustdoc/compute/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl ToolchainCache {
};
drop(guard);

let root_item_id = row.get_ref_unwrap(0).as_str()?;
let root_item_id = row.get_ref_unwrap(0).as_i64()?.try_into()?;
let external_crates = row.get_ref_unwrap(1).as_bytes()?;
let paths = row.get_ref_unwrap(2).as_bytes()?;
let format_version = row.get_ref_unwrap(3).as_i64()?;
Expand Down Expand Up @@ -322,7 +322,7 @@ impl ToolchainCache {
"CREATE TABLE IF NOT EXISTS rustdoc_toolchain_crates_cache (
name TEXT NOT NULL,
cargo_fingerprint TEXT NOT NULL,
root_item_id TEXT NOT NULL,
root_item_id INTEGER NOT NULL,
external_crates BLOB NOT NULL,
paths BLOB NOT NULL,
format_version INTEGER NOT NULL,
Expand Down Expand Up @@ -413,12 +413,12 @@ impl ThirdPartyCrateCache {
cache_key.default_feature_is_enabled,
cache_key.active_named_features
])?;
let Some(row) = rows.next()? else {
let Some(row) = rows.next().context("Failed to fetch next row")? else {
return Ok(None);
};
drop(guard);

let root_item_id = row.get_ref_unwrap(0).as_str()?;
let root_item_id = row.get_ref_unwrap(0).as_i64()?.try_into()?;
let external_crates = row.get_ref_unwrap(1).as_bytes()?;
let paths = row.get_ref_unwrap(2).as_bytes()?;
let format_version = row.get_ref_unwrap(3).as_i64()?;
Expand Down Expand Up @@ -550,7 +550,7 @@ impl ThirdPartyCrateCache {
rustdoc_options TEXT NOT NULL,
default_feature_is_enabled INTEGER NOT NULL,
active_named_features TEXT NOT NULL,
root_item_id TEXT NOT NULL,
root_item_id INTEGER NOT NULL,
external_crates BLOB NOT NULL,
paths BLOB NOT NULL,
format_version INTEGER NOT NULL,
Expand All @@ -571,7 +571,7 @@ impl ThirdPartyCrateCache {
#[derive(Debug)]
/// The serialized form of a crate's documentation, as stored in the cache.
pub(super) struct CachedData<'a> {
root_item_id: &'a str,
root_item_id: u32,
external_crates: Cow<'a, [u8]>,
paths: Cow<'a, [u8]>,
format_version: i64,
Expand All @@ -598,7 +598,7 @@ impl<'a> CachedData<'a> {
let start = items.len();
serde_json::to_writer(&mut items, item)?;
let end = items.len();
item_id2delimiters.insert(item_id.0.as_str(), (start, end));
item_id2delimiters.insert(item_id.0, (start, end));
}

let id2public_import_paths = bincode::serialize(&krate.id2public_import_paths)?;
Expand All @@ -609,7 +609,7 @@ impl<'a> CachedData<'a> {
let paths = bincode::serialize(&crate_data.paths)?;

Ok(CachedData {
root_item_id: crate_data.root_item_id.0.as_str(),
root_item_id: crate_data.root_item_id.0,
external_crates: Cow::Owned(external_crates),
paths: Cow::Owned(paths),
format_version: crate_data.format_version as i64,
Expand Down
Loading

0 comments on commit a0017de

Please sign in to comment.