Skip to content

Commit 90b1e19

Browse files
authored
feat: add xtask devspace command (#314)
* feat: add devspace management commands - Introduced `devspace` module for managing local development dependencies. - Added `start` and `stop` commands to the `devspace` functionality. - Updated `.cargo/config.toml` to include an alias for `xtask`. - Modified `.gitignore` to exclude `.devspace/` directory. - Added new dependencies in `Cargo.lock` and `xtask/Cargo.toml`. - Refactored `xtask/src/cargo.rs` and `xtask/src/image.rs` for improved code structure and readability. - Cleaned up unnecessary whitespace in various files. * refactor: simplify error messages and string formatting in devspace and image modules
1 parent 309c65f commit 90b1e19

File tree

11 files changed

+620
-94
lines changed

11 files changed

+620
-94
lines changed

.cargo/config.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# [patch."https://github.com/arceos-hypervisor/axvm.git".axvm]
2-
# path = "crates/axvm"
3-
41
[target.aarch64-unknown-none-softfloat]
52
rustflags = [
63
"-Clink-args=-no-pie",
@@ -20,3 +17,4 @@ rustflags = [
2017

2118
[alias]
2219
xtask = "run --package xtask --"
20+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ __pycache__/
3030
/crates/*
3131
!/crates/nop/
3232
!/crates/nop/**
33+
.devspace/
3334

3435
/Cargo.toml.bk
3536

.gitmodules

Whitespace-only changes.

modules/axconfig/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub mod devices {
3434
#[doc = " End PCI bus number."]
3535
pub const PCI_BUS_END: usize = 0xff;
3636
#[doc = " Base physical address of the PCIe ECAM space."]
37-
pub const PCI_ECAM_BASE: usize = 0xb000_0000 ;
37+
pub const PCI_ECAM_BASE: usize = 0xb000_0000;
3838
#[doc = " PCI device memory ranges."]
3939
pub const PCI_RANGES: &[(usize, usize)] = &[];
4040
#[doc = " Timer interrupt num (PPI, physical timer)."]
@@ -55,7 +55,7 @@ pub mod plat {
5555
#[doc = " Kernel address space size."]
5656
pub const KERNEL_ASPACE_SIZE: usize = 0x0000_7fff_ffff_f000;
5757
#[doc = " No need."]
58-
pub const KERNEL_BASE_PADDR: usize = 0x20_0000 ;
58+
pub const KERNEL_BASE_PADDR: usize = 0x20_0000;
5959
#[doc = " Base virtual address of the kernel image."]
6060
pub const KERNEL_BASE_VADDR: usize = 0xffff_8000_0020_0000;
6161
#[doc = " Offset of bus address and phys address. some boards, the bus address is"]

platform/x86-qemu-q35/src/mp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ core::arch::global_asm!(
1212
);
1313

1414
unsafe fn setup_startup_page(stack_top: PhysAddr) {
15-
unsafe extern "C" {
15+
unsafe extern {
1616
fn ap_entry32();
1717
fn ap_start();
1818
fn ap_end();

xtask/Cargo.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ version = "0.1.0"
88
anyhow = "1.0"
99
cargo_metadata = "0.23"
1010
chrono = "0.4"
11-
clap = { version = "4.4", features = ["derive"] }
11+
clap = {version = "4.4", features = ["derive"]}
1212
colored = "3"
13-
ostool = "0.8"
1413
jkconfig = "0.1"
14+
ostool = "0.8"
1515
reqwest = "0.12"
16-
schemars = { version = "1", features = ["derive"] }
17-
serde = { version = "1.0", features = ["derive"] }
16+
schemars = {version = "1", features = ["derive"]}
17+
serde = {version = "1.0", features = ["derive"]}
1818
serde_json = "1"
1919
sha2 = "0.10"
20-
tokio = { version = "1", features = ["full"] }
20+
tokio = {version = "1", features = ["full"]}
2121
toml.workspace = true
2222

23-
axvmconfig = { workspace = true, features = ["std"] }
24-
25-
23+
axvmconfig = {workspace = true, features = ["std"]}

xtask/src/cargo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::ctx::Context;
77
impl Context {
88
pub async fn run_qemu(&mut self, config_path: Option<PathBuf>) -> anyhow::Result<()> {
99
let build_config = self.load_config()?;
10-
10+
1111
let arch = if build_config.target.contains("aarch64") {
1212
Arch::Aarch64
1313
} else if build_config.target.contains("x86_64") {
@@ -18,7 +18,7 @@ impl Context {
1818
build_config.target
1919
));
2020
};
21-
21+
2222
let config_path = if let Some(path) = config_path {
2323
path
2424
} else {

0 commit comments

Comments
 (0)