From 343512ee2fe5dfa5bdd397637f04c665027f9c27 Mon Sep 17 00:00:00 2001 From: fef Date: Sun, 28 May 2023 19:22:25 +0200 Subject: [PATCH] build: emit assembler messages as warnings --- build.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 8077a3f..5751abd 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +use std::path::PathBuf; use std::{env, ffi::OsStr, io, io::Write, path::Path, process::Command}; // We have to build stage 0 completely separately because it won't be part of @@ -10,7 +11,7 @@ fn main() { let stage0_srcs = ["src/boot/stage0.s"]; let stage0_objs = make.all(stage0_srcs); make.link(Some("config/stage0.ld"), stage0_objs, "stage0.elf"); - make.objcopy("stage0.elf", "mbr.bin"); + make.objcopy("stage0.elf", "stage0.bin"); make.end(); } @@ -187,9 +188,14 @@ impl Make { eprintln!(" {cmd:?}"); let output = cmd.output().expect("failed to execute assembler"); - self.stdout_raw(output.stdout.as_ref()); + let stderr = String::from_utf8(output.stderr).unwrap(); + for line in stderr.lines() { + if !line.is_empty() { + println!("cargo:warning={line}"); + } + } + if !output.status.success() { - self.stdout_raw(output.stderr.as_ref()); self.cmd_failed(&self.cmd_as, output.status.code()); } }