{"record":{"id":"b06b7a403f238dd2","repo":"jdx/mise","slug":"native-binstall-metadata-should-have-a-package-url","errorCode":null,"errorMessage":"native binstall metadata should have a package URL","messagePattern":"native binstall metadata should have a package URL","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/cargo/native_binstall.rs","lineNumber":63,"sourceCode":"    let target_platform = PlatformTarget::from_current();\n    let manifest = download_crate_manifest(&package, tv, ctx).await?;\n    let mut binstall = NativeBinstallMetadata::from_manifest(&manifest, &target, &target_platform)?;\n    if binstall.disabled_strategies.contains(\"crate-meta-data\") {\n        return Ok(false);\n    }\n    if binstall.pkg_url.is_none() {\n        let Some(discovered) =\n            discover_native_binstall_metadata(&package, &crate_name, version, &target).await\n        else {\n            return Ok(false);\n        };\n        binstall.pkg_url = discovered.pkg_url;\n        binstall.pkg_fmt = discovered.pkg_fmt;\n    }\n    let pkg_url = binstall\n        .pkg_url\n        .as_deref()\n        .expect(\"native binstall metadata should have a package URL\");\n\n    let manifest_bins = native_manifest_bins(&manifest);\n    let bins = native_bins_to_install(opts.bin(), &manifest_bins, &package, &crate_name);\n    let bin_names = bins.iter().map(|bin| bin.name.clone()).collect::<Vec<_>>();\n    let pkg_fmt = binstall.pkg_fmt.unwrap_or_else(|| \"tgz\".to_string());\n    let package_format = native_package_format(&pkg_fmt)?;\n    let binary_ext = if cfg!(windows) { \".exe\" } else { \"\" };\n    let archive_suffix = if package_format.extraction_format.is_some() {\n        format!(\".{}\", package_format.template_value)\n    } else {\n        binary_ext.to_string()\n    };\n    let template_ctx = BinstallTemplateContext {\n        package: &package,\n        crate_name: &crate_name,\n        version,\n        target: &target,\n        archive_format: package_format.template_value,","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/backend/cargo/native_binstall.rs#L45-L81","documentation":"When installing a cargo crate via native binstall metadata, the code requires `binstall.pkg_url` to be present after merging discovered metadata. The panic means the crate's binstall metadata (cargo-binstall.toml / Cargo.toml [package.metadata.binstall]) never supplied a package URL template, so mise cannot know where to download the prebuilt artifact.","triggerScenarios":"Running `mise use cargo:<crate>` (or installing with native binstall enabled) for a crate that publishes binstall metadata without a `pkg-url` key, or whose metadata discovery step returned partial metadata (pkg_fmt set but pkg_url missing).","commonSituations":"Crate authors add `[package.metadata.binstall]` with only `pkg-fmt` or incomplete overrides; a crate release changed its artifact naming so the URL template was dropped; no prebuilt artifacts are actually published for the crate.","solutions":["Verify the crate actually publishes binstall metadata with `pkg-url` (and releases binaries) — check its repo's cargo-binstall config","Fall back to source compilation: `mise settings set cargo_binstall false` or install with `cargo:<crate>` without binstall","Add/fix `[package.metadata.binstall] pkg-url = \"...\"` in the crate if you own it and re-release","Use an explicit backend install like `mise use cargo:<crate>` compiling from source instead"],"exampleFix":"# before (crate Cargo.toml metadata missing pkg-url)\n[package.metadata.binstall]\npkg-fmt = \"tgz\"\n# after\n[package.metadata.binstall]\npkg-url = \"{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz\"\npkg-fmt = \"tgz\"","handlingStrategy":"validation","validationCode":"# before installing via native binstall, check the crate publishes binaries + metadata\ncrate=$(basename \"$CRATE\");\ncurl -fsSL \"https://raw.githubusercontent.com/${OWNER}/${REPO}/main/Cargo.toml\" | grep -q 'pkg-url' || echo 'no binstall pkg-url — compile from source instead'","typeGuard":"function hasBinstallUrl(meta) { return !!meta?.binstall?.pkg_url; }","tryCatchPattern":"if mise install cargo:foo 2>&1 | grep -q 'should have a package URL'; then echo 'falling back to source build'; MISE_CARGO_BINSTALL=false mise install cargo:foo; fi","preventionTips":["Verify the crate publishes prebuilt release artifacts and [package.metadata.binstall] with pkg-url before using cargo:<crate>","If you maintain the crate, include pkg-url and pkg-fmt metadata in every release","Prefer source installs for crates known to lack binstall metadata"],"tags":["cargo","binstall","metadata","panic","installation"],"backgroundTag":"missing-required-config-field","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"}