[PATCH] D62020: [zorg] Build and test LLVM with GN

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 15:20:04 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL361323: [zorg] Build and test LLVM with GN (authored by vitalybuka, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62020/new/

https://reviews.llvm.org/D62020

Files:
  zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
  zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh


Index: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
===================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
@@ -90,6 +90,29 @@
     fi
 }
 
+function buildbot_update_git {
+  if [[ -d "$BUILDBOT_MONO_REPO_PATH" ]]; then
+    LLVM=$BUILDBOT_MONO_REPO_PATH/llvm
+  else
+    (
+      [[ -d llvm-project ]] || git clone https://github.com/llvm/llvm-project.git
+      cd llvm-project
+      git fetch
+      git clean -fd
+      if [[ "$BUILDBOT_REVISION" == "" ]] ; then
+        REV=origin/master
+      else
+        REV=$(git log --format="%H" -n1 --grep "^llvm-svn: ${BUILDBOT_REVISION}$" origin/master)
+        [[ "$REV" != "" ]] || exit 1
+      fi
+      git checkout $REV
+      git status
+      git log -n1 --oneline
+    ) || { echo @@@STEP_EXCEPTION@@@ ; exit 1 ; }
+    LLVM=$ROOT/llvm-project/llvm
+  fi
+}
+
 function set_chrome_suid_sandbox {
   export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
 }
Index: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh
===================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh
@@ -7,17 +7,56 @@
 
 ROOT=`pwd`
 PLATFORM=`uname`
-export PATH="/usr/local/bin:$PATH"
 
 CHECK_LIBCXX=${CHECK_LIBCXX:-0}
-CHECK_LLD=${CHECK_LLD:-0}
-LLVM=$ROOT/llvm
+CHECK_LLD=${CHECK_LLD:-1}
+STAGE1_DIR=llvm_build0
+STAGE1_CLOBBER=
+STAGE2_DIR=llvm_build
 
 if [ "$BUILDBOT_CLOBBER" != "" ]; then
   echo @@@BUILD_STEP clobber@@@
   rm -rf llvm
+  rm -rf llvm-project
+  rm -rf gn
+  rm -rf ${STAGE1_DIR}
+  rm -rf ${STAGE2_DIR}
 fi
 
+(
+  LLVM=$ROOT/llvm
+  CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_PARALLEL_LINK_JOBS=20"
+  build_stage1_clang_at_revison
+)
+
+echo @@@BUILD_STEP build GN@@@
+[[ -d gn ]] || git clone https://gn.googlesource.com/gn
+(
+  export PATH="$PATH:$(readlink -f $STAGE1_DIR)/bin"
+  cd gn
+  # Does not work with 0d038c2e0a32a528713d3dfaf1f1e0cdfe87fd46
+  git checkout 0d038c2e0a32a528713d3dfaf1f1e0cdfe87fd46^
+  python build/gen.py
+  ninja -C out
+) || { echo @@@STEP_EXCEPTION@@@ ; exit 1 ; }
+
 echo @@@BUILD_STEP update@@@
-buildbot_update
+buildbot_update_git
 
+(
+  echo @@@BUILD_STEP configure@@@
+  export PATH=$(readlink -f gn/out/):$PATH
+  $LLVM/utils/gn/gn.py gen ${STAGE2_DIR} \
+    --list --short --overrides-only \
+    --args="clang_base_path=\"$(readlink -f $STAGE1_DIR)\""
+) || echo @@@STEP_FAILURE@@@
+
+(
+  cd $STAGE2_DIR
+  echo @@@BUILD_STEP build all@@@
+
+  for TARGET in "" $(ninja -t targets | grep -o "^check-[^:]*") ; do
+    echo @@@BUILD_STEP $TARGET@@@
+    ninja $TARGET || echo @@@STEP_FAILURE@@@
+  done
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62020.200599.patch
Type: text/x-patch
Size: 2868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190521/5fadff77/attachment.bin>


More information about the llvm-commits mailing list