From 5e7e3be60ae918c55c869a6df1fa95fd956165fc Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Thu, 14 Dec 2023 10:56:30 -0800 Subject: [PATCH] build: use dedicated strings for conformance test keys This uses separate strings for the keys for the conformance tests versus just deriving them from the sliced path. This fixed an issue for me where a few of the tests were showing up as InvalidConformance (notably the "blocks" test), even though, oddly enough, the key/value entries do appear to be there (e.g. if you iterated over them). I did notice, though, that we currently sliced the key from the file entry of the directory iterator, which is closed at the end of conformanceSteps. --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 730a09793..a17e09831 100644 --- a/build.zig +++ b/build.zig @@ -929,7 +929,7 @@ fn conformanceSteps( if (index == 0) continue; // Name of the conformance app and full path to the entrypoint. - const name = entry.name[0..index]; + const name = try b.allocator.dupe(u8, entry.name[0..index]); const path = try fs.path.join(b.allocator, &[_][]const u8{ c_dir_path, entry.name,