Skip to content

Commit 9dec0f3

Browse files
committed
Merge branch 'main' of https://github.com/arceos-org/arceos into arceos-main
2 parents a51ef37 + d51d602 commit 9dec0f3

File tree

191 files changed

+1970
-7973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+1970
-7973
lines changed

.github/workflows/actions/setup-musl/action.yml

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

.github/workflows/actions/setup-qemu/action.yml

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

.github/workflows/build.yml

Lines changed: 153 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
2222
- uses: Swatinem/rust-cache@v2
2323
with:
24+
shared-key: cargo-bin-cache
2425
cache-targets: false
2526
- name: Check rust version
2627
run: rustc --version --verbose
@@ -37,11 +38,10 @@ jobs:
3738
run: make clippy ARCH=${{ matrix.arch }}
3839

3940
build:
40-
runs-on: ${{ matrix.os }}
41+
runs-on: ubuntu-latest
4142
strategy:
4243
fail-fast: false
4344
matrix:
44-
os: [ubuntu-latest]
4545
arch: [x86_64, riscv64, aarch64, loongarch64]
4646
rust-toolchain: [nightly, nightly-2025-05-20]
4747
env:
@@ -55,8 +55,8 @@ jobs:
5555
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
5656
- uses: Swatinem/rust-cache@v2
5757
with:
58+
shared-key: cargo-bin-cache
5859
cache-targets: false
59-
- run: cargo install cargo-binutils
6060
- name: Build helloworld
6161
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
6262
run: make ARCH=${{ matrix.arch }} A=examples/helloworld
@@ -70,7 +70,7 @@ jobs:
7070
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
7171
run: make ARCH=${{ matrix.arch }} A=examples/shell
7272

73-
- uses: ./.github/workflows/actions/setup-musl
73+
- uses: arceos-org/setup-musl@v1
7474
with:
7575
arch: ${{ matrix.arch }}
7676
- name: Build helloworld-c
@@ -84,12 +84,13 @@ jobs:
8484
run: make ARCH=${{ matrix.arch }} A=examples/httpserver-c
8585

8686
build-for-other-platforms:
87-
runs-on: ${{ matrix.os }}
87+
runs-on: ubuntu-latest
8888
strategy:
8989
fail-fast: false
9090
matrix:
91-
os: [ubuntu-latest]
9291
rust-toolchain: [nightly, nightly-2025-05-20]
92+
env:
93+
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
9394
steps:
9495
- uses: actions/checkout@v4
9596
- uses: dtolnay/rust-toolchain@stable
@@ -99,50 +100,179 @@ jobs:
99100
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
100101
- uses: Swatinem/rust-cache@v2
101102
with:
103+
shared-key: cargo-bin-cache
102104
cache-targets: false
103-
- run: cargo install cargo-binutils
105+
106+
# Test various config files
104107
- name: Build helloworld for x86_64-pc-oslab
105108
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
106-
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld
109+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/helloworld
107110
- name: Build httpclient for x86_64-pc-oslab
108111
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
109-
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient FEATURES=page-alloc-4g,driver-ixgbe
112+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/httpclient FEATURES=page-alloc-4g,driver-ixgbe
110113
- name: Build httpserver for x86_64-pc-oslab
111114
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
112-
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver FEATURES=page-alloc-4g,driver-ixgbe
115+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/httpserver FEATURES=page-alloc-4g,driver-ixgbe
113116
- name: Build shell for x86_64-pc-oslab
114117
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
115-
run: make PLATFORM=x86_64-pc-oslab A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
118+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
116119

117-
- run: make PLATFORM=aarch64-raspi4 defconfig
120+
# Test app `helloworld-myplat` for various platforms
121+
- name: Build helloworld-myplat for x86-pc
122+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
123+
run: |
124+
make ARCH=x86_64 defconfig
125+
make ARCH=x86_64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=x86-pc
126+
make MYPLAT=axplat-x86-pc A=examples/helloworld-myplat SMP=4 APP_FEATURES=x86-pc
127+
- name: Build helloworld-myplat for aarch64-qemu-virt
128+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
129+
run: |
130+
make ARCH=aarch64 defconfig
131+
make ARCH=aarch64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=aarch64-qemu-virt
132+
make MYPLAT=axplat-aarch64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=aarch64-qemu-virt
133+
- name: Build helloworld-myplat for aarch64-raspi4
134+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
135+
run: |
136+
make MYPLAT=axplat-aarch64-raspi defconfig
137+
make MYPLAT=axplat-aarch64-raspi A=examples/helloworld-myplat APP_FEATURES=aarch64-raspi4
138+
- name: Build helloworld-myplat for aarch64-bsta1000b
139+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
140+
run: |
141+
make MYPLAT=axplat-aarch64-bsta1000b defconfig
142+
make MYPLAT=axplat-aarch64-bsta1000b A=examples/helloworld-myplat APP_FEATURES=aarch64-bsta1000b
143+
144+
- name: Build helloworld-myplat for aarch64-phytium-pi
145+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
146+
run: |
147+
make MYPLAT=axplat-aarch64-phytium-pi defconfig
148+
make MYPLAT=axplat-aarch64-phytium-pi A=examples/helloworld-myplat APP_FEATURES=aarch64-phytium-pi
149+
150+
- name: Build helloworld-myplat for loongarch64-qemu-virt
151+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
152+
run: |
153+
make ARCH=loongarch64 defconfig
154+
make ARCH=loongarch64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=loongarch64-qemu-virt
155+
make MYPLAT=axplat-loongarch64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=loongarch64-qemu-virt
156+
157+
- name: Build helloworld-myplat for riscv64-qemu-virt
158+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
159+
run: |
160+
make ARCH=riscv64 defconfig
161+
make ARCH=riscv64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=riscv64-qemu-virt
162+
make MYPLAT=axplat-riscv64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=riscv64-qemu-virt
163+
164+
165+
# Test platform `aarch64-raspi4` for various apps
166+
- name: Setup aarch64-raspi4
167+
run: |
168+
git checkout .
169+
make MYPLAT=axplat-aarch64-raspi defconfig
170+
cargo axplat add axplat-aarch64-raspi -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
171+
cargo axplat add axplat-aarch64-raspi -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
172+
echo "extern crate axplat_aarch64_raspi;" >> examples/helloworld/src/main.rs
173+
echo "extern crate axplat_aarch64_raspi;" >> examples/shell/src/main.rs
118174
- name: Build helloworld for aarch64-raspi4
119175
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
120-
run: make PLATFORM=aarch64-raspi4 SMP=4 A=examples/helloworld
176+
run: make MYPLAT=axplat-aarch64-raspi A=examples/helloworld
121177
- name: Build shell for aarch64-raspi4
122178
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
123-
run: make PLATFORM=aarch64-raspi4 SMP=4 A=examples/shell FEATURES=page-alloc-4g,driver-bcm2835-sdhci BUS=mmio
179+
run: make MYPLAT=axplat-aarch64-raspi A=examples/shell FEATURES=page-alloc-4g,driver-bcm2835-sdhci BUS=mmio
124180

125-
- run: make PLATFORM=aarch64-bsta1000b defconfig
181+
# Test platform `aarch64-bsta1000b` for various apps
182+
- name: Setup aarch64-bsta1000b
183+
run: |
184+
git checkout .
185+
make MYPLAT=axplat-aarch64-bsta1000b defconfig
186+
cargo axplat add axplat-aarch64-bsta1000b -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
187+
cargo axplat add axplat-aarch64-bsta1000b -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
188+
echo "extern crate axplat_aarch64_bsta1000b;" >> examples/helloworld/src/main.rs
189+
echo "extern crate axplat_aarch64_bsta1000b;" >> examples/shell/src/main.rs
126190
- name: Build helloworld for aarch64-bsta1000b
127191
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
128-
run: make PLATFORM=aarch64-bsta1000b A=examples/helloworld SMP=8
192+
run: make MYPLAT=axplat-aarch64-bsta1000b A=examples/helloworld
193+
- name: Build shell for aarch64-bsta1000b
194+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
195+
run: make MYPLAT=axplat-aarch64-bsta1000b A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk BUS=mmio
129196

130-
- run: make PLATFORM=aarch64-phytium-pi defconfig
197+
# Test platform `aarch64-phytium-pi` for various apps
198+
- name: Setup aarch64-phytium-pi
199+
run: |
200+
git checkout .
201+
make MYPLAT=axplat-aarch64-phytium-pi defconfig
202+
cargo axplat add axplat-aarch64-phytium-pi -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
203+
cargo axplat add axplat-aarch64-phytium-pi -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
204+
echo "extern crate axplat_aarch64_phytium_pi;" >> examples/helloworld/src/main.rs
205+
echo "extern crate axplat_aarch64_phytium_pi;" >> examples/shell/src/main.rs
131206
- name: Build helloworld for aarch64-phytium-pi
132207
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
133-
run: make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4
208+
run: make MYPLAT=axplat-aarch64-phytium-pi A=examples/helloworld
209+
- name: Build shell for aarch64-phytium-pi
210+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
211+
run: make MYPLAT=axplat-aarch64-phytium-pi A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk BUS=mmio
134212

135-
- uses: ./.github/workflows/actions/setup-musl
213+
# Test various config files for C apps
214+
- uses: arceos-org/setup-musl@v1
136215
with:
137216
arch: x86_64
138-
- run: make PLATFORM=x86_64-pc-oslab defconfig
217+
- name: Setup x86_64-pc-oslab for C apps
218+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml defconfig
139219
- name: Build helloworld-c for x86_64-pc-oslab
140220
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
141-
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld-c
221+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/helloworld-c
142222
- name: Build httpclient-c for x86_64-pc-oslab
143223
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
144-
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient-c FEATURES=page-alloc-4g,driver-ixgbe
224+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/httpclient-c FEATURES=page-alloc-4g,driver-ixgbe
145225
- name: Build httpserver-c for x86_64-pc-oslab
146226
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
147-
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver-c FEATURES=page-alloc-4g,driver-ixgbe
227+
run: make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml A=examples/httpserver-c FEATURES=page-alloc-4g,driver-ixgbe
148228

229+
# Necessary checks for macOS builds
230+
build-for-macos:
231+
runs-on: macos-latest
232+
strategy:
233+
fail-fast: false
234+
matrix:
235+
rust-toolchain: [nightly, nightly-2025-05-20]
236+
steps:
237+
- uses: actions/checkout@v4
238+
- uses: dtolnay/rust-toolchain@stable
239+
with:
240+
toolchain: ${{ matrix.rust-toolchain }}
241+
components: rust-src, clippy
242+
targets: x86_64-unknown-none
243+
- uses: Swatinem/rust-cache@v2
244+
with:
245+
shared-key: cargo-bin-cache
246+
cache-targets: false
247+
- name: Clippy for the default target
248+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
249+
run: make clippy
250+
251+
- run: cargo install cargo-binutils
252+
- name: Build helloworld
253+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
254+
run: make A=examples/helloworld
255+
256+
# Test for other platforms
257+
- run: make PLATFORM=x86_64-pc-oslab defconfig
258+
- name: Build helloworld for x86_64-pc-oslab
259+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
260+
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld
261+
- name: Build shell for x86_64-pc-oslab
262+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
263+
run: make PLATFORM=x86_64-pc-oslab A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
264+
265+
- run: make PLATFORM=aarch64-raspi4 defconfig
266+
- name: Build helloworld for aarch64-raspi4
267+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
268+
run: make PLATFORM=aarch64-raspi4 SMP=4 A=examples/helloworld
269+
270+
- run: make PLATFORM=aarch64-bsta1000b defconfig
271+
- name: Build helloworld for aarch64-bsta1000b
272+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
273+
run: make PLATFORM=aarch64-bsta1000b A=examples/helloworld SMP=8
274+
275+
- run: make PLATFORM=aarch64-phytium-pi defconfig
276+
- name: Build helloworld for aarch64-phytium-pi
277+
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
278+
run: make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4

.github/workflows/docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ env:
77

88
jobs:
99
doc:
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
1111
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest]
1214
fail-fast: false
1315
permissions:
1416
contents: write
@@ -21,12 +23,12 @@ jobs:
2123
toolchain: ${{ env.rust-toolchain }}
2224
- uses: Swatinem/rust-cache@v2
2325
with:
26+
shared-key: cargo-bin-cache
2427
cache-targets: false
2528
- name: Build docs
26-
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
27-
run: make doc_check_missing
29+
run: make doc_check_missing ARCH=${{ matrix.os == 'macos-latest' && 'aarch64' || 'x86_64' }}
2830
- name: Deploy to Github Pages
29-
if: ${{ github.ref == env.default-branch }}
31+
if: ${{ github.ref == env.default-branch && matrix.os == 'ubuntu-latest' }}
3032
uses: JamesIves/github-pages-deploy-action@v4
3133
with:
3234
single-commit: true

0 commit comments

Comments
 (0)