jdx/mise · error · RuntimeError

unsupported cask metadata DSL `#

Error message

unsupported cask metadata DSL `#{name}`

What it means

Raised by CaskMetadata#method_missing in mise's tap_cask_metadata.rb shim when the evaluated cask calls a top-level DSL method the shim does not implement (respond_to_missing? is true so the raise, not NoMethodError, is what surfaces). The shim implements only the cask stanzas mise needs (version, url, sha256, name, desc, homepage, etc.); anything else aborts parsing. It exists to fail loudly on newer Homebrew cask DSL constructs instead of silently ignoring them.

Solutions

  1. Add a handler (usually a no-op attr setter) for the unsupported stanza name in CaskMetadata in src/system/packages/brew/tap_cask_metadata.rb
  2. Update mise to a version that supports the stanza
  3. Pin/checkout an older tap revision whose casks use only supported stanzas
  4. Report/upstream the DSL gap so the shim gains support

Example fix

# before (shim)
def method_missing(name, *, &block)
  raise "unsupported cask metadata DSL `#{name}`"
end
# after (shim)
def method_missing(name, *, &block)
  return nil if name == :depends_on_cask
  raise "unsupported cask metadata DSL `#{name}`"
end
Defensive patterns

Strategy: validation

Validate before calling

KNOWN_STANZAS = %i[version url sha256 name desc homepage auto_updates app binary].freeze
unknown = cask_stanzas - KNOWN_STANZAS
raise "unsupported stanzas: #{unknown.join(', ')}" unless unknown.empty?

Type guard

def supported_stanza?(name) = CaskMetadata.instance_methods(false).include?(name)

Try / catch

begin
  metadata = parse_cask_metadata(cask_source)
rescue RuntimeError => e
  raise unless e.message.start_with?("unsupported cask metadata DSL")
  warn "cask uses unsupported stanza: #{e.message}"; nil
end

Prevention

When it happens

Trigger: A cask calls a stanza such as a recently added Homebrew DSL method the shim has not mirrored; a tap-specific helper method; a typo'd or deprecated stanza inside the cask block.

Common situations: Third-party tap casks adopting new Homebrew stanzas before mise's shim is updated; casks using conflicts_with, livecheck variants, or auto_dependencies the minimal shim lacks; stale tap checkouts with casks newer than the shim.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/6abee0af0dcdf153. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/brew/tap_cask_metadata.rb:314

      "token" => @token,
      "version" => @version.to_s,
      "auto_updates" => @auto_updates,
      "url" => @url,
      "sha256" => @sha256,
      "artifacts" => @artifacts,
      "depends_on" => {
        "formula" => @formula_dependencies,
        "cask" => @cask_dependencies
      },
      "conflicts_with" => { "cask" => @conflicting_casks },
      "ruby_source_path" => ENV.fetch("MISE_BREW_SOURCE_PATH"),
      "ruby_source_checksum" => { "sha256" => ENV.fetch("MISE_BREW_SOURCE_CHECKSUM") },
      "tap_git_head" => ENV.fetch("MISE_BREW_TAP_COMMIT")
    }
  end

  def method_missing(name, *, &block)
    raise "unsupported cask metadata DSL `#{name}`"
  end

  def respond_to_missing?(*) = true

  private

  def add_flight_steps(kind, &block)
    collector = CaskFlightSteps.new(self)
    collector.instance_eval(&block)
    @artifacts << { kind => [{ "steps" => collector.steps }] }
  end

  def add_artifact(kind, source, target)
    value = [source.to_s]
    value << { "target" => target.to_s } unless target.nil?
    @artifacts << { kind => value }
  end
end

View on GitHub (pinned to 533346cc37)