vendorCargoDeps: handle unused patch dependencies (#581)

This commit is contained in:
Ivan Petkov 2024-04-07 10:45:14 -07:00 committed by GitHub
parent 1e44708c0b
commit b47c4078b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 1 deletions

View File

@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
* `inheritCargoArtifactsHook` and `installCargoArtifactsHook` now correctly
handle the case when `CARGO_TARGET_DIR` is set to a nested directory
* Dependency vendoring now correctly takes unused patch dependencies into
account
## [0.16.3] - 2024-03-19

View File

@ -50,3 +50,8 @@ dependencies = [
"num_cpus",
"rustversion",
]
[[patch.unused]]
name = "unicode-ident"
version = "1.0.12"
source = "git+https://github.com/dtolnay/unicode-ident.git?rev=a8736e7e62be959d87970d2d137a098ba533d78b#a8736e7e62be959d87970d2d137a098ba533d78b"

View File

@ -21,3 +21,8 @@ tag = "v1.13.1"
version = "*"
git = "https://github.com/dtolnay/rustversion.git"
rev = "2abd4d0e00db08bb91145cb88e5dcbad2f45bbcb"
# Intentionally unused patch dependency
# https://github.com/ipetkov/crane/issues/576
[patch.crates-io]
unicode-ident = { git = "https://github.com/dtolnay/unicode-ident.git", rev = "a8736e7e62be959d87970d2d137a098ba533d78b" }

View File

@ -49,7 +49,7 @@ let
allPackagesTrimmed = map
(l: map
(filterAttrs (k: _: allowedAttrs.${k} or false))
(l.package or [ ])
((l.package or [ ]) ++ (l.patch.unused or [ ]))
)
cargoLocksParsed;