build: make boto and requests optional dependencies (#14970)

This commit is contained in:
Alexey Kuzmin 2018-10-05 02:20:25 +02:00 committed by John Kleinschmidt
parent 9d4818c784
commit 0857ecf478
7 changed files with 39 additions and 22 deletions

View file

@ -670,6 +670,7 @@ jobs:
linux-x64-publish:
<<: *machine-linux-2xlarge
environment:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-release-build
<<: *steps-electron-build-for-publish
@ -716,6 +717,7 @@ jobs:
linux-ia32-publish:
<<: *machine-linux-2xlarge
environment:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-ia32
<<: *env-release-build
<<: *steps-electron-build-for-publish
@ -766,7 +768,7 @@ jobs:
environment:
<<: *env-arm
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True'
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *steps-electron-build-for-publish
linux-arm-native-mksnapshot:
@ -822,7 +824,7 @@ jobs:
environment:
<<: *env-arm64
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True'
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *steps-electron-build-for-publish
linux-arm64-native-mksnapshot:

6
.gitmodules vendored
View file

@ -1,6 +0,0 @@
[submodule "vendor/requests"]
path = vendor/requests
url = https://github.com/kennethreitz/requests
[submodule "vendor/boto"]
path = vendor/boto
url = https://github.com/boto/boto.git

36
DEPS
View file

@ -4,9 +4,14 @@ vars = {
'node_version':
'18a9880b70039f5d41ee860a95fe84e5ef928973',
'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'requests_version': 'e4d59bedfd3c7f4f254f4f5d036587bcd8152458',
'pyyaml_version':
'3.12',
'boto_git': 'https://github.com/boto',
'chromium_git':
'https://chromium.googlesource.com',
@ -16,12 +21,20 @@ vars = {
'yaml_git':
'https://github.com/yaml',
'requests_git': 'https://github.com/kennethreitz',
# Python interface to Amazon Web Services. Is used for releases only.
'checkout_boto': False,
'checkout_nacl':
False,
'checkout_libaom':
True,
'checkout_oculus_sdk':
False,
# Python "requests" module is used for releases only.
'checkout_requests': False,
}
deps = {
@ -31,6 +44,14 @@ deps = {
(Var("electron_git")) + '/node.git@' + (Var("node_version")),
'src/electron/vendor/pyyaml':
(Var("yaml_git")) + '/pyyaml.git@' + (Var("pyyaml_version")),
'src/electron/vendor/boto': {
'url': Var('boto_git') + '/boto.git' + '@' + Var('boto_version'),
'condition': 'checkout_boto',
},
'src/electron/vendor/requests': {
'url': Var('requests_git') + '/requests.git' + '@' + Var('requests_version'),
'condition': 'checkout_requests',
},
}
hooks = [
@ -66,31 +87,24 @@ hooks = [
'name': 'electron_npm_deps'
},
{
'action': [
'python',
'-c',
'import os; os.chdir("src"); os.chdir("electron"); os.system("git submodule update --init --recursive");',
],
'pattern': 'src/electron',
'name': 'electron_submodules'
},
{
'name': 'setup_boto',
'condition': 'checkout_boto',
'action': [
'python',
'-c',
'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("boto"); os.system("python setup.py build");',
],
'pattern': 'src/electron',
'name': 'setup_boto',
},
{
'name': 'setup_requests',
'condition': 'checkout_requests',
'action': [
'python',
'-c',
'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("requests"); os.system("python setup.py build");',
],
'pattern': 'src/electron',
'name': 'setup_requests',
}
]

View file

@ -17,10 +17,15 @@ build_script:
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe"
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
$env:GCLIENT_EXTRA_ARGS="--custom-var=checkout_boto=True --custom-var=checkout_requests=True"
}
- >-
gclient config
--name "src\electron"
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- gclient sync --with_branch_heads --with_tags
- cd src
@ -34,7 +39,6 @@ build_script:
- ninja -C out/Default third_party/electron_node:headers
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/chromedriver.zip
- appveyor PushArtifact out/ffmpeg/ffmpeg.zip
- ps: >-
if ($env:GN_CONFIG -eq 'release') {

1
vendor/boto vendored

@ -1 +0,0 @@
Subproject commit f7574aa6cc2c819430c1f05e9a1a1a666ef8169b

1
vendor/requests vendored

@ -1 +0,0 @@
Subproject commit e4d59bedfd3c7f4f254f4f5d036587bcd8152458

View file

@ -13,10 +13,15 @@ jobs:
export PATH="$PATH:/Users/electron/depot_tools"
echo "##vso[task.setvariable variable=PATH]$PATH"
export GIT_CACHE_PATH="/Users/electron/libcc_cache"
if [ "$ELECTRON_RELEASE" == "1" ]; then
GCLIENT_EXTRA_ARGS='--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
fi
set -ex
gclient config \
--name "src/electron" \
--unmanaged \
$GCLIENT_EXTRA_ARGS \
"https://github.com/electron/electron"
gclient sync --with_branch_heads --with_tags
cd src