Update all dependencies

This commit is contained in:
Luke Street 2024-10-03 22:24:54 -06:00
parent f91c2a1474
commit 71701b5667
4 changed files with 47 additions and 49 deletions

46
Cargo.lock generated
View File

@ -247,9 +247,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.22" version = "1.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
@ -384,15 +384,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2e06f9bce634a3c898eb1e5cb949ff63133cbb218af93cc9b38b31d6f3ea285" checksum = "c2e06f9bce634a3c898eb1e5cb949ff63133cbb218af93cc9b38b31d6f3ea285"
[[package]]
name = "cwextab"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0f1036150ed9aa3265b83b9755a14db1600231e0478e678241e4f4d7c30bcf6"
dependencies = [
"thiserror",
]
[[package]] [[package]]
name = "cwextab" name = "cwextab"
version = "1.0.2" version = "1.0.2"
@ -413,7 +404,7 @@ dependencies = [
"base64", "base64",
"crossterm", "crossterm",
"cwdemangle", "cwdemangle",
"cwextab 1.0.2", "cwextab",
"dyn-clone", "dyn-clone",
"enable-ansi-support", "enable-ansi-support",
"filetime", "filetime",
@ -455,7 +446,7 @@ dependencies = [
"tracing-attributes", "tracing-attributes",
"tracing-subscriber", "tracing-subscriber",
"xxhash-rust", "xxhash-rust",
"zerocopy 0.7.35", "zerocopy 0.8.0",
] ]
[[package]] [[package]]
@ -625,6 +616,12 @@ dependencies = [
"ahash", "ahash",
] ]
[[package]]
name = "hashbrown"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb"
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.5.0" version = "0.5.0"
@ -669,12 +666,12 @@ checksum = "d9f1a0777d972970f204fdf8ef319f1f4f8459131636d7e3c96c5d59570d0fa6"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.5.0" version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown", "hashbrown 0.15.0",
] ]
[[package]] [[package]]
@ -782,9 +779,9 @@ dependencies = [
[[package]] [[package]]
name = "liblzma-sys" name = "liblzma-sys"
version = "0.3.8" version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63117d31458acdb7b406f6c60090aa8e1e7cd6e283f8ee02ce585ed68c53fe39" checksum = "6630cb23edeb2e563cd6c30d4117554c69646871455843c33ddcb1d9aef82ecf"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@ -1022,14 +1019,14 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]] [[package]]
name = "objdiff-core" name = "objdiff-core"
version = "2.1.0" version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca74e690bcdff2375aafe70b82a21e9806ff455ccf62b43500a01dadd5470b21" checksum = "3ec5e2ba3ab275d85ec500ed6dd2c617015d7bf72435b423785457def47217fc"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byteorder", "byteorder",
"cwdemangle", "cwdemangle",
"cwextab 0.3.1", "cwextab",
"filetime", "filetime",
"flagset", "flagset",
"log", "log",
@ -1053,7 +1050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"hashbrown", "hashbrown 0.14.5",
"indexmap", "indexmap",
"memchr", "memchr",
] ]
@ -1311,9 +1308,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.6" version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
] ]
@ -2160,7 +2157,6 @@ version = "0.7.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [ dependencies = [
"byteorder",
"zerocopy-derive 0.7.35", "zerocopy-derive 0.7.35",
] ]

View File

@ -32,7 +32,7 @@ base16ct = "0.2"
base64 = "0.22" base64 = "0.22"
crossterm = "0.28" crossterm = "0.28"
cwdemangle = "1.0" cwdemangle = "1.0"
cwextab = "1.0.2" cwextab = "1.0"
dyn-clone = "1.0" dyn-clone = "1.0"
enable-ansi-support = "0.2" enable-ansi-support = "0.2"
filetime = "0.2" filetime = "0.2"
@ -41,7 +41,7 @@ flagset = { version = "0.4", features = ["serde"] }
glob = "0.3" glob = "0.3"
hex = "0.4" hex = "0.4"
indent = "0.1" indent = "0.1"
indexmap = "2.5" indexmap = "2.6"
itertools = "0.13" itertools = "0.13"
log = "0.4" log = "0.4"
memchr = "2.7" memchr = "2.7"
@ -51,7 +51,7 @@ nintendo-lz = "0.1"
nodtool = "1.4" nodtool = "1.4"
#nodtool = { path = "../nod-rs/nodtool" } #nodtool = { path = "../nod-rs/nodtool" }
num_enum = "0.7" num_enum = "0.7"
objdiff-core = { version = "2.1", features = ["ppc"] } objdiff-core = { version = "2.2", features = ["ppc"] }
#objdiff-core = { path = "../objdiff/objdiff-core", features = ["ppc"] } #objdiff-core = { path = "../objdiff/objdiff-core", features = ["ppc"] }
object = { version = "0.36", features = ["read_core", "std", "elf", "write_std"], default-features = false } object = { version = "0.36", features = ["read_core", "std", "elf", "write_std"], default-features = false }
once_cell = "1.20" once_cell = "1.20"
@ -75,7 +75,7 @@ tracing = "0.1"
tracing-attributes = "0.1" tracing-attributes = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] }
xxhash-rust = { version = "0.8", features = ["xxh3"] } xxhash-rust = { version = "0.8", features = ["xxh3"] }
zerocopy = { version = "0.7", features = ["derive"] } zerocopy = { version = "0.8", features = ["derive"] }
[target.'cfg(target_env = "musl")'.dependencies] [target.'cfg(target_env = "musl")'.dependencies]
mimalloc = "0.1" mimalloc = "0.1"

View File

@ -1,12 +1,12 @@
use std::{borrow::Cow, ffi::CStr}; use std::{borrow::Cow, ffi::CStr};
use zerocopy::{big_endian::*, AsBytes, FromBytes, FromZeroes}; use zerocopy::{big_endian::*, FromBytes, Immutable, IntoBytes, KnownLayout};
use crate::static_assert; use crate::static_assert;
pub const RARC_MAGIC: [u8; 4] = *b"RARC"; pub const RARC_MAGIC: [u8; 4] = *b"RARC";
#[derive(Copy, Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Copy, Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
pub struct RarcHeader { pub struct RarcHeader {
/// Magic identifier. (Always "RARC") /// Magic identifier. (Always "RARC")
@ -40,7 +40,7 @@ impl RarcHeader {
pub fn data_len(&self) -> u32 { self.data_len.get() } pub fn data_len(&self) -> u32 { self.data_len.get() }
} }
#[derive(Copy, Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Copy, Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
struct RarcInfo { struct RarcInfo {
/// Number of directories in the directory table. /// Number of directories in the directory table.
@ -63,7 +63,7 @@ struct RarcInfo {
static_assert!(size_of::<RarcInfo>() == 0x20); static_assert!(size_of::<RarcInfo>() == 0x20);
#[derive(Copy, Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Copy, Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
pub struct RarcNode { pub struct RarcNode {
/// Index of the node. (0xFFFF for directories) /// Index of the node. (0xFFFF for directories)
@ -104,7 +104,7 @@ impl RarcNode {
pub fn data_length(&self) -> u32 { self.data_length.get() } pub fn data_length(&self) -> u32 { self.data_length.get() }
} }
#[derive(Copy, Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Copy, Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
pub struct RarcDirectory { pub struct RarcDirectory {
/// Identifier of the directory. /// Identifier of the directory.
@ -149,7 +149,7 @@ pub struct RarcView<'a> {
impl<'a> RarcView<'a> { impl<'a> RarcView<'a> {
/// Create a new RARC view from a buffer. /// Create a new RARC view from a buffer.
pub fn new(buf: &'a [u8]) -> Result<Self, &'static str> { pub fn new(buf: &'a [u8]) -> Result<Self, &'static str> {
let Some(header) = RarcHeader::ref_from_prefix(buf) else { let Ok((header, remaining)) = RarcHeader::ref_from_prefix(buf) else {
return Err("Buffer not large enough for RARC header"); return Err("Buffer not large enough for RARC header");
}; };
if header.magic != RARC_MAGIC { if header.magic != RARC_MAGIC {
@ -161,32 +161,32 @@ impl<'a> RarcView<'a> {
// All offsets are relative to the _end_ of the header, so we can // All offsets are relative to the _end_ of the header, so we can
// just trim the header from the buffer and use the offsets as is. // just trim the header from the buffer and use the offsets as is.
let buf = &buf[size_of::<RarcHeader>()..]; let Ok((info, _)) = RarcInfo::ref_from_prefix(remaining) else {
let Some(info) = RarcInfo::ref_from_prefix(buf) else {
return Err("Buffer not large enough for RARC info"); return Err("Buffer not large enough for RARC info");
}; };
let directory_table_offset = info.directory_offset.get() as usize; let directory_table_offset = info.directory_offset.get() as usize;
let directory_table_size = info.directory_count.get() as usize * size_of::<RarcDirectory>(); let directory_table_size = info.directory_count.get() as usize * size_of::<RarcDirectory>();
let directories_buf = buf let directories_buf = remaining
.get(directory_table_offset..directory_table_offset + directory_table_size) .get(directory_table_offset..directory_table_offset + directory_table_size)
.ok_or("RARC directory table out of bounds")?; .ok_or("RARC directory table out of bounds")?;
let directories = let directories = <[RarcDirectory]>::ref_from_bytes(directories_buf)
RarcDirectory::slice_from(directories_buf).ok_or("RARC directory table not aligned")?; .map_err(|_| "RARC directory table not aligned")?;
if directories.is_empty() || directories[0].identifier != *b"ROOT" { if directories.is_empty() || directories[0].identifier != *b"ROOT" {
return Err("RARC root directory not found"); return Err("RARC root directory not found");
} }
let node_table_offset = info.node_offset.get() as usize; let node_table_offset = info.node_offset.get() as usize;
let node_table_size = info.node_count.get() as usize * size_of::<RarcNode>(); let node_table_size = info.node_count.get() as usize * size_of::<RarcNode>();
let nodes_buf = buf let nodes_buf = remaining
.get(node_table_offset..node_table_offset + node_table_size) .get(node_table_offset..node_table_offset + node_table_size)
.ok_or("RARC node table out of bounds")?; .ok_or("RARC node table out of bounds")?;
let nodes = RarcNode::slice_from(nodes_buf).ok_or("RARC node table not aligned")?; let nodes =
<[RarcNode]>::ref_from_bytes(nodes_buf).map_err(|_| "RARC node table not aligned")?;
let string_table_offset = info.string_table_offset.get() as usize; let string_table_offset = info.string_table_offset.get() as usize;
let string_table_size = info.string_table_len.get() as usize; let string_table_size = info.string_table_len.get() as usize;
let string_table = buf let string_table = remaining
.get(string_table_offset..string_table_offset + string_table_size) .get(string_table_offset..string_table_offset + string_table_size)
.ok_or("RARC string table out of bounds")?; .ok_or("RARC string table out of bounds")?;

View File

@ -1,14 +1,14 @@
use std::{borrow::Cow, ffi::CStr, mem::size_of}; use std::{borrow::Cow, ffi::CStr, mem::size_of};
use anyhow::Result; use anyhow::Result;
use zerocopy::{big_endian::U32, AsBytes, FromBytes, FromZeroes}; use zerocopy::{big_endian::U32, FromBytes, Immutable, IntoBytes, KnownLayout};
use crate::static_assert; use crate::static_assert;
pub const U8_MAGIC: [u8; 4] = [0x55, 0xAA, 0x38, 0x2D]; pub const U8_MAGIC: [u8; 4] = [0x55, 0xAA, 0x38, 0x2D];
/// U8 archive header. /// U8 archive header.
#[derive(Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
pub struct U8Header { pub struct U8Header {
magic: [u8; 4], magic: [u8; 4],
@ -32,7 +32,7 @@ pub enum U8NodeKind {
} }
/// An individual file system node. /// An individual file system node.
#[derive(Copy, Clone, Debug, PartialEq, FromBytes, FromZeroes, AsBytes)] #[derive(Copy, Clone, Debug, PartialEq, FromBytes, IntoBytes, Immutable, KnownLayout)]
#[repr(C, align(4))] #[repr(C, align(4))]
pub struct U8Node { pub struct U8Node {
kind: u8, kind: u8,
@ -91,7 +91,7 @@ pub struct U8View<'a> {
impl<'a> U8View<'a> { impl<'a> U8View<'a> {
/// Create a new U8 view from a buffer. /// Create a new U8 view from a buffer.
pub fn new(buf: &'a [u8]) -> Result<Self, &'static str> { pub fn new(buf: &'a [u8]) -> Result<Self, &'static str> {
let Some(header) = U8Header::ref_from_prefix(buf) else { let Ok((header, _)) = U8Header::ref_from_prefix(buf) else {
return Err("Buffer not large enough for U8 header"); return Err("Buffer not large enough for U8 header");
}; };
if header.magic != U8_MAGIC { if header.magic != U8_MAGIC {
@ -101,7 +101,8 @@ impl<'a> U8View<'a> {
let nodes_buf = buf let nodes_buf = buf
.get(node_table_offset..node_table_offset + header.node_table_size.get() as usize) .get(node_table_offset..node_table_offset + header.node_table_size.get() as usize)
.ok_or("U8 node table out of bounds")?; .ok_or("U8 node table out of bounds")?;
let root_node = U8Node::ref_from_prefix(nodes_buf).ok_or("U8 root node not aligned")?; let (root_node, _) =
U8Node::ref_from_prefix(nodes_buf).map_err(|_| "U8 root node not aligned")?;
if root_node.kind() != U8NodeKind::Directory { if root_node.kind() != U8NodeKind::Directory {
return Err("U8 root node is not a directory"); return Err("U8 root node is not a directory");
} }
@ -113,7 +114,8 @@ impl<'a> U8View<'a> {
return Err("U8 node table size mismatch"); return Err("U8 node table size mismatch");
} }
let (nodes_buf, string_table) = nodes_buf.split_at(node_count * size_of::<U8Node>()); let (nodes_buf, string_table) = nodes_buf.split_at(node_count * size_of::<U8Node>());
let nodes = U8Node::slice_from(nodes_buf).ok_or("U8 node table not aligned")?; let nodes =
<[U8Node]>::ref_from_bytes(nodes_buf).map_err(|_| "U8 node table not aligned")?;
Ok(Self { header, nodes, string_table }) Ok(Self { header, nodes, string_table })
} }