Merge pull request #28 from birth-software/make-builders-compile

Fix builder not compiling
This commit is contained in:
David 2023-11-30 18:06:32 -06:00 committed by GitHub
commit a18564c8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1102,7 +1102,7 @@ pub fn compileModule(compilation: *Compilation, descriptor: Module.Descriptor) !
}{
.{
.name = "std",
.directory_path = try compilation.pathFromCwd(std_package_dir),
.directory_path = try compilation.pathFromCompiler(std_package_dir),
},
.{
.name = "builtin",
@ -1216,6 +1216,17 @@ pub fn compileModule(compilation: *Compilation, descriptor: Module.Descriptor) !
if (descriptor.transpile_to_c) {
try c_transpiler.initialize(compilation, module, descriptor);
if (descriptor.is_build) {
var process = std.ChildProcess.init(&.{descriptor.executable_path}, compilation.base_allocator);
switch (try process.spawnAndWait()) {
.Exited => |exit_code| {
if (exit_code != 0) {
@panic("Exited with errors");
}
},
else => @panic("Unexpected program state"),
}
}
} else {
unreachable;
// const ir = try intermediate_representation.initialize(compilation, module);