{"record":{"id":"de273f007aeae583","repo":"jdx/mise","slug":"native-cargo-binary-artifact-did-not-contain","errorCode":null,"errorMessage":"native cargo binary artifact did not contain {}{}","messagePattern":"native cargo binary artifact did not contain (.+?)(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/cargo/native_binstall.rs","lineNumber":189,"sourceCode":"            ctx.pr\n                .set_message(format!(\"download {}\", get_filename_from_url(&archive_url)));\n            download_native_binstall_file(&archive_url, &archive_path, Some(ctx.pr.as_ref()))\n                .await?;\n            file::create_dir_all(&extract_dir)?;\n            file::extract_archive(\n                &archive_path,\n                &extract_dir,\n                package_format.extraction_format.unwrap(),\n                &ExtractOptions {\n                    strip_components: 0,\n                    pr: Some(ctx.pr.as_ref()),\n                    preserve_mtime: true,\n                },\n            )?;\n            let Some(src) = find_native_bin(&extract_dir, binstall.bin_dir.as_deref(), &vars)?\n            else {\n                if bin.required_features.is_empty() {\n                    bail!(\n                        \"native cargo binary artifact did not contain {}{}\",\n                        bin.name,\n                        binary_ext\n                    );\n                }\n                debug!(\n                    \"native cargo binary artifact skipped optional bin {} requiring features {}\",\n                    bin.name,\n                    bin.required_features.join(\",\")\n                );\n                continue;\n            };\n            let dest = bin_root.join(format!(\"{}{}\", bin.name, binary_ext));\n            pending.push((src, dest));\n        }\n        validate_native_bin_sources(&pending)?;\n        if pending.is_empty() {\n            return Ok(false);","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/cargo/native_binstall.rs#L171-L207","documentation":"During native cargo-binstall installation, mise downloads the crate's published binary artifact, extracts it, and locates each declared bin executable via find_native_bin. If a bin that requires no extra cargo features is missing from the artifact (path bin.name + binary_ext not found under bin_dir), the install is treated as corrupt and fails; feature-gated bins are skipped (debug) instead.","triggerScenarios":"install() on native_binstall path: the extracted artifact contains no file matching a required (non feature-gated) bin's expected name at the configured bin_dir/binary-ext.","commonSituations":"Upstream crate republished with renamed binaries; binstall metadata (bin_dir / binary ext) mismatched for the platform (e.g. .exe suffix logic); downloaded artifact for wrong target triple; tarball layout changed between releases.","solutions":["Reinstall or pin a different version of the crate whose artifact actually contains the expected binary.","Check that the correct target-triple artifact was downloaded (verify rust target/platform matches your machine).","If the crate needs custom features to produce the binary, install from source (disable binstall-only) since feature-gated bins are not in the prebuilt artifact.","Report/fix the crate's binstall metadata (bin_dir, bin names) if it's wrong upstream."],"exampleFix":"// before: expecting binary with custom features\nlet _ = binstall.install(ctx, &tv).await?; // bin requires `ssl` feature\n\n// after: allow cargo install fallback so feature-gated binaries build\nlet settings = Settings::get();\nassert!(!settings.cargo.binstall_only, \"feature-gated bins need cargo install\");","handlingStrategy":"fallback","validationCode":"# verify artifact contains expected binary before/after download\ntar -tzf artifact.tar.gz | grep -E '(^|/)mytool(\\.exe)?$'","typeGuard":null,"tryCatchPattern":"# shell\nmise install cargo:mytool@1.2 || mise settings set cargo.binstall_only false && mise install cargo:mytool@1.2","preventionTips":["Clear mise caches after upstream re-publishes a release","Match the artifact target triple to your host platform","Avoid binstall_only for crates needing feature-gated binaries"],"tags":["cargo","binstall","artifact","missing-file"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}