From 4213f2d329de42c3dbb399fd0a1486f110d42509 Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Thu, 28 Mar 2024 11:46:28 +0100 Subject: [PATCH] Stop holding on to the .dep file handle --- payload/reggae/backend/binary.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/payload/reggae/backend/binary.d b/payload/reggae/backend/binary.d index ecd9ef6c..e42a94ae 100644 --- a/payload/reggae/backend/binary.d +++ b/payload/reggae/backend/binary.d @@ -249,9 +249,14 @@ private: //Checks dependencies listed in the .dep file created by the compiler bool checkDeps(Target target, in string depFileName) @trusted { + import std.array: array; + // byLine splits at `\n`, so open Windows text files with CRLF line terminators in non-binary mode - auto file = File(depFileName, "r"); - auto lines = file.byLine.map!(a => a.to!string); + auto lines = File(depFileName, "r") + .byLine + .map!(a => a.to!string) + .array + ; auto dependencies = dependenciesFromFile(lines); if(anyNewer(options.projectPath, dependencies, target)) {