An error occurred while fetching the assigned milestone of the selected merge_request.
HUST codebase improvement suggestions
9 unresolved threads
9 unresolved threads
Merge request reports
Activity
Filter activity
added code-style-improv toolset-improv labels
assigned to @root
- .gitlab-ci.yml 0 → 100644
10 - pacman -Sy && pacman -S --noconfirm gcc make bison flex gettext sdl2 lib32-glibc grep 11 - export AM_HOME=$(pwd)/nexus-am/ 12 - cd nemu && make EXTRA_FLAGS='-DDISABLE_MMIO' 13 - show_log=1 ./runall.sh &> testcases.log ; echo $? > testres.log 14 artifacts: 15 paths: 16 - nemu/testres.log 17 - nemu/testcases.log 18 expire_in: 1 week 19 20 test: 21 stage: test 22 script: 23 - test 0 = $(<nemu/testres.log) || cat nemu/testcases.log 24 - test 0 = $(<nemu/testres.log) 25 16 16 .DEFAULT_GOAL = app 17 17 18 18 # Compilation flags 19 CC = gcc 20 LD = gcc 19 CC ?= gcc 20 LD = $(CC) 注:这样允许学生自由的开关-Werror这个有争议的编译选项。https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
12 15 -@(echo "> $(1)" && echo $(STUID) && id -un && uname -a && uptime && (head -c 20 /dev/urandom | hexdump -v -e '"%02x"') && echo) | git commit -F - $(GITFLAGS) 13 16 -@sync 14 17 endef 18 19 define git_commit 20 -@echo Recolic helped you to prevent fucking junks! 21 endef 22 23 git_gen: 24 ifeq ($(M),) 25 @echo 'Usage: make git_gen M="Some message"' 26 @echo ' or: env M="Some message" make git_gen' 27 else 28 $(call git_commit_origin, "Manual commit: " $(M)) 29 endif 30 这里我禁用了每次make自动生成git commit,改为手动
make git_gen M="Implement more instructions!"
,老师可以按需求修改。如果确实有必要,可以不必采纳我的更改。Edited by Recolic
- nemu/runall.sh 100644 → 100755
31 38 echo -e "\033[1;32mPASS!\033[0m" 32 rm $logfile 33 39 else 34 40 echo -e "\033[1;31mFAIL!\033[0m see $logfile for more information" 41 has_fail=1 35 42 if (test -e $ori_log) then 36 43 echo -e "\n\n===== the original log.txt =====\n" >> $logfile 37 44 cat $ori_log >> $logfile 38 45 fi 46 head -n 512 $logfile >> $g_logfile 39 47 fi 48 rm -f $logfile 40 49 done 50 51 [[ $has_fail = 1 ]] && cat $g_logfile 52 exit $has_fail 6 11 [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit 7 12 [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit 8 13 echo "uploading public key..." 9 curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" https://dssl.cun.io/teach/api/uploads/pasetup 10 sleep 2 14 echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" 15 curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -v || 16 (echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' ; exit 2) 17 sleep 5 curl一定要检查是否成功。后面那些命令因为较少失败,我就没加检查。但反代用户curl经常失败,这个很有必要。(老师可以改一下报错信息,
Unable to upload to $hust_submit_server_host
之类的)Edited by Recolic
6 11 [ -z ${STUID} ] && echo "STUID must be set (RTFM)" && exit 7 12 [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit 8 13 echo "uploading public key..." 9 curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" https://dssl.cun.io/teach/api/uploads/pasetup 10 sleep 2 14 echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" 15 curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -v || 16 (echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' ; exit 2) 17 sleep 5 11 18 echo "recover from remote git..." 12 git remote add hustpa pa@dssl.cun.io:${STUID}-git 19 git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git" ssh反代。需要按这里的指导,设置
~/.ssh/config
。https://git.recolic.org/snippets/14