Skip to content

Commit

Permalink
Merge branch '13-x-y' into trop/13-x-y-bp-fix-adjust-initial-webconte…
Browse files Browse the repository at this point in the history
…nts-focus-calculation-1621416492669
  • Loading branch information
nornagon committed Jun 22, 2021
2 parents 5112506 + 9942b2b commit 2d2f2bb
Show file tree
Hide file tree
Showing 156 changed files with 2,496 additions and 712 deletions.
104 changes: 75 additions & 29 deletions .circleci/config.yml
Expand Up @@ -57,6 +57,16 @@ parameters:
type: boolean
default: false

# Executors
executors:
linux-arm:
resource_class: electronjs/linux-arm
machine: true

linux-arm64:
resource_class: electronjs/linux-arm64
machine: true

# The config expects the following environment variables to be set:
# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
#
Expand Down Expand Up @@ -239,7 +249,14 @@ step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
killall Safari || echo "No Safari processes left running"
rm -rf ~/Library/Application\ Support/Electron*
rm -rf ~/Library/Application\ Support/electron*
elif [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
XVFB=/usr/bin/Xvfb
/sbin/start-stop-daemon --stop --exec $XVFB || echo "Xvfb not running"
pkill electron || echo "electron not running"
rm -rf ~/.config/Electron*
rm -rf ~/.config/electron*
fi
when: always

step-checkout-electron: &step-checkout-electron
Expand Down Expand Up @@ -505,6 +522,7 @@ step-gn-check: &step-gn-check
gn check out/Default //electron/shell/common/api:mojo
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
node electron/script/gen-libc++-filenames.js --check
step-electron-build: &step-electron-build
run:
Expand All @@ -530,6 +548,7 @@ step-electron-build: &step-electron-build
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
(cd out/Default; zip mksnapshot.zip mksnapshot_args clang_x64_v8_arm64/gen/v8/embedded.S)
rm -rf out/Default/clang_x64_v8_arm64/gen
rm -rf out/Default/clang_x64_v8_arm64/obj
rm -rf out/Default/clang_x64/obj
Expand Down Expand Up @@ -687,6 +706,11 @@ step-persist-data-for-tests: &step-persist-data-for-tests
- src/third_party/electron_node
- src/third_party/nan
- src/cross-arch-snapshots
- src/third_party/llvm-build
- src/build/linux
- src/buildtools/third_party/libc++
- src/buildtools/third_party/libc++abi
- src/out/Default/obj/buildtools/third_party

step-electron-dist-unzip: &step-electron-dist-unzip
run:
Expand Down Expand Up @@ -756,7 +780,7 @@ step-verify-mksnapshot: &step-verify-mksnapshot
command: |
if [ "$IS_ASAN" != "1" ]; then
cd src
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/cross-arch-snapshots
else
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
Expand Down Expand Up @@ -837,6 +861,17 @@ step-hunspell-store: &step-hunspell-store
path: src/out/Default/hunspell_dictionaries.zip
destination: hunspell_dictionaries.zip

step-maybe-generate-libcxx: &step-maybe-generate-libcxx
run:
name: maybe generate libcxx
command: |
cd src
if [ "`uname`" == "Linux" ]; then
ninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
run:
name: Generate breakpad symbols
Expand Down Expand Up @@ -890,28 +925,6 @@ step-maybe-cross-arch-snapshot-store: &step-maybe-cross-arch-snapshot-store
path: src/cross-arch-snapshots
destination: cross-arch-snapshots

step-maybe-trigger-arm-test: &step-maybe-trigger-arm-test
run:
name: Trigger an arm test on VSTS if applicable
command: |
cd src
# Only run for non-fork prs
if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
#Trigger VSTS job, passing along CircleCI job number and branch to build
if [ "`uname`" == "Darwin" ]; then
if [ x"$MAS_BUILD" == x"true" ]; then
export DEVOPS_BUILD="electron-mas-arm64-testing"
else
export DEVOPS_BUILD="electron-osx-arm64-testing"
fi
echo "Triggering $DEVOPS_BUILD build on Azure DevOps"
node electron/script/release/ci-release-build.js --job=$DEVOPS_BUILD --ci=DevOps --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
else
echo "Triggering electron-$TARGET_ARCH-testing build on VSTS"
node electron/script/release/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
fi
fi
step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
run:
name: Generate type declarations
Expand Down Expand Up @@ -1326,7 +1339,7 @@ steps-tests: &steps-tests
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging --files $(circleci tests glob spec-main/*-spec.ts | circleci tests split)) 2>&1 | $ASAN_SYMBOLIZE
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging --files $(circleci tests glob spec/*-spec.js | circleci tests split)) 2>&1 | $ASAN_SYMBOLIZE
else
if [ "$TARGET_ARCH" == "arm64" ] &&[ "`uname`" == "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
(cd electron && node script/yarn test --runners=remote --trace-uncaught --enable-logging)
Expand Down Expand Up @@ -1617,9 +1630,6 @@ commands:
steps:
- *step-save-out-cache

# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test

- *step-maybe-notify-slack-failure

electron-publish:
Expand Down Expand Up @@ -1687,6 +1697,9 @@ commands:
- *step-hunspell-build
- *step-hunspell-store

# libcxx
- *step-maybe-generate-libcxx

# typescript defs
- *step-maybe-generate-typescript-defs

Expand Down Expand Up @@ -1960,7 +1973,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- electron-build:
persist: false
persist: true
checkout: true
use-out-cache: false

Expand Down Expand Up @@ -2019,7 +2032,7 @@ jobs:
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- electron-build:
persist: false
persist: true
checkout: true
use-out-cache: false

Expand Down Expand Up @@ -2416,6 +2429,24 @@ jobs:
<<: *env-send-slack-notifications
<<: *steps-verify-ffmpeg

linux-arm-testing-tests:
executor: linux-arm
environment:
<<: *env-arm
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-tests

linux-arm64-testing-tests:
executor: linux-arm64
environment:
<<: *env-arm64
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-tests

osx-testing-x64-tests:
<<: *machine-mac-large
environment:
Expand Down Expand Up @@ -2668,8 +2699,23 @@ workflows:
- linux-ia32-testing

- linux-arm-testing
- linux-arm-testing-tests:
filters:
branches:
# Do not run this on forked pull requests
ignore: /pull\/[0-9]+/
requires:
- linux-arm-testing

- linux-arm64-testing
- linux-arm64-testing-tests:
filters:
branches:
# Do not run this on forked pull requests
ignore: /pull\/[0-9]+/
requires:
- linux-arm64-testing

- linux-arm64-testing-gn-check:
requires:
- linux-checkout-fast
Expand Down
52 changes: 51 additions & 1 deletion BUILD.gn
@@ -1,6 +1,7 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/os_crypt/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
Expand All @@ -25,6 +26,8 @@ import("electron_paks.gni")
import("filenames.auto.gni")
import("filenames.gni")
import("filenames.hunspell.gni")
import("filenames.libcxx.gni")
import("filenames.libcxxabi.gni")

if (is_mac) {
import("//build/config/mac/rules.gni")
Expand Down Expand Up @@ -290,7 +293,7 @@ templated_file("electron_version_header") {
action("electron_fuses") {
script = "build/fuses/build.py"

inputs = [ "build/fuses/fuses.json" ]
inputs = [ "build/fuses/fuses.json5" ]

outputs = [
"$target_gen_dir/fuses.h",
Expand Down Expand Up @@ -329,6 +332,7 @@ source_set("electron_lib") {
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/os_crypt",
"//components/pref_registry",
"//components/prefs",
"//components/upload_list",
Expand Down Expand Up @@ -676,6 +680,10 @@ source_set("electron_lib") {
]
libs += [ "uxtheme.lib" ]
}

if (allow_runtime_configurable_key_storage) {
defines += [ "ALLOW_RUNTIME_CONFIGURABLE_KEY_STORAGE" ]
}
}

electron_paks("packed_resources") {
Expand Down Expand Up @@ -1292,13 +1300,18 @@ template("dist_zip") {
"testonly",
])
flatten = false
flatten_relative_to = false
if (defined(invoker.flatten)) {
flatten = invoker.flatten
if (defined(invoker.flatten_relative_to)) {
flatten_relative_to = invoker.flatten_relative_to
}
}
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
target_cpu,
target_os,
"$flatten",
"$flatten_relative_to",
]
}
}
Expand Down Expand Up @@ -1389,6 +1402,43 @@ dist_zip("hunspell_dictionaries_zip") {
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
}

copy("libcxx_headers") {
sources = libcxx_headers + libcxx_licenses
outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
}

dist_zip("libcxx_headers_zip") {
data_deps = [ ":libcxx_headers" ]
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxx_include/buildtools/third_party/libc++/trunk",
"$root_out_dir")

outputs = [ "$root_build_dir/libcxx_headers.zip" ]
}

copy("libcxxabi_headers") {
sources = libcxxabi_headers + libcxxabi_licenses
outputs = [ "$target_gen_dir/electron_libcxxabi_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
}

dist_zip("libcxxabi_headers_zip") {
data_deps = [ ":libcxxabi_headers" ]
flatten = true
flatten_relative_to = rebase_path(
"$target_gen_dir/electron_libcxxabi_include/buildtools/third_party/libc++abi/trunk",
"$root_out_dir")

outputs = [ "$root_build_dir/libcxxabi_headers.zip" ]
}

action("libcxx_objects_zip") {
deps = [ "//buildtools/third_party/libc++" ]
script = "build/zip_libcxx.py"
outputs = [ "$root_build_dir/libcxx_objects.zip" ]
args = rebase_path(outputs)
}

group("electron") {
public_deps = [ ":electron_app" ]
}
4 changes: 2 additions & 2 deletions DEPS
Expand Up @@ -14,13 +14,13 @@ gclient_gn_args = [

vars = {
'chromium_version':
'91.0.4472.69',
'91.0.4472.106',
'node_version':
'v14.16.0',
'nan_version':
'v2.14.2',
'squirrel.mac_version':
'cdc0729c8bf8576bfef18629186e1e9ecf1b0d9f',
'0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',

'pyyaml_version': '3.12',

Expand Down
2 changes: 1 addition & 1 deletion ELECTRON_VERSION
@@ -1 +1 @@
13.0.0-beta.28
13.1.4
5 changes: 5 additions & 0 deletions build/args/all.gn
Expand Up @@ -28,3 +28,8 @@ libcxx_abi_unstable = false
enable_pseudolocales = false

is_cfi = false

# Make application name configurable at runtime for cookie crypto
allow_runtime_configurable_key_storage = true

enable_cet_shadow_stack = false
5 changes: 3 additions & 2 deletions build/fuses/build.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

from collections import OrderedDict
import json
import os
import sys
Expand Down Expand Up @@ -49,8 +50,8 @@
}
"""

with open(os.path.join(dir_path, "fuses.json"), 'r') as f:
fuse_defaults = json.load(f)
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"), object_pairs_hook=OrderedDict)

fuse_version = fuse_defaults['_version']
del fuse_defaults['_version']
Expand Down
3 changes: 2 additions & 1 deletion build/fuses/fuses.json → build/fuses/fuses.json5
Expand Up @@ -2,5 +2,6 @@
"_comment": "Modifying the fuse schema in any breaking way should result in the _version prop being incremented. NEVER remove a fuse or change its meaning, instead mark it as removed with 'r'",
"_schema": "0 == off, 1 == on, r == removed fuse",
"_version": 1,
"run_as_node": "1"
"run_as_node": "1",
"cookie_encryption": "0"
}

0 comments on commit 2d2f2bb

Please sign in to comment.