update GitRepoStep to change to correct revision prior to updating submodules
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Emil Lerch 2022-03-09 17:30:48 -08:00
parent 8ccddaabb8
commit a1aae60a94
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -96,7 +96,9 @@ fn make(step: *std.build.Step) !void {
defer args.deinit(); defer args.deinit();
try args.append("git"); try args.append("git");
try args.append("clone"); try args.append("clone");
try args.append("--recurse-submodules"); // This is a bad idea, because we really want to get to the correct
// revision before we go updating submodules
// try args.append("--recurse-submodules");
try args.append(self.url); try args.append(self.url);
// TODO: clone it to a temporary location in case of failure // TODO: clone it to a temporary location in case of failure
// also, remove that temporary location before running // also, remove that temporary location before running
@ -116,6 +118,17 @@ fn make(step: *std.build.Step) !void {
"-b", "-b",
"fordep", "fordep",
}); });
// Now that we're on the correct revision, we can update submodules
try run(self.builder, &[_][]const u8{
"git",
"-C",
self.path,
"submodule",
"update",
"--init",
"--recursive",
});
}; };
try self.checkSha(); try self.checkSha();
@ -171,7 +184,7 @@ fn run(builder: *std.build.Builder, argv: []const []const u8) !void {
try writer.print("{s}\"{s}\"", .{ prefix, arg }); try writer.print("{s}\"{s}\"", .{ prefix, arg });
prefix = " "; prefix = " ";
} }
std.log.info("[RUN] {s}", .{msg.items}); std.log.debug("[RUN] {s}", .{msg.items});
} }
const child = try std.ChildProcess.init(argv, builder.allocator); const child = try std.ChildProcess.init(argv, builder.allocator);