Commit e5d10c49 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[gcmole] Provide packaging script for gcmole deployment.

This is a minimalistic script usable for creating packages of gcmole
together with the corresponding Clang. Such packages are used on V8's
infrastructure.

R=machenbach@chromium.org
BUG=v8:8813

Change-Id: Iee3594a3acdc7a4e5b5d5628e5557725d27d9ced
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1523068
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60237}
parent 2ae99adf
......@@ -71,7 +71,21 @@ can be ignored.
If any errors were found driver exits with non-zero status.
TROUBLESHOOTING ------------------------
PACKAGING ---------------------------------------------------------------------
gcmole is deployed on V8's buildbot infrastructure to run it as part of the
continuous integration. A pre-built package of gcmole together with Clang is
hosted on Google Cloud Storage for this purpose. To update this package to a
newer version, use the provided packaging script:
$ ./tools/gcmole/package.sh
This will create a new "tools/gcmole/gcmole-tools.tar.gz" package with the
corresponding SHA1 sum suitable to be used for this purpose. It assumes that
Clang was built in "third_party/llvm+clang-build" (e.g. by the bootstrapping
script "bootstrap.sh" mentioned above).
TROUBLESHOOTING ---------------------------------------------------------------
gcmole is tighly coupled with the AST structure that Clang produces. Therefore
when upgrading to a newer Clang version, it might start producing bogus output
......
#!/usr/bin/env bash
# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script will package a built gcmole plugin together with the
# corresponding clang binary into an archive which can be used on the
# buildbot infrastructure to be run against V8 checkouts.
THIS_DIR="$(readlink -f "$(dirname "${0}")")"
PACKAGE_DIR="${THIS_DIR}/../../tools/gcmole/gcmole-tools"
PACKAGE_FILE="${THIS_DIR}/../../tools/gcmole/gcmole-tools.tar.gz"
PACKAGE_SUM="${THIS_DIR}/../../tools/gcmole/gcmole-tools.tar.gz.sha1"
BUILD_DIR="${THIS_DIR}/../../third_party/llvm+clang-build"
# Echo all commands
set -x
# Copy all required files
mkdir -p "${PACKAGE_DIR}/bin"
cp "${BUILD_DIR}/bin/clang++" "${PACKAGE_DIR}/bin"
mkdir -p "${PACKAGE_DIR}/lib"
cp -r "${BUILD_DIR}/lib/clang" "${PACKAGE_DIR}/lib"
cp "${THIS_DIR}/libgcmole.so" "${PACKAGE_DIR}"
# Generate the archive
cd "$(dirname "${PACKAGE_DIR}")"
tar -c -z -f "${PACKAGE_FILE}" "$(basename "${PACKAGE_DIR}")"
# Generate checksum
sha1sum "${PACKAGE_FILE}" | awk '{print $1}' > "${PACKAGE_SUM}"
set +x
echo
echo You can find a packaged version of gcmole here:
echo
echo $(readlink -f "${PACKAGE_FILE}")
echo
echo You can now run gcmole using this command:
echo
echo CLANG_BIN="tools/gcmole/gcmole-tools/bin" lua tools/gcmole/gcmole.lua
echo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment