Skip to content

Commit cc31c7a

Browse files
committed
fix(cargo): repair the rest of #998's dependency-bump fallout
PR #998 bumped several major dependency versions but did not migrate the code that used them, leaving `origin/main` unbuildable. #1001 handled rodio; this fixes everything else flake-check flagged. git2 0.20 -> 0.21: `Remote::url`, `Reference::shorthand`, `Signature::name`, `Commit::summary`, and `ConfigEntry::value` now return `Result` instead of `Option`. Thread `.ok()` (and `.ok().flatten()` for the `Result<Option<_>>` shapes) through search-core, git-log-pretty, and claude-stories so the previous "None on failure" behavior is preserved. rusqlite 0.32 -> 0.40: dropped the `u64` `FromSql`/`ToSql` impls (SQLite columns are signed `i64`). search-core now reads `i64` and converts with `u64::try_from`, and writes via `i64::try_from`, still erroring on an impossible (negative / > i64::MAX) value rather than silently wrapping. sha2 0.10 -> 0.11: the digest `Output` no longer implements `LowerHex`, so `format!("{:x}", ..)` stops compiling. Hex-encode with `hex::encode` in search-core, sink-parquet, and oci-image-builder; `hex` is added to the workspace dependency table (already present transitively in the lock). pty-process 0.4 -> 0.5: `Pty::new()` + `pty.pts()` are replaced by the single `pty_process::open() -> (Pty, Pts)`, `Command` is now a consuming builder, and `Command::spawn` takes `Pts` by value. Migrate tap-pty (and drop its now-unreachable `Pts` error variant) and tui's spawn path. arrow/parquet 58 -> 59: the bot also bumped lake-iceberg's deliberately pinned `arrow-array`/`arrow-schema` from 57 to 59, breaking interop with `iceberg` 0.9 (which pins arrow ^57.1). Revert that pair to 57; the comment explaining the isolated 57 tree already documents why. Verified: cargo test passes for every touched crate.
1 parent 7f1b1fb commit cc31c7a

17 files changed

Lines changed: 67 additions & 49 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ fontdue = "0.9"
158158
futures = "0.3"
159159
git2 = { version = "0.21", default-features = false }
160160
glob = "0.3"
161+
hex = "0.4"
161162
hegeltest = { version = "0.14", default-features = false }
162163
# The Iceberg corpus lake (issue #752). iceberg 0.9 pins arrow/parquet ^57.1
163-
# while the workspace parquet pair is on 58; the 57 tree stays isolated inside
164+
# while the workspace parquet pair is on 59; the 57 tree stays isolated inside
164165
# lake-iceberg (see its Cargo.toml).
165166
iceberg = "0.9"
166167
iceberg-catalog-rest = "0.9"

packages/claude-stories/src/story.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,25 @@ pub fn derive(path: &Path) -> Result<Story> {
6161
let commit = head
6262
.peel_to_commit()
6363
.wrap_err("HEAD does not point at a commit")?;
64-
let subject = commit.summary().unwrap_or("(no commit message)").to_owned();
64+
let subject = commit
65+
.summary()
66+
.ok()
67+
.flatten()
68+
.unwrap_or("(no commit message)")
69+
.to_owned();
6570

6671
// Prefer the configured user.name; fall back to the latest commit's author.
6772
let name = repo
6873
.config()
6974
.ok()
7075
.and_then(|c| c.get_string("user.name").ok())
71-
.or_else(|| commit.author().name().map(str::to_owned))
76+
.or_else(|| commit.author().name().ok().map(str::to_owned))
7277
.unwrap_or_else(|| "anonymous".to_owned());
7378

7479
let origin = repo
7580
.find_remote("origin")
7681
.ok()
77-
.and_then(|r| r.url().map(str::to_owned));
82+
.and_then(|r| r.url().ok().map(str::to_owned));
7883
let repo_name = origin
7984
.as_deref()
8085
.and_then(repo_basename)

packages/git-log-pretty/src/avatar.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Resolver {
5757
let origin = repo
5858
.find_remote("origin")
5959
.ok()
60-
.and_then(|remote| remote.url().and_then(github_avatar::parse_remote));
60+
.and_then(|remote| remote.url().ok().and_then(github_avatar::parse_remote));
6161

6262
let cache_dir = avatar_cache_dir();
6363
let login_cache = cache_dir
@@ -270,7 +270,8 @@ fn load_identities(repo: &Repository) -> HashMap<String, String> {
270270
// it so it matches only `githublogin.map` and not other keys.
271271
if let Ok(entries) = config.entries(Some("^githublogin\\.map$")) {
272272
let _ = entries.for_each(|entry| {
273-
if let Some((email, login)) = entry.value().and_then(|value| value.split_once('=')) {
273+
if let Some((email, login)) = entry.value().ok().and_then(|value| value.split_once('='))
274+
{
274275
let (email, login) = (email.trim(), login.trim());
275276
if !email.is_empty() && !login.is_empty() {
276277
map.insert(email.to_string(), login.to_string());

packages/git-log-pretty/src/display.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ fn commit_block(
8181
) -> color_eyre::eyre::Result<CommitBlock> {
8282
let commit = &ahead.commit;
8383
let short = commit.id().to_string().chars().take(7).collect::<String>();
84-
let summary = commit.summary().unwrap_or("<no message>").trim();
84+
let summary = commit
85+
.summary()
86+
.ok()
87+
.flatten()
88+
.unwrap_or("<no message>")
89+
.trim();
8590
let when = time::relative(commit.time().seconds())?;
8691

8792
let yellow = palette::fg(Color::Ansi(AnsiColor::Yellow));

packages/git-log-pretty/src/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn discover() -> Result<Repository> {
5858
pub fn head_branch_name(repo: &Repository) -> Option<String> {
5959
let head = repo.head().ok()?;
6060
head.is_branch()
61-
.then(|| head.shorthand().map(str::to_string))?
61+
.then(|| head.shorthand().ok().map(str::to_string))?
6262
}
6363

6464
/// Pair a commit with the files it changed, the shape the display layer expects.

packages/lake/iceberg/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ description = "The Iceberg corpus lake: append+tombstone document log with snaps
99
workspace = true
1010

1111
[dependencies]
12-
# iceberg 0.9 pins arrow/parquet ^57.1; the rest of the workspace is on 58 for
12+
# iceberg 0.9 pins arrow/parquet ^57.1; the rest of the workspace is on 59 for
1313
# the plain-parquet pair. The 57 tree is pinned here directly (not in the
1414
# workspace table) so it stays an implementation detail of this crate; both
1515
# trees coexist (`multiple_crate_versions` is allowed workspace-wide).
16-
arrow-array = "59"
17-
arrow-schema = "59"
16+
arrow-array = "57"
17+
arrow-schema = "57"
1818
futures.workspace = true
1919
iceberg.workspace = true
2020
iceberg-catalog-rest.workspace = true

packages/oci-image-builder/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ workspace = true
1111
chrono = { workspace = true, default-features = false, features = ["clock", "std"] }
1212
serde = { workspace = true, features = ["derive"] }
1313
serde_json.workspace = true
14+
hex.workspace = true
1415
sha2.workspace = true
1516
tar.workspace = true
1617
tempfile.workspace = true

packages/oci-image-builder/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ impl<W: Write> HashingWriter<W> {
16221622
}
16231623

16241624
fn finalize(self) -> HashedBytes {
1625-
let checksum = format!("{:x}", self.hasher.finalize());
1625+
let checksum = hex::encode(self.hasher.finalize());
16261626
HashedBytes {
16271627
size: self.size,
16281628
checksum,
@@ -1644,7 +1644,7 @@ impl<W: Write> Write for HashingWriter<W> {
16441644
}
16451645

16461646
fn sha256_bytes(data: &[u8]) -> String {
1647-
format!("{:x}", Sha256::digest(data))
1647+
hex::encode(Sha256::digest(data))
16481648
}
16491649

16501650
#[cfg(test)]

packages/search-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ rusqlite = { workspace = true, features = ["bundled"] }
2424
source-meta.workspace = true
2525
serde = { workspace = true, features = ["derive"] }
2626
serde_json.workspace = true
27+
hex.workspace = true
2728
sha2.workspace = true
2829
snafu.workspace = true
2930
tokio = { workspace = true, features = ["fs", "time"] }

0 commit comments

Comments
 (0)