Skip to content

Commit

Permalink
Update README.md and add the loader_app template
Browse files Browse the repository at this point in the history
  • Loading branch information
BeichenY1 committed Apr 17, 2024
1 parent 8ab91e2 commit 9edffaa
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruxgo"
version = "0.9.4"
version = "0.9.5"
edition = "2021"
authors = ["Zewei Yang <[email protected]>"]
description = "A Cargo-like build tool for building C and C++ applications"
Expand Down
44 changes: 10 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,37 @@
# Ruxgo

Ruxgo is a Cargo-like build tool for building C and C++ applications that relies solely on a Toml file.
Ruxgo is a Cargo-like build tool for building C/C++ applications that relies solely on a Toml file.

**To start using Ruxgo**, learn more at [The Ruxgo Book](https://ruxgo.syswonder.org/).
It is also a companion command-line tool for RuxOS and has the explicit aim of making it easy to build and manage your C/C++ applications.

🚧 Working In Progress.
**To start using Ruxgo**, learn more at [The Ruxgo Book](https://ruxgo.syswonder.org/).

## Installation

To build the `ruxgo` executable from source, you will first need to install Rust and Cargo. Follow the instructions on the [Rust installation page](https://www.rust-lang.org/tools/install). Ruxgo currently requires at least Rust version 1.74.

Once you have installed Rust, the following command can be used to build and install Ruxgo:
Ruxgo currently requires at least Rust version 1.75. You can install it with Cargo:

```sh
cargo install ruxgo
```

The version published to [crates.io](https://crates.io/) will ever so slightly be behind the version hosted on GitHub. If you need the latest version you can build the git version of ruxgo yourself.

```sh
cargo install --git https://github.com/syswonder/ruxgo.git ruxgo
```

## Usage

Write a `config_linux.toml` for linux and `config_win32.toml` for windows in the project directory.

You can then build the project with:
```console
ruxgo -b
```

Once built, you can execute the project via:
```console
ruxgo -r
```

For help:
```console
ruxgo --help
```

You can also configure the log level with the environment variable `"RUXGO_LOG_LEVEL"`, the default log level is "Info".
Ruxgo supports building self-developed applications to run on linux or windows platforms, and also supports assembling and building Unikernel-based RuxOS and running applications on it. You just need to Write a `config_linux.toml` for linux or `config_win32.toml` for windows in the project directory.

## Ruxgo-apps
The `ruxgo/apps/` directory places all the Toml files that have been tested, you can switch to either directory and follow the instructions to build the application.

The `ruxgo/apps/` directory places all the Toml files that have been tested, you can switch to either directory and follow the instructions to build the application. Currently, there are two ways to build an app:
- If you are developing your own application and want to build and run it, you can refer to the template to write a Toml file, then put it in your project directory, and use ruxgo to build and run it.

- If building locally, you'll need to download the apps source code and then use ruxgo to build and run it.
- If you want to build an already supported app on ruxos, you need to copy `config_<platform>.toml` from `ruxgo/apps/<name>/ruxos` into `ruxos/apps/c/<name>`, then refer to the instructions and use ruxgo to build and run it.

- If you want to build on ruxos, you need to copy `config_<platform>.toml` from `ruxgo/apps/<name>/ruxos` into `ruxos/apps/c/<name>`, then download the apps source code and use ruxgo to build and run it.
- If you have your own app executable and want to run it on RuxOS, you can refer to the template under `ruxgo/apps/loader_app` and configure your own, then use ruxgo to build and run it.

**Note:** Refer to the README.md in each app directory for details. The following applications are already supported:

* [x] [redis](apps/redis)
* [x] [sqlite3](apps/sqlite3)
* [x] [iperf](apps/iperf)
* [x] [loader_app](apps/loader_app)
* [x] helloworld
* [x] memtest
* [x] httpclient
Expand Down
15 changes: 15 additions & 0 deletions apps/loader_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Load your app executable to run on RuxOS

Inside this is a configuration template for loading your app executable, you just need to fill in your app path in the app field in [build].

To load and run your app executable, you first need to create your app directory under **`ruxos/apps/c/`**, then put your custom toml files into it, and then build and run with the following commands:

```bash
# Build and Run
ruxgo -b
ruxgo -r
```

**Note**:

The app executable needs to be compiled by musl.
22 changes: 22 additions & 0 deletions apps/loader_app/config_linux.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build]
compiler = "gcc"
# fill in your app path
app = "/your_app_path"

[os]
name = "ruxos"
services = ["alloc","fp_simd","irq","multitask","fs","net","pipe","epoll","poll","rtc","virtio-9p"]
ulib = "ruxmusl"

[os.platform]
name = "aarch64-qemu-virt"
smp = "1"
log = "info"

[os.platform.qemu]
memory = "256M"
net = "y"
v9p = "y"
v9p_path = "./rootfs"
# your app parameter config
args = ""
3 changes: 2 additions & 1 deletion doc/ruxgo_book/src/guide/builder_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

**[build]** 模块描述了编译器的类型。它包含 `compiler`

- `compiler`: 指定编译器类型,例如: "gcc"。
- `compiler`: 指定编译器类型,例如: "gcc"。
- `app`: 指定 app 可执行文件的路径。
2 changes: 1 addition & 1 deletion doc/ruxgo_book/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ruxgo 安装

要安装`ruxgo`可执行文件,您首先需要安装 Rust 和 Cargo。按照[Rust安装页面](https://www.rust-lang.org/tools/install)上的说明操作。Ruxgo 目前至少需要 Rust 1.74 版本。
要安装`ruxgo`可执行文件,您首先需要安装 Rust 和 Cargo。按照[Rust安装页面](https://www.rust-lang.org/tools/install)上的说明操作。Ruxgo 目前至少需要 Rust 1.75 版本。

一旦您安装了 Rust,就可以使用以下命令来构建和安装 Ruxgo:

Expand Down
4 changes: 3 additions & 1 deletion doc/ruxgo_book/src/introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 简介

[Ruxgo](https://github.com/syswonder/ruxgo) 是一个类似 Cargo 的构建工具,用于构建 C 和 C++ 应用程序。与传统的 Make 构建工具不同,Ruxgo 的构建过程仅依赖一个 Toml 文件,其摒弃了繁杂的语法和规则限制,使得编译过程回归到更为简洁的状态。如果你对 Makefile 感到疲倦,Ruxgo 绝对值得你尝试,它能让你的构建过程变得更加轻松和高效。
[Ruxgo](https://github.com/syswonder/ruxgo) 是一个类似 Cargo 的构建工具, 专用于构建 C/C++ 应用程序, 它只依赖于一个 Toml 文件。

它也是 [RuxOS](https://github.com/syswonder/ruxos) 的一个配套命令行工具, 其目标是简化 RuxOS 及其上 C/C++ 应用程序的组装构建和管理。
9 changes: 6 additions & 3 deletions doc/ruxgo_book/src/run_apps.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# 运行不同的app

`ruxgo/apps/`目录下放置了所有经过测试的 Toml 文件。目前,有两种方法构建应用程序:
`ruxgo/apps/`目录下放置了所有经过测试的 Toml 文件。

- 如果在本地构建,你只需要在`ruxgo/apps/<name>/local`目录下下载 app 的源代码,然后使用 ruxgo 构建并运行它
- 如果你正在开发自己的应用程序并希望构建和运行它,你可以参考模板写一个 Toml 文件,然后把它放在你的项目目录下,即可使用 ruxgo 来构建和运行它

- 如果在 RuxOS 上构建,你需要将`config_linux.toml``ruxgo/apps/<name>/ruxos`复制到`ruxos/apps/c/<name>`,然后下载 app 的源代码并使用 ruxgo 来构建并运行它。
- 如果你想在 RuxOS 上构建一个已经支持的应用程序,你需要将`config_linux.toml``ruxgo/apps/<name>/ruxos`复制到`ruxos/apps/c/<name>`,然后参考说明使用 ruxgo 构建并运行它。

- 如果你有自己的应用程序可执行文件,并希望在 RuxOS 上运行它,你可以参考`ruxgo/apps/loader_app`下的模板并配置你自己的 Toml 文件,然后使用 ruxgo 来构建和运行它。

**注:** 有关详细信息,请参阅每个 app 目录下的 README.md。以下应用程序已获支持:

* [x] [redis](https://github.com/syswonder/ruxgo/tree/master/apps/redis)
* [x] [sqlite3](https://github.com/syswonder/ruxgo/tree/master/apps/sqlite3)
* [x] [iperf](https://github.com/syswonder/ruxgo/tree/master/apps/iperf)
* [x] [loader_app](https://github.com/syswonder/ruxgo/tree/master/apps/loader_app)
* [x] helloworld
* [x] memtest
* [x] httpclient
Expand Down

0 comments on commit 9edffaa

Please sign in to comment.