-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Feature request: pixi-unpack --from-extracted <dir> to run post-processing only
Problem
On Windows, when antivirus software is enabled, pixi-unpack can be very slow because it:
- Creates a system temp directory (
tempfile::tempdir()→ typically%TEMP%/%TMP%), which antivirus often scans. - Extracts the tar archive into that temp dir.
- Runs post-processing (validate metadata, create conda cache, install packages, write activation script) — all under that same temp path.
Plain tar extraction (e.g. with 7-zip or another tool) in a user-chosen directory is fast; the slowdown is largely from doing extraction and post-processing under a system temp path that is heavily monitored.
Proposed solution
Add a mode that skips tar extraction and uses an already-extracted pack directory as input. This allows callers to:
- Extract the tar with a fast method (e.g. Node
tar, 7-zip, or systemtar) into a directory they control (e.g. app-local, outside system temp). - Run pixi-unpack only for the post-processing step, with all I/O under that directory (or another app-local path).
Suggested interface
pixi-unpack --from-extracted <dir> -o <output_dir>
Behavior:
- Do not create a temp dir or unarchive anything.
- Treat
<dir>as the already-extracted pack root (same layout as aftertar -xf environment.tar:pixi-pack.json,channel/, optionalpypi/, etc.). - Run only:
- Validate metadata (
pixi-pack.json). - Create prefix: read repodata, build cache (e.g. under
<dir>/cacheor a configurable path), install conda packages intooutput_dir/env. - If present, install PyPI packages from
<dir>/pypi/. - Write
activate.sh/activate.batunderoutput_dir.
- Validate metadata (
The tar format and pack layout stay the same; this is purely a different “entry point” that assumes the tar has already been extracted.
Example usage (caller side)
# 1. Extract with any fast tool (e.g. tar, 7-zip, Node tar)
tar -xf env-win-64.tar -C .pixi-src
# 2. Run post-processing only
pixi-unpack --from-extracted .pixi-src -o .Benefits
- Performance on Windows: Avoids system temp for extraction; callers can extract to an app-local directory that antivirus may not scan as aggressively.
- Flexibility: Callers can choose their own extractor (e.g. for speed or to avoid touching system temp at all).
- Same format: The pack remains the same conda-packed tar; no change to how
pixi-packproduces it.
Possible implementation notes
- In
unpack.rs, the new code path would skiptempfile::tempdir()andunarchive(), and would setunpack_dir = PathBuf::from(<dir>)(and optionally keep cache under that dir or under-o). - The rest of the pipeline (validate metadata → create_prefix → install_pypi_packages → create_activation_script) can likely be reused as-is, with the only difference being the source of
unpack_dir.
Alternative names
--extract-tocould mean “extract the tar into this dir, then run post-processing there” (extract + post-process in one shot, but to a chosen path instead of system temp). That would also help with the antivirus issue. The request above is specifically “post-processing only” so that extraction can be done by an external tool.
Thank you for considering this feature.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels