Skip to content

Commit f886c1f

Browse files
committed
Remove mentions of xbuild from error variants and code comments
1 parent 7e5f343 commit f886c1f

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/builder/error.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ pub enum BuildKernelError {
2929
)]
3030
XbuildNotFound,
3131

32-
/// Running `cargo xbuild` failed.
32+
/// Running `cargo build` failed.
3333
#[error("Kernel build failed.\nStderr: {}", String::from_utf8_lossy(.stderr))]
34-
XbuildFailed {
34+
BuildFailed {
3535
/// The standard error output.
3636
stderr: Vec<u8>,
3737
},
3838

39-
/// The output of `cargo xbuild --message-format=json` was not valid UTF-8
39+
/// The output of `cargo build --message-format=json` was not valid UTF-8
4040
#[error("Output of kernel build with --message-format=json is not valid UTF-8:\n{0}")]
41-
XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
42-
/// The output of `cargo xbuild --message-format=json` was not valid JSON
41+
BuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
42+
/// The output of `cargo build --message-format=json` was not valid JSON
4343
#[error("Output of kernel build with --message-format=json is not valid JSON:\n{0}")]
44-
XbuildJsonOutputInvalidJson(json::Error),
44+
BuildJsonOutputInvalidJson(json::Error),
4545
}
4646

4747
/// Represents an error that occurred when creating a bootimage.
@@ -59,7 +59,7 @@ pub enum CreateBootimageError {
5959
/// Building the bootloader failed
6060
#[error("Bootloader build failed.\nStderr: {}", String::from_utf8_lossy(.stderr))]
6161
BootloaderBuildFailed {
62-
/// The `cargo xbuild` output to standard error
62+
/// The `cargo build` output to standard error
6363
stderr: Vec<u8>,
6464
},
6565

@@ -76,12 +76,12 @@ pub enum CreateBootimageError {
7676
error: io::Error,
7777
},
7878

79-
/// The output of `cargo xbuild --message-format=json` was not valid UTF-8
79+
/// The output of `cargo build --message-format=json` was not valid UTF-8
8080
#[error("Output of bootloader build with --message-format=json is not valid UTF-8:\n{0}")]
81-
XbuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
82-
/// The output of `cargo xbuild --message-format=json` was not valid JSON
81+
BuildJsonOutputInvalidUtf8(std::string::FromUtf8Error),
82+
/// The output of `cargo build --message-format=json` was not valid JSON
8383
#[error("Output of bootloader build with --message-format=json is not valid JSON:\n{0}")]
84-
XbuildJsonOutputInvalidJson(json::Error),
84+
BuildJsonOutputInvalidJson(json::Error),
8585
}
8686

8787
/// There is something wrong with the bootloader dependency.

src/builder/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Builder {
3838
&self.manifest_path
3939
}
4040

41-
/// Builds the kernel by executing `cargo xbuild` with the given arguments.
41+
/// Builds the kernel by executing `cargo build` with the given arguments.
4242
///
4343
/// Returns a list of paths to all built executables. For crates with only a single binary,
4444
/// the returned list contains only a single element.
@@ -54,7 +54,7 @@ impl Builder {
5454
println!("Building kernel");
5555
}
5656

57-
// try to run cargo xbuild
57+
// try to build kernel
5858
let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_owned());
5959
let mut cmd = process::Command::new(&cargo);
6060
cmd.args(&config.build_command);
@@ -80,7 +80,7 @@ impl Builder {
8080
}
8181
}
8282
}
83-
return Err(BuildKernelError::XbuildFailed {
83+
return Err(BuildKernelError::BuildFailed {
8484
stderr: output.stderr,
8585
});
8686
}
@@ -95,17 +95,17 @@ impl Builder {
9595
error: err,
9696
})?;
9797
if !output.status.success() {
98-
return Err(BuildKernelError::XbuildFailed {
98+
return Err(BuildKernelError::BuildFailed {
9999
stderr: output.stderr,
100100
});
101101
}
102102
let mut executables = Vec::new();
103103
for line in String::from_utf8(output.stdout)
104-
.map_err(BuildKernelError::XbuildJsonOutputInvalidUtf8)?
104+
.map_err(BuildKernelError::BuildJsonOutputInvalidUtf8)?
105105
.lines()
106106
{
107107
let mut artifact =
108-
json::parse(line).map_err(BuildKernelError::XbuildJsonOutputInvalidJson)?;
108+
json::parse(line).map_err(BuildKernelError::BuildJsonOutputInvalidJson)?;
109109
if let Some(executable) = artifact["executable"].take_string() {
110110
executables.push(PathBuf::from(executable));
111111
}
@@ -165,11 +165,11 @@ impl Builder {
165165
}
166166
let mut bootloader_elf_path = None;
167167
for line in String::from_utf8(output.stdout)
168-
.map_err(CreateBootimageError::XbuildJsonOutputInvalidUtf8)?
168+
.map_err(CreateBootimageError::BuildJsonOutputInvalidUtf8)?
169169
.lines()
170170
{
171171
let mut artifact =
172-
json::parse(line).map_err(CreateBootimageError::XbuildJsonOutputInvalidJson)?;
172+
json::parse(line).map_err(CreateBootimageError::BuildJsonOutputInvalidJson)?;
173173
if let Some(executable) = artifact["executable"].take_string() {
174174
if bootloader_elf_path
175175
.replace(PathBuf::from(executable))

0 commit comments

Comments
 (0)