Skip to content

Commit 38fd486

Browse files
committed
Check that the --kernel-manifest path points to a file named Cargo.toml
1 parent 3c1dfc4 commit 38fd486

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ mod binary {
204204
Err(env::VarError::NotUnicode(_)) => {
205205
panic!("The KERNEL_MANIFEST environment variable contains invalid unicode")
206206
}
207+
Ok(path)
208+
if Path::new(&path).file_name().and_then(|s| s.to_str()) != Some("Cargo.toml") =>
209+
{
210+
format!(
211+
"compile_error!(\"The given `--kernel-manifest` path `{}` does not \
212+
point to a `Cargo.toml`\")",
213+
path,
214+
)
215+
}
207216
Ok(path) => {
208217
println!("cargo:rerun-if-changed={}", path);
209218

0 commit comments

Comments
 (0)