{"record":{"id":"71fcd027c3669410","repo":"jdx/mise","slug":"install-from-exe","errorCode":null,"errorMessage":"install from exe","messagePattern":"install from exe","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/swift.rs","lineNumber":91,"sourceCode":"                tempdir_in(tv.install_path().parent().unwrap())?\n                    .path()\n                    .to_path_buf()\n            };\n            CmdLineRunner::new(pkgutil_path())\n                .arg(\"--expand-full\")\n                .arg(tarball_path)\n                .arg(&tmp)\n                .with_pr(ctx.pr.as_ref())\n                .env_values(tv.install_env())\n                .execute()?;\n            file::remove_all(tv.install_path())?;\n            file::rename(\n                tmp.join(format!(\"swift-{version}-RELEASE-osx-package.pkg\"))\n                    .join(\"Payload\"),\n                tv.install_path(),\n            )?;\n        } else if cfg!(windows) {\n            todo!(\"install from exe\");\n        } else {\n            file::untar(\n                tarball_path,\n                &tv.install_path(),\n                file::ExtractionFormat::TarGz,\n                &file::ExtractOptions {\n                    strip_components: 1,\n                    pr: Some(ctx.pr.as_ref()),\n                    ..Default::default()\n                },\n            )?;\n        }\n        Ok(())\n    }\n\n    fn symlink_bins(&self, tv: &ToolVersion) -> Result<()> {\n        let usr_bin = tv.install_path().join(\"usr\").join(\"bin\");\n        let bin_dir = tv.install_path().join(\"bin\");","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/plugins/core/swift.rs#L73-L109","documentation":"link_binary symlinks a staged binary from the Caskroom into the target bin directory. If the staged path is a symlink but not a file, mise reads the link target and bails when that target does not exist — i.e. the cask's flight steps staged a symlink whose destination was never extracted into the stage.","triggerScenarios":"A cask archive contains a symlink whose target was filtered out (e.g. under __MACOSX), renamed by a preflight step, or points outside the extracted set; relocation rewrote the symlink so it no longer resolves inside the Caskroom.","commonSituations":"Casks shipping relative symlinks to versioned files (libfoo.1 -> libfoo.1.2.3) where the real file landed elsewhere; upstream cask layout changes; partially extracted or interrupted prior installs leaving stale symlinks.","solutions":["Inspect the staged Caskroom directory (ls -la <prefix>/Caskroom/<token>/<version>/) and check what the dangling symlink points at","Clear the cask's Caskroom dir and cached archive, then reinstall so extraction re-runs cleanly","Compare with an install via upstream brew to see if the cask itself is broken","Report the cask token plus the symlink target to mise if metadata and archive disagree"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// after staging, before linking: verify the staged binary resolves\nif caskroom_binary.symlink_metadata().is_ok_and(|m| m.file_type().is_symlink()) {\n    let t = std::fs::read_link(&caskroom_binary)?;\n    if !t.exists() { /* repair or abort before link_binary */ }\n}","typeGuard":null,"tryCatchPattern":"match link_binary(&caskroom, &appdir, &binary) {\n    Err(e) if e.to_string().contains(\"symlink target\") => {\n        // stale stage: wipe and re-extract once, then retry\n        fs::remove_dir_all(&caskroom)?;\n    }\n    r => r?,\n}","preventionTips":["Treat interrupted installs as poison: remove the cask's Caskroom dir before reinstalling","When authoring flight steps, symlink only to files the same archive guarantees"],"tags":["rust","mise","brew-cask","symlink","staging"],"backgroundTag":"dangling-symlink","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}