d12frosted/homebrew-emacs-plus · error · ConfigurationError

Invalid '#{key}' in #{path} External and local patches requi

Error message

Invalid '#{key}' in #{path}
External and local patches require both 'url' and 'sha256'.
Got: #{spec.inspect}

What it means

Error "Invalid '#{key}' in #{path} External and local patches require both 'url' and 'sha256'. Got: #{spec.inspect}" thrown in d12frosted/homebrew-emacs-plus.

Source

Thrown at Library/BuildConfig.rb:309

                validate_patch_spec!(spec, path, key: "patches.#{name}.#{ver}")
              end
            else
              validate_patch_spec!(value, path, key: "patches.#{name}")
            end
          end
        else
          raise ConfigurationError,
            "Invalid 'patches' entry in #{path}\n" \
            "Expected: patch name (string) or named patch with 'url' and 'sha256'\n" \
            "Got: #{entry.inspect} (#{entry.class})"
        end
      end
    end

    def validate_patch_spec!(spec, path, key:)
      return if spec.is_a?(Hash) && spec["url"] && spec["sha256"]

      raise ConfigurationError,
        "Invalid '#{key}' in #{path}\n" \
        "External and local patches require both 'url' and 'sha256'.\n" \
        "Got: #{spec.inspect}"
    end

    def validate_revision!(revision, path)
      case revision
      when String
        unless revision.match?(/\A[a-f0-9]+\z/i)
          raise ConfigurationError,
            "Invalid 'revision' in #{path}\n" \
            "Expected: git commit hash (hex string)\n" \
            "Got: #{revision.inspect}"
        end
      when Hash
        validate_version_map_keys!(revision, "revision", path)
        revision.each do |ver, rev|
          unless rev.is_a?(String) && rev.match?(/\A[a-f0-9]+\z/i)

View on GitHub (pinned to 01c47fe98f)

Solutions

  1. Add both 'url' and 'sha256' to the patch entry: patches: - my-patch: url: https://example.com/my.patch sha256: <hex digest>
  2. Compute the sha256 of the patch file with 'shasum -a 256 my.patch' and paste the digest.
  3. If you meant a built-in patch, use just its name string instead of a map.

When it happens

Trigger: Thrown at Library/BuildConfig.rb:309 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of d12frosted/homebrew-emacs-plus@01c47fe98f (2026-08-23). Data as JSON: /api/errors/fc76321bf360c32a. Report an issue: GitHub.