{"record":{"id":"8d759d7311a20515","repo":"jdx/mise","slug":"failed-to-parse-registry-option-k-as-a-toml-valu","errorCode":null,"errorMessage":"failed to parse registry option {k} as a TOML value: {e}","messagePattern":"failed to parse registry option (.+?) as a TOML value: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":658,"sourceCode":"    pub fn ba(&self) -> Option<BackendArg> {\n        self.backends()\n            .first()\n            .map(|f| BackendArg::new(self.short.to_string(), Some(f.to_string())))\n    }\n\n    /// Get RegistryBackend for a specific full backend string\n    pub fn get_backend(&self, full: &str) -> Option<&RegistryBackend> {\n        self.backends.iter().find(|rb| rb.full == full)\n    }\n\n    /// Get options for a specific backend\n    pub fn backend_options(&self, full: &str) -> ToolVersionOptions {\n        let mut opts = IndexMap::new();\n\n        if let Some(backend) = self.get_backend(full) {\n            for (k, v) in backend.options {\n                let value = v.parse::<toml::Value>().unwrap_or_else(|e| {\n                    panic!(\"failed to parse registry option {k} as a TOML value: {e}\")\n                });\n                opts.insert(k.to_string(), value);\n            }\n        }\n\n        ToolVersionOptions {\n            opts: RawBackendOptions::from(opts),\n            ..Default::default()\n        }\n    }\n\n    pub(crate) fn version_order(&self, full: &str) -> Option<VersionOrder> {\n        matches!(\n            BackendType::guess(full),\n            BackendType::Aqua\n                | BackendType::Forgejo\n                | BackendType::Github\n                | BackendType::Gitlab","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/registry.rs#L640-L676","documentation":"Raised by shim_unsupported! in mise's Homebrew formula source-build shim (src/system/packages/brew/shim.rb). When mise builds a formula from source it evaluates the formula's Ruby file against a small DSL reimplementation; features the shim cannot reproduce — resource patches, custom download strategies, on_macos conditionals, inline patch strings, testpath/test blocks, and any unknown install-time helper reached through method_missing (line 857-858) — abort with ShimUnsupportedError naming the feature. Failing loudly prevents a formula from being built with silently missing patches or an unverified download strategy.","triggerScenarios":"mise source-build of a formula whose Ruby definition contains: `patch` inside a resource (line 405), a resource with `using: <strategy>` (line 410), an on_system macos conditional (line 614), inline patch strings (line 659), a `testpath` call (line 718), or any helper method the shim never defined (method_missing, line 858) — e.g. `livecheck`, `fails_with`, `needs :xcode`.","commonSituations":"Building older/complex formulas (e.g. those carrying backported patches or custom fetch strategies); formulas upgraded upstream to use newer Homebrew DSL after your mise version; Linux users hitting `on_macos`/`on_linux` blocks in mac-centric formulas; CI source-builds of formulas that normally ship bottles.","solutions":["Prefer the prebuilt bottle: install the tool via a mise backend (aqua/github/core plugin) or real `brew install <formula>` instead of source-building it","Update mise to the newest release and retry — the source-build shim's DSL coverage expands each release","Pin an older formula version whose definition predates the unsupported feature","If you control the formula, replace the unsupported construct (drop the resource patch, use the default download strategy, remove the test block) or vendor the patch into your build config"],"exampleFix":"# before: formula feature the shim cannot build\nclass Foo < Formula\n  resource \"data\" do\n    url \"https://example.com/data.tar.gz\"\n    patch { url \"https://example.com/p.diff\" }  # -> shim_unsupported!(\"resource patches\")\n  end\nend\n\n# after: plain resources, no custom strategy/patch\nclass Foo < Formula\n  resource \"data\" do\n    url \"https://example.com/data.tar.gz\"\n    sha256 \"...\"\n  end\nend","handlingStrategy":"fallback","validationCode":"# heuristic pre-check before mise source-builds a formula\nbrew cat <formula> 2>/dev/null | grep -nE 'patch|using:|testpath|on_macos|on_system' && \\\n  echo \"formula likely unsupported by mise source-build shim -> use a bottle or real brew\"","typeGuard":"def shim_supported_formula?(path)\n  src = File.read(path)\n  src.scan(/resource\\s+\"\\w+\".*?end/m).none? { |r| r.match?(/patch|using\\s*:/) } &&\n    !src.match?(/testpath|inline_patch|on_macos/)\nend","tryCatchPattern":"begin ... rescue ShimUnsupportedError => e; warn e.message; fall back to `brew install <formula>` (bottle) or a mise backend (aqua/github) for the same tool; end — do not retry the source build.","preventionTips":["Prefer bottles/backends over source builds by default; source-build only formulas you control","Pin formula versions whose definitions you have verified against the shim's supported subset","In CI, snapshot `brew cat` output and fail the pipeline when new unsupported stanzas appear after a Homebrew bump"],"tags":["homebrew","formula","source-build","ruby","shim","system-packages"],"backgroundTag":"unsupported-dsl-feature","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}