From e94a06ac294bd3110e66ac2691343c6c9b889fc1 Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Fri, 2 Oct 2020 23:09:12 +0200 Subject: [PATCH] Build.zig: Skip copying files that are used internally by the compiler Before this it was trying to copy all the files from the zig-cache dir to the output dir, but in the current compiler architecture the cache dir is also used for internal compiler files. --- lib/std/build.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/std/build.zig b/lib/std/build.zig index c680e72710..6575e057e8 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -2331,6 +2331,14 @@ pub const LibExeObjStep = struct { var it = src_dir.iterate(); while (try it.next()) |entry| { + // The compiler can put these files into the same directory, but we don't + // want to copy them over. + if (mem.eql(u8, entry.name, "stage1.id") or + mem.eql(u8, entry.name, "llvm-ar.id") or + mem.eql(u8, entry.name, "libs.txt") or + mem.eql(u8, entry.name, "builtin.zig") or + mem.eql(u8, entry.name, "lld.id")) continue; + _ = try src_dir.updateFile(entry.name, dest_dir, entry.name, .{}); } } else {