fix(rust): don't replace path deps if they are already in source

This commit is contained in:
Yusuf Bera Ertan 2022-08-16 02:47:38 +03:00
parent 9331fb1376
commit fcdb3dfa6b
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA

View File

@ -231,8 +231,18 @@ in {
value = dlib.sanitizeRelativePath "${package.relPath}/${dep.path}";
};
replacements = l.listToAttrs (l.map makeReplacement outsideDeps);
# filter out replacements which won't replace anything
# this means that the path doesn't need to be replaced because it's
# already in the source that we are building
filtered =
l.filterAttrs
(
n: v:
(l.removeSuffix "/" (l.removePrefix "./" n)) != v
)
replacements;
in
replacements;
filtered;
# find replacements for all packages we export
allPackageReplacements =
l.map