Skip to content

Commit

Permalink
fix: Do not append empty recipePath to list of dependencies
Browse files Browse the repository at this point in the history
This can happen for single-file package, which do not have a recipePath,
leading (under the new path module) to always rebuilding.
  • Loading branch information
Geod24 committed Jan 2, 2025
1 parent 7cf262f commit 5a4fd0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/dub/generators/build.d
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,12 @@ class BuildGenerator : ProjectGenerator {
allfiles ~= buildsettings.stringImportFiles;
allfiles ~= buildsettings.extraDependencyFiles;
// TODO: add library files
foreach (p; packages)
allfiles ~= (p.recipePath != NativePath.init ? p : p.basePackage).recipePath.toNativeString();
foreach (p; packages) {
if (p.recipePath != NativePath.init)
allfiles ~= p.recipePath.toNativeString();
else if (p.basePackage.recipePath != NativePath.init)
allfiles ~= p.basePackage.recipePath.toNativeString();
}
foreach (f; additional_dep_files) allfiles ~= f.toNativeString();
bool checkSelectedVersions = !settings.single;
if (checkSelectedVersions && main_pack is m_project.rootPackage && m_project.rootPackage.getAllDependencies().length > 0)
Expand Down

0 comments on commit 5a4fd0c

Please sign in to comment.