Commit aa7d48d2 authored by Oliver Behnke's avatar Oliver Behnke

Merge branch 'master' into drupal-eah-albert

parents df72d969 0c9081d8
Pipeline #5307 failed with stages
......@@ -12,6 +12,9 @@
# Visual Studio 2015/2017 cache/options directory
.vs/
#Visual Studio Code options directory
.vscode/
# Installshield build directories
/win_build/installerv2/BOINC
/win_build/installerv2/BOINC_vbox
......
......@@ -37,7 +37,7 @@ env:
- BOINC_TYPE=manager
- BOINC_TYPE=libs-mingw
- BOINC_TYPE=apps-mingw
- BOINC_TYPE=integration-test
- BOINC_TYPE=unit-test
matrix:
fast_finish: true
......@@ -46,19 +46,35 @@ matrix:
os: linux
php: 7.0
env:
- BOINC_TYPE=unit-test
- BOINC_TYPE=integration-test
- language: cpp
os: osx
env: BOINC_TYPE=manager-osx
- language: android
env: BOINC_TYPE=client-android-arm
- language: android
env: BOINC_TYPE=client-android-arm64
- language: android
env: BOINC_TYPE=client-android-x86
- language: android
env: BOINC_TYPE=client-android-x86_64
- language: android
android:
components:
- build-tools-28.0.2
- android-26
- extra-google-m2repository
- extra-android-m2repository
env: BOINC_TYPE=manager-android
before_install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get -qq update ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get install freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libsqlite3-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get install -y freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libsqlite3-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 realpath ) fi
- if [[ "${BOINC_TYPE}" == "integration-test" ]]; then ( sudo apt-get install ansible/trusty-backports; sudo service mysql stop; ) fi
before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( ./_autosetup ) fi
- if [[ "${BOINC_TYPE}" == "integration-test" ]]; then ( ./integration_test/installTestSuite.sh ) fi
script:
- if [[ "${BOINC_TYPE}" == "libs" ]]; then ( ./configure --disable-server --disable-client --disable-manager && make ) fi
......@@ -70,6 +86,10 @@ script:
- if [[ "${BOINC_TYPE}" == "libs-mingw" ]]; then ( cd lib && MINGW=x86_64-w64-mingw32 make -f Makefile.mingw ) fi
- if [[ "${BOINC_TYPE}" == "apps-mingw" ]]; then ( cd lib && MINGW=x86_64-w64-mingw32 make -f Makefile.mingw wrapper ) fi
- if [[ "${BOINC_TYPE}" == "manager-osx" ]]; then ( ./3rdParty/buildMacDependencies.sh -q && ./mac_build/buildMacBOINC-CI.sh --no_shared_headers ) fi
- if [[ "${BOINC_TYPE}" == "manager-android" ]]; then ( /bin/true ) fi
- if [[ "${BOINC_TYPE}" == "client-android-arm" ]]; then ( cd android && ./buildAndroidBOINC-CI.sh --arch arm ) fi
- if [[ "${BOINC_TYPE}" == "client-android-arm64" ]]; then ( cd android && ./buildAndroidBOINC-CI.sh --arch arm64 ) fi
- if [[ "${BOINC_TYPE}" == "client-android-x86" ]]; then ( cd android && ./buildAndroidBOINC-CI.sh --arch x86 ) fi
- if [[ "${BOINC_TYPE}" == "client-android-x86_64" ]]; then ( cd android && ./buildAndroidBOINC-CI.sh --arch x86_64 ) fi
- if [[ "${BOINC_TYPE}" == "manager-android" ]]; then ( cd android/BOINC && ./gradlew assemble ) fi
- if [[ "${BOINC_TYPE}" == "unit-test" ]]; then ( /bin/true ) fi
- if [[ "${BOINC_TYPE}" == "integration-test" ]]; then ( /bin/true ) fi
- if [[ "${BOINC_TYPE}" == "integration-test" ]]; then ( ./integration_test/executeTestSuite.sh ) fi
This diff is collapsed.
......@@ -200,6 +200,7 @@
<string name="projects_add">新增專案</string>
<string name="projects_icon">專案圖示</string>
<string name="projects_credits">積分:</string>
<string name="projects_credits_host_and_user">%1$,d (裝置上) %2$,d (總計)</string>
<!--project status strings-->
<string name="projects_status_suspendedviagui">用戶已暫停</string>
<string name="projects_status_dontrequestmorework">拒絕新任務</string>
......@@ -333,9 +334,13 @@
<string name="about_name">BOINC</string>
<string name="about_version">版本</string>
<string name="about_name_long">柏克萊開放式網路運算平台</string>
<string name="about_copyright">\u00A9 2003–2018 美國加州大學柏克萊分校</string>
<string name="about_copyright_reserved">All Rights Reserved.</string>
<string name="about_credits">特別感謝 Max Planck Institute for Gravitational Physics, IBM Corporation 和 HTC Corporation 的技術支援。</string>
<!--notice notification e.g. New notice from SETI@HOME OR 3 new notices-->
<plurals name="notice_notification">
<item quantity="other">%2$,d 則新提醒</item>
</plurals>
<!--multi BOINC compatibility-->
<string name="nonexcl_dialog_header">偵測到志願運算 APP</string>
<string name="nonexcl_dialog_text">有其它志願運算 APP 正在此裝置執行。只容許一個版本執行。</string>
......
#!/bin/sh
set -e
# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2018 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# BOINC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#
export OPENSSL_VERSION=1.0.2p
export CURL_VERSION=7.61.0
export NDK_VERSION=17c
export ANDROID_HOME=$HOME/Android/Sdk
export NDK_ROOT=$HOME/Android/Ndk
export ANDROID_TC=$HOME/Android/Toolchains
# checks if a given path is canonical (absolute and does not contain relative links)
# from http://unix.stackexchange.com/a/256437
isPathCanonical() {
case "x$1" in
(x*/..|x*/../*|x../*|x*/.|x*/./*|x./*)
rc=1
;;
(x/*)
rc=0
;;
(*)
rc=1
;;
esac
return $rc
}
doclean=""
cache_dir=""
arch=""
while [ $# -gt 0 ]; do
key="$1"
case $key in
--cache_dir)
cache_dir="$2"
shift
;;
--build_dir)
build_dir="$2"
shift
;;
--clean)
doclean="yes"
;;
--arch)
arch="$2"
shift
;;
*)
echo "unrecognized option $key"
;;
esac
shift # past argument or value
done
if [ "x$cache_dir" != "x" ]; then
if isPathCanonical "$cache_dir" && [ "$cache_dir" != "/" ]; then
PREFIX="$cache_dir"
else
echo "cache_dir must be an absolute path without ./ or ../ in it"
exit 1
fi
else
cd ../
PREFIX="$(pwd)/3rdParty/buildCache/android-tc"
cd android/
fi
if [ "x$build_dir" != "x" ]; then
if isPathCanonical "$build_dir" && [ "$build_dir" != "/" ]; then
PREFIX="$build_dir"
else
echo "build_dir must be an absolute path without ./ or ../ in it"
exit 1
fi
else
cd ../
BUILD_DIR="$(pwd)/3rdParty/android"
cd android/
fi
mkdir -p "${PREFIX}"
mkdir -p "${BUILD_DIR}"
if [ "${doclean}" = "yes" ]; then
echo "cleaning cache"
rm -rf "${PREFIX}"
mkdir -p "${PREFIX}"
echo "cleaning build dir"
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
fi
export COMPILEOPENSSL="no"
OPENSSL_FLAGFILE="$PREFIX/openssl-${OPENSSL_VERSION}_done"
if [ ! -e "${OPENSSL_FLAGFILE}" ]; then
wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xzf /tmp/openssl.tgz --directory=$BUILD_DIR
export COMPILEOPENSSL="yes"
touch "${OPENSSL_FLAGFILE}"
fi
export OPENSSL_SRC=$BUILD_DIR/openssl-${OPENSSL_VERSION}
export COMPILECURL="no"
CURL_FLAGFILE="$PREFIX/curl-${CURL_VERSION}_done"
if [ ! -e "${CURL_FLAGFILE}" ]; then
wget -O /tmp/curl.tgz https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz
tar xzf /tmp/curl.tgz --directory=$BUILD_DIR
export COMPILECURL="yes"
touch "${CURL_FLAGFILE}"
fi
export CURL_SRC=$BUILD_DIR/curl-${CURL_VERSION}
export NDK_FLAGFILE="$PREFIX/NDK-${NDK_VERSION}-${arch}_done"
if [ ! -e "${NDK_FLAGFILE}" ]; then
rm -rf "${PREFIX}/${arch}"
wget -O /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip
unzip -qq /tmp/ndk.zip -d $HOME
touch "${NDK_FLAGFILE}"
fi
export NDK_ROOT=$HOME/android-ndk-r${NDK_VERSION}
export ANDROID_TC=$PREFIX
case "$arch" in
"arm")
./build_androidtc_arm.sh
./build_openssl_arm.sh
./build_curl_arm.sh
./build_boinc_arm.sh
exit 0
;;
"arm64")
./build_androidtc_arm64.sh
./build_openssl_arm64.sh
./build_curl_arm64.sh
./build_boinc_arm64.sh
exit 0
;;
"x86")
./build_androidtc_x86.sh
./build_openssl_x86.sh
./build_curl_x86.sh
./build_boinc_x86.sh
exit 0
;;
"x86_64")
./build_androidtc_x86_64.sh
./build_openssl_x86_64.sh
./build_curl_x86_64.sh
./build_boinc_x86_64.sh
exit 0
;;
esac
echo "unknown architecture: $arch"
exit 1
\ No newline at end of file
......@@ -11,5 +11,3 @@ set -e
./build_boinc_arm64.sh
./build_boinc_x86.sh
./build_boinc_x86_64.sh
./build_boinc_mips.sh
./build_boinc_mips64.sh
......@@ -7,7 +7,7 @@ set -e
# Script to compile Libcurl for Android
COMPILECURL="yes"
COMPILECURL="${COMPILECURL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_arm.sh
if [ -n "$COMPILECURL" ]; then
if [ "$COMPILECURL" = "yes" ]; then
echo "==================building curl from $CURL================================="
cd "$CURL"
if [ -n "$MAKECLEAN" ] && $(grep -q "^distclean:" "${CURL}/Makefile"); then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile Libcurl for Android
COMPILECURL="yes"
COMPILECURL="${COMPILECURL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_arm64.sh
if [ -n "$COMPILECURL" ]; then
if [ "$COMPILECURL" = "yes" ]; then
echo "==================building curl from $CURL================================="
cd "$CURL"
if [ -n "$MAKECLEAN" ] && $(grep -q "^distclean:" "${CURL}/Makefile"); then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile Libcurl for Android
COMPILECURL="yes"
COMPILECURL="${COMPILECURL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_x86.sh
if [ -n "$COMPILECURL" ]; then
if [ "$COMPILECURL" = "yes" ]; then
echo "==================building curl from $CURL================================="
cd "$CURL"
if [ -n "$MAKECLEAN" ] && $(grep -q "^distclean:" "${CURL}/Makefile"); then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile Libcurl for Android
COMPILECURL="yes"
COMPILECURL="${COMPILECURL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_x86_64.sh
if [ -n "$COMPILECURL" ]; then
if [ "$COMPILECURL" = "yes" ]; then
echo "==================building curl from $CURL================================="
cd "$CURL"
if [ -n "$MAKECLEAN" ] && $(grep -q "^distclean:" "${CURL}/Makefile"); then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile OpenSSL for Android
COMPILEOPENSSL="yes"
COMPILEOPENSSL="${COMPILEOPENSSL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_arm.sh
if [ -n "$COMPILEOPENSSL" ]; then
if [ "$COMPILEOPENSSL" = "yes" ]; then
echo "================building openssl from $OPENSSL============================="
cd "$OPENSSL"
if [ -n "$MAKECLEAN" ]; then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile OpenSSL for Android
COMPILEOPENSSL="yes"
COMPILEOPENSSL="${COMPILEOPENSSL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_arm64.sh
if [ -n "$COMPILEOPENSSL" ]; then
if [ "$COMPILEOPENSSL" = "yes" ]; then
echo "================building openssl from $OPENSSL============================="
cd "$OPENSSL"
if [ -n "$MAKECLEAN" ]; then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile OpenSSL for Android
COMPILEOPENSSL="yes"
COMPILEOPENSSL="${COMPILEOPENSSL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_x86.sh
if [ -n "$COMPILEOPENSSL" ]; then
if [ "$COMPILEOPENSSL" = "yes" ]; then
echo "================building openssl from $OPENSSL============================="
cd "$OPENSSL"
if [ -n "$MAKECLEAN" ]; then
......
......@@ -7,7 +7,7 @@ set -e
# Script to compile OpenSSL for Android
COMPILEOPENSSL="yes"
COMPILEOPENSSL="${COMPILEOPENSSL:-yes}"
CONFIGURE="yes"
MAKECLEAN="yes"
......@@ -32,7 +32,7 @@ export GDB_CFLAGS="--sysroot=$TCSYSROOT -Wall -g -I$TCINCLUDES/include"
# Prepare android toolchain and environment
./build_androidtc_x86_64.sh
if [ -n "$COMPILEOPENSSL" ]; then
if [ "$COMPILEOPENSSL" = "yes" ]; then
echo "================building openssl from $OPENSSL============================="
cd "$OPENSSL"
if [ -n "$MAKECLEAN" ]; then
......
......@@ -437,10 +437,10 @@ void LOOKUP_LOGIN_TOKEN_OP::handle_reply(int http_op_retval) {
msg_printf(NULL, MSG_INFO,
"Using account manager %s", pli->name.c_str()
);
strcpy(gstate.acct_mgr_info.project_name, pli->name.c_str());
strcpy(gstate.acct_mgr_info.master_url, pli->master_url.c_str());
strcpy(gstate.acct_mgr_info.user_name, user_name.c_str());
strcpy(gstate.acct_mgr_info.authenticator, authenticator.c_str());
safe_strcpy(gstate.acct_mgr_info.project_name, pli->name.c_str());
safe_strcpy(gstate.acct_mgr_info.master_url, pli->master_url.c_str());
safe_strcpy(gstate.acct_mgr_info.user_name, user_name.c_str());
safe_strcpy(gstate.acct_mgr_info.authenticator, authenticator.c_str());
gstate.acct_mgr_info.write_info();
} else {
msg_printf(NULL, MSG_INFO, "Attaching to project %s", pli->name.c_str());
......@@ -450,8 +450,8 @@ void LOOKUP_LOGIN_TOKEN_OP::handle_reply(int http_op_retval) {
);
PROJECT *p = gstate.lookup_project(pli->master_url.c_str());
if (p) {
strcpy(p->user_name, user_name.c_str());
strcpy(p->team_name, team_name.c_str());
safe_strcpy(p->user_name, user_name.c_str());
safe_strcpy(p->team_name, team_name.c_str());
xml_unescape(p->user_name);
xml_unescape(p->team_name);
}
......
......@@ -273,7 +273,7 @@ void ASYNC_VERIFY::error(int retval) {
}
int ASYNC_VERIFY::verify_chunk() {
int n;
size_t n;
unsigned char buf[BUFSIZE];
if (fip->download_gzipped) {
n = gzread(gzin, buf, BUFSIZE);
......@@ -287,23 +287,23 @@ int ASYNC_VERIFY::verify_chunk() {
finish();
return 1;
} else {
int m = (int)fwrite(buf, 1, n, out);
if (m != n) {
size_t m = fwrite(buf, 1, n, out);
if (m != n || ferror(out)) {
// write failed
//
error(ERR_FWRITE);
return 1;
}
md5_append(&md5_state, buf, n);
md5_append(&md5_state, buf, (int)n);
}
} else {
n = (int)fread(buf, 1, BUFSIZE, in);
if (n <= 0) {
n = fread(buf, 1, BUFSIZE, in);
if (!n || ferror(in)) {
fclose(in);
finish();
return 1;
} else {
md5_append(&md5_state, buf, n);
md5_append(&md5_state, buf, (int)n);
}
}
return 0;
......
......@@ -58,6 +58,7 @@
#ifdef _WIN32
#include "boinc_win.h"
#include "win_util.h"
#ifdef _MSC_VER
#define snprintf _snprintf
#define chdir _chdir
......@@ -66,6 +67,8 @@
#include "config.h"
#include <setjmp.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#endif
#include "coproc.h"
......@@ -595,6 +598,7 @@ int COPROCS::launch_child_process_to_detect_gpus() {
#else
int prog;
#endif
char quoted_client_path[MAXPATHLEN];
char quoted_data_dir[MAXPATHLEN+2];
char data_dir[MAXPATHLEN];
int retval = 0;
......@@ -612,25 +616,38 @@ int COPROCS::launch_child_process_to_detect_gpus() {
}
}
// use full path to exe if possible, otherwise keep using argv[0]
char execpath[MAXPATHLEN];
if (!get_real_executable_path(execpath, sizeof(execpath))) {
client_path = execpath;
}
boinc_getcwd(data_dir);
#ifdef _WIN32
strlcpy(quoted_client_path, "\"", sizeof(quoted_client_path));
strlcat(quoted_client_path, client_path, sizeof(quoted_client_path));
strlcat(quoted_client_path, "\"", sizeof(quoted_client_path));
strlcpy(quoted_data_dir, "\"", sizeof(quoted_data_dir));
strlcat(quoted_data_dir, data_dir, sizeof(quoted_data_dir));
strlcat(quoted_data_dir, "\"", sizeof(quoted_data_dir));
#else
strlcpy(quoted_client_path, client_path, sizeof(quoted_client_path));
strlcpy(quoted_data_dir, data_dir, sizeof(quoted_data_dir));
#endif
if (log_flags.coproc_debug) {
msg_printf(0, MSG_INFO,
"[coproc] launching child process at %s",
client_path
);
msg_printf(0, MSG_INFO,
"[coproc] relative to directory %s",
client_dir
quoted_client_path
);
if (!is_path_absolute(client_path)) {
msg_printf(0, MSG_INFO,
"[coproc] relative to directory %s",
client_dir
);
}
msg_printf(0, MSG_INFO,
"[coproc] with data directory %s",
quoted_data_dir
......@@ -639,15 +656,13 @@ int COPROCS::launch_child_process_to_detect_gpus() {
int argc = 4;
char* const argv[5] = {
const_cast<char *>(CLIENT_EXEC_FILENAME),
const_cast<char *>(quoted_client_path),
const_cast<char *>("--detect_gpus"),
const_cast<char *>("--dir"),
const_cast<char *>(quoted_data_dir),
NULL
};
chdir(client_dir);
retval = run_program(
client_dir,
client_path,
......@@ -657,8 +672,6 @@ int COPROCS::launch_child_process_to_detect_gpus() {
prog
);
chdir(data_dir);
if (retval) {
if (log_flags.coproc_debug) {