Skip to content

Commit 7d373fc

Browse files
cargo clone arceos-helloworld, then cargo xtask ... OK
1 parent fd34e88 commit 7d373fc

File tree

6 files changed

+33
-16
lines changed

6 files changed

+33
-16
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[alias]
2-
xtask = "run --manifest-path xtask/Cargo.toml --"
2+
xtask = "run --bin xtask --no-default-features --features xtask --"
33

44
[env]
55
AX_CONFIG_PATH = { value = ".axconfig.toml", relative = true }

Cargo.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "arceos-helloworld"
3-
version = "0.3.0"
3+
version = "0.4.1"
44
edition = "2024"
55
authors = ["Yuekai Jia <equation618@gmail.com>", "Yu Chen <yuchen@tsinghua.edu.cn>"]
66
description = "A simple helloworld crate (from crates.io) for ArceOS"
@@ -9,12 +9,29 @@ homepage = "https://github.com/arceos-org/app-helloworld"
99
repository = "https://github.com/arceos-org/app-helloworld/tree/dev"
1010
keywords = ["arceos", "example"]
1111
categories = ["os", "no-std"]
12+
include = [
13+
"src/**",
14+
"build.rs",
15+
"configs/**",
16+
"xtask/src/**",
17+
".cargo/config.toml",
18+
"rust-toolchain.toml",
19+
"README.md",
20+
"LICENSE*",
21+
]
1222

1323
[features]
1424
default = ["axstd"]
1525
axstd = ["dep:axstd"]
26+
xtask = ["dep:clap"]
27+
28+
[[bin]]
29+
name = "xtask"
30+
path = "xtask/src/main.rs"
31+
required-features = ["xtask"]
1632

1733
[dependencies]
1834
axstd = { version = "0.2.2-preview.1", features = ["defplat"], optional = true }
35+
clap = { version = "4", features = ["derive"], optional = true }
1936

2037
[profile.release]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ A standalone Hello World application running on [ArceOS](https://github.com/arce
5050
## Quick Start
5151

5252
```bash
53+
# install cargo-clone sub-command
54+
cargo install cargo-clone
55+
# get source code of arceos-helloworld crate from crates.io
56+
cargo clone arceos-helloworld
57+
# into crate dir
58+
cd arceos-helloworld
5359
# Build and run on RISC-V 64 QEMU (default)
5460
cargo xtask run
5561

rust-toolchain.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
profile = "minimal"
33
channel = "nightly-2025-12-12"
44
components = ["rust-src", "llvm-tools"]
5-
targets = ["riscv64gc-unknown-none-elf"]
5+
targets = [
6+
"riscv64gc-unknown-none-elf",
7+
"aarch64-unknown-none-softfloat",
8+
"x86_64-unknown-none",
9+
"loongarch64-unknown-none",
10+
]

xtask/Cargo.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

xtask/src/main.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,9 @@ fn arch_info(arch: &str) -> ArchInfo {
6666
}
6767
}
6868

69-
/// Locate the project root (parent of xtask/).
69+
/// Locate the project root.
7070
fn project_root() -> PathBuf {
71-
let xtask_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
72-
xtask_dir
73-
.parent()
74-
.expect("xtask must be inside the project directory")
75-
.to_path_buf()
71+
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
7672
}
7773

7874
/// Copy the architecture-specific axconfig to .axconfig.toml

0 commit comments

Comments
 (0)