{"record":{"id":"0aaf672884af5a7a","repo":"DioxusLabs/dioxus","slug":"error-0aaf67","errorCode":null,"errorMessage":"{}\n{}","messagePattern":"\\{\\}\n\\{\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/cli/link.rs","lineNumber":159,"sourceCode":"        }\n\n        // Write the linker args to a file for the main process to read\n        // todo: we might need to encode these as escaped shell words in case newlines are passed\n        std::fs::write(&self.link_args_file, args.join(\"\\n\"))?;\n\n        // If there's a linker specified, we use that. Otherwise, we write a dummy object file to satisfy\n        // any post-processing steps that rustc does.\n        match self.linker {\n            Some(linker) => {\n                let mut cmd = std::process::Command::new(linker);\n                match cfg!(target_os = \"windows\") {\n                    true => cmd.arg(format!(\"@{}\", &self.link_args_file.display())),\n                    false => cmd.args(args),\n                };\n                let res = cmd.output().expect(\"Failed to run linker\");\n\n                if !res.status.success() {\n                    bail!(\n                        \"{}\\n{}\",\n                        String::from_utf8_lossy(&res.stdout),\n                        String::from_utf8_lossy(&res.stderr)\n                    );\n                }\n                if !res.stderr.is_empty() || !res.stdout.is_empty() {\n                    // Write linker warnings to file so that the main process can read them.\n                    _ = std::fs::create_dir_all(self.link_err_file.parent().unwrap());\n                    _ = std::fs::write(\n                        self.link_err_file,\n                        format!(\n                            \"Linker warnings: {}\\n{}\",\n                            String::from_utf8_lossy(&res.stdout),\n                            String::from_utf8_lossy(&res.stderr)\n                        ),\n                    );\n                }\n            }","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/cli/link.rs#L141-L177","documentation":"Raised in run_link_inner (called from run) when the linker invocation or the surrounding link step produces two error payloads that are combined into a single bail with a `{}\\n{}` format. This is the generic failure exit of the custom-linker path — where linker args were written to a file and an external linker was executed — so the message content comes from the linker/subprocess errors themselves rather than a specific guard.","triggerScenarios":"Thrown at packages/cli/src/cli/link.rs:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The linker reported the two printed error lines. Read them and fix the underlying link problem."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}