Skip to content

Update to metagoblin 10; remove atty dep - #44

Merged
m4b merged 9 commits into
masterfrom
metagoblin_10
Jan 4, 2026
Merged

Update to metagoblin 10; remove atty dep#44
m4b merged 9 commits into
masterfrom
metagoblin_10

Conversation

@m4b

@m4b m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner

Updates to metagoblin 0.10; fixes some breaking changes to goblin api. Updates all outdated deps.

Removes the atty dep, and update MSRV to 1.70, so we can use the IsTerminal api.

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

@koutheir would you mind a quick review? ignore CI failures for now i'm looking into what's going on

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

heh , i have no ideat wtf this error means:

Run cargo build
    Updating crates.io index
error: failed to select a version for `env_logger`.
    ... required by package `bingrep v0.11.0 (/home/runner/work/bingrep/bingrep)`
versions that meet the requirements `^0.11` (locked to 0.11.8) are: 0.11.8

the package `bingrep` depends on `env_logger`, with features: `anstream` but `env_logger` does not have these features.
 It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.

we don't have any features in bingrep, and it also just does env_logger = "0.11" so 🤔

@koutheir

koutheir commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

It is weird. Remove Cargo.lock and try again. Maybe the --verbose flag of cargo can help?

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

I've already ran cargo update , but --verbose is a good idea

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

(for clarity, rm Cargo.lock; cargo c has no diff, e.g., cargo update is identical result, as expected

@m4b
m4b force-pushed the metagoblin_10 branch 2 times, most recently from 7a38e7a to de4de93 Compare January 4, 2026 21:52
@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

even weirder, env_logger does not have a feature of that name, even though the error message says it does?

 cargo info env_logger
env_logger #logging #log #logger
A logging implementation for `log` which is configured via an environment
variable.
version: 0.11.8
license: MIT OR Apache-2.0
rust-version: 1.71
documentation: https://docs.rs/env_logger/0.11.8
repository: https://github.com/rust-cli/env_logger
crates.io: https://crates.io/crates/env_logger/0.11.8
features:
 +default     = [auto-color, humantime, regex]
  auto-color  = [color, anstream/auto]
  color       = [dep:anstream, dep:anstyle]
  humantime   = [dep:jiff]
  regex       = [env_filter/regex]
  kv          = [log/kv]
  unstable-kv = [kv]

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

ah nvm, it's a dep called anstream

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

wow, it's because env_logger MSRV is 1.71: rust-cli/env_logger#312

man never would have guessed that!

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

whelp scroll is 2024, so I guess bingrep is going into the 24th year :)

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

hmmm, this is odd:


info: override toolchain for '/home/runner/work/bingrep/bingrep' set to '1.71.0-x86_64-unknown-linux-gnu'
  1.71.0-x86_64-unknown-linux-gnu installed - rustc 1.71.0 (8ede3aae2 2023-07-12)

it should be set to 1.85; and the previous CI run did set it to that ? 🤔

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

ugh i forgot to save the file locally :/

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

yay green again

…to 2021 and rust version to 1.74; we'll bounce to new edition with latest goblin, which requires scroll 0.13
@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

actually I decided to revert back to scroll 0.12 so no duplicate deps, and keep edition at 2021 and rustc; when update to metagoblin with latest goblin and scroll, we'll update to latest edition. some distros build this from source/alternative to cargo so older edition + rustc is usually better

@m4b

m4b commented Jan 4, 2026

Copy link
Copy Markdown
Owner Author

i'm going to merge and publish this in a few hours so if have any comments @koutheir let me know :)

also if you're interested, there's a new COFF object that needs coloring; probably most of the PE colorizer could be reused is my guess?

@koutheir koutheir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Comment thread src/format.rs
@@ -39,13 +39,18 @@ macro_rules! color_dim {
}

fn union_demangle(s: &str) -> String {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a matter of style, but this is how I did it:

fn union_demangle(s: &str) -> String {
    match rustc_demangle::try_demangle(s) {
        Ok(demangled) => demangled.to_string(),
        Err(_) => match cpp_demangle::Symbol::new(s) {
            Ok(sym) => sym.demangle().unwrap_or_else(|_| s.to_owned()),
            Err(_) => s.to_owned(),
        },
    }
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had something like this originally but replaced with a map + unwrap_or_else, because it had slightly less matches

@koutheir

koutheir commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

also if you're interested, there's a new COFF object that needs coloring; probably most of the PE colorizer could be reused is my guess?

Let's make an issue to track this new feature.

@m4b
m4b merged commit 5fd3549 into master Jan 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants