Skip to content

Commit 66b1b47

Browse files
authored
build: vendor DADK v0.6.1 and install it from tools/dadk (#2472)
* chore: import DADK v0.6.1 into tools/dadk Vendor https://github.com/DragonOS-Community/DADK at 3c2246f2bb91ba9585652db99b11b8df74e07d8d so later installs can use this tree instead of a separate repository. Co-authored-by: Cursor <cursoragent@cursor.com> * build: install DADK from the vendored workspace Share installation and version checks between bootstrap, developer images, and Make. Exercise the vendored install and workspace tests in CI. Signed-off-by: longjin <longjin@dragonos.org> --------- Signed-off-by: longjin <longjin@dragonos.org>
1 parent 83b45ab commit 66b1b47

128 files changed

Lines changed: 19565 additions & 33 deletions

File tree

Some content is hidden

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

‎.github/workflows/dadk.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: DADK
2+
3+
on:
4+
push:
5+
branches: ["master", "feat-*", "fix-*"]
6+
paths:
7+
- "tools/dadk/**"
8+
- "tools/install-dadk.sh"
9+
- "tools/bootstrap.sh"
10+
- "tools/Dockerfile"
11+
- "tools/.dockerignore"
12+
- "user/Makefile"
13+
- ".github/workflows/dadk.yml"
14+
pull_request:
15+
branches: ["master", "feat-*", "fix-*"]
16+
paths:
17+
- "tools/dadk/**"
18+
- "tools/install-dadk.sh"
19+
- "tools/bootstrap.sh"
20+
- "tools/Dockerfile"
21+
- "tools/.dockerignore"
22+
- "user/Makefile"
23+
- ".github/workflows/dadk.yml"
24+
25+
jobs:
26+
build-test:
27+
name: Build, test, and format
28+
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
working-directory: tools/dadk
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Install native TLS build dependencies
36+
working-directory: .
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y --no-install-recommends libssl-dev pkg-config
40+
41+
- name: Install the vendored CLI
42+
run: |
43+
export CARGO_INSTALL_ROOT="$RUNNER_TEMP/dadk-install"
44+
export CARGO_TARGET_DIR="$PWD/target"
45+
export PATH="$CARGO_INSTALL_ROOT/bin:$PATH"
46+
make -C ../../user DADK="$CARGO_INSTALL_ROOT/bin/dadk" install_dadk
47+
make -C ../../user DADK="$CARGO_INSTALL_ROOT/bin/dadk" install_dadk
48+
49+
- name: Test
50+
run: cargo test --workspace --locked
51+
52+
- name: Check formatting
53+
run: cargo fmt --all --check

‎docs/userland/appdev/rust-quick-start.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-Ap
2626
```
2727

2828
4. Use `cargo run` to run the project.
29-
5. In the `user/dadk/config` directory of DragonOS, refer to the template [userapp_config.toml](https://github.com/DragonOS-Community/DADK/blob/main/dadk-config/templates/config/userapp_config.toml) to create a compilation configuration, and install it to the `/` directory of DragonOS.
29+
5. In the `user/dadk/config` directory of DragonOS, refer to the template `tools/dadk/dadk-config/templates/config/userapp_config.toml` to create a compilation configuration, and install it to the `/` directory of DragonOS.
3030
(When using the compilation command options of dadk, please use the `make install` configuration in the Makefile for compilation and installation)
3131
6. Compile DragonOS to install.
3232

‎docs/zh/userland/appdev/rust-quick-start.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-Ap
2626
```
2727

2828
4. 使用`cargo run`来运行项目
29-
5. 在DragonOS的`user/dadk/config`目录下,参考模版[userapp_config.toml](https://github.com/DragonOS-Community/DADK/blob/main/dadk-config/templates/config/userapp_config.toml),创建编译配置,安装到DragonOS的`/`目录下。
29+
5. 在DragonOS的`user/dadk/config`目录下,参考模版 `tools/dadk/dadk-config/templates/config/userapp_config.toml`,创建编译配置,安装到DragonOS的`/`目录下。
3030
(在dadk的编译命令选项处,请使用Makefile里面的`make install`配置进行编译、安装)
3131
6. 编译DragonOS即可安装
3232

‎tools/.dockerignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dadk/target
2+
dadk/docs/node_modules
3+
dadk/docs/.vuepress/dist

‎tools/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
members = [
33
"debugging/logmonitor",
44
]
5+
exclude = ["dadk"]
56

67
resolver = "2"

‎tools/Dockerfile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1111
# 设置工作目录
1212
WORKDIR /tmp
1313

14-
# 将本地的脚本复制到工作目录
14+
# 将本地的脚本和 dadk 源码复制到工作目录。
15+
# 安装脚本按自身位置寻找 ./dadk,安装结果写入 cargo bin。
1516
COPY *.sh ./
17+
COPY dadk /tmp/dadk
1618

1719
# 设置sudo免密码
1820
RUN apt update && \

‎tools/bootstrap.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ fi
689689
# 安装rust
690690
rustInstall
691691

692-
# 安装dadk
693-
cargo +nightly install --git https://git.mirrors.dragonos.org.cn/DragonOS-Community/DADK.git --tag v0.6.1 --locked || exit 1
692+
# 安装源码树自带的 DADK。
693+
bash "$(dirname -- "${BASH_SOURCE[0]}")/install-dadk.sh" || exit 1
694694

695695
bashpath=$(cd `dirname $0`; pwd)
696696

‎tools/dadk/.gitignore‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
5+
# These are backup files generated by rustfmt
6+
**/*.rs.bk
7+
8+
/run/
9+
10+
/bin
11+
/user

0 commit comments

Comments
 (0)