Transcode lockfiles without solving#

Use the lockfile fast path when an existing lockfile already contains every requested platform and the output is another lockfile format.

The examples use a pixi.lock previously written through conda-presto by conda-lockfiles’ pixi-lock-v6 exporter. Other lockfile versions require an installed conda environment-specifier plugin that supports them.

Transcode from the CLI#

Pass one input lockfile, its covered platforms, and a lockfile exporter:

conda presto \
  --file pixi.lock \
  --platform linux-64 \
  --platform osx-arm64 \
  --format conda-lock-v1 \
  > conda-lock.yml

The CLI reuses the parsed package records and does not invoke the solver only when all of these conditions hold:

  • exactly one input file is provided

  • that input is recognized as a lockfile

  • every requested platform is present

  • the output format is recognized as a lockfile

  • no inline specs are added

  • channels are not overridden

If those conditions do not hold, the normal CLI path may solve the combined request instead.

Transcode through the HTTP API#

The /transcode endpoint is stricter than the CLI. It rejects a request that would require a solve. Conda-presto’s compatibility path builds and serializes temporary package records inside the isolated parser process using only metadata already present in the upload. It does not fetch package archives:

export CONDA_PRESTO_URL=http://127.0.0.1:8000

curl --fail --silent --show-error \
  --data-binary @pixi.lock \
  --header 'Content-Type: application/yaml' \
  "$CONDA_PRESTO_URL/transcode?filename=pixi.lock&platform=linux-64&platform=osx-arm64&format=conda-lock-v1" \
  --output conda-lock.yml

Use filename when the media type does not identify the lockfile parser. The no-fetch path currently targets the conda-lock-v1 and rattler-lock-v6 exporters supplied by conda-lockfiles, including their aliases.

Note

The temporary compatibility path rejects source data it cannot carry through conda’s environment model without changing package selection or solver constraints. This can apply even when the source and target formats match. See POST /transcode for the exact rejection cases.

Diagnose a rejected transcode#

Remove --fail temporarily to inspect an HTTP 400 response. The reasons list identifies missing platforms, a non-lockfile input or output, or request fields that would require a solve.

Available lockfile exporters are listed in Output format reference. For a normal environment-to-lockfile solve, use Resolve from the CLI or Call the HTTP API.