{"record":{"id":"edcae61fa11bdf11","repo":"rust-lang/rust","slug":"unknown-compression-format","errorCode":null,"errorMessage":"unknown compression format: {}","messagePattern":"unknown compression format: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/rust-installer/src/compression.rs","lineNumber":143,"sourceCode":"            CompressionFormat::Xz => Box::new(XzDecoder::new(file)),\n        })\n    }\n}\n\n/// This struct wraps Vec<CompressionFormat> in order to parse the value from the command line.\n#[derive(Debug, Clone)]\npub struct CompressionFormats(Vec<CompressionFormat>);\n\nimpl TryFrom<&'_ str> for CompressionFormats {\n    type Error = Error;\n\n    fn try_from(value: &str) -> Result<Self, Self::Error> {\n        let mut parsed = Vec::new();\n        for format in value.split(',') {\n            match format.trim() {\n                \"gz\" => parsed.push(CompressionFormat::Gz),\n                \"xz\" => parsed.push(CompressionFormat::Xz),\n                other => anyhow::bail!(\"unknown compression format: {}\", other),\n            }\n        }\n        Ok(CompressionFormats(parsed))\n    }\n}\n\nimpl FromStr for CompressionFormats {\n    type Err = Error;\n\n    fn from_str(value: &str) -> Result<Self, Self::Err> {\n        Self::try_from(value)\n    }\n}\n\nimpl fmt::Display for CompressionFormats {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        for (i, format) in self.iter().enumerate() {\n            if i != 0 {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/rust-installer/src/compression.rs#L125-L161","documentation":"Thrown by CompressionFormats::try_from<&str> in the rust-installer compression module. The parser splits the input by commas and accepts only \"gz\" and \"xz\" per element (compression.rs:137-147). Any unrecognized token becomes {other} and triggers this bail. CompressionFormats determines which compressed tarballs are produced by the Tarballer.","triggerScenarios":"Setting the compression_formats field (via CLI --compression-formats or actor! arg) to a comma-separated list containing an unsupported format token. Examples: \"gz,bz2\", \"zst\", \"gzip,xz\" (must be \"gz\" not \"gzip\"), or an empty element from a trailing comma.","commonSituations":"Using full algorithm names (\"gzip\", \"bzip2\") instead of the short forms (\"gz\", \"xz\"); trailing comma producing an empty token; requesting zstd support that does not exist in this tool.","solutions":["Use only the short tokens gz and xz, separated by commas — e.g., \"gz,xz\" (the default) or \"xz\" only.","Check for trailing/leading commas or extra whitespace that produces an empty token.","If you need a new format, extend CompressionFormats::try_from and CompressionFormat with the new variant, encoder, and decoder."],"exampleFix":"# before\n--compression-formats gzip,bzip2\n# after\n--compression-formats gz,xz","handlingStrategy":"validation","validationCode":"// Validate each format token in the comma-separated list.\nfn validate_compression_formats(formats: &str) -> Result<(), String> {\n    for token in formats.split(',') {\n        let token = token.trim();\n        match token {\n            \"gz\" | \"xz\" => {}\n            \"\" => return Err(\"empty format token (check for trailing commas)\".into()),\n            other => return Err(format!(\"unknown compression format '{}': only 'gz' and 'xz' are supported\", other)),\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use short tokens gz and xz — not gzip, bzip2, or zstd.","Avoid trailing commas in the comma-separated list.","Default is 'gz,xz' which produces both formats."],"tags":["rust-installer","compression","config","cli"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}