feat: Support remote URLs in inject, fetch-file, and inspect commands - #2538
Draft
pavelzw wants to merge 4 commits into
Draft
feat: Support remote URLs in inject, fetch-file, and inspect commands#2538pavelzw wants to merge 4 commits into
pavelzw wants to merge 4 commits into
Conversation
Make the single-archive subcommands accept both local paths and remote URLs instead of only one or the other: - `inspect` and `fetch-file` now accept a local file path in addition to a URL, reading the requested member directly from the archive via `rattler_package_streaming::seek`. - `inject-into-prefix` now accepts remote URLs in addition to local paths. Remote archives are downloaded to a temporary directory, their package record is derived locally, and the shared package cache is pre-seeded so the installer does not download them a second time. The recorded URL is the original remote URL (file:// for local archives). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QkUDTwKbtUcLCwrnuzwYn5
baszalmstra
approved these changes
Jun 26, 2026
…ckage-support-d3oerk # Conflicts: # crates/rattler-bin/src/commands/fetch_file.rs # crates/rattler-bin/src/commands/inspect.rs
Resolves clippy::single_match_else on the local/remote branch in the inspect command's read_file helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QkUDTwKbtUcLCwrnuzwYn5
`Url::parse` parses a path like `C:\pkgs\foo.conda` as a URL with the single-character scheme `c`, so parse_remote_url misclassified Windows local paths as remote and tried to download them. This broke the inject tests on Windows and would mishandle real `C:\...` arguments to inject, inspect and fetch-file. Require a scheme longer than one character (alongside the existing file:// exclusion) so drive letters are treated as local paths. Adds a cross-platform unit test for the classification. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QkUDTwKbtUcLCwrnuzwYn5
Contributor
|
@pavelzw ready to undraft? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 yap
Description
Extends the
rattler-bincommands to accept remote URLs in addition to local file paths:injectcommand: Now accepts both local paths and remote URLs for conda package archives. Remote packages are downloaded to a temporary directory and their archives are cached to avoid re-downloading during installation.fetch-filecommand: Now accepts both local paths and remote URLs for conda packages when extracting files.inspectcommand: Now accepts both local paths and remote URLs for conda packages when reading metadata.The implementation includes:
parse_remote_url()helper function to distinguish between remote URLs and local paths (treatingfile://URLs as local)resolve_local_package()andresolve_remote_package()functions in the inject command to handle both casesdownload_archive()function that streams remote packages to diskrattler_package_streaming::seekAll three commands now have consistent behavior: they accept a
packageargument that can be either a local file path or a remote URL (http/https).How Has This Been Tested?
injectcommand tests continue to pass with local paths converted to stringsChecklist:
https://claude.ai/code/session_01QkUDTwKbtUcLCwrnuzwYn5
prompt:
In rattler bin Give me an overview of subcommands that only support local file system conda packages and which only support remote conda packages. Is it feasible to support both?
lets add url support to inject-into-prefix and local fs support for inspect + fetch-file