{"record":{"id":"c39909acd73cb446","repo":"d12frosted/homebrew-emacs-plus","slug":"invalid-key-configuration-in-path-when-spe","errorCode":null,"errorMessage":"Invalid '#{key}' configuration in #{path}\nWhen specifying an external icon, both 'url' and 'sha256' are required.\nGot: #{icon.inspect}","messagePattern":"Invalid '#(.+?)' configuration in #(.+?)\nWhen specifying an external icon, both 'url' and 'sha256' are required\\.\nGot: #(.+?)","errorType":"validation","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"Library/BuildConfig.rb","lineNumber":237,"sourceCode":"              \"Invalid 'icon.#{ver}' in #{path}\\n\" \\\n              \"Version maps cannot be nested.\\n\" \\\n              \"Got: #{spec.inspect}\"\n          end\n          validate_icon_spec!(spec, path, key: \"icon.#{ver}\")\n        end\n      else\n        validate_icon_spec!(icon, path)\n      end\n    end\n\n    def validate_icon_spec!(icon, path, key: \"icon\")\n      case icon\n      when String, nil\n        # Valid: icon name from registry or no icon\n        return\n      when Hash\n        unless icon[\"url\"] && icon[\"sha256\"]\n          raise ConfigurationError,\n            \"Invalid '#{key}' configuration in #{path}\\n\" \\\n            \"When specifying an external icon, both 'url' and 'sha256' are required.\\n\" \\\n            \"Got: #{icon.inspect}\"\n        end\n      else\n        raise ConfigurationError,\n          \"Invalid '#{key}' in #{path}\\n\" \\\n          \"Expected: string (icon name) or object with 'url' and 'sha256'\\n\" \\\n          \"Got: #{icon.inspect} (#{icon.class})\"\n      end\n    end\n\n    # Validate that all keys of a version map are major versions or \"default\"\n    def validate_version_map_keys!(map, key, path)\n      bad = map.keys.reject { |k| k.to_s == \"default\" || k.to_s.match?(VERSION_KEY) }\n      return if bad.empty?\n\n      raise ConfigurationError,","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/d12frosted/homebrew-emacs-plus/blob/01c47fe98f35ff28a37a89e1f7aafadff621f9e0/Library/BuildConfig.rb#L219-L255","documentation":"An icon entry is a Hash but does not carry both a truthy `url` and `sha256` - validate_icon_spec! (Library/BuildConfig.rb:235-241) requires exactly these two keys because the build must download and checksum-verify the file. The '{key}' in the message tells you where: 'icon' for the top-level entry, 'icon.30' inside a version map. By design `icon: {}` (empty hash) also lands here (see the comment at lines 212-213): an empty hash is neither a usable spec nor a usable version map.","triggerScenarios":"`icon:` with a hash containing url but no sha256 (or vice versa); a key present but value empty (`url:` with nothing after it parses to nil, which is falsy); typo'd key names (`sha:`, `checksum:`); `icon: {}`; or a version-map entry like `\"30\": {url: ...}` missing the digest.","commonSituations":"Skipping the sha256 because it is tedious to compute, then hitting it at install time; key names copied from another tool's config (sha, sha_sum, checksum); an incompletely pasted block where the last line was dropped; assuming the digest is optional - it never is for external resources.","solutions":["Add the missing key: fetch the file and compute the digest - `curl -LO <url> && shasum -a 256 <file>` - then paste the hex after `sha256:`.","Fix key-name typos - the hash must use exactly `url` and `sha256`, no aliases.","If you wanted a bundled icon instead, replace the whole hash with a plain registry name: `icon: Spacemacs`.","If you wanted no icon at all, delete the `icon:` key entirely - `icon: {}` is not 'no icon' and still raises this error."],"exampleFix":"# before - missing sha256\nicon:\n  url: https://example.com/Emacs.icns\n\n# after\nicon:\n  url: https://example.com/Emacs.icns\n  sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","handlingStrategy":"validation","validationCode":"def external_icon_complete?(spec)\n  spec.is_a?(Hash) && !!spec[\"url\"] && !!spec[\"sha256\"]\nend\n\nicon = config_hash[\"icon\"]\nspec_map = icon.is_a?(Hash) && !(icon.keys.map(&:to_s) - %w[url sha256]).empty?\nif spec_map\n  icon.each { |ver, s| abort \"icon.#{ver}: url and sha256 both required\" unless external_icon_complete?(s) }\nelsif icon.is_a?(Hash)\n  abort \"icon: url and sha256 both required\" unless external_icon_complete?(icon)\nend","typeGuard":"def valid_icon_entry?(v)\n  v.is_a?(String) || v.nil? || (v.is_a?(Hash) && !!v[\"url\"] && !!v[\"sha256\"])\nend","tryCatchPattern":"begin\n  BuildConfig.load_config\nrescue BuildConfig::ConfigurationError => e\n  if e.message.include?(\"both 'url' and 'sha256' are required\")\n    abort \"Compute the digest with: curl -LO <url> && shasum -a 256 <file>\"\n  end\n  raise\nend","preventionTips":["Write url and sha256 together, or not at all - never save a half-finished spec","The keys are literally `url` and `sha256`; no aliases exist","An empty hash is not a no-op - omit the key to disable the icon","Run a tiny preflight that walks icon entries and checks both keys before brew starts"],"tags":["configuration","icon","sha256","checksum","external-resource","emacs-plus"],"backgroundTag":"missing-required-field","analyzedSha":"01c47fe98f35ff28a37a89e1f7aafadff621f9e0","analyzedAt":"2026-08-23T16:25:45.065Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}