From b7c10c82c3951f399e9b59aa0c80f2f190a176de Mon Sep 17 00:00:00 2001 From: Masco Skray Date: Sat, 22 Sep 2018 00:42:01 +0800 Subject: [PATCH] feat(judge_client/1/uoj_judger): support new version of compilers in Ubuntu 18.04 The compilers are all updated in Ubuntu 18.04 basesystem. Add some defines for judger on compiling and replace web's display version to the real version. To support new compilers we must modify the syscall list to let them run properly, otherwise they will error with "Dangerous Syscalls". The Oracle JDK8 will read usagetracker profiles and record usage infomation, so disable it in order to not making junk files which may cause DGS. --- install/bundle/install.sh | 15 ++++- .../1/uoj_judger/run/run_program_conf.h | 59 +++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/install/bundle/install.sh b/install/bundle/install.sh index 8ca4ddd..0063a42 100644 --- a/install/bundle/install.sh +++ b/install/bundle/install.sh @@ -26,13 +26,17 @@ getOracleJDK(){ echo -e "\n\n==> Getting JDK runtime files" #Add judger user useradd -m local_main_judger && usermod -a -G www-data local_main_judger + #Set Oracle JDK do not track usage + mkdir -p /etc/oracle/java/ && echo 'com.oracle.usagetracker.track.last.usage=false' >/etc/oracle/java/usagetracker.properties #Get newest jdk dist file JDK_MIRROR_LINK=https://build.funtoo.org/distfiles/oracle-java/ #Deprecated #JDK_CNMIRROR_LINK=http://funtoo.neu.edu.cn/funtoo/distfiles/oracle-java/ curl -s ${JDK_MIRROR_LINK} | grep -oP '>jdk-[7,8].*-linux-x64.tar' | sed -e 's/[\",>]//g' -e 's/-linux-x64.tar//g' >jdkdist.list wget ${JDK_MIRROR_LINK}$(sed -n '1p' jdkdist.list)-linux-x64.tar.gz && wget ${JDK_MIRROR_LINK}$(sed -n '$p' jdkdist.list)-linux-x64.tar.gz - #Change jdk version to faq.php - sed -i -e "s/jdk-7u76/$(sed -n '1p' jdkdist.list)/g" -e "s/jdk-8u31/$(sed -n '$p' jdkdist.list)/g" ../../uoj/1/app/controllers/faq.php + #Change jdk and other environment version to faq.php + sed -i -e 's/Ubuntu Linux 14.04 LTS x64/Ubuntu Linux 18.04 LTS x64/' \ + -e 's/g++ 4.8.4/g++ 7.3.0/' -e 's/gcc 4.8.4/gcc 7.3.0/' -e 's/fpc 2.6.2/fpc 3.0.4/' -e 's/Python 2.7和3.4/Python 2.7和3.6/' \ + -e "s/jdk-7u76/$(sed -n '1p' jdkdist.list)/g" -e "s/jdk-8u31/$(sed -n '$p' jdkdist.list)/g" ../../uoj/1/app/controllers/faq.php #Move jdk file to judge user root chown local_main_judger jdkdist.list jdk-*-linux-x64.tar.gz mv jdkdist.list jdk-*-linux-x64.tar.gz /home/local_main_judger/ @@ -197,7 +201,12 @@ svn update /var/svn/judge_client/cur/judge_client --username root --password $_s ln -s /var/svn/judge_client/cur/judge_client/1 ~/judge_client ln -s /var/uoj_data ~/judge_client/uoj_judger/data cd ~/judge_client && chmod +x judge_client -echo '#define UOJ_WORK_PATH "/home/local_main_judger/judge_client/uoj_judger"' >uoj_judger/include/uoj_work_path.h +cat >uoj_judger/include/uoj_work_path.h <