astral-sh/uv · error · anyhow::Error
pip-compile's `--resolver=legacy` is unsupported (uv always
Error message
pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)
What it means
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.
Source
Thrown at crates/uv-cli/src/compat.rs:97
if self.reuse_hashes {
return Err(anyhow!(
"pip-compile's `--reuse-hashes` is unsupported (uv doesn't reuse hashes)"
));
}
if self.no_reuse_hashes {
warn_user!("pip-compile's `--no-reuse-hashes` has no effect (uv doesn't reuse hashes)");
}
if let Some(resolver) = self.resolver {
match resolver {
Resolver::Backtracking => {
warn_user!(
"pip-compile's `--resolver=backtracking` has no effect (uv always backtracks)"
);
}
Resolver::Legacy => {
return Err(anyhow!(
"pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)"
));
}
}
}
if self.max_rounds.is_some() {
return Err(anyhow!(
"pip-compile's `--max-rounds` is unsupported (uv always resolves until convergence)"
));
}
if self.client_cert.is_some() {
return Err(anyhow!(
"pip-compile's `--client-cert` is unsupported (uv doesn't support dedicated client certificates)"
));
}
View on GitHub (pinned to f1a42680ff)
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.
Example fix
# before uv pip compile --resolver legacy requirements.in # after uv pip compile requirements.in
Defensive patterns
Strategy: validation
Validate before calling
def sanitize_pip_compile_args(argv: list[str]) -> list[str]:
out = []
for arg in argv:
if arg in ("--resolver", "--resolver=legacy"):
raise ValueError("--resolver legacy has no uv equivalent; uv always backtracks")
if arg == "legacy": # value of --resolver
continue
out.append(arg)
return out Prevention
- 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.
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- pip-compile's `--max-rounds` is unsupported (uv always resol
- pip-compile's `--reuse-hashes` is unsupported (uv doesn't re
- pip-compile's `--client-cert` is unsupported (uv doesn't sup
- pip-compile's `--emit-trusted-host` is unsupported
- pip-compile's `--config` is unsupported (uv does not use a c
AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16).
Data as JSON: /api/errors/1ffb4f5dc77d2a23.
Report an issue: GitHub.