Skip to content

Commit 1733719

Browse files
committed
2024S: build offline
1 parent b80d52a commit 1733719

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitlab-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ test-code-job:
99
script:
1010
- git clone https://github.com/LearningOS/rCore-Tutorial-Checker-2024S.git ci-user
1111
- 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
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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,18 @@ RUN rustup --version && \
7373
cargo --version && \
7474
rustc --version
7575

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
88+
7689
# Ready to go
7790
WORKDIR ${HOME}

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)