mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-09 05:16:47 +00:00
Check OSDK crate when running make check
This commit is contained in:
parent
951b2f98dd
commit
c7383ef23d
1
Makefile
1
Makefile
@ -163,6 +163,7 @@ format:
|
|||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: $(CARGO_OSDK)
|
check: $(CARGO_OSDK)
|
||||||
|
@cd osdk && cargo clippy -- -D warnings
|
||||||
@./tools/format_all.sh --check # Check Rust format issues
|
@./tools/format_all.sh --check # Check Rust format issues
|
||||||
@# Check if STD_CRATES and NOSTD_CRATES combined is the same as all workspace members
|
@# Check if STD_CRATES and NOSTD_CRATES combined is the same as all workspace members
|
||||||
@sed -n '/^\[workspace\]/,/^\[.*\]/{/members = \[/,/\]/p}' Cargo.toml | \
|
@sed -n '/^\[workspace\]/,/^\[.*\]/{/members = \[/,/\]/p}' Cargo.toml | \
|
||||||
|
@ -90,7 +90,7 @@ fn get_workspace_default_members() -> Vec<String> {
|
|||||||
.map(|value| {
|
.map(|value| {
|
||||||
// The default member is in the form of "<crate_name> <crate_version> (path+file://<crate_path>)"
|
// The default member is in the form of "<crate_name> <crate_version> (path+file://<crate_path>)"
|
||||||
let default_member = value.as_str().unwrap();
|
let default_member = value.as_str().unwrap();
|
||||||
let path = default_member.split(" ").nth(2).unwrap();
|
let path = default_member.split(' ').nth(2).unwrap();
|
||||||
path.trim_start_matches("(path+file://")
|
path.trim_start_matches("(path+file://")
|
||||||
.trim_end_matches(')')
|
.trim_end_matches(')')
|
||||||
.to_string()
|
.to_string()
|
||||||
|
@ -106,7 +106,7 @@ fn get_default_member(metadata: &serde_json::Value) -> &str {
|
|||||||
.iter()
|
.iter()
|
||||||
.filter(|package| {
|
.filter(|package| {
|
||||||
let id = package.get("id").unwrap();
|
let id = package.get("id").unwrap();
|
||||||
if !default_members.contains(&id) {
|
if !default_members.contains(id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ fn get_default_member(metadata: &serde_json::Value) -> &str {
|
|||||||
.collect()
|
.collect()
|
||||||
};
|
};
|
||||||
|
|
||||||
if packages.len() == 0 {
|
if packages.is_empty() {
|
||||||
error_msg!("OSDK requires there's at least one kernel package. Please navigate to the kernel package directory or the workspace root and run the command.");
|
error_msg!("OSDK requires there's at least one kernel package. Please navigate to the kernel package directory or the workspace root and run the command.");
|
||||||
std::process::exit(Errno::BuildCrate as _);
|
std::process::exit(Errno::BuildCrate as _);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user