Skip to content

Commit 1dfb5b5

Browse files
Jaideep BajwaMylesBorins
Jaideep Bajwa
authored andcommitted
v8: update make-v8.sh to use git
google build tool gclient doesn't support svn anymore. Updating v8 build script to use git instead. PR-URL: #9393 Reviewed By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 9f0ef5a commit 1dfb5b5

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ cctest: all
109109
@out/$(BUILDTYPE)/$@
110110

111111
v8:
112-
tools/make-v8.sh v8
112+
tools/make-v8.sh
113113
$(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)
114114

115115
test: | cctest # Depends on 'all'.

tools/make-v8.sh

+29-20
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
11
#!/bin/bash
22

3-
4-
git_origin=$(git config --get remote.origin.url | sed 's/.\+[\/:]\([^\/]\+\/[^\/]\+\)$/\1/')
5-
git_branch=$(git rev-parse --abbrev-ref HEAD)
6-
v8ver=${1:-v8} #default v8
7-
svn_prefix=https://github.com
8-
svn_path="$svn_prefix/$git_origin/branches/$git_branch/deps/$v8ver"
9-
#svn_path="$git_origin/branches/$git_branch/deps/$v8ver"
10-
gclient_string="solutions = [{'name': 'v8', 'url': '$svn_path', 'managed': False}]"
3+
# Get V8 branch from v8/include/v8-version.h
4+
MAJOR=$(grep V8_MAJOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3)
5+
MINOR=$(grep V8_MINOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3)
6+
BRANCH=$MAJOR.$MINOR
117

128
# clean up if someone presses ctrl-c
139
trap cleanup INT
1410

1511
function cleanup() {
1612
trap - INT
17-
1813
rm .gclient || true
1914
rm .gclient_entries || true
2015
rm -rf _bad_scm/ || true
21-
22-
#if v8ver isn't v8, move the v8 folders
23-
#back to what they were
24-
if [ "$v8ver" != "v8" ]; then
25-
mv v8 $v8ver
26-
mv .v8old v8
27-
fi
16+
find v8 -name ".git" | xargs rm -rf || true
17+
echo "git cleanup"
18+
git reset --hard HEAD
19+
git clean -fdq
20+
# unstash local changes
21+
git stash pop
2822
exit 0
2923
}
3024

3125
cd deps
32-
echo $gclient_string > .gclient
33-
if [ "$v8ver" != "v8" ]; then
34-
mv v8 .v8old
35-
mv $v8ver v8
26+
# stash local changes
27+
git stash
28+
rm -rf v8
29+
30+
echo "Fetching V8 from chromium.googlesource.com"
31+
fetch v8
32+
if [ "$?" -ne 0 ]; then
33+
echo "V8 fetch failed"
34+
exit 1
3635
fi
36+
echo "V8 fetched"
37+
38+
cd v8
39+
40+
echo "Checking out branch:$BRANCH"
41+
git checkout remotes/branch-heads/$BRANCH
42+
43+
echo "Sync dependencies"
3744
gclient sync
45+
46+
cd ..
3847
cleanup

0 commit comments

Comments
 (0)