Skip to content

Commit f7498cf

Browse files
committed
updates
1 parent 3a63a18 commit f7498cf

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

build.zig

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,11 @@ fn addGlibcCheck(
862862
return glibc_check_step;
863863
}
864864

865-
const repo_path = requireRepoPath(b, "dep" ++ std.fs.path.sep_str ++ "glibc-testsuite");
865+
const repo_rel_path = "dep" ++ std.fs.path.sep_str ++ "glibc-testsuite";
866+
const repo_path = findRepoPath(b, repo_rel_path) orelse {
867+
glibc_check_step.dependOn(MissingRepoStep.create(b, "missing glibc-testsuite dependency", repo_rel_path));
868+
return glibc_check_step;
869+
};
866870

867871
inline for (.{ "io/tst-getcwd.c", "libio/test-fmemopen.c", "malloc/tst-malloc.c", "rt/tst-clock.c" }) |src| {
868872
const name = b.fmt("glibc-check-{s}", .{std.mem.replaceOwned(u8, b.allocator, src, "/", "-") catch unreachable});
@@ -898,7 +902,11 @@ fn addPosixTestSuite(
898902
return posix_test_suite_step;
899903
}
900904

901-
const repo_path = requireRepoPath(b, "dep" ++ std.fs.path.sep_str ++ "open_posix_testsuite");
905+
const repo_rel_path = "dep" ++ std.fs.path.sep_str ++ "open_posix_testsuite";
906+
const repo_path = findRepoPath(b, repo_rel_path) orelse {
907+
posix_test_suite_step.dependOn(MissingRepoStep.create(b, "missing open_posix_testsuite dependency", repo_rel_path));
908+
return posix_test_suite_step;
909+
};
902910
const include_path = b.pathJoin(&.{ repo_path, "include" });
903911

904912
inline for (.{"conformance/interfaces/clock_gettime/1-1.c"}) |src| {
@@ -944,7 +952,11 @@ fn addAustinGroupTests(
944952
return austin_group_tests_step;
945953
}
946954

947-
const repo_path = requireRepoPath(b, "dep" ++ std.fs.path.sep_str ++ "libc-test");
955+
const repo_rel_path = "dep" ++ std.fs.path.sep_str ++ "libc-test";
956+
const repo_path = findRepoPath(b, repo_rel_path) orelse {
957+
austin_group_tests_step.dependOn(MissingRepoStep.create(b, "missing libc-test dependency", repo_rel_path));
958+
return austin_group_tests_step;
959+
};
948960
const common_inc_path = b.pathJoin(&.{ repo_path, "src", "common" });
949961
const common_src = &[_][]const u8{
950962
b.pathJoin(&.{ repo_path, "src", "common", "print.c" }),
@@ -987,8 +999,12 @@ fn addLibcTest(
987999
zig_start: *std.Build.Step.Compile,
9881000
libc_only_posix: *std.Build.Step.Compile,
9891001
) *std.Build.Step {
990-
const libc_test_path = requireRepoPath(b, "dep" ++ std.fs.path.sep_str ++ "libc-test");
9911002
const libc_test_step = b.step("libc-test", "run tests from the libc-test project");
1003+
const repo_rel_path = "dep" ++ std.fs.path.sep_str ++ "libc-test";
1004+
const libc_test_path = findRepoPath(b, repo_rel_path) orelse {
1005+
libc_test_step.dependOn(MissingRepoStep.create(b, "missing libc-test dependency", repo_rel_path));
1006+
return libc_test_step;
1007+
};
9921008

9931009
// inttypes
9941010
inline for (.{ "assert", "ctype", "errno", "main", "stdbool", "stddef", "string" }) |name| {
@@ -1056,7 +1072,11 @@ fn addTinyRegexCTests(
10561072
// harness instead of changing libc runtime behavior.
10571073
return re_step;
10581074
}
1059-
const repo_path = requireRepoPath(b, "dep" ++ std.fs.path.sep_str ++ "tiny-regex-c");
1075+
const repo_rel_path = "dep" ++ std.fs.path.sep_str ++ "tiny-regex-c";
1076+
const repo_path = findRepoPath(b, repo_rel_path) orelse {
1077+
re_step.dependOn(MissingRepoStep.create(b, "missing tiny-regex-c dependency", repo_rel_path));
1078+
return re_step;
1079+
};
10601080
inline for (&[_][]const u8{ "test1", "test3" }) |test_name| {
10611081
const exe = addExecutableCompat(b, .{
10621082
.name = "re" ++ test_name,

0 commit comments

Comments
 (0)