From 7fd039722d67dc28c67d97249b7c6ce69dcd09b2 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 13 Mar 2024 18:30:15 -0600 Subject: [PATCH] Format & use syntect regex-fancy The onig crate no longer builds in CI with cargo-zigbuild. --- Cargo.lock | 55 +++++++++++++++++++++++------------------------- Cargo.toml | 2 +- src/cmd/dwarf.rs | 3 +-- src/cmd/elf.rs | 5 ++--- src/util/elf.rs | 3 +-- 5 files changed, 31 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca6263e..862e568 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,6 +135,21 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -345,6 +360,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + [[package]] name = "filetime" version = "0.2.23" @@ -677,28 +702,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "onig" -version = "6.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" -dependencies = [ - "bitflags", - "libc", - "once_cell", - "onig_sys", -] - -[[package]] -name = "onig_sys" -version = "69.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "overload" version = "0.1.1" @@ -736,12 +739,6 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppc750cl" version = "0.2.0" @@ -1044,10 +1041,10 @@ checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bincode", "bitflags", + "fancy-regex", "flate2", "fnv", "once_cell", - "onig", "regex-syntax 0.8.2", "serde", "serde_derive", diff --git a/Cargo.toml b/Cargo.toml index 05b6d7f..c921bb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ serde_yaml = "0.9.32" sha-1 = "0.10.1" smallvec = "1.13.1" supports-color = "3.0.0" -syntect = { version = "5.2.0", features = ["parsing", "regex-onig", "dump-load"], default-features = false } +syntect = { version = "5.2.0", features = ["parsing", "regex-fancy", "dump-load"], default-features = false } tracing = "0.1.40" tracing-attributes = "0.1.27" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } diff --git a/src/cmd/dwarf.rs b/src/cmd/dwarf.rs index cbeff3f..506bf7a 100644 --- a/src/cmd/dwarf.rs +++ b/src/cmd/dwarf.rs @@ -8,8 +8,7 @@ use std::{ use anyhow::{anyhow, bail, Context, Result}; use argp::FromArgs; use object::{ - elf, Object, ObjectSection, ObjectSymbol, RelocationFlags, RelocationTarget, - Section, + elf, Object, ObjectSection, ObjectSymbol, RelocationFlags, RelocationTarget, Section, }; use syntect::{ highlighting::{Color, HighlightIterator, HighlightState, Highlighter, Theme, ThemeSet}, diff --git a/src/cmd/elf.rs b/src/cmd/elf.rs index fde17f6..99c0bac 100644 --- a/src/cmd/elf.rs +++ b/src/cmd/elf.rs @@ -12,9 +12,8 @@ use objdiff_core::obj::split_meta::{SplitMeta, SPLITMETA_SECTION}; use object::{ elf, write::{Mangling, SectionId, SymbolId}, - FileFlags, Object, ObjectSection, ObjectSymbol, - RelocationTarget, SectionFlags, SectionIndex, SectionKind, SymbolFlags, SymbolIndex, - SymbolKind, SymbolScope, SymbolSection, + FileFlags, Object, ObjectSection, ObjectSymbol, RelocationTarget, SectionFlags, SectionIndex, + SectionKind, SymbolFlags, SymbolIndex, SymbolKind, SymbolScope, SymbolSection, }; use crate::{ diff --git a/src/util/elf.rs b/src/util/elf.rs index a139b51..26830d3 100644 --- a/src/util/elf.rs +++ b/src/util/elf.rs @@ -18,8 +18,7 @@ use object::{ StringId, }, Architecture, Endianness, Object, ObjectKind, ObjectSection, ObjectSymbol, Relocation, - RelocationFlags, RelocationTarget, SectionKind, Symbol, SymbolKind, - SymbolScope, SymbolSection, + RelocationFlags, RelocationTarget, SectionKind, Symbol, SymbolKind, SymbolScope, SymbolSection, }; use crate::{