{"record":{"id":"6abee0af0dcdf153","repo":"jdx/mise","slug":"unsupported-cask-metadata-dsl-name","errorCode":null,"errorMessage":"unsupported cask metadata DSL `#{name}`","messagePattern":"unsupported cask metadata DSL `#(.+?)`","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/tap_cask_metadata.rb","lineNumber":271,"sourceCode":"      \"token\" => @token,\n      \"version\" => @version.to_s,\n      \"auto_updates\" => @auto_updates,\n      \"url\" => @url,\n      \"sha256\" => @sha256,\n      \"artifacts\" => @artifacts,\n      \"depends_on\" => {\n        \"formula\" => @formula_dependencies,\n        \"cask\" => @cask_dependencies\n      },\n      \"conflicts_with\" => { \"cask\" => @conflicting_casks },\n      \"ruby_source_path\" => ENV.fetch(\"MISE_BREW_SOURCE_PATH\"),\n      \"ruby_source_checksum\" => { \"sha256\" => ENV.fetch(\"MISE_BREW_SOURCE_CHECKSUM\") },\n      \"tap_git_head\" => ENV.fetch(\"MISE_BREW_TAP_COMMIT\")\n    }\n  end\n\n  def method_missing(name, *, &block)\n    raise \"unsupported cask metadata DSL `#{name}`\"\n  end\n\n  def respond_to_missing?(*) = true\n\n  private\n\n  def add_artifact(kind, source, target)\n    value = [source.to_s]\n    value << { \"target\" => target.to_s } unless target.nil?\n    @artifacts << { kind => value }\n  end\nend\n\ndef cask(token, &block)\n  $mise_cask_metadata = CaskMetadata.new(token)\n  $mise_cask_metadata.instance_eval(&block)\nend\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/tap_cask_metadata.rb#L253-L289","documentation":"The tap cask metadata shim implements only a small subset of the cask DSL, and its `method_missing` raises 'unsupported cask metadata DSL `<name>`' for any stanza it does not recognize. This is deliberate: unknown/ignored DSL could carry metadata the tool depends on, so instead of silently skipping, it fails loudly so the shim can be extended.","triggerScenarios":"A cask file evaluated via `instance_eval` calls any stanza not implemented by the shim — e.g. `app`, `binary`, `livecheck`, `depends_on`, `auto_updates` if not stubbed, nested blocks, or a newly introduced Homebrew DSL keyword.","commonSituations":"Upstream Homebrew added a new cask stanza the embedded shim hasn't learned yet; casks using common but unimplemented stanzas like `livecheck` or `depends_on macos`; evaluating a formula-like file through the cask metadata path by mistake.","solutions":["Identify the stanza name in the message and add a no-op or recording stub (e.g. `def livecheck(*) = nil`) to the shim's CaskMetadata class","Use/upgrade to a mise version whose shim supports that cask stanza","Patch the cask file (locally/vendored) to remove the unsupported stanza if it's not needed for metadata","Skip the offending cask in the tap metadata generation and file an issue for shim support"],"exampleFix":"# before (shim)\ndef container(*) = nil\ndef deprecate!(**) = nil\n# after (add stub for the unsupported stanza)\ndef container(*) = nil\ndef deprecate!(**) = nil\ndef livecheck(*) = nil\ndef depends_on(*) = nil","handlingStrategy":"try-catch","validationCode":"known = %w[version url sha256 name desc homepage container deprecate! disable! no_autobump!]\nunknown = File.read(cask_path).scan(/^\\s*(\\w+)[\\s(!]/).flatten.uniq - known\nraise \"unsupported cask DSL: #{unknown.join(', ')}\" unless unknown.empty?","typeGuard":null,"tryCatchPattern":"begin\n  metadata.instance_eval(cask_source)\nrescue RuntimeError => e\n  raise unless e.message.start_with?('unsupported cask metadata DSL')\n  stanza = e.message[/`([^`]+)`/, 1]\n  # add a stub or skip this cask\nend","preventionTips":["Keep the shim's stub list in sync with Homebrew cask DSL changes","Pre-scan cask files for unknown stanza names before evaluation","Pin/upgrade mise when new Homebrew DSL keywords appear","Handle nested/conditional stanzas explicitly in the shim"],"tags":["ruby","homebrew-cask","dsl","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}