File: build-custom-v8.sh

package info (click to toggle)
firefox 147.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,532 kB
  • sloc: cpp: 7,607,356; javascript: 6,533,348; ansic: 3,775,236; python: 1,415,508; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,760; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (49 lines) | stat: -rwxr-xr-x 1,088 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -x -e -v

# This script is for building a custom version of V8
ARTIFACT_NAME='d8.tar.zst'
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"

cd $GECKO_PATH

# Setup depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:$GECKO_PATH/depot_tools
# Bug 1901936 changes to config upstream for depot tools path
export XDG_CONFIG_HOME=$GECKO_PATH

# Get v8 source code and dependencies
fetch --force 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

tar caf $ARTIFACT_NAME d8

mkdir -p $UPLOAD_DIR
cp $ARTIFACT_NAME $UPLOAD_DIR