| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 set -u | 6 set -u |
| 7 set -e | 7 set -e |
| 8 | 8 |
| 9 # On Windows, this script is invoked from a batch file. | 9 # On Windows, this script is invoked from a batch file. |
| 10 # The inherited PWD environmental variable is a Windows-style path. | 10 # The inherited PWD environmental variable is a Windows-style path. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 readonly BUILD_OS=$1 | 29 readonly BUILD_OS=$1 |
| 30 readonly BUILD_ARCH=$2 | 30 readonly BUILD_ARCH=$2 |
| 31 readonly BUILD_LIBMODE=$3 | 31 readonly BUILD_LIBMODE=$3 |
| 32 | 32 |
| 33 echo "*** STARTING PNACL BUILD ***" | 33 echo "*** STARTING PNACL BUILD ***" |
| 34 if [ "${BUILDBOT_BUILDERNAME:+isset}" == "isset" ]; then | 34 if [ "${BUILDBOT_BUILDERNAME:+isset}" == "isset" ]; then |
| 35 echo "*** BUILDBOT_BUILDERNAME: ${BUILDBOT_BUILDERNAME}" | 35 echo "*** BUILDBOT_BUILDERNAME: ${BUILDBOT_BUILDERNAME}" |
| 36 fi | 36 fi |
| 37 echo "*** ARGUMENTS : $*" | 37 echo "*** ARGUMENTS : $*" |
| 38 | 38 |
| 39 UTMAN="tools/llvm/utman.sh" | 39 PNACL_BUILD="pnacl/build.sh" |
| 40 UTMAN_TEST="tools/llvm/utman-test.sh" | 40 PNACL_TEST="pnacl/test.sh" |
| 41 | 41 |
| 42 # On some systems (e.g., windows 64-bit), we must build a 32-bit plugin | 42 # On some systems (e.g., windows 64-bit), we must build a 32-bit plugin |
| 43 # because the browser is 32-bit. Only sel_ldr and the nexes are 64-bit. | 43 # because the browser is 32-bit. Only sel_ldr and the nexes are 64-bit. |
| 44 BUILD_32BIT_PLUGIN=false | 44 BUILD_32BIT_PLUGIN=false |
| 45 | 45 |
| 46 case ${BUILD_OS}-${BUILD_ARCH}-${BUILD_LIBMODE} in | 46 case ${BUILD_OS}-${BUILD_ARCH}-${BUILD_LIBMODE} in |
| 47 linux-32-newlib) | 47 linux-32-newlib) |
| 48 # Don't test arm + 64-bit on 32-bit builder. | 48 # Don't test arm + 64-bit on 32-bit builder. |
| 49 # We can't build 64-bit trusted components on a 32-bit system. | 49 # We can't build 64-bit trusted components on a 32-bit system. |
| 50 # Arm disabled on 32-bit because it runs out of memory. | 50 # Arm disabled on 32-bit because it runs out of memory. |
| 51 TOOLCHAIN_LABEL=pnacl_linux_i686_newlib | 51 TOOLCHAIN_LABEL=pnacl_linux_i686_newlib |
| 52 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" | 52 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" |
| 53 ;; | 53 ;; |
| 54 linux-32-glibc) | 54 linux-32-glibc) |
| 55 TOOLCHAIN_LABEL=pnacl_linux_i686_glibc | 55 TOOLCHAIN_LABEL=pnacl_linux_i686_glibc |
| 56 UTMAN="tools/llvm/gutman.sh" | 56 PNACL_BUILD="pnacl/build-glibc.sh" |
| 57 # TODO(pdox): Determine which tests should be run. | 57 # TODO(pdox): Determine which tests should be run. |
| 58 RUN_TESTS="" | 58 RUN_TESTS="" |
| 59 ;; | 59 ;; |
| 60 linux-64-newlib) | 60 linux-64-newlib) |
| 61 TOOLCHAIN_LABEL=pnacl_linux_x86_64_newlib | 61 TOOLCHAIN_LABEL=pnacl_linux_x86_64_newlib |
| 62 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" | 62 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" |
| 63 RUN_TESTS+=" arm arm-pic arm-browser" | 63 RUN_TESTS+=" arm arm-pic arm-browser" |
| 64 RUN_TESTS+=" x86-64 x86-64-pic x86-64-browser" | 64 RUN_TESTS+=" x86-64 x86-64-pic x86-64-browser" |
| 65 ;; | 65 ;; |
| 66 linux-64-glibc) | 66 linux-64-glibc) |
| 67 TOOLCHAIN_LABEL=pnacl_linux_x86_64_glibc | 67 TOOLCHAIN_LABEL=pnacl_linux_x86_64_glibc |
| 68 UTMAN="tools/llvm/gutman.sh" | 68 PNACL_BUILD="pnacl/build-glibc.sh" |
| 69 RUN_TESTS="" | 69 RUN_TESTS="" |
| 70 RUN_TESTS="x86-32-glibc x86-32-browser-glibc" | 70 RUN_TESTS="x86-32-glibc x86-32-browser-glibc" |
| 71 RUN_TESTS+=" x86-64-glibc x86-64-browser-glibc" | 71 RUN_TESTS+=" x86-64-glibc x86-64-browser-glibc" |
| 72 ;; | 72 ;; |
| 73 mac-32-newlib) | 73 mac-32-newlib) |
| 74 export UTMAN_VERBOSE=true # To avoid timing out, since this bot is slow. | 74 export PNACL_VERBOSE=true # To avoid timing out, since this bot is slow. |
| 75 # We can't test ARM because we do not have QEMU for Mac. | 75 # We can't test ARM because we do not have QEMU for Mac. |
| 76 # We can't test X86-64 because NaCl X86-64 Mac support is not in good shape. | 76 # We can't test X86-64 because NaCl X86-64 Mac support is not in good shape. |
| 77 TOOLCHAIN_LABEL=pnacl_darwin_i386_newlib | 77 TOOLCHAIN_LABEL=pnacl_darwin_i386_newlib |
| 78 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" | 78 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" |
| 79 ;; | 79 ;; |
| 80 mac-32-glibc) | 80 mac-32-glibc) |
| 81 export UTMAN_VERBOSE=true | 81 export PNACL_VERBOSE=true |
| 82 TOOLCHAIN_LABEL=pnacl_darwin_i386_glibc | 82 TOOLCHAIN_LABEL=pnacl_darwin_i386_glibc |
| 83 UTMAN="tools/llvm/gutman.sh" | 83 PNACL_BUILD="pnacl/build-glibc.sh" |
| 84 # TODO(pdox): Determine which tests should be run. | 84 # TODO(pdox): Determine which tests should be run. |
| 85 RUN_TESTS="" | 85 RUN_TESTS="" |
| 86 ;; | 86 ;; |
| 87 win-32-newlib) | 87 win-32-newlib) |
| 88 TOOLCHAIN_LABEL=pnacl_windows_i686_newlib | 88 TOOLCHAIN_LABEL=pnacl_windows_i686_newlib |
| 89 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" | 89 RUN_TESTS="x86-32 x86-32-pic x86-32-browser" |
| 90 ;; | 90 ;; |
| 91 win-64-newlib) | 91 win-64-newlib) |
| 92 TOOLCHAIN_LABEL=pnacl_windows_i686_newlib | 92 TOOLCHAIN_LABEL=pnacl_windows_i686_newlib |
| 93 BUILD_32BIT_PLUGIN=true | 93 BUILD_32BIT_PLUGIN=true |
| (...skipping 14 matching lines...) Expand all Loading... |
| 108 src/third_party/nacl_sdk/arm-newlib | 108 src/third_party/nacl_sdk/arm-newlib |
| 109 # Try to clobber /tmp/ contents to clear temporary chrome files. | 109 # Try to clobber /tmp/ contents to clear temporary chrome files. |
| 110 rm -rf /tmp/.org.chromium.Chromium.* | 110 rm -rf /tmp/.org.chromium.Chromium.* |
| 111 | 111 |
| 112 # Only clobber the directory of the toolchain being built. | 112 # Only clobber the directory of the toolchain being built. |
| 113 rm -rf toolchain/${TOOLCHAIN_LABEL} | 113 rm -rf toolchain/${TOOLCHAIN_LABEL} |
| 114 rm -rf toolchain/hg* | 114 rm -rf toolchain/hg* |
| 115 rm -rf toolchain/test-log | 115 rm -rf toolchain/test-log |
| 116 | 116 |
| 117 echo @@@BUILD_STEP show-config@@@ | 117 echo @@@BUILD_STEP show-config@@@ |
| 118 UTMAN_BUILDBOT=true UTMAN_PRUNE=true ${UTMAN} show-config | 118 PNACL_BUILDBOT=true PNACL_PRUNE=true ${PNACL_BUILD} show-config |
| 119 | 119 |
| 120 echo @@@BUILD_STEP compile_toolchain@@@ | 120 echo @@@BUILD_STEP compile_toolchain@@@ |
| 121 UTMAN_BUILDBOT=true UTMAN_PRUNE=true ${UTMAN} untrusted_sdk pnacl-toolchain.tgz | 121 PNACL_BUILDBOT=true PNACL_PRUNE=true \ |
| 122 ${PNACL_BUILD} untrusted_sdk pnacl-toolchain.tgz |
| 122 chmod a+r pnacl-toolchain.tgz | 123 chmod a+r pnacl-toolchain.tgz |
| 123 | 124 |
| 124 echo @@@BUILD_STEP untar_toolchain@@@ | 125 echo @@@BUILD_STEP untar_toolchain@@@ |
| 125 # Untar to ensure we can and to place the toolchain where the main build | 126 # Untar to ensure we can and to place the toolchain where the main build |
| 126 # expects it to be. | 127 # expects it to be. |
| 127 mkdir -p toolchain/${TOOLCHAIN_LABEL} | 128 mkdir -p toolchain/${TOOLCHAIN_LABEL} |
| 128 cd toolchain/${TOOLCHAIN_LABEL} | 129 cd toolchain/${TOOLCHAIN_LABEL} |
| 129 tar xfz ../../pnacl-toolchain.tgz | 130 tar xfz ../../pnacl-toolchain.tgz |
| 130 cd ../.. | 131 cd ../.. |
| 131 | 132 |
| 132 if [[ "${BUILDBOT_SLAVE_TYPE:-Trybot}" != "Trybot" ]]; then | 133 if [[ "${BUILDBOT_SLAVE_TYPE:-Trybot}" != "Trybot" ]]; then |
| 133 echo @@@BUILD_STEP archive_build@@@ | 134 echo @@@BUILD_STEP archive_build@@@ |
| 134 gsutil=buildbot/gsutil.sh | 135 gsutil=buildbot/gsutil.sh |
| 135 GS_BASE=gs://nativeclient-archive2/toolchain | 136 GS_BASE=gs://nativeclient-archive2/toolchain |
| 136 ${gsutil} -h Cache-Control:no-cache cp -a public-read \ | 137 ${gsutil} -h Cache-Control:no-cache cp -a public-read \ |
| 137 pnacl-toolchain.tgz \ | 138 pnacl-toolchain.tgz \ |
| 138 ${GS_BASE}/${BUILDBOT_GOT_REVISION}/naclsdk_${TOOLCHAIN_LABEL}.tgz | 139 ${GS_BASE}/${BUILDBOT_GOT_REVISION}/naclsdk_${TOOLCHAIN_LABEL}.tgz |
| 139 ${gsutil} -h Cache-Control:no-cache cp -a public-read \ | 140 ${gsutil} -h Cache-Control:no-cache cp -a public-read \ |
| 140 pnacl-toolchain.tgz \ | 141 pnacl-toolchain.tgz \ |
| 141 ${GS_BASE}/latest/naclsdk_${TOOLCHAIN_LABEL}.tgz | 142 ${GS_BASE}/latest/naclsdk_${TOOLCHAIN_LABEL}.tgz |
| 142 fi | 143 fi |
| 143 | 144 |
| 144 if ${BUILD_32BIT_PLUGIN}; then | 145 if ${BUILD_32BIT_PLUGIN}; then |
| 145 echo @@@BUILD_STEP plugin compile 32@@@ | 146 echo @@@BUILD_STEP plugin compile 32@@@ |
| 146 ./scons --verbose -k -j8 --mode=opt-host,nacl platform=x86-32 plugin | 147 ./scons --verbose -k -j8 --mode=opt-host,nacl platform=x86-32 plugin |
| 147 fi | 148 fi |
| 148 | 149 |
| 149 for arch in ${RUN_TESTS} ; do | 150 for arch in ${RUN_TESTS} ; do |
| 150 echo @@@BUILD_STEP test-${arch}@@@ | 151 echo @@@BUILD_STEP test-${arch}@@@ |
| 151 UTMAN_BUILDBOT=true ${UTMAN_TEST} test-${arch} || | 152 PNACL_BUILDBOT=true ${PNACL_TEST} test-${arch} || |
| 152 { RETCODE=$? && echo @@@STEP_FAILURE@@@;} | 153 { RETCODE=$? && echo @@@STEP_FAILURE@@@;} |
| 153 done | 154 done |
| 154 | 155 |
| 155 | 156 |
| 156 if [[ ${RETCODE} != 0 ]]; then | 157 if [[ ${RETCODE} != 0 ]]; then |
| 157 echo @@@BUILD_STEP summary@@@ | 158 echo @@@BUILD_STEP summary@@@ |
| 158 echo There were failed stages. | 159 echo There were failed stages. |
| 159 exit ${RETCODE} | 160 exit ${RETCODE} |
| 160 fi | 161 fi |
| OLD | NEW |