Skip to content

Commit 49d98ad

Browse files
committed
2024S: build offline
1 parent 6d8ec83 commit 49d98ad

5 files changed

Lines changed: 23 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656
- name: Mirror + trigger CI
5757
uses: tkf2019/gitlab-mirror-and-ci-action@master
5858
with:
59-
args: "https://git.tsinghua.edu.cn/os-lab/2024s/public/rcore-tutorial-code"
59+
args: "https://git.tsinghua.edu.cn/os-lab/2024s/public/rcore-tutorial-code-2024s"
6060
env:
6161
GITLAB_HOSTNAME: "git.tsinghua.edu.cn"
6262
GITLAB_PROJECT_ID: "29091"
63-
GITLAB_PROJECT_NAME: "rcore-tutorial-code"
63+
GITLAB_PROJECT_NAME: "rcore-tutorial-code-2024s"
6464
GITLAB_PROJECT_TOKEN: ${{secrets.GITLAB_PROJECT_TOKEN}}
6565
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
6666
deploy:

.gitlab-ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ stages:
77
test-code-job:
88
stage: test
99
script:
10-
- git clone https://github.com/LearningOS/rCore-Tutorial-Checker-2024S.git ci-user
11-
- git clone https://github.com/LearningOS/rCore-Tutorial-Test-2024S.git ci-user/user
12-
- cd ci-user && make test CHAPTER=`echo $CI_COMMIT_REF_NAME | grep -oP 'ch\K[0-9]'` passwd=$BASE_TEST_TOKEN
10+
- git clone https://token:${RCORE_CHECKER_REPO_READ_TOKEN_2024S}@git.tsinghua.edu.cn/os-lab/2024s/ta/rcore-tutorial-checker-2024s.git ci-user
11+
- git clone https://token:${RCORE_TEST_REPO_READ_TOKEN_2024S}@git.tsinghua.edu.cn/os-lab/2024s/public/rcore-tutorial-test-2024s.git ci-user/user
12+
- cp -r $HOME/os-vendor os/vendor
13+
- cp -r $HOME/user-vendor ci-user/user/vendor
14+
- cd ci-user && make test CHAPTER=`echo $CI_COMMIT_REF_NAME | grep -oP 'ch\K[0-9]'` passwd=$BASE_TEST_TOKEN OFFLINE=1

Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ RUN rustup --version && \
7373
cargo --version && \
7474
rustc --version
7575

76-
# 3. Build env for labs
77-
# See os1/Makefile `env:` for example.
78-
# This avoids having to wait for these steps each time using a new container.
79-
RUN rustup target add riscv64gc-unknown-none-elf && \
80-
cargo install cargo-binutils --vers ~0.2 && \
81-
rustup component add rust-src && \
82-
rustup component add llvm-tools-preview
76+
# 2.3 Env
77+
RUN cargo install cargo-binutils; \
78+
rustup target add riscv64gc-unknown-none-elf; \
79+
rustup component add rust-src; \
80+
rustup component add llvm-tools-preview; \
81+
rustup component add rustfmt; \
82+
rustup component add clippy;
83+
84+
# 3. Cargo vendor
85+
WORKDIR ${HOME}
86+
COPY os/vendor ./os-vendor
87+
COPY user/vendor ./user-vendor
8388

8489
# Ready to go
8590
WORKDIR ${HOME}

os/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ bitflags = "1.2.1"
1111
buddy_system_allocator = "0.6"
1212
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
1313
log = "0.4"
14-
riscv = { git = "https://gitee.com/rcore-os/riscv", features = ["inline-asm"] }
14+
riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }
1515
xmas-elf = "0.7.0"

os/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MODE := release
44
KERNEL_ELF := target/$(TARGET)/$(MODE)/os
55
KERNEL_BIN := $(KERNEL_ELF).bin
66
DISASM_TMP := target/$(TARGET)/$(MODE)/asm
7+
OFFLINE :=
78

89
# BOARD
910
BOARD := qemu
@@ -32,10 +33,12 @@ DISASM ?= -x
3233
build: env $(KERNEL_BIN)
3334

3435
env:
36+
ifeq ($(OFFLINE),)
3537
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
3638
cargo install cargo-binutils
3739
rustup component add rust-src
3840
rustup component add llvm-tools-preview
41+
endif
3942

4043
$(KERNEL_BIN): kernel
4144
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

0 commit comments

Comments
 (0)