summaryrefslogtreecommitdiffstats
path: root/gfx/angle/auto-update-angle.sh
blob: ba5edf06cc0ffa8882166d8d06e04a3e7e91b8d4 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set -vex

if [[ -z "${MOZ_AUTOMATION}" ]]; then
	echo "This script is only meant to be used to update ANGLE via ./mach vendor when in automation."
	echo "However, if you set a few environment variables yourself, this script"
	echo "will probably work locally."
	exit 1
fi

if [ "$#" -ne 1 ]; then
	echo "Usage: auto-update-angle.sh upstream-tag"
	exit 1
fi

export DEPOT_TOOLS_WIN_TOOLCHAIN=0
export GYP_MSVS_OVERRIDE_PATH="$MOZ_FETCHES_DIR/VS"
export GYP_MSVS_VERSION=2019
export vs2019_install="$MOZ_FETCHES_DIR/VS"
export WINDOWSSDKDIR="$MOZ_FETCHES_DIR/SDK"
export WINDIR="$MOZ_FETCHES_DIR/WinDir"

set +v
export INCLUDE=""
export INCLUDE="$INCLUDE;$MOZ_FETCHES_DIR/VS/VC/Tools/MSVC/14.29.30133/ATLMFC/include"
export INCLUDE="$INCLUDE;$MOZ_FETCHES_DIR/VS/VC/Tools/MSVC/14.29.30133/include"

export LIB=""
export LIB="$LIB;$MOZ_FETCHES_DIR/VS/VC/Tools/MSVC/14.29.30133/ATLMFC/lib/x64"
export LIB="$LIB;$MOZ_FETCHES_DIR/VS/VC/Tools/MSVC/14.29.30133/lib/x64"
export LIB="$LIB;$MOZ_FETCHES_DIR/SDK/Lib/10.0.19041.0/um/x64"
export LIB="$LIB;$MOZ_FETCHES_DIR/SDK/Lib/10.0.19041.0/ucrt/x64"
set -v

# depot_tools
# This needs to use the /c/ format, rather than C:/ format.  PWD will translate for us though.
pushd $MOZ_FETCHES_DIR
MOZ_FETCHES_PATH=$(pwd)
popd
export PATH="$MOZ_FETCHES_PATH/depot_tools:$PATH"

# Do not update depot tools automatically
export DEPOT_TOOLS_UPDATE=0
pushd "$MOZ_FETCHES_DIR/depot_tools"
touch .disable_auto_update

################################################
if test -n "$GENERATE_DEPOT_TOOLS_BINARIES"; then
	# We're generating binaries, so run the setup manually
	cmd '/c cipd_bin_setup.bat'

	pushd bootstrap
	cmd '/c win_tools.bat'
	popd
else
	# Move the preloaded binaries into place so we don't need to do any setup
	mv "$MOZ_FETCHES_DIR"/depot_tools-preloaded-binaries/* .
	# Move the hidden files also. If we don't do the .[^.]* we get an error trying to move . and ..
	mv "$MOZ_FETCHES_DIR"/depot_tools-preloaded-binaries/.[^.]* .
fi

################################################

popd

# do the update
cd "$MOZ_FETCHES_DIR"
git clone https://chromium.googlesource.com/angle/angle
cd angle
git checkout "origin/$1"

python3 scripts/bootstrap.py

gclient sync

python3 "$GECKO_PATH/gfx/angle/update-angle.py" origin

cd $GECKO_PATH
hg status