From 955af2d157ac9bc59ac19c8b732c1f1159ce498d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Mon, 27 May 2024 17:15:08 -0700 Subject: [PATCH 1/2] Update gimli deps Requires a minor code tweak to account for a breaking change. --- Cargo.lock | 49 ++++++++++++++++++------------------------- thorin-bin/Cargo.toml | 2 +- thorin/Cargo.toml | 4 ++-- thorin/src/package.rs | 18 ++++++++-------- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a084438..15a1743 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" @@ -156,6 +156,17 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -180,9 +191,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.30.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9" dependencies = [ "fallible-iterator", "indexmap", @@ -327,9 +338,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.0" +version = "0.36.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "crc32fast", "flate2", @@ -439,12 +450,12 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "ruzstd" -version = "0.4.0" +version = "0.6.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b" dependencies = [ "byteorder", - "thiserror-core", + "derive_more", "twox-hash", ] @@ -568,26 +579,6 @@ dependencies = [ "thiserror-impl", ] -[[package]] -name = "thiserror-core" -version = "1.0.38" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" -dependencies = [ - "thiserror-core-impl", -] - -[[package]] -name = "thiserror-core-impl" -version = "1.0.38" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "thiserror-impl" version = "1.0.44" diff --git a/thorin-bin/Cargo.toml b/thorin-bin/Cargo.toml index 44f7add..1d855e6 100644 --- a/thorin-bin/Cargo.toml +++ b/thorin-bin/Cargo.toml @@ -24,7 +24,7 @@ tracing-tree = "0.1.10" typed-arena = "2.0.1" [dependencies.object] -version = "0.32.0" +version = "0.36.0" default-features = false features = [ "archive", "read", "write", "compression" ] diff --git a/thorin/Cargo.toml b/thorin/Cargo.toml index 18dd82b..4b20d82 100644 --- a/thorin/Cargo.toml +++ b/thorin/Cargo.toml @@ -16,14 +16,14 @@ tracing = "0.1.29" hashbrown = "0.14.0" [dependencies.gimli] -version = "0.28.0" +version = "0.30.0" default-features = false # `gimli/std` pulls in `fallible-iterator` which we don't use, but can't opt out of, because of # cargo#8832. features = [ "read", "write", "std" ] [dependencies.object] -version = "0.32.0" +version = "0.36.0" default-features = false features = [ "archive", "read", "write", "compression" ] diff --git a/thorin/src/package.rs b/thorin/src/package.rs index 719c4ca..1162476 100644 --- a/thorin/src/package.rs +++ b/thorin/src/package.rs @@ -214,7 +214,7 @@ where pub(crate) fn create_contribution_adjustor<'input, R: 'input>( cu_index: Option<&'input UnitIndex>, tu_index: Option<&'input UnitIndex>, - target_section_id: gimli::SectionId, + target_section_id: gimli::IndexSectionId, ) -> impl FnMut(DwarfObject, Option) -> Result> + 'input where R: gimli::Reader, @@ -544,42 +544,42 @@ impl<'file> InProgressDwarfPackage<'file> { let mut abbrev_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugAbbrev, + gimli::IndexSectionId::DebugAbbrev, ); let mut line_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugLine, + gimli::IndexSectionId::DebugLine, ); let mut loc_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugLoc, + gimli::IndexSectionId::DebugLoc, ); let mut loclists_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugLocLists, + gimli::IndexSectionId::DebugLocLists, ); let mut rnglists_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugRngLists, + gimli::IndexSectionId::DebugRngLists, ); let mut str_offsets_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugStrOffsets, + gimli::IndexSectionId::DebugStrOffsets, ); let mut macinfo_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugMacinfo, + gimli::IndexSectionId::DebugMacinfo, ); let mut macro_adjustor = create_contribution_adjustor( cu_index.as_ref(), tu_index.as_ref(), - gimli::SectionId::DebugMacro, + gimli::IndexSectionId::DebugMacro, ); let mut seen_debug_info = false; From 927fd8e31dd1e79c7a5b8f4efb30c0bd1bbb4ef0 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Mon, 27 May 2024 21:47:52 -0700 Subject: [PATCH 2/2] Curry create_contribution_adjustor at use --- thorin/src/package.rs | 50 +++++++++---------------------------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/thorin/src/package.rs b/thorin/src/package.rs index 1162476..9635100 100644 --- a/thorin/src/package.rs +++ b/thorin/src/package.rs @@ -541,46 +541,16 @@ impl<'file> InProgressDwarfPackage<'file> { // Create offset adjustor functions, see comment on `create_contribution_adjustor` for // explanation. - let mut abbrev_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugAbbrev, - ); - let mut line_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugLine, - ); - let mut loc_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugLoc, - ); - let mut loclists_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugLocLists, - ); - let mut rnglists_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugRngLists, - ); - let mut str_offsets_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugStrOffsets, - ); - let mut macinfo_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugMacinfo, - ); - let mut macro_adjustor = create_contribution_adjustor( - cu_index.as_ref(), - tu_index.as_ref(), - gimli::IndexSectionId::DebugMacro, - ); + let adjustor_for_index = + |id| create_contribution_adjustor(cu_index.as_ref(), tu_index.as_ref(), id); + let mut abbrev_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugAbbrev); + let mut line_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugLine); + let mut loc_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugLoc); + let mut loclists_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugLocLists); + let mut rnglists_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugRngLists); + let mut str_offsets_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugStrOffsets); + let mut macinfo_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugMacinfo); + let mut macro_adjustor = adjustor_for_index(gimli::IndexSectionId::DebugMacro); let mut seen_debug_info = false; let mut seen_debug_types = false;