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: linux-x64-publish:
<<: *machine-linux-2xlarge <<: *machine-linux-2xlarge
environment: environment:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-release-build <<: *env-release-build
<<: *steps-electron-build-for-publish <<: *steps-electron-build-for-publish
@ -716,6 +717,7 @@ jobs:
linux-ia32-publish: linux-ia32-publish:
<<: *machine-linux-2xlarge <<: *machine-linux-2xlarge
environment: environment:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-ia32 <<: *env-ia32
<<: *env-release-build <<: *env-release-build
<<: *steps-electron-build-for-publish <<: *steps-electron-build-for-publish
@ -766,7 +768,7 @@ jobs:
environment: environment:
<<: *env-arm <<: *env-arm
<<: *env-release-build <<: *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 <<: *steps-electron-build-for-publish
linux-arm-native-mksnapshot: linux-arm-native-mksnapshot:
@ -822,7 +824,7 @@ jobs:
environment: environment:
<<: *env-arm64 <<: *env-arm64
<<: *env-release-build <<: *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 <<: *steps-electron-build-for-publish
linux-arm64-native-mksnapshot: 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': 'node_version':
'18a9880b70039f5d41ee860a95fe84e5ef928973', '18a9880b70039f5d41ee860a95fe84e5ef928973',
'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'requests_version': 'e4d59bedfd3c7f4f254f4f5d036587bcd8152458',
'pyyaml_version': 'pyyaml_version':
'3.12', '3.12',
'boto_git': 'https://github.com/boto',
'chromium_git': 'chromium_git':
'https://chromium.googlesource.com', 'https://chromium.googlesource.com',
@ -16,12 +21,20 @@ vars = {
'yaml_git': 'yaml_git':
'https://github.com/yaml', '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': 'checkout_nacl':
False, False,
'checkout_libaom': 'checkout_libaom':
True, True,
'checkout_oculus_sdk': 'checkout_oculus_sdk':
False, False,
# Python "requests" module is used for releases only.
'checkout_requests': False,
} }
deps = { deps = {
@ -31,6 +44,14 @@ deps = {
(Var("electron_git")) + '/node.git@' + (Var("node_version")), (Var("electron_git")) + '/node.git@' + (Var("node_version")),
'src/electron/vendor/pyyaml': 'src/electron/vendor/pyyaml':
(Var("yaml_git")) + '/pyyaml.git@' + (Var("pyyaml_version")), (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 = [ hooks = [
@ -66,31 +87,24 @@ hooks = [
'name': 'electron_npm_deps' 'name': 'electron_npm_deps'
}, },
{ {
'action': [ 'name': 'setup_boto',
'python', 'condition': 'checkout_boto',
'-c',
'import os; os.chdir("src"); os.chdir("electron"); os.system("git submodule update --init --recursive");',
],
'pattern': 'src/electron',
'name': 'electron_submodules'
},
{
'action': [ 'action': [
'python', 'python',
'-c', '-c',
'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("boto"); os.system("python setup.py build");', 'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("boto"); os.system("python setup.py build");',
], ],
'pattern': 'src/electron', 'pattern': 'src/electron',
'name': 'setup_boto',
}, },
{ {
'name': 'setup_requests',
'condition': 'checkout_requests',
'action': [ 'action': [
'python', 'python',
'-c', '-c',
'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("requests"); os.system("python setup.py build");', 'import os; os.chdir("src"); os.chdir("electron"); os.chdir("vendor"); os.chdir("requests"); os.system("python setup.py build");',
], ],
'pattern': 'src/electron', '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: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools" - ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe" - 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 gclient config
--name "src\electron" --name "src\electron"
--unmanaged --unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron" "https://github.com/electron/electron"
- gclient sync --with_branch_heads --with_tags - gclient sync --with_branch_heads --with_tags
- cd src - cd src
@ -34,7 +39,6 @@ build_script:
- ninja -C out/Default third_party/electron_node:headers - ninja -C out/Default third_party/electron_node:headers
- appveyor PushArtifact out/Default/dist.zip - appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/chromedriver.zip - appveyor PushArtifact out/Default/chromedriver.zip
- appveyor PushArtifact out/ffmpeg/ffmpeg.zip - appveyor PushArtifact out/ffmpeg/ffmpeg.zip
- ps: >- - ps: >-
if ($env:GN_CONFIG -eq 'release') { 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" export PATH="$PATH:/Users/electron/depot_tools"
echo "##vso[task.setvariable variable=PATH]$PATH" echo "##vso[task.setvariable variable=PATH]$PATH"
export GIT_CACHE_PATH="/Users/electron/libcc_cache" 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 set -ex
gclient config \ gclient config \
--name "src/electron" \ --name "src/electron" \
--unmanaged \ --unmanaged \
$GCLIENT_EXTRA_ARGS \
"https://github.com/electron/electron" "https://github.com/electron/electron"
gclient sync --with_branch_heads --with_tags gclient sync --with_branch_heads --with_tags
cd src cd src