diff --git a/src/builder/error.rs b/src/builder/error.rs index 86e6e14..5c0cab1 100644 --- a/src/builder/error.rs +++ b/src/builder/error.rs @@ -29,19 +29,19 @@ pub enum BuildKernelError { )] XbuildNotFound, - /// Running `cargo xbuild` failed. + /// Running `cargo build` failed. #[error("Kernel build failed.\nStderr: {}", String::from_utf8_lossy(.stderr))] - XbuildFailed { + BuildFailed { /// The standard error output. stderr: Vec, }, - /// The output of `cargo xbuild --message-format=json` was not valid UTF-8 + /// The output of `cargo build --message-format=json` was not valid UTF-8 #[error("Output of kernel build with --message-format=json is not valid UTF-8:\n{0}")] - XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error), - /// The output of `cargo xbuild --message-format=json` was not valid JSON + BuildJsonOutputInvalidUtf8(std::string::FromUtf8Error), + /// The output of `cargo build --message-format=json` was not valid JSON #[error("Output of kernel build with --message-format=json is not valid JSON:\n{0}")] - XbuildJsonOutputInvalidJson(json::Error), + BuildJsonOutputInvalidJson(json::Error), } /// Represents an error that occurred when creating a bootimage. @@ -59,7 +59,7 @@ pub enum CreateBootimageError { /// Building the bootloader failed #[error("Bootloader build failed.\nStderr: {}", String::from_utf8_lossy(.stderr))] BootloaderBuildFailed { - /// The `cargo xbuild` output to standard error + /// The `cargo build` output to standard error stderr: Vec, }, @@ -76,12 +76,12 @@ pub enum CreateBootimageError { error: io::Error, }, - /// The output of `cargo xbuild --message-format=json` was not valid UTF-8 + /// The output of `cargo build --message-format=json` was not valid UTF-8 #[error("Output of bootloader build with --message-format=json is not valid UTF-8:\n{0}")] - XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error), - /// The output of `cargo xbuild --message-format=json` was not valid JSON + BuildJsonOutputInvalidUtf8(std::string::FromUtf8Error), + /// The output of `cargo build --message-format=json` was not valid JSON #[error("Output of bootloader build with --message-format=json is not valid JSON:\n{0}")] - XbuildJsonOutputInvalidJson(json::Error), + BuildJsonOutputInvalidJson(json::Error), } /// There is something wrong with the bootloader dependency. diff --git a/src/builder/mod.rs b/src/builder/mod.rs index 1474bfd..46e9361 100644 --- a/src/builder/mod.rs +++ b/src/builder/mod.rs @@ -38,7 +38,7 @@ impl Builder { &self.manifest_path } - /// Builds the kernel by executing `cargo xbuild` with the given arguments. + /// Builds the kernel by executing `cargo build` with the given arguments. /// /// Returns a list of paths to all built executables. For crates with only a single binary, /// the returned list contains only a single element. @@ -54,7 +54,7 @@ impl Builder { println!("Building kernel"); } - // try to run cargo xbuild + // try to build kernel let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_owned()); let mut cmd = process::Command::new(&cargo); cmd.args(&config.build_command); @@ -80,7 +80,7 @@ impl Builder { } } } - return Err(BuildKernelError::XbuildFailed { + return Err(BuildKernelError::BuildFailed { stderr: output.stderr, }); } @@ -95,17 +95,17 @@ impl Builder { error: err, })?; if !output.status.success() { - return Err(BuildKernelError::XbuildFailed { + return Err(BuildKernelError::BuildFailed { stderr: output.stderr, }); } let mut executables = Vec::new(); for line in String::from_utf8(output.stdout) - .map_err(BuildKernelError::XbuildJsonOutputInvalidUtf8)? + .map_err(BuildKernelError::BuildJsonOutputInvalidUtf8)? .lines() { let mut artifact = - json::parse(line).map_err(BuildKernelError::XbuildJsonOutputInvalidJson)?; + json::parse(line).map_err(BuildKernelError::BuildJsonOutputInvalidJson)?; if let Some(executable) = artifact["executable"].take_string() { executables.push(PathBuf::from(executable)); } @@ -165,11 +165,11 @@ impl Builder { } let mut bootloader_elf_path = None; for line in String::from_utf8(output.stdout) - .map_err(CreateBootimageError::XbuildJsonOutputInvalidUtf8)? + .map_err(CreateBootimageError::BuildJsonOutputInvalidUtf8)? .lines() { let mut artifact = - json::parse(line).map_err(CreateBootimageError::XbuildJsonOutputInvalidJson)?; + json::parse(line).map_err(CreateBootimageError::BuildJsonOutputInvalidJson)?; if let Some(executable) = artifact["executable"].take_string() { if bootloader_elf_path .replace(PathBuf::from(executable))