Index: tools/clang/scripts/update.sh |
diff --git a/tools/clang/scripts/update.sh b/tools/clang/scripts/update.sh |
index 352eff173175e1307842d2e7c49b4dce3940fe17..27abeab2e10b2965ebb401a83758dfd43aeab83f 100755 |
--- a/tools/clang/scripts/update.sh |
+++ b/tools/clang/scripts/update.sh |
@@ -34,11 +34,37 @@ fi |
# To always force a new build if someone interrupts their build half way. |
rm -f "${STAMP_FILE}" |
+# Check if there's a prebuilt binary and if so just fetch that. That's faster, |
+# and goma relies on having matching binary hashes on client and server too. |
+CDS_URL=http://commondatastorage.googleapis.com/chromium-browser-clang |
Mark Mentovai
2011/08/26 16:55:19
Can you skip the “try to download binary” step if
Nico
2011/08/27 05:25:33
I wanted to add some flag for that, and I'm waitin
|
+CDS_FILE="clang-${CLANG_REVISION}.tgz" |
+echo Trying to download prebuilt clang |
Mark Mentovai
2011/08/26 16:55:19
It’s good practice to quote the entire string you’
Nico
2011/08/27 05:25:33
Done.
|
+if [ "$(uname -s)" = "Linux" ]; then |
Mark Mentovai
2011/08/26 16:55:19
You run |uname -s| repeatedly to check the same th
Nico
2011/08/27 05:25:33
It's cheap to run and its result is unlikely to ch
|
+ wget "${CDS_URL}/Linux_x64/${CDS_FILE}" || rm -f "${CDS_FILE}" |
+elif [ "$(uname -s)" = "Darwin" ]; then |
+ curl -L --fail -O "${CDS_URL}/Mac/${CDS_FILE}" || rm -f "${CDS_FILE}" |
+fi |
+if [ -f "${CDS_FILE}" ]; then |
+ rm -rf "${LLVM_BUILD_DIR}/Release+Asserts" |
+ mkdir -p "${LLVM_BUILD_DIR}/Release+Asserts" |
+ tar -xzf "${CDS_FILE}" -C "${LLVM_BUILD_DIR}/Release+Asserts" |
+ echo clang "${CLANG_REVISION}" unpacked |
+ echo "${CLANG_REVISION}" > "${STAMP_FILE}" |
+ exit 0 |
+else |
+ echo Did not find prebuilt clang at r"${CLANG_REVISION}", building |
+fi |
+ |
if grep -q 'src/third_party/llvm":' "${DEPS_FILE}"; then |
echo LLVM pulled in through DEPS, skipping LLVM update step |
else |
echo Getting LLVM r"${CLANG_REVISION}" in "${LLVM_DIR}" |
- svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" |
+ if ! svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" \ |
+ "${LLVM_DIR}"; then |
+ echo Checkout failed, retrying |
Mark Mentovai
2011/08/26 16:55:19
Why do you retry this one but not the one to check
Nico
2011/08/27 05:25:33
clang's checked out to llvm/tools/clang. It's very
|
+ rm -rf "${LLVM_DIR}" |
+ svn co --force "${LLVM_REPO_URL}/llvm/trunk@${CLANG_REVISION}" "${LLVM_DIR}" |
+ fi |
fi |
if grep -q 'src/third_party/llvm/tools/clang":' "${DEPS_FILE}"; then |
@@ -59,6 +85,8 @@ cd "${LLVM_BUILD_DIR}" |
if [ ! -f ./config.status ]; then |
../llvm/configure \ |
--enable-optimized \ |
+ --disable-threads \ |
Mark Mentovai
2011/08/26 16:55:19
Curious about what GOMA’s requirements are that ma
Nico
2011/08/27 05:25:33
They run gcc in a fake chrooted sandbox, and I'm g
|
+ --disable-pthreads \ |
--without-llvmgcc \ |
--without-llvmgxx |
fi |