{"record":{"id":"1ffb4f5dc77d2a23","repo":"astral-sh/uv","slug":"pip-compile-s-resolver-legacy-is-unsupported","errorCode":null,"errorMessage":"pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)","messagePattern":"pip-compile's `--resolver=legacy` is unsupported \\(uv always backtracks\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv-cli/src/compat.rs","lineNumber":97,"sourceCode":"        if self.reuse_hashes {\n            return Err(anyhow!(\n                \"pip-compile's `--reuse-hashes` is unsupported (uv doesn't reuse hashes)\"\n            ));\n        }\n\n        if self.no_reuse_hashes {\n            warn_user!(\"pip-compile's `--no-reuse-hashes` has no effect (uv doesn't reuse hashes)\");\n        }\n\n        if let Some(resolver) = self.resolver {\n            match resolver {\n                Resolver::Backtracking => {\n                    warn_user!(\n                        \"pip-compile's `--resolver=backtracking` has no effect (uv always backtracks)\"\n                    );\n                }\n                Resolver::Legacy => {\n                    return Err(anyhow!(\n                        \"pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)\"\n                    ));\n                }\n            }\n        }\n\n        if self.max_rounds.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--max-rounds` is unsupported (uv always resolves until convergence)\"\n            ));\n        }\n\n        if self.client_cert.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--client-cert` is unsupported (uv doesn't support dedicated client certificates)\"\n            ));\n        }\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-cli/src/compat.rs#L79-L115","documentation":"uv's pip-compile compatibility layer rejects flags whose behavior it cannot reproduce. pip-tools' `--resolver legacy` selects the old (pre-2020) legacy resolver; uv implements only the backtracking resolver and always uses it, so `PipCompileCompatArgs::validate()` returns an error for `Resolver::Legacy`. Passing `--resolver backtracking` only warns that it has no effect, because that matches uv's behavior.","triggerScenarios":"`uv pip compile --resolver legacy requirements.in`, or a pip-compile invocation copied into a Makefile/CI job and rerun with `uv pip compile` unchanged.","commonSituations":"Legacy pip-compile invocations pinned to the old resolver for reproducibility; migration to uv without pruning flags; scripts shared across teams where one member still uses pip-tools and another uv.","solutions":["Drop `--resolver legacy`; uv's backtracking resolver is the only mode.","If resolution differences are the concern, pin inputs (constraints, `--resolution lowest-direct`, lockfile) instead of the resolver mode.","Remove the equally-dead `--resolver backtracking` form too (it only warns) to keep scripts clean."],"exampleFix":"# before\nuv pip compile --resolver legacy requirements.in\n\n# after\nuv pip compile requirements.in","handlingStrategy":"validation","validationCode":"def sanitize_pip_compile_args(argv: list[str]) -> list[str]:\n    out = []\n    for arg in argv:\n        if arg in (\"--resolver\", \"--resolver=legacy\"):\n            raise ValueError(\"--resolver legacy has no uv equivalent; uv always backtracks\")\n        if arg == \"legacy\":  # value of --resolver\n            continue\n        out.append(arg)\n    return out","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep pipelines for `--resolver` before switching invocations to `uv pip compile`.","Encode resolver expectations in lockfiles/constraints, not resolver flags.","Note the asymmetry: `--resolver backtracking` warns, `--resolver legacy` errors — remove both."],"tags":["cli","pip-tools","compatibility","resolver","compile"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}