Skip to content

Update dependency dev.zacsweers.metro:runtime to v1.2.0#334

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/dev.zacsweers.metro-runtime-1.x
Jun 11, 2026
Merged

Update dependency dev.zacsweers.metro:runtime to v1.2.0#334
renovate[bot] merged 1 commit into
mainfrom
renovate/dev.zacsweers.metro-runtime-1.x

Conversation

@renovate

@renovate renovate Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
dev.zacsweers.metro:runtime 1.1.11.2.0 age confidence

Release Notes

ZacSweers/metro (dev.zacsweers.metro:runtime)

v1.2.0

Compare Source

2026-06-10

New
  • [interop] This release introduces experimental support for Hilt @InstallIn and @EntryPoint interop.
    • Enabled with metro { interop { includeHilt() } }
    • A @DependencyGraph(<scope>) automatically merges every @InstallIn(<component>) @&#8203;Module (as a binding container) and @InstallIn(<component>) @&#8203;EntryPoint (as a supertype) whose <component> maps to <scope>.
      • The eight standard Android Hilt components map to their canonical scopes out of the box.
      • User-declared @DefineComponent interfaces are resolved on demand by looking for an annotation on the same interface whose annotation class is itself annotated with @Scope (Hilt's own convention).
    • Both consuming Hilt-generated aggregation deps and also treating @InstallIn + @EntryPoint/@Module as interop are supported.
    • See the docs for the details and current limitations.
Enhancements
  • [compat] Improve IDE kotlinc version resolution. IntelliJ uses custom tags like 2.4.0-ij261-64 that are a little tricky to decipher.
  • [FIR] Add diagnostic guidance around inline @Provides declarations. TL;DR, they only make sense for public providers.
  • [FIR/IR] Inline constant @Provides bindings directly into generated graph implementations when possible, avoiding generated factory calls for literals, nulls, object singletons, enum entries, class literals, and const property reads. This is enabled by default and can be disabled with the enable-provider-inlining compiler flag if you see any issues.
  • [IR] Add a member-naming-strategy compiler option for shortening generated member names in generated code. Accepts DESCRIPTIVE (default), TYPED (provider*/instance*/factory*), or MINIMAL (single collapsed provider* naming). See docs/performance.md for guidance.
  • [IR] Lazily compute cached hashCode and toString renders for compiler-internal type keys without delegation.
  • [IR] Propagate inline modifiers from @Provides functions to factory newInstance() functions.
  • [IR] Preserve concrete generated provider factory return types where possible instead of widening to Factory<T>. In the future, Metro may generate these as value classes and this will allow better compiler optimization in those scenarios.
  • [IR/IC] Optimize IC tracking by buffering lookup and expect/actual records during IR and flushing them once after graph validation, avoiding per-write synchronization on the hot path. This is enabled by default but can be disabled via the buffered-ic-tracking compiler option if it causes any issues.
  • [IR/IC] Use newer compiler DeclarationFinder APIs on Kotlin 2.3.20+. These have more granular search scopes plus automatic IC tracking.
  • [IR/runtime] Add internal primitive instance factories and use them where possible for primitive graph inputs and inlined providers.
  • [gradle] Add a metroEnv task that writes human-readable Metro/Kotlin/Gradle environment reports for bug reports.
  • [reporting] Add compiler stats to reporting.
  • [runtime] Rework DoubleCheck synchronization on JVM and native targets.
    • On JVM, scoped bindings now synchronize on the DoubleCheck instance's own monitor (like Dagger) instead of allocating a ReentrantLock per instance, which also eliminates the spurious ReservedStackAccess JVM warning.
    • On native targets, the previous spinlock impl is replaced with a reentrant init guard whose contended callers park on a process-wide condition variable instead of busy-waiting.
      • On Apple platforms, parked waiters additionally donate their QoS class to the initializing thread to avoid priority inversion.
    • Notes for virtual thread (i.e. Project Loom):
      • JDK 21–23: synchronized can pin a virtual thread to its carrier if a scoped provider blocks during its one-time init (JEP 444).
      • JDK 24+ removes monitor pinning (JEP 491).
Fixes
  • [FIR] Loosen nonPublicContributionSeverity if generateContributionProviders is enabled. Note it will still fire on internal @ExposeImplBinding-annotated types.
  • [FIR] Fix compatibility with IntelliJ 2026.1.3.
  • [FIR] Don't merge generated binding containers from @ContributesInto* declarations as supertypes when aggregating contributions.
  • [IR] Fix graph extensions inheriting a farther ancestor's contribution-provider binding when a closer parent graph already owns a scoped binding for the same key.
  • [IR] Fix dynamic graphs (createDynamicGraph/createDynamicGraphFactory) sharing a single generated impl across call sites in different files. The shared impl was a private (on the JVM, package-private) nested class placed under one call site, so call sites in other packages failed at runtime with IllegalAccessError, and removing the owning file caused NoClassDefFoundError. Generated impls are now cached per-file.
  • [IR] Fix IR graph nodes eagerly resolving supertypes.
  • [IR] Don't reserve an InstanceFactory field for graph inputs unless it's needed.
  • [interop] Read @IntoSet/@IntoMap/@MapKey multibinding annotations from external Dagger modules.
Changes
  • Promote @GraphPrivate to stable.
  • Promote @DefaultBinding to stable.
  • Promote generateContributionProviders (and @ExposeImplBinding) to stable.
  • [gradle] Add missing experimental annotations to the Gradle plugin's analysis APIs. Sorry these were not meant to be stabilized yet!
  • Build against Kotlin 2.4.0. Note the runtime artifacts still target Kotlin 2.3.0 and Metro supports a wide range of compiler versions. See the compatibility docs for a full table of compatible versions.
  • No longer test most Kotlin 2.4.0 pre-release builds. Kotlin 2.4.0-dev-2124 is still tested because this appears to be roughly where IntelliJ platform 2026.1.x branched from.
  • Test Android Studio Quail 1 stable (2026.1.1.8).
  • Test Android Studio Quail 2 canaries (2026.1.2.4).
  • Test IntelliJ 2026.1.2.
  • Test IntelliJ 2026.1.3.
Contributors

Special thanks to the following contributors for contributing to this release!

Consider sponsoring Metro's development

Go Knicks!


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/dev.zacsweers.metro-runtime-1.x branch from a290a31 to dcf350e Compare June 10, 2026 22:54
@renovate renovate Bot merged commit 4c04ca5 into main Jun 11, 2026
12 checks passed
@renovate renovate Bot deleted the renovate/dev.zacsweers.metro-runtime-1.x branch June 11, 2026 00:46
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.

0 participants