hearth-cross-compilation

Identify cross-compilation pitfalls in Hearth macros across Scala 2.13 and Scala 3.

68|7|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/kubuszok/kindlings --skill hearth-cross-compilation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill:  hearth-cross-compilation
Source: https://github.com/kubuszok/kindlings/tree/main/docs/contributing/hearth-cross-compilation
Command: npx skills add https://github.com/kubuszok/kindlings --skill hearth-cross-compilation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cross-compiled Hearth macro development often suffers from subtle Scala 2.13 vs Scala 3 differences leading to divergent behavior, brittle code, and runtime errors.

Core Features & Use Cases

  • Live reference of cross-compilation pitfalls including path-dependent types, splice isolation, type constructor matching, reification failures, Array ClassTag, upcast semantics, phantom types, and IsMap ordering.
  • Guidance on safe extension loading, LambdaBuilder scope, and def-caching strategies to maintain consistent macro expansion across platforms.
  • Use cases: when authoring Hearth macros or SPI extensions that must compile and run identically on both Scala 2.13 and Scala 3.

Quick Start

Review pitfalls.md first to understand common failure modes and apply the recommended extension patterns when building Hearth macros for dual-version support.

Frequently Asked Questions about hearth-cross-compilation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my Scala macros fail during cross-compilation between Scala 2.13 and Scala 3?

Scala macro cross-compilation fails due to subtle differences in path-dependent types, splice isolation, and type constructor matching. Identifying these version-specific pitfalls ensures robust macro expansion and prevents divergent runtime behavior across Scala 2.13 and Scala 3.

How do I handle path-dependent types and splice isolation in Scala 3 macros?

Handling path-dependent types and splice isolation requires careful quote scoping to avoid reification failures. Applying safe extension patterns and understanding Scala 3 quote semantics maintains consistent macro behavior when porting Scala 2.13 macro logic.

What are common pitfalls when authoring macros for both Scala 2.13 and Scala 3?

Common macro pitfalls include Array ClassTag mismatches, upcast semantics differences, phantom types, and IsMap or IsCollection ordering. Reviewing a comprehensive pitfalls reference helps avoid brittle code and resolve these edge cases before runtime.

Does cross-compilation affect LambdaBuilder scope and def-caching in Scala macros?

Cross-compilation impacts LambdaBuilder scope and def-caching strategies, requiring specific guidance to maintain consistent macro expansion. Properly managing these loading and caching mechanisms ensures extension code compiles identically across both Scala versions.

When should I check for IsCollection ordering issues in cross-compiled Scala macros?

Check for IsCollection and IsMap ordering issues when macro derivation behaves differently across Scala versions. Addressing these type constructor matching and reification failures early ensures your dual-version extension code remains stable and avoids runtime errors.