-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 把drstd换成musl
- Loading branch information
Showing
35 changed files
with
139 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
[build] | ||
target = "./x86_64-unknown-dragonos.json" | ||
|
||
[unstable] | ||
build-std = ["core", "compiler_builtins", "alloc"] | ||
build-std-features = ["compiler-builtins-mem"] | ||
|
||
[target.'cfg(target_os = "dragonos")'] | ||
rustflags = [ | ||
"-C", "target-feature=+crt-static", | ||
"-C", "link-arg=-no-pie", | ||
] | ||
target = "x86_64-unknown-linux-musl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,4 @@ jobs: | |
|
||
- name: Build check | ||
run: | | ||
make all -j $(nproc) | ||
make build-release -j $(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
Cargo.lock | ||
/DragonReach | ||
/install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,37 @@ | ||
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static | ||
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup | ||
# The toolchain we use. | ||
# You can get it by running DragonOS' `tools/bootstrap.sh` | ||
TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux-gnu" | ||
RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie" | ||
|
||
OUTPUT_DIR = $(DADK_BUILD_CACHE_DIR_DRAGONREACH_0_1_0) | ||
REACH_ETC_DIR=$(OUTPUT_DIR)/etc/reach | ||
REACH_BIN_DIR=$(OUTPUT_DIR)/bin/ | ||
TMP_INSTALL_DIR=$(OUTPUT_DIR)/tmp_install | ||
# 如果是在dadk中编译,那么安装到dadk的安装目录中 | ||
INSTALL_DIR?=$(DADK_CURRENT_BUILD_DIR) | ||
# 如果是在本地编译,那么安装到当前目录下的install目录中 | ||
INSTALL_DIR?=./install | ||
|
||
all: build | ||
|
||
build: | ||
@$(MAKE) -C ./systemctl build | ||
cargo +nightly-2023-08-15 -Z build-std=core,alloc,compiler_builtins build --target ./x86_64-unknown-dragonos.json --release | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build | ||
|
||
install: | ||
mkdir -p $(TMP_INSTALL_DIR) | ||
mkdir -p $(REACH_ETC_DIR) | ||
mkdir -p $(REACH_ETC_DIR)/system/ | ||
mkdir -p $(REACH_BIN_DIR) | ||
mkdir -p $(REACH_ETC_DIR)/ipc/ | ||
|
||
cp ./parse_test/shell.service $(REACH_ETC_DIR)/system/shell.service | ||
|
||
cargo +nightly-2023-08-15 -Z build-std=core,alloc,compiler_builtins install --target $(TARGET) --path . --root $(TMP_INSTALL_DIR) | ||
mv $(TMP_INSTALL_DIR)/bin/DragonReach $(REACH_BIN_DIR)/DragonReach | ||
|
||
cargo -Z build-std=core,alloc,compiler_builtins install --target $(TARGET) --path ./systemctl --root $(TMP_INSTALL_DIR) | ||
mv $(TMP_INSTALL_DIR)/bin/systemctl $(REACH_BIN_DIR)/systemctl | ||
|
||
rm -rf $(TMP_INSTALL_DIR) | ||
|
||
build-linux: | ||
@$(MAKE) -C ./systemctl build-linux | ||
cargo -Z build-std=core,alloc,compiler_builtins build --target x86_64-unknown-linux-gnu | ||
run-dragonreach: | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --bin DragonReach | ||
|
||
clean: | ||
cargo clean | ||
@$(MAKE) -C ./systemctl clean | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean | ||
|
||
build-release: | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build --release | ||
|
||
clean-release: | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --release | ||
|
||
fmt: | ||
cargo fmt | ||
@$(MAKE) -C ./systemctl fmt | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt | ||
|
||
fmt-check: | ||
cargo fmt --check | ||
@$(MAKE) -C ./systemctl fmt-check | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt --check | ||
|
||
check: | ||
cargo -Z build-std=core,alloc,compiler_builtins check --workspace --message-format=json --target ./x86_64-unknown-dragonos.json | ||
@$(MAKE) -C ./systemctl check | ||
.PHONY: install | ||
install: | ||
mkdir -p $(INSTALL_DIR)/etc/reach/system | ||
cp ./parse_test/shell.service $(INSTALL_DIR)/etc/reach/system/shell.service | ||
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) install --path . --no-track --root $(INSTALL_DIR) --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
pub mod parse_error; | ||
pub mod runtime_error; | ||
|
||
use std::string::String; | ||
|
||
pub trait ErrorFormat { | ||
fn error_format(&self) -> String; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.