Skip to content

Conversation

@the-fixr
Copy link

Summary

Replace all lazy_static! macro usages across the codebase with std::sync::LazyLock from the standard library (stable since Rust 1.80). This eliminates the external lazy_static dependency from all 9 crates that used it.

Changes

34 files changed across 9 crates:

Crate Files Statics converted
stackslib 12 ~35 (boot code, epochs, prometheus metrics, regex, test data)
stacks-common 1 3 (logger, log format, log level)
clarity 2 7 (cost types, regex patterns, lexer matchers)
clarity-types 2 8 (regex strings, serialization constants)
libsigner 1 1 (version string)
stacks-node 5 8 (test flags, test data, prometheus metrics)
stacks-signer 1 14 (prometheus metrics)
contrib/clarity-cli 1 2 (boot code arrays)

Cargo.toml changes: Removed lazy_static from [dependencies] in all 9 crate Cargo.tomls and from [workspace.dependencies] in the workspace root.

Test plan

  • Mechanical conversion — LazyLock<T> implements Deref<Target = T> identically to lazy_static statics, so all access patterns are unchanged
  • No remaining references to lazy_static in any .rs source file
  • Cargo.lock references are from transitive dependencies only (third-party crates)

Closes #5035

🤖 Generated with Claude Code

Replace all lazy_static! macro usages across the codebase with
std::sync::LazyLock from the standard library (stable since Rust 1.80).

Removes the lazy_static dependency from all 9 crates that used it:
stackslib, stacks-common, clarity, clarity-types, libsigner,
stacks-node, stacks-signer, contrib/clarity-cli, and the workspace root.

Closes stacks-network#5035

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

1 participant