Skip to content

downloadCargoPackageFromGit: use cargo package for creating the file list (resubmit)#976

Merged
ipetkov merged 6 commits intomasterfrom
fix/swap-rg-for-cargo-package
Feb 15, 2026
Merged

downloadCargoPackageFromGit: use cargo package for creating the file list (resubmit)#976
ipetkov merged 6 commits intomasterfrom
fix/swap-rg-for-cargo-package

Conversation

@ipetkov
Copy link
Owner

@ipetkov ipetkov commented Feb 15, 2026

Motivation

Fixes #962

Continuation of #975 but reopened here since I don't have push permissions to the upstream repo

One thing I noticed is that cargo package -l isn't exactly forthright with where the files come from. Or rather, it lists what files will end up in the packaged artifact, but not necessarily where they come from disk. For example, cargo seems to support inheriting a readme from the repo root, but locally (to the crate) the readme file might not be present.

So for now we'll handle this as gracefully as we can: ignore (but loudly warn) any such missing files and move on. Worst case downstream consumers can always patch git dependencies to put the files in the appropriate order if our heuristics aren't perfect

Checklist

  • added tests to verify new behavior
  • added an example template or updated an existing one
  • updated docs/API.md (or general documentation) with changes
  • updated CHANGELOG.md

vikanezrimaya and others added 6 commits February 12, 2026 02:50
…e list

This avoids pitfalls with `rg` misinterpreting include/exclude rules,
because it uses THE SAME logic `cargo` uses for .crate files.

Because it uses Cargo itself.

Issues with lock file generation are side-stepped by using
`--exclude-lockfile`, which I verified completely disables the check
that the lockfile is up-to-date.

Fixes #962
We already `cd` into the crate's subdirectory, so cargo implicitly knows
what crate we're operating on
We'll ignore any missing files anyway so we can simplify this check
@ipetkov ipetkov merged commit 4926f1a into master Feb 15, 2026
18 checks passed
@ipetkov ipetkov deleted the fix/swap-rg-for-cargo-package branch February 15, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect include/exclude behavior with git dependencies (doesn't match cargo package)

2 participants