{"record":{"id":"0f161c1bc46bfc47","repo":"astral-sh/uv","slug":"pip-compile-s-emit-options-is-unsupported-try","errorCode":null,"errorMessage":"pip-compile's `--emit-options` is unsupported (try `--emit-build-options` instead)","messagePattern":"pip-compile's `--emit-options` is unsupported \\(try `--emit-build-options` instead\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv-cli/src/compat.rs","lineNumber":135,"sourceCode":"            return Err(anyhow!(\n                \"pip-compile's `--emit-trusted-host` is unsupported\"\n            ));\n        }\n\n        if self.no_emit_trusted_host {\n            warn_user!(\n                \"pip-compile's `--no-emit-trusted-host` has no effect (uv never emits trusted hosts)\"\n            );\n        }\n\n        if self.config.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--config` is unsupported (uv does not use a configuration file)\"\n            ));\n        }\n\n        if self.emit_options {\n            return Err(anyhow!(\n                \"pip-compile's `--emit-options` is unsupported (try `--emit-build-options` instead)\"\n            ));\n        }\n\n        if self.no_emit_options {\n            warn_user!(\"pip-compile's `--no-emit-options` has no effect (uv never emits options)\");\n        }\n\n        if self.pip_args.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--pip-args` is unsupported (try passing arguments to uv directly)\"\n            ));\n        }\n\n        Ok(())\n    }\n}\n","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-cli/src/compat.rs#L117-L153","documentation":"pip-compile's `--emit-options` writes global pip options (like `--index-url`) into the generated requirements file. uv splits this concept: it never emits arbitrary pip options, but it can emit build options via its own flag, so the compatibility validator rejects `--emit-options` with a pointer to `--emit-build-options`. The negated `--no-emit-options` only warns since uv never emits options anyway.","triggerScenarios":"`uv pip compile --emit-options requirements.in`; the error appears immediately during argument validation, before any network or resolution work.","commonSituations":"Pipelines that relied on the requirements file carrying its index-url to downstream `pip install -r` steps; migrations that copy the full pip-compile flag list into uv invocations.","solutions":["Replace `--emit-options` with `--emit-build-options` if you need build settings preserved in the output.","For index settings, pass them explicitly at install time (`uv pip sync --index-url ...`) or via `UV_INDEX_URL`, since uv will not write them into the file.","Remove the flag entirely if nothing downstream reads options from the requirements file."],"exampleFix":"# before\nuv pip compile --emit-options requirements.in\n\n# after\nuv pip compile --emit-build-options requirements.in","handlingStrategy":"validation","validationCode":"EMIT_FLAG_MAP = {\"--emit-options\": \"--emit-build-options\"}\n\ndef migrate_emit_flags(argv: list[str]) -> list[str]:\n    return [EMIT_FLAG_MAP.get(a, a) for a in argv]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide explicitly which metadata belongs in the lockfile; uv only emits build options.","Pass index configuration at install time (`--index-url`, UV_INDEX_URL) instead of expecting it inside requirements files.","Add a lint that runs `uv pip compile` in CI so flag mismatches fail the build, not production."],"tags":["cli","pip-tools","compatibility","compile","requirements"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}