2018-12-21 22:21:15 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -x -e -v
|
|
|
|
|
|
|
|
# This script is for building a custom version of V8
|
|
|
|
ARTIFACT_NAME='d8.zip'
|
|
|
|
CONFIG='is_debug=false target_cpu="x64"'
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
echo "Using default configuration for v8 build."
|
|
|
|
CONFIG=$(echo $CONFIG | tr -d "'")
|
|
|
|
else
|
|
|
|
# First argument must be the artifact name
|
|
|
|
ARTIFACT_NAME="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
# Use the rest of the arguments as the build config
|
|
|
|
CONFIG=$(echo $* | tr -d "'")
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Config: $CONFIG"
|
|
|
|
echo "Artifact name: $ARTIFACT_NAME"
|
|
|
|
|
2019-08-01 12:55:26 +03:00
|
|
|
cd $GECKO_PATH
|
2018-12-21 22:21:15 +03:00
|
|
|
|
|
|
|
# Setup depot_tools
|
|
|
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
2019-08-01 12:55:26 +03:00
|
|
|
export PATH=$PATH:$GECKO_PATH/depot_tools
|
2018-12-21 22:21:15 +03:00
|
|
|
|
Bug 1519816 - Simplify build-custom-v8 script and avoid installing packages during build. r=sparky
The build script currently is doing some unnecessary steps:
- Running `gclient` only prints out an help message. It is a step
indicated in various documentations, but is only necessary to keep
depot-tools up-to-date, which they are, since we just cloned it.
- The `fetch v8` command creates a v8 directory, no need to create
another layer.
- `gclient sync` is run as part of `fetch`. Same as `gclient`, this step
is only given in documentations to keep things up-to-date on an existing
clone, but we just freshly got one.
- Same goes for `git pull && gclient sync`
- `git checkout master` is not necessary, as `fetch` gets us there
already (albeit, in a detached head state)
- install-build-deps.sh installs build dependencies for chrome or
whatever. That's way too much for v8, that barely needs pkg-config and
glib, which we now install in the docker image.
Differential Revision: https://phabricator.services.mozilla.com/D20082
2019-02-17 04:28:27 +03:00
|
|
|
# Get v8 source code and dependencies
|
2018-12-21 22:21:15 +03:00
|
|
|
fetch v8
|
|
|
|
cd v8
|
|
|
|
|
|
|
|
# Build v8
|
|
|
|
gn gen out/release --args="$CONFIG"
|
|
|
|
ninja -C out/release d8
|
|
|
|
|
|
|
|
# Gather binary and related files into a zip, and upload it
|
|
|
|
cd ..
|
|
|
|
mkdir d8
|
|
|
|
|
|
|
|
cp -R v8/out/release d8
|
|
|
|
cp -R v8/include d8
|
|
|
|
chmod -R +x d8
|
|
|
|
|
|
|
|
zip -r $ARTIFACT_NAME d8
|
|
|
|
|
|
|
|
mkdir -p $UPLOAD_DIR
|
|
|
|
cp $ARTIFACT_NAME $UPLOAD_DIR
|