diff --git a/.autofix.markdownlint-cli2.jsonc b/.autofix.markdownlint-cli2.jsonc
new file mode 100644
index 0000000000000..5d7f87fcab44d
--- /dev/null
+++ b/.autofix.markdownlint-cli2.jsonc
@@ -0,0 +1,8 @@
+{
+ "config": {
+ "default": false,
+ "no-trailing-spaces": {
+ "br_spaces": 0
+ }
+ }
+}
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 960431281a9d8..0000000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,1766 +0,0 @@
-# The config expects the following environment variables to be set:
-# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
-#
-# The publishing scripts expect access tokens to be defined as env vars,
-# but those are not covered here.
-#
-# CircleCI docs on variables:
-# https://circleci.com/docs/2.0/env-vars/
-
-# Build machines configs.
-docker-image: &docker-image
- docker:
- - image: electronbuilds/electron:0.0.9
-
-machine-linux-medium: &machine-linux-medium
- <<: *docker-image
- resource_class: medium
-
-machine-linux-2xlarge: &machine-linux-2xlarge
- <<: *docker-image
- resource_class: 2xlarge
-
-machine-mac: &machine-mac
- macos:
- xcode: "9.4.1"
-
-machine-mac-large: &machine-mac-large
- resource_class: large
- macos:
- xcode: "9.4.1"
-
-# Build configurations options.
-env-debug-build: &env-debug-build
- GN_CONFIG: //electron/build/args/debug.gn
-
-env-testing-build: &env-testing-build
- GN_CONFIG: //electron/build/args/testing.gn
- CHECK_DIST_MANIFEST: '1'
-
-env-release-build: &env-release-build
- GN_CONFIG: //electron/build/args/release.gn
- STRIP_BINARIES: true
- GENERATE_SYMBOLS: true
-
-env-headless-testing: &env-headless-testing
- DISPLAY: ':99.0'
-
-env-stack-dumping: &env-stack-dumping
- ELECTRON_ENABLE_STACK_DUMPING: '1'
-
-env-browsertests: &env-browsertests
- GN_CONFIG: //electron/build/args/native_tests.gn
- BUILD_TARGET: electron/spec:chromium_browsertests
- TESTS_CONFIG: src/electron/spec/configs/browsertests.yml
-
-env-unittests: &env-unittests
- GN_CONFIG: //electron/build/args/native_tests.gn
- BUILD_TARGET: electron/spec:chromium_unittests
- TESTS_CONFIG: src/electron/spec/configs/unittests.yml
-
-# Build targets options.
-env-ia32: &env-ia32
- GN_EXTRA_ARGS: 'target_cpu = "x86"'
- NPM_CONFIG_ARCH: ia32
- TARGET_ARCH: ia32
-
-env-arm: &env-arm
- GN_EXTRA_ARGS: 'target_cpu = "arm"'
- MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm
- BUILD_NATIVE_MKSNAPSHOT: 1
- TARGET_ARCH: arm
-
-env-arm64: &env-arm64
- GN_EXTRA_ARGS: 'target_cpu = "arm64" fatal_linker_warnings = false enable_linux_installer = false'
- MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm64
- BUILD_NATIVE_MKSNAPSHOT: 1
- TARGET_ARCH: arm64
-
-env-mas: &env-mas
- GN_EXTRA_ARGS: 'is_mas_build = true'
- MAS_BUILD: 'true'
-
-# Misc build configuration options.
-env-enable-sccache: &env-enable-sccache
- USE_SCCACHE: true
-
-env-send-slack-notifications: &env-send-slack-notifications
- NOTIFY_SLACK: true
-
-env-linux-medium: &env-linux-medium
- NUMBER_OF_NINJA_PROCESSES: 3
-
-env-linux-2xlarge: &env-linux-2xlarge
- NUMBER_OF_NINJA_PROCESSES: 18
-
-env-machine-mac: &env-machine-mac
- NUMBER_OF_NINJA_PROCESSES: 6
-
-env-mac-large: &env-mac-large
- NUMBER_OF_NINJA_PROCESSES: 10
-
-env-disable-crash-reporter-tests: &env-disable-crash-reporter-tests
- DISABLE_CRASH_REPORTER_TESTS: true
-
-# Individual (shared) steps.
-step-maybe-notify-slack-failure: &step-maybe-notify-slack-failure
- run:
- name: Send a Slack notification on failure
- command: |
- if [ "$NOTIFY_SLACK" == "true" ]; then
- export MESSAGE="Build failed for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
- curl -g -H "Content-Type: application/json" -X POST \
- -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
- fi
- when: on_fail
-
-step-maybe-notify-slack-success: &step-maybe-notify-slack-success
- run:
- name: Send a Slack notification on success
- command: |
- if [ "$NOTIFY_SLACK" == "true" ]; then
- export MESSAGE="Build succeeded for *<$CIRCLE_BUILD_URL|$CIRCLE_JOB>* nightly build from *$CIRCLE_BRANCH*."
- curl -g -H "Content-Type: application/json" -X POST \
- -d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"good\",\"title\": \"$CIRCLE_JOB nightly build results\",\"title_link\": \"$CIRCLE_BUILD_URL\"}]}" $SLACK_WEBHOOK
- fi
- when: on_success
-
-step-checkout-electron: &step-checkout-electron
- checkout:
- path: src/electron
-
-step-depot-tools-get: &step-depot-tools-get
- run:
- name: Get depot tools
- command: |
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
-
-step-depot-tools-add-to-path: &step-depot-tools-add-to-path
- run:
- name: Add depot tools to PATH
- command: echo 'export PATH="$PATH:'"$PWD"'/depot_tools"' >> $BASH_ENV
-
-step-gclient-sync: &step-gclient-sync
- run:
- name: Gclient sync
- command: |
- # If we did not restore a complete sync then we need to sync for realz
- if [ ! -s "src/electron/.circle-sync-done" ]; then
- gclient config \
- --name "src/electron" \
- --unmanaged \
- $GCLIENT_EXTRA_ARGS \
- "$CIRCLE_REPOSITORY_URL"
-
- gclient sync --with_branch_heads --with_tags
- fi
-
-step-setup-env-for-build: &step-setup-env-for-build
- run:
- name: Setup Environment Variables
- command: |
- # To find `gn` executable.
- echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
-
- if [ "$USE_SCCACHE" == "true" ]; then
- # https://github.com/mozilla/sccache
- SCCACHE_PATH="$PWD/src/electron/external_binaries/sccache"
- echo 'export SCCACHE_PATH="'"$SCCACHE_PATH"'"' >> $BASH_ENV
- if [ "$CIRCLE_PR_NUMBER" != "" ]; then
- #if building a fork set readonly access to sccache
- echo 'export SCCACHE_BUCKET="electronjs-sccache"' >> $BASH_ENV
- echo 'export SCCACHE_TWO_TIER=true' >> $BASH_ENV
- fi
- fi
-
-step-restore-brew-cache: &step-restore-brew-cache
- restore_cache:
- paths:
- - /usr/local/Homebrew
- keys:
- - v1-brew-cache-{{ arch }}
-
-step-get-more-space-on-mac: &step-get-more-space-on-mac
- run:
- name: Free up space on MacOS
- command: |
- if [ "`uname`" == "Darwin" ]; then
- sudo rm -rf /Library/Developer/CoreSimulator
- fi
-
-step-delete-git-directories: &step-delete-git-directories
- run:
- name: Delete src/.git directory on MacOS to free space
- command: |
- if [ "`uname`" == "Darwin" ]; then
- sudo rm -rf src/.git
- fi
-
-# On macOS the yarn install command during gclient sync was run on a linux
-# machine and therefore installed a slightly different set of dependencies
-# Notably "fsevents" is a macOS only dependency, we rerun yarn install once
-# we are on a macOS machine to get the correct state
-step-install-npm-deps-on-mac: &step-install-npm-deps-on-mac
- run:
- name: Install node_modules on MacOS
- command: |
- if [ "`uname`" == "Darwin" ]; then
- cd src/electron
- node script/yarn install
- fi
-
-# This step handles the differences between the linux "gclient sync"
-# and the expected state on macOS
-step-fix-sync-on-mac: &step-fix-sync-on-mac
- run:
- name: Fix Sync on macOS
- command: |
- if [ "`uname`" == "Darwin" ]; then
- # Fix Clang Install (wrong binary)
- rm -rf src/third_party/llvm-build
- python src/tools/clang/scripts/update.py
- # Fix Framework Header Installs (symlinks not retained)
- rm -rf src/electron/external_binaries
- python src/electron/script/update-external-binaries.py
- fi
-
-step-install-signing-cert-on-mac: &step-install-signing-cert-on-mac
- run:
- name: Import and trust self-signed codesigning cert on MacOS
- command: |
- if [ "`uname`" == "Darwin" ]; then
- cd src/electron
- ./script/codesign/import-testing-cert-ci.sh
- fi
-
-step-install-gnutar-on-mac: &step-install-gnutar-on-mac
- run:
- name: Install gnu-tar on macos
- command: |
- if [ "`uname`" == "Darwin" ]; then
- brew update
- brew install gnu-tar
- ln -fs /usr/local/bin/gtar /usr/local/bin/tar
- fi
-
-step-gn-gen-default: &step-gn-gen-default
- run:
- name: Default GN gen
- command: |
- cd src
- gn gen out/Default --args='import("'$GN_CONFIG'") cc_wrapper="'"$SCCACHE_PATH"'"'" $GN_EXTRA_ARGS"
-
-step-gn-check: &step-gn-check
- run:
- name: GN check
- command: |
- cd src
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron:manifests
- gn check out/Default //electron/atom/common/api:mojo
-
-step-electron-build: &step-electron-build
- run:
- name: Electron build
- no_output_timeout: 30m
- command: |
- cd src
- ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
-
-step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
- run:
- name: Strip electron binaries
- command: |
- if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" != "Darwin" ]; then
- cd src
- electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH"
- fi
-
-step-electron-dist-build: &step-electron-dist-build
- run:
- name: Build dist.zip
- command: |
- cd src
- ninja -C out/Default electron:electron_dist_zip
- if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
- if [ "`uname`" == "Darwin" ]; then
- target_os=mac
- target_cpu=x64
- if [ x"$MAS_BUILD" == x"true" ]; then
- target_os=mac_mas
- fi
- elif [ "`uname`" == "Linux" ]; then
- target_os=linux
- if [ x"$TARGET_ARCH" == x ]; then
- target_cpu=x64
- elif [ "$TARGET_ARCH" == "ia32" ]; then
- target_cpu=x86
- else
- target_cpu="$TARGET_ARCH"
- fi
- else
- echo "Unknown system: `uname`"
- exit 1
- fi
- electron/script/check-zip-manifest.py out/Default/dist.zip electron/script/dist_zip.$target_os.$target_cpu.manifest
- fi
-
-step-electron-dist-store: &step-electron-dist-store
- store_artifacts:
- path: src/out/Default/dist.zip
- destination: dist.zip
-
-step-electron-chromedriver-build: &step-electron-chromedriver-build
- run:
- name: Build chromedriver.zip
- command: |
- cd src
- ninja -C out/Default chrome/test/chromedriver -j $NUMBER_OF_NINJA_PROCESSES
- electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/out/Default/chromedriver
- ninja -C out/Default electron:electron_chromedriver_zip
-
-step-electron-chromedriver-store: &step-electron-chromedriver-store
- store_artifacts:
- path: src/out/Default/chromedriver.zip
- destination: chromedriver.zip
-
-step-nodejs-headers-build: &step-nodejs-headers-build
- run:
- name: Build Node.js headers
- command: |
- cd src
- ninja -C out/Default third_party/electron_node:headers
-
-step-nodejs-headers-store: &step-nodejs-headers-store
- store_artifacts:
- path: src/out/Default/gen/node_headers.tar.gz
- destination: node_headers.tar.gz
-
-step-electron-publish: &step-electron-publish
- run:
- name: Publish Electron Dist
- command: |
- cd src/electron
- if [ "$UPLOAD_TO_S3" == "1" ]; then
- echo 'Uploading Electron release distribution to S3'
- script/upload.py --upload_to_s3
- else
- echo 'Uploading Electron release distribution to Github releases'
- script/upload.py
- fi
-
-step-persist-data-for-tests: &step-persist-data-for-tests
- persist_to_workspace:
- root: .
- paths:
- # Build artifacts
- - src/out/Default/dist.zip
- - src/out/Default/mksnapshot.zip
- - src/out/Default/gen/node_headers
- - src/out/ffmpeg/ffmpeg.zip
-
-step-electron-dist-unzip: &step-electron-dist-unzip
- run:
- name: Unzip dist.zip
- command: |
- cd src/out/Default
- # -o overwrite files WITHOUT prompting
- # TODO(alexeykuzmin): Remove '-o' when it's no longer needed.
- unzip -o dist.zip
-
-step-ffmpeg-unzip: &step-ffmpeg-unzip
- run:
- name: Unzip ffmpeg.zip
- command: |
- cd src/out/ffmpeg
- unzip -o ffmpeg.zip
-
-step-mksnapshot-unzip: &step-mksnapshot-unzip
- run:
- name: Unzip mksnapshot.zip
- command: |
- cd src/out/Default
- unzip -o mksnapshot.zip
-
-step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
- run:
- name: ffmpeg GN gen
- command: |
- cd src
- gn gen out/ffmpeg --args='import("//electron/build/args/ffmpeg.gn") cc_wrapper="'"$SCCACHE_PATH"'"'" $GN_EXTRA_ARGS"
-
-step-ffmpeg-build: &step-ffmpeg-build
- run:
- name: Non proprietary ffmpeg build
- command: |
- cd src
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip -j $NUMBER_OF_NINJA_PROCESSES
-
-step-verify-ffmpeg: &step-verify-ffmpeg
- run:
- name: Verify ffmpeg
- command: |
- cd src
- python electron/script/verify-ffmpeg.py --source-root "$PWD" --build-dir out/Default --ffmpeg-path out/ffmpeg
-
-step-ffmpeg-store: &step-ffmpeg-store
- store_artifacts:
- path: src/out/ffmpeg/ffmpeg.zip
- destination: ffmpeg.zip
-
-step-verify-mksnapshot: &step-verify-mksnapshot
- run:
- name: Verify mksnapshot
- command: |
- cd src
- python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
-
-step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
- run:
- name: Setup for headless testing
- command: |
- if [ "`uname`" != "Darwin" ]; then
- sh -e /etc/init.d/xvfb start
- fi
-
-step-show-sccache-stats: &step-show-sccache-stats
- run:
- name: Check sccache stats after build
- command: |
- if [ "$SCCACHE_PATH" != "" ]; then
- $SCCACHE_PATH -s
- fi
-
-step-mksnapshot-build: &step-mksnapshot-build
- run:
- name: mksnapshot build
- command: |
- cd src
- if [ "`uname`" != "Darwin" ]; then
- if [ "$TARGET_ARCH" == "arm" ]; then
- electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
- elif [ "$TARGET_ARCH" == "arm64" ]; then
- electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
- else
- electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
- fi
- fi
- ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
-
-step-mksnapshot-store: &step-mksnapshot-store
- store_artifacts:
- path: src/out/Default/mksnapshot.zip
- destination: mksnapshot.zip
-
-step-maybe-build-dump-syms: &step-maybe-build-dump-syms
- run:
- name: Build dump_syms binary
- command: |
- if [ "$GENERATE_SYMBOLS" == "true" ]; then
- cd src
- # Build needed dump_syms executable
- ninja -C out/Default third_party/breakpad:dump_syms
- fi
-
-step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
- run:
- name: Generate breakpad symbols
- command: |
- if [ "$GENERATE_SYMBOLS" == "true" ]; then
- cd src
- export BUILD_PATH="$PWD/out/Default"
- export DEST_PATH="$BUILD_PATH/breakpad_symbols"
- electron/script/dump-symbols.py -b $BUILD_PATH -d $DEST_PATH -v
- fi
-
-step-maybe-zip-symbols: &step-maybe-zip-symbols
- run:
- name: Zip symbols
- command: |
- cd src
- export BUILD_PATH="$PWD/out/Default"
- electron/script/zip-symbols.py -b $BUILD_PATH
-
-step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
- run:
- name: Generate cross arch snapshot (arm/arm64)
- command: |
- if [ "$TRIGGER_ARM_TEST" == "true" ] && [ -z "$CIRCLE_PR_NUMBER" ]; then
- cd src
- if [ "$TARGET_ARCH" == "arm" ]; then
- export MKSNAPSHOT_PATH="clang_x86_v8_arm"
- elif [ "$TARGET_ARCH" == "arm64" ]; then
- export MKSNAPSHOT_PATH="clang_x64_v8_arm64"
- fi
- cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
- cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
- cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
- python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
- mkdir cross-arch-snapshots
- cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
- fi
-
-step-maybe-cross-arch-snapshot-store: &step-maybe-cross-arch-snapshot-store
- store_artifacts:
- 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
- echo "Triggering electron-$TARGET_ARCH-testing build on VSTS"
- node electron/script/ci-release-build.js --job=electron-$TARGET_ARCH-testing --ci=VSTS --armTest --circleBuildNum=$CIRCLE_BUILD_NUM $CIRCLE_BRANCH
- fi
-
-step-maybe-generate-typescript-defs: &step-maybe-generate-typescript-defs
- run:
- name: Generate type declarations
- command: |
- if [ "`uname`" == "Darwin" ]; then
- cd src/electron
- node script/yarn create-typescript-definitions
- fi
-
-step-fix-known-hosts-linux: &step-fix-known-hosts-linux
- run:
- name: Fix Known Hosts on Linux
- command: |
- if [ "`uname`" == "Linux" ]; then
- ./src/electron/.circleci/fix-known-hosts.sh
- fi
-
-# Lists of steps.
-steps-lint: &steps-lint
- steps:
- - *step-checkout-electron
- - run:
- name: Setup third_party Depot Tools
- command: |
- # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
- echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
- - run:
- name: Download GN Binary
- command: |
- chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
- gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
-
- cipd ensure -ensure-file - -root . <<-CIPD
- \$ServiceURL https://chrome-infra-packages.appspot.com/
- @Subdir buildtools/linux64
- gn/gn/linux-amd64 $gn_version
- CIPD
-
- echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/buildtools"' >> $BASH_ENV
- - run:
- name: Run Lint
- command: |
- # gn.py tries to find a gclient root folder starting from the current dir.
- # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
- touch .gclient
- # Another option would be to checkout "buildtools" inside the Electron checkout,
- # but then we would lint its contents (at least gn format), and it doesn't pass it.
-
- cd src/electron
- node script/yarn install
- node script/yarn lint
-
-steps-checkout: &steps-checkout
- steps:
- - *step-checkout-electron
- - *step-depot-tools-get
- - *step-depot-tools-add-to-path
- - *step-restore-brew-cache
- - *step-get-more-space-on-mac
- - *step-install-gnutar-on-mac
-
- - run:
- name: Generate DEPS Hash
- command: node src/electron/script/generate-deps-hash.js
- - run:
- name: Touch Sync Done
- command: touch src/electron/.circle-sync-done
- # Restore exact src cache based on the hash of DEPS and patches/*
- # If no cache is matched EXACTLY then the .circle-sync-done file is empty
- # If a cache is matched EXACTLY then the .circle-sync-done file contains "done"
- - restore_cache:
- paths:
- - ./src
- keys:
- - v5-src-cache-{{ arch }}-{{ checksum "src/electron/.depshash" }}
- name: Restoring src cache
- # Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done
- # If the src cache was restored above then this will match an empty cache
- # If the src cache was not restored above then this will match a close git cache
- - restore_cache:
- paths:
- - ~/.gclient-cache
- keys:
- - v2-gclient-cache-{{ arch }}-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
- - v2-gclient-cache-{{ arch }}-{{ checksum "src/electron/.circle-sync-done" }}
- name: Conditionally restoring git cache
- - run:
- name: Set GIT_CACHE_PATH to make gclient to use the cache
- command: |
- # CircleCI does not support interpolation when setting environment variables.
- # https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-shell-command
- echo 'export GIT_CACHE_PATH="$HOME/.gclient-cache"' >> $BASH_ENV
- # This sync call only runs if .circle-sync-done is an EMPTY file
- - *step-gclient-sync
- # Persist the git cache based on the hash of DEPS and .circle-sync-done
- # If the src cache was restored above then this will persist an empty cache
- - save_cache:
- paths:
- - ~/.gclient-cache
- key: v2-gclient-cache-{{ arch }}-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
- name: Persisting git cache
- # These next few steps reset Electron to the correct commit regardless of which cache was restored
- - run:
- name: Wipe Electron
- command: rm -rf src/electron
- - *step-checkout-electron
- - run:
- name: Run Electron Only Hooks
- command: gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
- - run:
- name: Generate DEPS Hash
- command: (cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
- # Mark the sync as done for future cache saving
- - run:
- name: Mark Sync Done
- command: echo DONE > src/electron/.circle-sync-done
- # Minimize the size of the cache
- - run:
- name: Remove some unused data to avoid storing it in the workspace/cache
- command: |
- rm -rf src/android_webview
- rm -rf src/ios
- rm -rf src/third_party/blink/web_tests
- rm -rf src/third_party/blink/perf_tests
- rm -rf src/third_party/hunspell_dictionaries
- rm -rf src/third_party/WebKit/LayoutTests
- # Save the src cache based on the deps hash
- - save_cache:
- paths:
- - ./src
- key: v5-src-cache-{{ arch }}-{{ checksum "src/electron/.depshash" }}
- name: Persisting src cache
- - save_cache:
- paths:
- - /usr/local/Homebrew
- key: v1-brew-cache-{{ arch }}
- name: Persisting brew cache
- - persist_to_workspace:
- root: .
- paths:
- - depot_tools
- - src
-
-steps-electron-gn-check: &steps-electron-gn-check
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-setup-env-for-build
- - *step-gn-gen-default
- - *step-gn-check
-
-steps-electron-build: &steps-electron-build
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-setup-env-for-build
- - *step-gn-gen-default
-
- # Electron app
- - *step-electron-build
- - *step-electron-dist-build
- - *step-electron-dist-store
-
- # Node.js headers
- - *step-nodejs-headers-build
- - *step-nodejs-headers-store
-
- - *step-show-sccache-stats
-
-steps-electron-build-for-tests: &steps-electron-build-for-tests
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-setup-env-for-build
- - *step-restore-brew-cache
- - *step-install-npm-deps-on-mac
- - *step-fix-sync-on-mac
- - *step-gn-gen-default
-
- # Electron app
- - *step-electron-build
- - *step-maybe-electron-dist-strip
- - *step-electron-dist-build
- - *step-electron-dist-store
-
- # Node.js headers
- - *step-nodejs-headers-build
- - *step-nodejs-headers-store
-
- - *step-show-sccache-stats
-
- # mksnapshot
- - *step-mksnapshot-build
- - *step-mksnapshot-store
- - *step-maybe-cross-arch-snapshot
- - *step-maybe-cross-arch-snapshot-store
-
- # ffmpeg
- - *step-ffmpeg-gn-gen
- - *step-ffmpeg-build
- - *step-ffmpeg-store
-
- # Save all data needed for a further tests run.
- - *step-persist-data-for-tests
-
- - *step-maybe-build-dump-syms
- - *step-maybe-generate-breakpad-symbols
- - *step-maybe-zip-symbols
-
- # Trigger tests on arm hardware if needed
- - *step-maybe-trigger-arm-test
-
- - *step-maybe-notify-slack-failure
-
-steps-electron-build-for-publish: &steps-electron-build-for-publish
- steps:
- - *step-checkout-electron
- - *step-depot-tools-get
- - *step-depot-tools-add-to-path
- - *step-restore-brew-cache
- - *step-get-more-space-on-mac
- - *step-gclient-sync
- - *step-setup-env-for-build
- - *step-gn-gen-default
- - *step-delete-git-directories
-
- # Electron app
- - *step-electron-build
- - *step-maybe-electron-dist-strip
- - *step-electron-dist-build
- - *step-electron-dist-store
- - *step-maybe-build-dump-syms
- - *step-maybe-generate-breakpad-symbols
- - *step-maybe-zip-symbols
-
- # mksnapshot
- - *step-mksnapshot-build
- - *step-mksnapshot-store
-
- # chromedriver
- - *step-electron-chromedriver-build
- - *step-electron-chromedriver-store
-
- # Node.js headers
- - *step-nodejs-headers-build
- - *step-nodejs-headers-store
-
- # ffmpeg
- - *step-ffmpeg-gn-gen
- - *step-ffmpeg-build
- - *step-ffmpeg-store
-
- # typescript defs
- - *step-maybe-generate-typescript-defs
-
- # Publish
- - *step-electron-publish
-
-steps-chromedriver-build: &steps-chromedriver-build
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-setup-env-for-build
- - *step-fix-sync-on-mac
- - *step-gn-gen-default
-
- - *step-electron-chromedriver-build
- - *step-electron-chromedriver-store
-
- - *step-maybe-notify-slack-failure
-
-steps-native-tests: &steps-native-tests
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-setup-env-for-build
- - *step-gn-gen-default
-
- - run:
- name: Build tests
- command: |
- cd src
- ninja -C out/Default $BUILD_TARGET
- - *step-show-sccache-stats
-
- - *step-setup-linux-for-headless-testing
- - run:
- name: Run tests
- command: |
- mkdir test_results
- python src/electron/script/native-tests.py run \
- --config $TESTS_CONFIG \
- --tests-dir src/out/Default \
- --output-dir test_results \
- $TESTS_ARGS
-
- - store_artifacts:
- path: test_results
- destination: test_results # Put it in the root folder.
- - store_test_results:
- path: test_results
-
-steps-verify-ffmpeg: &steps-verify-ffmpeg
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-electron-dist-unzip
- - *step-ffmpeg-unzip
- - *step-setup-linux-for-headless-testing
-
- - *step-verify-ffmpeg
- - *step-maybe-notify-slack-failure
-
-steps-verify-mksnapshot: &steps-verify-mksnapshot
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-electron-dist-unzip
- - *step-mksnapshot-unzip
- - *step-setup-linux-for-headless-testing
-
- - *step-verify-mksnapshot
- - *step-maybe-notify-slack-failure
-
-steps-tests: &steps-tests
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-electron-dist-unzip
- - *step-mksnapshot-unzip
- - *step-setup-linux-for-headless-testing
- - *step-restore-brew-cache
- - *step-fix-known-hosts-linux
- - *step-install-signing-cert-on-mac
-
- - run:
- name: Run Electron tests
- environment:
- MOCHA_REPORTER: mocha-multi-reporters
- MOCHA_FILE: junit/test-results.xml
- MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
- ELECTRON_DISABLE_SECURITY_WARNINGS: 1
- command: |
- cd src
- export ELECTRON_OUT_DIR=Default
- (cd electron && node script/yarn test -- --ci --enable-logging)
- - run:
- name: Check test results existence
- command: |
- MOCHA_FILE='src/junit/test-results-remote.xml'
- # Check if it exists and not empty.
- if [ ! -s "$MOCHA_FILE" ]; then
- exit 1
- fi
-
- MOCHA_FILE='src/junit/test-results-main.xml'
- # Check if it exists and not empty.
- if [ ! -s "$MOCHA_FILE" ]; then
- exit 1
- fi
- - store_test_results:
- path: src/junit
-
- - *step-verify-mksnapshot
-
- - *step-maybe-notify-slack-failure
-
-steps-test-nan: &steps-test-nan
- steps:
- - attach_workspace:
- at: .
- - *step-depot-tools-add-to-path
- - *step-electron-dist-unzip
- - *step-setup-linux-for-headless-testing
- - *step-fix-known-hosts-linux
- - run:
- name: Run Nan Tests
- command: |
- cd src
- export ELECTRON_OUT_DIR=Default
- node electron/script/nan-spec-runner.js
-
-chromium-upgrade-branches: &chromium-upgrade-branches
- /chromium\-upgrade\/[0-9]+/
-
-# List of all jobs.
-version: 2
-jobs:
- # Layer 0: Lint. Standalone.
- lint:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *steps-lint
-
- # Layer 1: Checkout.
- linux-checkout:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
- <<: *steps-checkout
-
- linux-checkout-for-native-tests:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_pyyaml=True'
- <<: *steps-checkout
-
- linux-checkout-for-native-tests-with-no-patches:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=apply_patches=False --custom-var=checkout_pyyaml=True'
- <<: *steps-checkout
-
- mac-checkout:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
- <<: *steps-checkout
-
- # Layer 2: Builds.
- linux-x64-debug:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-debug-build
- <<: *env-enable-sccache
- <<: *steps-electron-build
-
- linux-x64-debug-gn-check:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-debug-build
- <<: *steps-electron-gn-check
-
- linux-x64-testing:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-testing-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- linux-x64-testing-gn-check:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-testing-build
- <<: *steps-electron-gn-check
-
- linux-x64-chromedriver:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- linux-x64-release:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-electron-build-for-tests
-
- linux-x64-publish:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *env-release-build
- <<: *steps-electron-build-for-publish
-
- linux-ia32-debug:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-ia32
- <<: *env-debug-build
- <<: *env-enable-sccache
- <<: *steps-electron-build
-
- linux-ia32-testing:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-ia32
- <<: *env-testing-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- linux-ia32-chromedriver:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- linux-ia32-release:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-ia32
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-electron-build-for-tests
-
- linux-ia32-publish:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *env-ia32
- <<: *env-release-build
- <<: *steps-electron-build-for-publish
-
- linux-arm-debug:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm
- <<: *env-debug-build
- <<: *env-enable-sccache
- <<: *steps-electron-build
-
- linux-arm-testing:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm
- <<: *env-testing-build
- <<: *env-enable-sccache
- TRIGGER_ARM_TEST: true
- <<: *steps-electron-build-for-tests
-
- linux-arm-chromedriver:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-arm
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- linux-arm-release:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-electron-build-for-tests
-
- linux-arm-publish:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm
- <<: *env-release-build
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *steps-electron-build-for-publish
-
- linux-arm64-debug:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm64
- <<: *env-debug-build
- <<: *env-enable-sccache
- <<: *steps-electron-build
-
- linux-arm64-debug-gn-check:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-arm64
- <<: *env-debug-build
- <<: *steps-electron-gn-check
-
- linux-arm64-testing:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm64
- <<: *env-testing-build
- <<: *env-enable-sccache
- TRIGGER_ARM_TEST: true
- <<: *steps-electron-build-for-tests
-
- linux-arm64-testing-gn-check:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-arm64
- <<: *env-testing-build
- <<: *steps-electron-gn-check
-
- linux-arm64-chromedriver:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-arm64
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- linux-arm64-release:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm64
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-electron-build-for-tests
-
- linux-arm64-publish:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-arm64
- <<: *env-release-build
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *steps-electron-build-for-publish
-
- osx-testing:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-testing-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- osx-debug-gn-check:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-debug-build
- <<: *steps-electron-gn-check
-
- osx-testing-gn-check:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-testing-build
- <<: *steps-electron-gn-check
-
- osx-chromedriver:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- osx-release:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- osx-publish:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-release-build
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *steps-electron-build-for-publish
-
- mas-testing:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-mas
- <<: *env-testing-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- mas-debug-gn-check:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-mas
- <<: *env-debug-build
- <<: *steps-electron-gn-check
-
- mas-testing-gn-check:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-mas
- <<: *env-testing-build
- <<: *steps-electron-gn-check
-
- mas-chromedriver:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *env-send-slack-notifications
- <<: *steps-chromedriver-build
-
- mas-release:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-mas
- <<: *env-release-build
- <<: *env-enable-sccache
- <<: *steps-electron-build-for-tests
-
- mas-publish:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-mas
- <<: *env-release-build
- GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
- <<: *steps-electron-build-for-publish
-
- # Layer 3: Tests.
- linux-x64-unittests:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-unittests
- <<: *env-enable-sccache
- <<: *env-headless-testing
- <<: *steps-native-tests
-
- linux-x64-disabled-unittests:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-unittests
- <<: *env-enable-sccache
- <<: *env-headless-testing
- TESTS_ARGS: '--only-disabled-tests'
- <<: *steps-native-tests
-
- linux-x64-chromium-unittests:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-unittests
- <<: *env-enable-sccache
- <<: *env-headless-testing
- TESTS_ARGS: '--include-disabled-tests'
- <<: *steps-native-tests
-
- linux-x64-browsertests:
- <<: *machine-linux-2xlarge
- environment:
- <<: *env-linux-2xlarge
- <<: *env-browsertests
- <<: *env-testing-build
- <<: *env-enable-sccache
- <<: *env-headless-testing
- <<: *steps-native-tests
-
- linux-x64-testing-tests:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-headless-testing
- <<: *env-stack-dumping
- <<: *steps-tests
-
- linux-x64-testing-nan:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-headless-testing
- <<: *env-stack-dumping
- <<: *steps-test-nan
-
- linux-x64-release-tests:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-tests
-
- linux-x64-verify-ffmpeg:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-verify-ffmpeg
-
- linux-x64-verify-mksnapshot:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-verify-mksnapshot
-
- linux-ia32-testing-tests:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-headless-testing
- <<: *env-stack-dumping
- <<: *steps-tests
-
- linux-ia32-testing-nan:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-headless-testing
- <<: *env-stack-dumping
- <<: *steps-test-nan
-
- linux-ia32-release-tests:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-tests
-
- linux-ia32-verify-ffmpeg:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-verify-ffmpeg
-
- linux-ia32-verify-mksnapshot:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-ia32
- <<: *env-headless-testing
- <<: *env-send-slack-notifications
- <<: *steps-verify-mksnapshot
-
- osx-testing-tests:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-stack-dumping
- <<: *env-disable-crash-reporter-tests
- <<: *steps-tests
-
- osx-release-tests:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-stack-dumping
- <<: *env-send-slack-notifications
- <<: *env-disable-crash-reporter-tests
- <<: *steps-tests
-
- osx-verify-ffmpeg:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- <<: *steps-verify-ffmpeg
-
- osx-verify-mksnapshot:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- <<: *steps-verify-mksnapshot
-
- mas-testing-tests:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-stack-dumping
- <<: *steps-tests
-
- mas-release-tests:
- <<: *machine-mac-large
- environment:
- <<: *env-mac-large
- <<: *env-stack-dumping
- <<: *env-send-slack-notifications
- <<: *steps-tests
-
- mas-verify-ffmpeg:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- <<: *steps-verify-ffmpeg
-
- mas-verify-mksnapshot:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- <<: *steps-verify-mksnapshot
-
- # Layer 4: Summary.
- linux-x64-release-summary:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
- linux-ia32-release-summary:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
- linux-arm-release-summary:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
- linux-arm64-release-summary:
- <<: *machine-linux-medium
- environment:
- <<: *env-linux-medium
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
- mas-release-summary:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
- osx-release-summary:
- <<: *machine-mac
- environment:
- <<: *env-machine-mac
- <<: *env-send-slack-notifications
- steps:
- - *step-maybe-notify-slack-success
-
-workflows:
- version: 2
- lint:
- jobs:
- - lint
-
- build-linux:
- jobs:
- - linux-checkout
-
- - linux-x64-debug:
- requires:
- - linux-checkout
- - linux-x64-debug-gn-check:
- requires:
- - linux-checkout
- - linux-x64-testing:
- requires:
- - linux-checkout
- - linux-x64-testing-gn-check:
- requires:
- - linux-checkout
- - linux-x64-testing-tests:
- requires:
- - linux-x64-testing
- - linux-x64-testing-nan:
- requires:
- - linux-x64-testing
-
- - linux-ia32-debug:
- requires:
- - linux-checkout
- - linux-ia32-testing:
- requires:
- - linux-checkout
- - linux-ia32-testing-tests:
- requires:
- - linux-ia32-testing
- - linux-ia32-testing-nan:
- requires:
- - linux-ia32-testing
-
- - linux-arm-debug:
- requires:
- - linux-checkout
- - linux-arm-testing:
- requires:
- - linux-checkout
-
- - linux-arm64-debug:
- requires:
- - linux-checkout
- - linux-arm64-debug-gn-check:
- requires:
- - linux-checkout
- - linux-arm64-testing:
- requires:
- - linux-checkout
- - linux-arm64-testing-gn-check:
- requires:
- - linux-checkout
-
- build-mac:
- jobs:
- - mac-checkout
- - osx-testing:
- requires:
- - mac-checkout
-
- - osx-debug-gn-check:
- requires:
- - mac-checkout
- - osx-testing-gn-check:
- requires:
- - mac-checkout
-
- - osx-testing-tests:
- requires:
- - osx-testing
-
- - mas-testing:
- requires:
- - mac-checkout
-
- - mas-debug-gn-check:
- requires:
- - mac-checkout
- - mas-testing-gn-check:
- requires:
- - mac-checkout
-
- - mas-testing-tests:
- requires:
- - mas-testing
-
- nightly-linux-release-test:
- triggers:
- - schedule:
- cron: "0 0 * * *"
- filters:
- branches:
- only:
- - master
- - *chromium-upgrade-branches
- jobs:
- - linux-checkout
-
- - linux-x64-release:
- requires:
- - linux-checkout
- - linux-x64-release-tests:
- requires:
- - linux-x64-release
- - linux-x64-verify-ffmpeg:
- requires:
- - linux-x64-release
- - linux-x64-verify-mksnapshot:
- requires:
- - linux-x64-release
- - linux-x64-chromedriver:
- requires:
- - linux-checkout
- - linux-x64-release-summary:
- requires:
- - linux-x64-release
- - linux-x64-release-tests
- - linux-x64-verify-ffmpeg
- - linux-x64-chromedriver
-
- - linux-ia32-release:
- requires:
- - linux-checkout
- - linux-ia32-release-tests:
- requires:
- - linux-ia32-release
- - linux-ia32-verify-ffmpeg:
- requires:
- - linux-ia32-release
- - linux-ia32-verify-mksnapshot:
- requires:
- - linux-ia32-release
- - linux-ia32-chromedriver:
- requires:
- - linux-checkout
- - linux-ia32-release-summary:
- requires:
- - linux-ia32-release
- - linux-ia32-release-tests
- - linux-ia32-verify-ffmpeg
- - linux-ia32-chromedriver
-
- - linux-arm-release:
- requires:
- - linux-checkout
- - linux-arm-chromedriver:
- requires:
- - linux-checkout
- - linux-arm-release-summary:
- requires:
- - linux-arm-release
- - linux-arm-chromedriver
-
-
- - linux-arm64-release:
- requires:
- - linux-checkout
- - linux-arm64-chromedriver:
- requires:
- - linux-checkout
- - linux-arm64-release-summary:
- requires:
- - linux-arm64-release
- - linux-arm64-chromedriver
-
- nightly-mac-release-test:
- triggers:
- - schedule:
- cron: "0 0 * * *"
- filters:
- branches:
- only:
- - master
- - *chromium-upgrade-branches
- jobs:
- - mac-checkout
-
- - osx-release:
- requires:
- - mac-checkout
- - osx-release-tests:
- requires:
- - osx-release
- - osx-verify-ffmpeg:
- requires:
- - osx-release
- - osx-verify-mksnapshot:
- requires:
- - osx-release
- - osx-chromedriver:
- requires:
- - mac-checkout
- - osx-release-summary:
- requires:
- - osx-release
- - osx-release-tests
- - osx-verify-ffmpeg
- - osx-chromedriver
-
- - mas-release:
- requires:
- - mac-checkout
- - mas-release-tests:
- requires:
- - mas-release
- - mas-verify-ffmpeg:
- requires:
- - mas-release
- - mas-verify-mksnapshot:
- requires:
- - mas-release
- - mas-chromedriver:
- requires:
- - mac-checkout
- - mas-release-summary:
- requires:
- - mas-release
- - mas-release-tests
- - mas-verify-ffmpeg
- - mas-chromedriver
-
- # Various slow and non-essential checks we run only nightly.
- # Sanitizer jobs should be added here.
- linux-checks-nightly:
- triggers:
- - schedule:
- cron: "0 0 * * *"
- filters:
- branches:
- only:
- - master
- - *chromium-upgrade-branches
- jobs:
- - linux-checkout-for-native-tests
-
- # TODO(alexeykuzmin): Enable it back.
- # Tons of crashes right now, see
- # https://circleci.com/gh/electron/electron/67463
-# - linux-x64-browsertests:
-# requires:
-# - linux-checkout-for-native-tests
-
- - linux-x64-unittests:
- requires:
- - linux-checkout-for-native-tests
-
- - linux-x64-disabled-unittests:
- requires:
- - linux-checkout-for-native-tests
-
- - linux-checkout-for-native-tests-with-no-patches
-
- - linux-x64-chromium-unittests:
- requires:
- - linux-checkout-for-native-tests-with-no-patches
diff --git a/.circleci/fix-known-hosts.sh b/.circleci/fix-known-hosts.sh
deleted file mode 100755
index d6d36e791ad5e..0000000000000
--- a/.circleci/fix-known-hosts.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-set -e
-
-mkdir -p ~/.ssh
-echo "|1|B3r+7aO0/x90IdefihIjxIoJrrk=|OJddGDfhbuLFc1bUyy84hhIw57M= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
-|1|rGlEvW55DtzNZp+pzw9gvyOyKi4=|LLWr+7qlkAlw3YGGVfLHHxB/kR0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000000000..6fb5e40a261ff
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,4 @@
+---
+Checks: '-modernize-use-nullptr'
+InheritParentConfig: true
+...
diff --git a/.devcontainer/README.md b/.devcontainer/README.md
new file mode 100644
index 0000000000000..9cfac3588531b
--- /dev/null
+++ b/.devcontainer/README.md
@@ -0,0 +1,68 @@
+# Electron Dev on Codespaces
+
+Welcome to the Codespaces Electron Developer Environment.
+
+## Quick Start
+
+Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following command.
+
+```bash
+e build
+```
+
+The initial build will take ~8 minutes. Incremental builds are substantially quicker. If you pull changes from upstream that touch either the `patches` folder or the `DEPS` folder you will have to run `e sync` in order to keep your checkout up to date.
+
+## Directory Structure
+
+Codespaces doesn't lean very well into gclient based checkouts, the directory structure is slightly strange. There are two locations for the `electron` checkout that both map to the same files under the hood.
+
+```graphql
+# Primary gclient checkout container
+/workspaces/gclient/*
+ └─ src/* - # Chromium checkout
+ └─ electron - # Electron checkout
+# Symlinked Electron checkout (identical to the above)
+/workspaces/electron
+```
+
+## Reclient
+
+If you are a maintainer [with Reclient access](../docs/development/reclient.md) you'll need to ensure you're authenticated when you spin up a new codespaces instance. You can validate this by checking `e d rbe info` - your build-tools configuration should have `Access` type `Cache & Execute`:
+
+```console
+Authentication Status: Authenticated
+Since: 2024-05-28 10:29:33 +0200 CEST
+Expires: 2024-08-26 10:29:33 +0200 CEST
+...
+Access: Cache & Execute
+```
+
+To authenticate if you're not logged in, run `e d rbe login` and follow the link to authenticate.
+
+## Running Electron
+
+You can run Electron in a few ways. If you just want to see if it launches:
+
+```bash
+# Enter an interactive JS prompt headlessly
+xvfb-run e start -i
+```
+
+But if you want to actually see Electron you will need to use the built-in VNC capability. If you click "Ports" in codespaces and then open the `VNC web client` forwarded port you should see a web based VNC portal in your browser. When you are asked for a password use `builduser`.
+
+Once in the VNC UI you can open `Applications -> System -> XTerm` which will open a VNC based terminal app and then you can run `e start` like normal and Electron will open in your VNC session.
+
+## Running Tests
+
+You run tests via build-tools and `xvfb`.
+
+```bash
+# Run all tests
+xvfb-run e test
+
+# Run the main process tests
+xvfb-run e test --runners=main
+
+# Run the old remote tests
+xvfb-run e test --runners=remote
+```
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000000000..9829cbbaaddee
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,51 @@
+{
+ "name": "Electron Core Development Environment",
+ "dockerComposeFile": "docker-compose.yml",
+ "service": "buildtools",
+ "onCreateCommand": ".devcontainer/on-create-command.sh",
+ "updateContentCommand": ".devcontainer/update-content-command.sh",
+ "workspaceFolder": "/workspaces/gclient/src/electron",
+ "forwardPorts": [6080, 5901],
+ "portsAttributes": {
+ "6080": {
+ "label": "VNC web client (noVNC)",
+ "onAutoForward": "silent"
+ },
+ "5901": {
+ "label": "VNC TCP port",
+ "onAutoForward": "silent"
+ }
+ },
+ "hostRequirements": {
+ "storage": "128gb",
+ "cpus": 16
+ },
+ "remoteUser": "builduser",
+ "customizations": {
+ "codespaces": {
+ "openFiles": [
+ ".devcontainer/README.md"
+ ]
+ },
+ "vscode": {
+ "extensions": [
+ "joeleinbinder.mojom-language",
+ "rafaelmaiolla.diff",
+ "surajbarkale.ninja",
+ "ms-vscode.cpptools",
+ "mutantdino.resourcemonitor",
+ "dsanders11.vscode-electron-build-tools",
+ "dbaeumer.vscode-eslint",
+ "shakram02.bash-beautify",
+ "marshallofsound.gnls-electron"
+ ],
+ "settings": {
+ "editor.tabSize": 2,
+ "bashBeautify.tabSize": 2,
+ "typescript.tsdk": "node_modules/typescript/lib",
+ "javascript.preferences.quoteStyle": "single",
+ "typescript.preferences.quoteStyle": "single"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
new file mode 100644
index 0000000000000..4eaf46700b472
--- /dev/null
+++ b/.devcontainer/docker-compose.yml
@@ -0,0 +1,19 @@
+version: '3'
+
+services:
+ buildtools:
+ image: ghcr.io/electron/devcontainer:424eedbf277ad9749ffa9219068aa72ed4a5e373
+
+ volumes:
+ - ..:/workspaces/gclient/src/electron:cached
+
+ - /var/run/docker.sock:/var/run/docker.sock
+
+ command: /bin/sh -c "while sleep 1000; do :; done"
+
+ user: builduser
+
+ cap_add:
+ - SYS_PTRACE
+ security_opt:
+ - seccomp:unconfined
diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh
new file mode 100755
index 0000000000000..b6a9318d97607
--- /dev/null
+++ b/.devcontainer/on-create-command.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+set -eo pipefail
+
+buildtools=$HOME/.electron_build_tools
+gclient_root=/workspaces/gclient
+buildtools_configs=/workspaces/buildtools-configs
+
+export PATH="$PATH:$buildtools/src"
+
+# Create the persisted buildtools config folder
+mkdir -p $buildtools_configs
+mkdir -p $gclient_root/.git-cache
+rm -f $buildtools/configs
+ln -s $buildtools_configs $buildtools/configs
+
+# Write the gclient config if it does not already exist
+if [ ! -f $gclient_root/.gclient ]; then
+ echo "Creating gclient config"
+
+ echo "solutions = [
+ { \"name\" : \"src/electron\",
+ \"url\" : \"https://github.com/electron/electron\",
+ \"deps_file\" : \"DEPS\",
+ \"managed\" : False,
+ \"custom_deps\" : {
+ },
+ \"custom_vars\": {},
+ },
+ ]
+ " >$gclient_root/.gclient
+fi
+
+# Write the default buildtools config file if it does
+# not already exist
+if [ ! -f $buildtools/configs/evm.testing.json ]; then
+ echo "Creating build-tools testing config"
+
+ write_config() {
+ echo "
+ {
+ \"root\": \"/workspaces/gclient\",
+ \"remotes\": {
+ \"electron\": {
+ \"origin\": \"https://github.com/electron/electron.git\"
+ }
+ },
+ \"gen\": {
+ \"args\": [
+ \"import(\\\"//electron/build/args/testing.gn\\\")\",
+ \"use_remoteexec = true\"
+ ],
+ \"out\": \"Testing\"
+ },
+ \"env\": {
+ \"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
+ \"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
+ },
+ \"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\",
+ \"configValidationLevel\": \"strict\",
+ \"reclient\": \"$1\",
+ \"preserveXcode\": 5
+ }
+ " >$buildtools/configs/evm.testing.json
+ }
+
+ write_config remote_exec
+
+ e use testing
+else
+ echo "build-tools testing config already exists"
+fi
diff --git a/.devcontainer/update-content-command.sh b/.devcontainer/update-content-command.sh
new file mode 100755
index 0000000000000..012eef97140ba
--- /dev/null
+++ b/.devcontainer/update-content-command.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -eo pipefail
+
+buildtools=$HOME/.electron_build_tools
+
+export PATH="$PATH:$buildtools/src"
+
+# Sync latest
+e d gclient sync --with_branch_heads --with_tags
diff --git a/.dockerignore b/.dockerignore
index abd84a3a662ae..7307e769482a1 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,2 @@
*
!tools/xvfb-init.sh
-!tools/run-electron.sh
-!build/install-build-deps.sh
diff --git a/.env.example b/.env.example
index eb3df4b6bdf9c..333d92c3eda23 100644
--- a/.env.example
+++ b/.env.example
@@ -1,7 +1,4 @@
# These env vars are only necessary for creating Electron releases.
# See docs/development/releasing.md
-APPVEYOR_CLOUD_TOKEN=
-CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
-VSTS_TOKEN=
\ No newline at end of file
diff --git a/.eslintrc.json b/.eslintrc.json
index 08b7ff0923125..2bec582ff6fa9 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,4 +1,5 @@
{
+ "root": true,
"extends": "standard",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
@@ -6,18 +7,52 @@
"browser": true
},
"rules": {
+ "semi": ["error", "always"],
"no-var": "error",
- "no-unused-vars": 0,
- "no-global-assign": 0,
+ "no-unused-vars": "off",
+ "guard-for-in": "error",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
- "ignoreRestSiblings": false
+ "ignoreRestSiblings": true
}],
"prefer-const": ["error", {
"destructuring": "all"
}],
- "node/no-deprecated-api": 0
+ "n/no-callback-literal": "off",
+ "import/newline-after-import": "error",
+ "import/order": ["error", {
+ "alphabetize": {
+ "order": "asc"
+ },
+ "newlines-between": "always",
+ "pathGroups": [
+ {
+ "pattern": "@electron/internal/**",
+ "group": "external",
+ "position": "before"
+ },
+ {
+ "pattern": "@electron/**",
+ "group": "external",
+ "position": "before"
+ },
+ {
+ "pattern": "{electron,electron/**}",
+ "group": "external",
+ "position": "before"
+ }
+ ],
+ "pathGroupsExcludedImportTypes": [],
+ "distinctGroup": true,
+ "groups": [
+ "external",
+ "builtin",
+ ["sibling", "parent"],
+ "index",
+ "type"
+ ]
+ }]
},
"parserOptions": {
"ecmaVersion": 6,
@@ -25,9 +60,19 @@
},
"overrides": [
{
- "files": "*.js",
+ "files": "*.ts",
"rules": {
- "@typescript-eslint/no-unused-vars": "off"
+ "no-undef": "off",
+ "no-redeclare": "off",
+ "@typescript-eslint/no-redeclare": ["error"],
+ "no-use-before-define": "off"
+ }
+ },
+ {
+ "files": "*.d.ts",
+ "rules": {
+ "no-useless-constructor": "off",
+ "@typescript-eslint/no-unused-vars": "off"
}
}
]
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000000000..198363a8ae8fb
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,5 @@
+# Atom --> Electron rename
+d9321f4df751fa32813fab1b6387bbd61bd681d0
+34c4c8d5088fa183f56baea28809de6f2a427e02
+# Enable JS Semicolons
+5d657dece4102e5e5304d42e8004b6ad64c0fcda
diff --git a/.gitattributes b/.gitattributes
index a8cc2eac7063f..f4542e6b25f8f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,34 @@
# `git apply` and friends don't understand CRLF, even on windows. Force those
# files to be checked out with LF endings even if core.autocrlf is true.
*.patch text eol=lf
+DEPS text eol=lf
+yarn.lock text eol=lf
+script/zip_manifests/*.manifest text eol=lf
+patches/**/.patches merge=union
+
+# Source code and markdown files should always use LF as line ending.
+*.c text eol=lf
+*.cc text eol=lf
+*.cpp text eol=lf
+*.csv text eol=lf
+*.grd text eol=lf
+*.grdp text eol=lf
+*.gn text eol=lf
+*.gni text eol=lf
+*.h text eol=lf
+*.html text eol=lf
+*.idl text eol=lf
+*.in text eol=lf
+*.js text eol=lf
+*.json text eol=lf
+*.json5 text eol=lf
+*.md text eol=lf
+*.mm text eol=lf
+*.mojom text eol=lf
+*.patches text eol=lf
+*.proto text eol=lf
+*.py text eol=lf
+*.ps1 text eol=lf
+*.sh text eol=lf
+*.ts text eol=lf
+*.txt text eol=lf
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index ceb314251ddc7..a7e227b8fb205 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -3,28 +3,23 @@
# https://help.github.com/articles/about-codeowners
# https://git-scm.com/docs/gitignore
-# Most stuff in here is owned by the Community & Safety WG...
-/.github/* @electron/wg-community
-
-# ...except the Admin WG maintains this file.
-/.github/CODEOWNERS @electron/wg-admin
-
# Upgrades WG
-/patches/ @electron/wg-upgrades
-
-# Docs & Tooling WG
-/default_app/ @electron/wg-docs-tools
-/docs/ @electron/wg-docs-tools
+/patches/ @electron/patch-owners
+DEPS @electron/wg-upgrades
# Releases WG
+/docs/breaking-changes.md @electron/wg-releases
/npm/ @electron/wg-releases
-/script/release-notes @electron/wg-releases
-/script/prepare-release.js @electron/wg-releases
-/script/bump-version.js @electron/wg-releases
-/script/ci-release-build.js @electron/wg-releases
-/script/release.js @electron/wg-releases
-/script/upload-to-github.js @electron/wg-releases
-/script/release-artifact-cleanup.js @electron/wg-releases
-/script/get-last-major-for-master.js @electron/wg-releases
-/script/find-release.js @electron/wg-releases
-/script/download-circleci-artifacts.js @electron/wg-releases
\ No newline at end of file
+/script/release @electron/wg-releases
+
+# Security WG
+/lib/browser/devtools.ts @electron/wg-security
+/lib/browser/guest-view-manager.ts @electron/wg-security
+/lib/browser/rpc-server.ts @electron/wg-security
+/lib/renderer/security-warnings.ts @electron/wg-security
+
+# Infra WG
+/.github/actions/ @electron/wg-infra
+/.github/workflows/*-publish.yml @electron/wg-infra
+/.github/workflows/build.yml @electron/wg-infra
+/.github/workflows/pipeline-*.yml @electron/wg-infra
diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
deleted file mode 100644
index 296f4bd1437db..0000000000000
--- a/.github/ISSUE_TEMPLATE/Bug_report.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve Electron
-
----
-
-
-
-### Preflight Checklist
-
-
-* [ ] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
-* [ ] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
-* [ ] I have searched the issue tracker for an issue that matches the one I want to file, without success.
-
-### Issue Details
-
-* **Electron Version:**
- *
-* **Operating System:**
- *
-* **Last Known Working Electron version:**
- *
-
-### Expected Behavior
-
-
-### Actual Behavior
-
-
-### To Reproduce
-
-
-
-
-
-
-### Screenshots
-
-
-### Additional Information
-
diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md
deleted file mode 100644
index 20fc958e2ce57..0000000000000
--- a/.github/ISSUE_TEMPLATE/Feature_request.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for Electron
-
----
-
-
-
-### Preflight Checklist
-
-
-* [ ] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
-* [ ] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
-* [ ] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
-
-### Problem Description
-
-
-### Proposed Solution
-
-
-### Alternatives Considered
-
-
-### Additional Information
-
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000000000..2fc82218fb4fa
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,81 @@
+name: Bug Report
+description: Report a bug in Electron
+type: 'bug'
+labels: "bug :beetle:"
+body:
+- type: checkboxes
+ attributes:
+ label: Preflight Checklist
+ description: Please ensure you've completed all of the following.
+ options:
+ - label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
+ required: true
+ - label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
+ required: true
+ - label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.
+ required: true
+- type: input
+ attributes:
+ label: Electron Version
+ description: |
+ What version of Electron are you using?
+
+ Note: Please only report issues for [currently supported versions of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline).
+ placeholder: 32.0.0
+ validations:
+ required: true
+- type: dropdown
+ attributes:
+ label: What operating system(s) are you using?
+ multiple: true
+ options:
+ - Windows
+ - macOS
+ - Ubuntu
+ - Other Linux
+ - Other (specify below)
+ validations:
+ required: true
+- type: input
+ attributes:
+ label: Operating System Version
+ description: What operating system version are you using? On Windows, click Start button > Settings > System > About. On macOS, click the Apple Menu > About This Mac. On Linux, use lsb_release or uname -a.
+ placeholder: "e.g. Windows 10 version 1909, macOS Catalina 10.15.7, or Ubuntu 20.04"
+ validations:
+ required: true
+- type: dropdown
+ attributes:
+ label: What arch are you using?
+ options:
+ - x64
+ - ia32
+ - arm64 (including Apple Silicon)
+ - Other (specify below)
+ validations:
+ required: true
+- type: input
+ attributes:
+ label: Last Known Working Electron version
+ description: What is the last version of Electron this worked in, if applicable?
+ placeholder: 16.0.0
+- type: textarea
+ attributes:
+ label: Expected Behavior
+ description: A clear and concise description of what you expected to happen.
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Actual Behavior
+ description: A clear description of what actually happens.
+ validations:
+ required: true
+- type: input
+ attributes:
+ label: Testcase Gist URL
+ description: Electron maintainers need a standalone test case to reproduce and fix your issue. Please use [Electron Fiddle](https://github.com/electron/fiddle) to create one and to publish it as a [GitHub gist](https://gist.github.com). Then put the gist URL here. Issues without testcase gists receive less attention and might be closed without a maintainer taking a closer look. To maximize how much attention your issue receives, please include a testcase gist right from the start.
+ placeholder: https://gist.github.com/...
+- type: textarea
+ attributes:
+ label: Additional Information
+ description: If your problem needs further explanation, or if the issue you're seeing cannot be reproduced in a gist, please add more information here.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000000..aa3d859873ad0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Discord Chat
+ url: https://discord.gg/APGC3k5yaH
+ about: Have questions? Try asking on our Discord - this issue tracker is for reporting bugs or feature requests only
+ - name: Open Collective
+ url: https://opencollective.com/electron
+ about: Help support Electron by contributing to our Open Collective
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000000000..5bca8a2be4eb4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,40 @@
+name: Feature Request
+description: Suggest an idea for Electron
+type: 'enhancement'
+labels: "enhancement :sparkles:"
+body:
+- type: checkboxes
+ attributes:
+ label: Preflight Checklist
+ description: Please ensure you've completed all of the following.
+ options:
+ - label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
+ required: true
+ - label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
+ required: true
+ - label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
+ required: true
+- type: textarea
+ attributes:
+ label: Problem Description
+ description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Proposed Solution
+ description: Describe the solution you'd like in a clear and concise manner.
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Alternatives Considered
+ description: A clear and concise description of any alternative solutions or features you've considered.
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Additional Information
+ description: Add any other context about the problem here.
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.md b/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.md
deleted file mode 100644
index cefd5800e2a73..0000000000000
--- a/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-name: Mac App Store Private API Rejection
-about: Your app was rejected from the Mac App Store for using private API's
-
----
-
-
-
-### Preflight Checklist
-
-
-* [ ] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
-* [ ] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
-
-### Issue Details
-
-* **Electron Version:**
- *
-
-### Rejection Email
-
-
-### Additional Information
-
diff --git a/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.yml b/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.yml
new file mode 100644
index 0000000000000..df6f0fc972877
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/mac_app_store_private_api_rejection.yml
@@ -0,0 +1,30 @@
+name: Report Mac App Store Private API Rejection
+description: Your app was rejected from the Mac App Store for using private API's
+title: "[MAS Rejection]: "
+body:
+- type: checkboxes
+ attributes:
+ label: Preflight Checklist
+ description: Please ensure you've completed all of the following.
+ options:
+ - label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
+ required: true
+ - label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
+ required: true
+- type: input
+ attributes:
+ label: Electron Version
+ description: What version of Electron are you using?
+ placeholder: 12.0.0
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Rejection Email
+ description: Paste the contents of your rejection email here, censoring any private information such as app names.
+ validations:
+ required: true
+- type: textarea
+ attributes:
+ label: Additional Information
+ description: Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/maintainer_issue.yml b/.github/ISSUE_TEMPLATE/maintainer_issue.yml
new file mode 100644
index 0000000000000..9ae65a117626c
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/maintainer_issue.yml
@@ -0,0 +1,14 @@
+name: Maintainer Issue (not for public use)
+description: Only to be created by Electron maintainers
+body:
+- type: checkboxes
+ attributes:
+ label: Confirmation
+ options:
+ - label: I am a [maintainer](https://github.com/orgs/electron/people) of the Electron project. (If not, please create a [different issue type](https://github.com/electron/electron/issues/new/).)
+ required: true
+- type: textarea
+ attributes:
+ label: Description
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/security_report.md b/.github/ISSUE_TEMPLATE/security_report.md
deleted file mode 100644
index 8c2498da2e2bc..0000000000000
--- a/.github/ISSUE_TEMPLATE/security_report.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-name: Security report
-about: Do not create an issue for security reports, send an email to security@electronjs.org
-
----
-
-### Notice
-
-**DO NOT** create an issue for security reports.
-Send an email to: **security@electronjs.org**.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index e8215e0dc5342..e558ae9717861 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,9 +1,10 @@
#### Description of Change
+
#### Checklist
@@ -11,11 +12,10 @@ Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTIN
- [ ] PR description included and stakeholders cc'd
- [ ] `npm test` passes
-- [ ] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)
-- [ ] relevant documentation is changed or added
-- [ ] PR title follows semantic [commit guidelines](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines)
-- [ ] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).
+- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
+- [ ] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
+- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).
#### Release Notes
-Notes:
+Notes:
diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml
new file mode 100644
index 0000000000000..350866638b46d
--- /dev/null
+++ b/.github/actions/build-electron/action.yml
@@ -0,0 +1,250 @@
+name: 'Build Electron'
+description: 'Builds Electron & Friends'
+inputs:
+ target-arch:
+ description: 'Target arch'
+ required: true
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+ required: true
+ artifact-platform:
+ description: 'Artifact platform, should be linux, win, darwin or mas'
+ required: true
+ step-suffix:
+ description: 'Suffix for build steps'
+ required: false
+ default: ''
+ is-release:
+ description: 'Is release build'
+ required: true
+ strip-binaries:
+ description: 'Strip binaries (Linux only)'
+ required: false
+ generate-symbols:
+ description: 'Generate symbols'
+ required: true
+ upload-to-storage:
+ description: 'Upload to storage'
+ required: true
+ is-asan:
+ description: 'The ASan Linux build'
+ required: false
+runs:
+ using: "composite"
+ steps:
+ - name: Set GN_EXTRA_ARGS for MacOS x64 Builds
+ shell: bash
+ if: ${{ inputs.target-arch == 'x64' && inputs.target-platform == 'macos' }}
+ run: |
+ GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"x64\" v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
+ echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
+ - name: Add Clang problem matcher
+ shell: bash
+ run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
+ - name: Build Electron ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ rm -rf "src/out/Default/Electron Framework.framework"
+ rm -rf src/out/Default/Electron*.app
+
+ cd src/electron
+ # TODO(codebytere): remove this once we figure out why .git/packed-refs is initially missing
+ git pack-refs
+ cd ..
+
+ if [ "`uname`" = "Darwin" ]; then
+ ulimit -n 10000
+ sudo launchctl limit maxfiles 65536 200000
+ fi
+
+ NINJA_SUMMARIZE_BUILD=1 e build -j $NUMBER_OF_NINJA_PROCESSES
+ cp out/Default/.ninja_log out/electron_ninja_log
+ node electron/script/check-symlinks.js
+ - name: Strip Electron Binaries ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.strip-binaries == 'true' }}
+ run: |
+ cd src
+ electron/script/copy-debug-symbols.py --target-cpu="${{ inputs.target-arch }}" --out-dir=out/Default/debug --compress
+ electron/script/strip-binaries.py --target-cpu="${{ inputs.target-arch }}" --verbose
+ electron/script/add-debug-link.py --target-cpu="${{ inputs.target-arch }}" --debug-dir=out/Default/debug
+ - name: Build Electron dist.zip ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ cd src
+ e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES -d explain
+ if [ "${{ inputs.is-asan }}" != "true" ]; then
+ target_os=${{ inputs.target-platform == 'macos' && 'mac' || inputs.target-platform }}
+ if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
+ target_os="${target_os}_mas"
+ fi
+ electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.$target_os.${{ inputs.target-arch }}.manifest
+ fi
+ - name: Build Mksnapshot ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ cd src
+ e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
+ ELECTRON_DEPOT_TOOLS_DISABLE_LOG=1 e d gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
+ # Remove unused args from mksnapshot_args
+ SEDOPTION="-i"
+ if [ "`uname`" = "Darwin" ]; then
+ SEDOPTION="-i ''"
+ fi
+ sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
+ sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
+
+ if [ "${{ inputs.target-platform }}" = "linux" ]; then
+ if [ "${{ inputs.target-arch }}" = "arm" ]; then
+ electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
+ electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
+ elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
+ electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
+ electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/v8_context_snapshot_generator
+ else
+ electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
+ electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator
+ fi
+ fi
+
+ e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ cd out/Default
+ powershell Compress-Archive -update mksnapshot_args mksnapshot.zip
+ powershell mkdir mktmp\\gen\\v8
+ powershell Copy-Item gen\\v8\\embedded.S mktmp\\gen\\v8
+ powershell Compress-Archive -update -Path mktmp\\gen mksnapshot.zip
+ else
+ (cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
+ fi
+ - name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
+ run: |
+ cd src
+ if [ "${{ inputs.target-arch }}" = "arm" ]; then
+ MKSNAPSHOT_PATH="clang_x86_v8_arm"
+ elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
+ MKSNAPSHOT_PATH="clang_x64_v8_arm64"
+ fi
+
+ cp "out/Default/$MKSNAPSHOT_PATH/mksnapshot" out/Default
+ cp "out/Default/$MKSNAPSHOT_PATH/v8_context_snapshot_generator" out/Default
+ cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.so" out/Default
+
+ python3 electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
+ mkdir cross-arch-snapshots
+ cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
+ # Clean up so that ninja does not get confused
+ rm -f out/Default/libffmpeg.so
+ - name: Build Chromedriver ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ cd src
+ e build --target electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
+ e build --target electron:electron_chromedriver_zip
+ - name: Build Node.js headers ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ cd src
+ e build --target electron:node_headers
+ - name: Create installed_software.json ${{ inputs.step-suffix }}
+ shell: powershell
+ if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+ run: |
+ cd src
+ Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
+ - name: Profile Windows Toolchain ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+ run: |
+ cd src
+ python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
+ - name: Add msdia140.dll to Path ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+ run: |
+ # Needed for msdia140.dll on 64-bit windows
+ cd src
+ export PATH="$PATH:$(pwd)/third_party/llvm-build/Release+Asserts/bin"
+ - name: Generate & Zip Symbols ${{ inputs.step-suffix }}
+ shell: bash
+ run: |
+ # Generate breakpad symbols on release builds
+ if [ "${{ inputs.generate-symbols }}" = "true" ]; then
+ e build --target electron:electron_symbols
+ fi
+ cd src
+ export BUILD_PATH="$(pwd)/out/Default"
+ e build --target electron:licenses
+ e build --target electron:electron_version_file
+ if [ "${{ inputs.is-release }}" = "true" ]; then
+ DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
+ else
+ electron/script/zip-symbols.py -b $BUILD_PATH
+ fi
+ - name: Generate FFMpeg ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.is-release == 'true' }}
+ run: |
+ cd src
+ gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
+ e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg -j $NUMBER_OF_NINJA_PROCESSES
+ - name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
+ run: |
+ e build --target electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
+ - name: Generate Libcxx ${{ inputs.step-suffix }}
+ shell: bash
+ if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'linux' }}
+ run: |
+ e build --target electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
+ e build --target electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
+ e build --target electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
+ - name: Remove Clang problem matcher
+ shell: bash
+ run: echo "::remove-matcher owner=clang::"
+ - name: Generate TypeScript Definitions ${{ inputs.step-suffix }}
+ if: ${{ inputs.is-release == 'true' }}
+ shell: bash
+ run: |
+ cd src/electron
+ node script/yarn create-typescript-definitions
+ - name: Publish Electron Dist ${{ inputs.step-suffix }}
+ if: ${{ inputs.is-release == 'true' }}
+ shell: bash
+ run: |
+ rm -rf src/out/Default/obj
+ cd src/electron
+ if [ "${{ inputs.upload-to-storage }}" = "1" ]; then
+ echo 'Uploading Electron release distribution to Azure'
+ script/release/uploaders/upload.py --verbose --upload_to_storage
+ else
+ echo 'Uploading Electron release distribution to GitHub releases'
+ script/release/uploaders/upload.py --verbose
+ fi
+ - name: Generate Artifact Key
+ shell: bash
+ run: |
+ if [ "${{ inputs.is-asan }}" = "true" ]; then
+ ARTIFACT_KEY=${{ inputs.artifact-platform }}_${{ inputs.target-arch }}_asan
+ else
+ ARTIFACT_KEY=${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
+ fi
+ echo "ARTIFACT_KEY=$ARTIFACT_KEY" >> $GITHUB_ENV
+ # The current generated_artifacts_<< artifact.key >> name was taken from CircleCI
+ # to ensure we don't break anything, but we may be able to improve that.
+ - name: Move all Generated Artifacts to Upload Folder ${{ inputs.step-suffix }}
+ shell: bash
+ run: ./src/electron/script/actions/move-artifacts.sh
+ - name: Upload Generated Artifacts ${{ inputs.step-suffix }}
+ uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
+ with:
+ name: generated_artifacts_${{ env.ARTIFACT_KEY }}
+ path: ./generated_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
+ - name: Upload Src Artifacts ${{ inputs.step-suffix }}
+ uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
+ with:
+ name: src_artifacts_${{ env.ARTIFACT_KEY }}
+ path: ./src_artifacts_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
diff --git a/.github/actions/build-git-cache/action.yml b/.github/actions/build-git-cache/action.yml
new file mode 100644
index 0000000000000..6a50666a50fbd
--- /dev/null
+++ b/.github/actions/build-git-cache/action.yml
@@ -0,0 +1,83 @@
+name: 'Build Git Cache'
+description: 'Runs a gclient sync to build the git cache for Electron'
+inputs:
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+runs:
+ using: "composite"
+ steps:
+ - name: Set GIT_CACHE_PATH to make gclient to use the cache
+ shell: bash
+ run: |
+ echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Set up cache drive
+ shell: bash
+ run: |
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ echo "CACHE_DRIVE=/mnt/win-cache" >> $GITHUB_ENV
+ else
+ echo "CACHE_DRIVE=/mnt/cross-instance-cache" >> $GITHUB_ENV
+ fi
+ - name: Check cross instance cache disk space
+ shell: bash
+ run: |
+ # if there is less than 35 GB free space then creating the cache might fail so exit early
+ freespace=`df -m $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
+ freespace_human=`df -h $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
+ if [ $freespace -le 35000 ]; then
+ echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
+ exit 1
+ else
+ echo "The cross mount cache has $freespace_human free space - continuing"
+ fi
+ - name: Restore gitcache
+ shell: bash
+ run: |
+ GIT_CACHE_TAR="$CACHE_DRIVE/gitcache.tar"
+ if [ ! -f "$GIT_CACHE_TAR" ]; then
+ echo "Git cache tar file does not exist, skipping restore"
+ exit 0
+ fi
+ echo "Restoring git cache from $GIT_CACHE_TAR to $GIT_CACHE_PATH"
+ mkdir -p $GIT_CACHE_PATH
+ tar -xf $GIT_CACHE_TAR -C $GIT_CACHE_PATH
+ - name: Gclient Sync
+ shell: bash
+ run: |
+ e d gclient config \
+ --name "src/electron" \
+ --unmanaged \
+ ${GCLIENT_EXTRA_ARGS} \
+ "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
+
+ if [ "$TARGET_OS" != "" ]; then
+ echo "target_os=['$TARGET_OS']" >> ./.gclient
+ fi
+
+ ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags --nohooks -vv
+ - name: Compress Git Cache Directory
+ shell: bash
+ run: |
+ echo "Uncompressed gitcache size: $(du -sh $GIT_CACHE_PATH | cut -f1 -d' ')"
+ cd $GIT_CACHE_PATH
+ tar -cf ../gitcache.tar .
+ cd ..
+ echo "Compressed gitcache to $(du -sh gitcache.tar | cut -f1 -d' ')"
+ # remove the old cache file if it exists
+ if [ -f $CACHE_DRIVE/gitcache.tar ]; then
+ echo "Removing old gitcache.tar from $CACHE_DRIVE"
+ rm $CACHE_DRIVE/gitcache.tar
+ fi
+ cp ./gitcache.tar $CACHE_DRIVE/
+ - name: Wait for active SSH sessions
+ shell: bash
+ if: always() && !cancelled()
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml
new file mode 100644
index 0000000000000..3ff4b4b06d021
--- /dev/null
+++ b/.github/actions/checkout/action.yml
@@ -0,0 +1,213 @@
+name: 'Checkout'
+description: 'Checks out Electron and stores it in the AKS Cache'
+inputs:
+ generate-sas-token:
+ description: 'Whether to generate and persist a SAS token for the item in the cache'
+ required: false
+ default: 'false'
+ use-cache:
+ description: 'Whether to persist the cache to the shared drive'
+ required: false
+ default: 'true'
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+runs:
+ using: "composite"
+ steps:
+ - name: Set GIT_CACHE_PATH to make gclient to use the cache
+ shell: bash
+ run: |
+ echo "GIT_CACHE_PATH=$(pwd)/git-cache" >> $GITHUB_ENV
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Generate DEPS Hash
+ shell: bash
+ run: |
+ node src/electron/script/generate-deps-hash.js
+ DEPSHASH="v1-src-cache-$(cat src/electron/.depshash)"
+ echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
+ echo "CACHE_FILE=$DEPSHASH.tar" >> $GITHUB_ENV
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ echo "CACHE_DRIVE=/mnt/win-cache" >> $GITHUB_ENV
+ else
+ echo "CACHE_DRIVE=/mnt/cross-instance-cache" >> $GITHUB_ENV
+ fi
+ - name: Generate SAS Key
+ if: ${{ inputs.generate-sas-token == 'true' }}
+ shell: bash
+ run: |
+ curl --unix-socket /var/run/sas/sas.sock --fail "http://foo/$CACHE_FILE?platform=${{ inputs.target-platform }}" > sas-token
+ - name: Save SAS Key
+ if: ${{ inputs.generate-sas-token == 'true' }}
+ uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: sas-token
+ key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
+ enableCrossOsArchive: true
+ - name: Check If Cache Exists
+ id: check-cache
+ shell: bash
+ run: |
+ if [[ "${{ inputs.use-cache }}" == "false" ]]; then
+ echo "Not using cache this time..."
+ echo "cache_exists=false" >> $GITHUB_OUTPUT
+ else
+ cache_path=$CACHE_DRIVE/$CACHE_FILE
+ echo "Using cache key: $DEPSHASH"
+ echo "Checking for cache in: $cache_path"
+ if [ ! -f "$cache_path" ] || [ `du $cache_path | cut -f1` = "0" ]; then
+ echo "cache_exists=false" >> $GITHUB_OUTPUT
+ echo "Cache Does Not Exist for $DEPSHASH"
+ else
+ echo "cache_exists=true" >> $GITHUB_OUTPUT
+ echo "Cache Already Exists for $DEPSHASH, Skipping.."
+ fi
+ fi
+ - name: Check cross instance cache disk space
+ if: steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true'
+ shell: bash
+ run: |
+ # if there is less than 35 GB free space then creating the cache might fail so exit early
+ freespace=`df -m $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
+ freespace_human=`df -h $CACHE_DRIVE | grep -w $CACHE_DRIVE | awk '{print $4}'`
+ if [ $freespace -le 35000 ]; then
+ echo "The cross mount cache has $freespace_human free space which is not enough - exiting"
+ exit 1
+ else
+ echo "The cross mount cache has $freespace_human free space - continuing"
+ fi
+ - name: Add patch conflict problem matcher
+ shell: bash
+ run: echo "::add-matcher::src/electron/.github/problem-matchers/patch-conflict.json"
+ - name: Restore gitcache
+ if: steps.check-cache.outputs.cache_exists == 'false'
+ shell: bash
+ run: |
+ GIT_CACHE_TAR="$CACHE_DRIVE/gitcache.tar"
+ if [ ! -f "$GIT_CACHE_TAR" ]; then
+ echo "Git cache tar file does not exist, skipping restore"
+ exit 0
+ fi
+ echo "Restoring git cache from $GIT_CACHE_TAR to $GIT_CACHE_PATH"
+ mkdir -p $GIT_CACHE_PATH
+ tar -xf $GIT_CACHE_TAR -C $GIT_CACHE_PATH
+ - name: Gclient Sync
+ if: steps.check-cache.outputs.cache_exists == 'false'
+ shell: bash
+ run: |
+ e d gclient config \
+ --name "src/electron" \
+ --unmanaged \
+ ${GCLIENT_EXTRA_ARGS} \
+ "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
+
+ if [ "$TARGET_OS" != "" ]; then
+ echo "target_os=['$TARGET_OS']" >> ./.gclient
+ fi
+
+ ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 e d gclient sync --with_branch_heads --with_tags -vv
+ if [[ "${{ inputs.is-release }}" != "true" ]]; then
+ # Re-export all the patches to check if there were changes.
+ python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
+ cd src/electron
+ git update-index --refresh || true
+ if ! git diff-index --quiet HEAD --; then
+ # There are changes to the patches. Make a git commit with the updated patches
+ if node ./script/patch-up.js; then
+ echo
+ echo "======================================================================"
+ echo "Changes to the patches when applying, we have auto-pushed the diff to the current branch"
+ echo "A new CI job will kick off shortly"
+ echo "======================================================================"
+ exit 1
+ else
+ git add patches
+ GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
+ # Export it
+ mkdir -p ../../patches
+ git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
+ echo
+ echo "======================================================================"
+ echo "There were changes to the patches when applying."
+ echo "Check the CI artifacts for a patch you can apply to fix it."
+ echo "======================================================================"
+ echo
+ cat ../../patches/update-patches.patch
+ exit 1
+ fi
+ else
+ echo "No changes to patches detected"
+ fi
+ fi
+ - name: Remove patch conflict problem matcher
+ shell: bash
+ run: |
+ echo "::remove-matcher owner=merge-conflict::"
+ echo "::remove-matcher owner=patch-conflict::"
+ - name: Upload patches stats
+ if: ${{ inputs.target-platform == 'linux' && github.ref == 'refs/heads/main' }}
+ shell: bash
+ run: |
+ npx node src/electron/script/patches-stats.mjs --upload-stats || true
+ # delete all .git directories under src/ except for
+ # third_party/angle/ and third_party/dawn/ because of build time generation of files
+ # gen/angle/commit.h depends on third_party/angle/.git/HEAD
+ # https://chromium-review.googlesource.com/c/angle/angle/+/2074924
+ # and dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
+ # https://dawn-review.googlesource.com/c/dawn/+/83901
+ # TODO: maybe better to always leave out */.git/HEAD file for all targets ?
+ - name: Delete .git directories under src to free space
+ if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
+ shell: bash
+ run: |
+ cd src
+ ( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
+ - name: Minimize Cache Size for Upload
+ if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
+ shell: bash
+ run: |
+ rm -rf src/android_webview
+ rm -rf src/ios/chrome
+ rm -rf src/third_party/blink/web_tests
+ rm -rf src/third_party/blink/perf_tests
+ rm -rf src/chrome/test/data/xr/webvr_info
+ rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
+ rm -rf src/third_party/swift-toolchain
+ rm -rf src/third_party/swiftshader/tests/regres/testlists
+ cp src/electron/.github/actions/checkout/action.yml ./
+ rm -rf src/electron
+ mkdir -p src/electron/.github/actions/checkout
+ mv action.yml src/electron/.github/actions/checkout
+ - name: Compress Src Directory
+ if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
+ shell: bash
+ run: |
+ echo "Uncompressed src size: $(du -sh src | cut -f1 -d' ')"
+ tar -cf $CACHE_FILE src
+ echo "Compressed src to $(du -sh $CACHE_FILE | cut -f1 -d' ')"
+ cp ./$CACHE_FILE $CACHE_DRIVE/
+ - name: Persist Src Cache
+ if: ${{ steps.check-cache.outputs.cache_exists == 'false' && inputs.use-cache == 'true' }}
+ shell: bash
+ run: |
+ final_cache_path=$CACHE_DRIVE/$CACHE_FILE
+ echo "Using cache key: $DEPSHASH"
+ echo "Checking path: $final_cache_path"
+ if [ ! -f "$final_cache_path" ]; then
+ echo "Cache key not found"
+ exit 1
+ else
+ echo "Cache key persisted in $final_cache_path"
+ fi
+ - name: Wait for active SSH sessions
+ shell: bash
+ if: always() && !cancelled()
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
diff --git a/.github/actions/cipd-install/action.yml b/.github/actions/cipd-install/action.yml
new file mode 100644
index 0000000000000..327e904be473e
--- /dev/null
+++ b/.github/actions/cipd-install/action.yml
@@ -0,0 +1,40 @@
+name: 'CIPD install'
+description: 'Installs the specified CIPD package'
+inputs:
+ cipd-root-prefix-path:
+ description: 'Path to prepend to installation directory'
+ default: ''
+ dependency:
+ description: 'Name of dependency to install'
+ deps-file:
+ description: 'Location of DEPS file that defines the dependency'
+ installation-dir:
+ description: 'Location to install dependency'
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+ package:
+ description: 'Package to install'
+runs:
+ using: "composite"
+ steps:
+ - name: Delete wrong ${{ inputs.dependency }}
+ shell: bash
+ run : |
+ rm -rf ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }}
+ - name: Create ensure file for ${{ inputs.dependency }}
+ shell: bash
+ run: |
+ echo '${{ inputs.package }}' `e d gclient getdep --deps-file=${{ inputs.deps-file }} -r '${{ inputs.installation-dir }}:${{ inputs.package }}'` > ${{ inputs.dependency }}_ensure_file
+ cat ${{ inputs.dependency }}_ensure_file
+ - name: CIPD installation of ${{ inputs.dependency }} (macOS)
+ if: ${{ inputs.target-platform == 'macos' }}
+ shell: bash
+ run: |
+ echo "ensuring ${{ inputs.dependency }} on macOS"
+ e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
+ - name: CIPD installation of ${{ inputs.dependency }} (Windows)
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: powershell
+ run: |
+ echo "ensuring ${{ inputs.dependency }} on Windows"
+ e d cipd ensure --root ${{ inputs.cipd-root-prefix-path }}${{ inputs.installation-dir }} -ensure-file ${{ inputs.dependency }}_ensure_file
diff --git a/.github/actions/fix-sync/action.yml b/.github/actions/fix-sync/action.yml
new file mode 100644
index 0000000000000..23bd710e20141
--- /dev/null
+++ b/.github/actions/fix-sync/action.yml
@@ -0,0 +1,120 @@
+name: 'Fix Sync'
+description: 'Ensures proper binaries are in place'
+# This action is required to correct for differences between "gclient sync"
+# on Linux and the expected state on macOS/windows. This requires:
+# 1. Fixing Clang Install (wrong binary)
+# 2. Fixing esbuild (wrong binary)
+# 3. Fixing rustc (wrong binary)
+# 4. Fixing gn (wrong binary)
+# 5. Fix reclient (wrong binary)
+# 6. Fixing dsymutil (wrong binary)
+# 7. Ensuring we are using the correct ninja and adding it to PATH
+# 8. Fixing angle (wrong remote)
+# 9. Install windows toolchain on Windows
+# 10. Fix node binary on Windows
+# 11. Fix rc binary on Windows
+inputs:
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+runs:
+ using: "composite"
+ steps:
+ - name: Fix clang
+ shell: bash
+ run : |
+ rm -rf src/third_party/llvm-build
+ python3 src/tools/clang/scripts/update.py
+ - name: Fix esbuild
+ uses: ./src/electron/.github/actions/cipd-install
+ with:
+ cipd-root-prefix-path: src/third_party/devtools-frontend/src/
+ dependency: esbuild
+ deps-file: src/third_party/devtools-frontend/src/DEPS
+ installation-dir: third_party/esbuild
+ target-platform: ${{ inputs.target-platform }}
+ package: infra/3pp/tools/esbuild/${platform}
+ - name: Fix rustc
+ shell: bash
+ run : |
+ rm -rf src/third_party/rust-toolchain
+ python3 src/tools/rust/update_rust.py
+ - name: Fix gn (macOS)
+ if: ${{ inputs.target-platform == 'macos' }}
+ uses: ./src/electron/.github/actions/cipd-install
+ with:
+ dependency: gn
+ deps-file: src/DEPS
+ installation-dir: src/buildtools/mac
+ target-platform: ${{ inputs.target-platform }}
+ package: gn/gn/mac-${arch}
+ - name: Fix gn (Windows)
+ if: ${{ inputs.target-platform == 'win' }}
+ uses: ./src/electron/.github/actions/cipd-install
+ with:
+ dependency: gn
+ deps-file: src/DEPS
+ installation-dir: src/buildtools/win
+ target-platform: ${{ inputs.target-platform }}
+ package: gn/gn/windows-amd64
+ - name: Fix reclient
+ uses: ./src/electron/.github/actions/cipd-install
+ with:
+ dependency: reclient
+ deps-file: src/DEPS
+ installation-dir: src/buildtools/reclient
+ target-platform: ${{ inputs.target-platform }}
+ package: infra/rbe/client/${platform}
+ - name: Configure reclient configs
+ shell: bash
+ run : |
+ python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
+ - name: Fix dsymutil (macOS)
+ if: ${{ inputs.target-platform == 'macos' }}
+ shell: bash
+ run : |
+ # Fix dsymutil
+ if [ "${{ inputs.target-platform }}" = "macos" ]; then
+ if [ "${{ env.TARGET_ARCH }}" == "arm64" ]; then
+ DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
+ else
+ DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
+ fi
+ python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
+ fi
+ - name: Fix ninja
+ uses: ./src/electron/.github/actions/cipd-install
+ with:
+ dependency: ninja
+ deps-file: src/DEPS
+ installation-dir: src/third_party/ninja
+ target-platform: ${{ inputs.target-platform }}
+ package: infra/3pp/tools/ninja/${platform}
+ - name: Set ninja in path
+ shell: bash
+ run : |
+ echo "$(pwd)/src/third_party/ninja" >> $GITHUB_PATH
+ - name: Fixup angle git
+ shell: bash
+ run : |
+ cd src/third_party/angle
+ rm -f .git/objects/info/alternates
+ git remote set-url origin https://chromium.googlesource.com/angle/angle.git
+ cp .git/config .git/config.backup
+ git remote remove origin
+ mv .git/config.backup .git/config
+ git fetch
+ - name: Get Windows toolchain
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: powershell
+ run: e d vpython3 src\build\vs_toolchain.py update --force
+ - name: Download nodejs
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: powershell
+ run: |
+ $nodedeps = e d gclient getdep --deps-file=src/DEPS -r src/third_party/node/win | ConvertFrom-JSON
+ python3 src\third_party\depot_tools\download_from_google_storage.py --no_resume --no_auth --bucket chromium-nodejs -o src\third_party\node\win\node.exe $nodedeps.object_name
+ - name: Install rc
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: bash
+ run: |
+ python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1
diff --git a/.github/actions/free-space-macos/action.yml b/.github/actions/free-space-macos/action.yml
new file mode 100644
index 0000000000000..cf6b2d3bcaa8d
--- /dev/null
+++ b/.github/actions/free-space-macos/action.yml
@@ -0,0 +1,76 @@
+name: 'Free Space macOS'
+description: 'Checks out Electron and stores it in the AKS Cache'
+runs:
+ using: "composite"
+ steps:
+ - name: Free Space on MacOS
+ shell: bash
+ run: |
+ sudo mkdir -p $TMPDIR/del-target
+
+ tmpify() {
+ if [ -d "$1" ]; then
+ sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
+ fi
+ }
+
+ strip_universal_deep() {
+ opwd=$(pwd)
+ cd $1
+ f=$(find . -perm +111 -type f)
+ for fp in $f
+ do
+ if [[ $(file "$fp") == *"universal binary"* ]]; then
+ if [ "`arch`" == "arm64" ]; then
+ if [[ $(file "$fp") == *"x86_64"* ]]; then
+ sudo lipo -remove x86_64 "$fp" -o "$fp" || true
+ fi
+ else
+ if [[ $(file "$fp") == *"arm64e)"* ]]; then
+ sudo lipo -remove arm64e "$fp" -o "$fp" || true
+ fi
+ if [[ $(file "$fp") == *"arm64)"* ]]; then
+ sudo lipo -remove arm64 "$fp" -o "$fp" || true
+ fi
+ fi
+ fi
+ done
+
+ cd $opwd
+ }
+
+ tmpify /Library/Developer/CoreSimulator
+ tmpify ~/Library/Developer/CoreSimulator
+ tmpify $(xcode-select -p)/Platforms/AppleTVOS.platform
+ tmpify $(xcode-select -p)/Platforms/iPhoneOS.platform
+ tmpify $(xcode-select -p)/Platforms/WatchOS.platform
+ tmpify $(xcode-select -p)/Platforms/WatchSimulator.platform
+ tmpify $(xcode-select -p)/Platforms/AppleTVSimulator.platform
+ tmpify $(xcode-select -p)/Platforms/iPhoneSimulator.platform
+ tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios
+ tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
+ tmpify $(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0
+ tmpify ~/.rubies
+ tmpify ~/Library/Caches/Homebrew
+ tmpify /usr/local/Homebrew
+
+ sudo rm -rf $TMPDIR/del-target
+
+ sudo rm -rf /Applications/Safari.app
+ sudo rm -rf /Applications/Xcode_16.1.app
+ sudo rm -rf /Applications/Xcode_16.3.app
+ sudo rm -rf /Applications/Xcode_16.2.app
+ sudo rm -rf /Applications/Google Chrome.app
+ sudo rm -rf /Applications/Xcode_16.4.app
+ sudo rm -rf /Applications/Google Chrome for Testing.app
+ sudo rm -rf /Applications/Firefox.app
+ sudo rm -rf ~/project/src/third_party/catapult/tracing/test_data
+ sudo rm -rf ~/project/src/third_party/angle/third_party/VK-GL-CTS
+ sudo rm -rf /Users/runner/Library/Android
+ sudo rm -rf $JAVA_HOME_11_arm64
+ sudo rm -rf $JAVA_HOME_17_arm64
+ sudo rm -rf $JAVA_HOME_21_arm64
+
+ # lipo off some huge binaries arm64 versions to save space
+ strip_universal_deep $(xcode-select -p)/../SharedFrameworks
+ # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
\ No newline at end of file
diff --git a/.github/actions/generate-types/action.yml b/.github/actions/generate-types/action.yml
new file mode 100644
index 0000000000000..9909fba912c2b
--- /dev/null
+++ b/.github/actions/generate-types/action.yml
@@ -0,0 +1,24 @@
+name: 'Generate Types for Archaeologist Dig'
+description: 'Generate Types for Archaeologist Dig'
+inputs:
+ sha-file:
+ description: 'File containing sha'
+ required: true
+ filename:
+ description: 'Filename to write types to'
+ required: true
+runs:
+ using: "composite"
+ steps:
+ - name: Generating Types for SHA in ${{ inputs.sha-file }}
+ shell: bash
+ run: |
+ git checkout $(cat ${{ inputs.sha-file }})
+ rm -rf node_modules
+ yarn install --frozen-lockfile --ignore-scripts
+ echo "#!/usr/bin/env node\nglobal.x=1" > node_modules/typescript/bin/tsc
+ node node_modules/.bin/electron-docs-parser --dir=./ --outDir=./ --moduleVersion=0.0.0-development
+ node node_modules/.bin/electron-typescript-definitions --api=electron-api.json --outDir=artifacts
+ mv artifacts/electron.d.ts artifacts/${{ inputs.filename }}
+ git checkout .
+ working-directory: ./electron
diff --git a/.github/actions/install-build-tools/action.yml b/.github/actions/install-build-tools/action.yml
new file mode 100644
index 0000000000000..8712b89b4b608
--- /dev/null
+++ b/.github/actions/install-build-tools/action.yml
@@ -0,0 +1,30 @@
+name: 'Install Build Tools'
+description: 'Installs an exact SHA of build tools'
+runs:
+ using: "composite"
+ steps:
+ - name: Install Build Tools
+ shell: bash
+ run: |
+ if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
+ git config --global core.filemode false
+ git config --global core.autocrlf false
+ git config --global branch.autosetuprebase always
+ git config --global core.fscache true
+ git config --global core.preloadindex true
+ fi
+ export BUILD_TOOLS_SHA=0a7f6bef9453ceee45612442660ca16d2c40171b
+ npm i -g @electron/build-tools
+ # Update depot_tools to ensure python
+ e d update_depot_tools
+ e auto-update disable
+ # Disable further updates of depot_tools
+ e d auto-update disable
+ if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
+ e d cipd.bat --version
+ cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
+ echo "C:\Users\ContainerAdministrator\.electron_build_tools\third_party\depot_tools" >> $GITHUB_PATH
+ else
+ echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH
+ echo "$HOME/.electron_build_tools/third_party/depot_tools/python-bin" >> $GITHUB_PATH
+ fi
\ No newline at end of file
diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml
new file mode 100644
index 0000000000000..ff0f5581472db
--- /dev/null
+++ b/.github/actions/install-dependencies/action.yml
@@ -0,0 +1,21 @@
+name: 'Install Dependencies'
+description: 'Installs yarn depdencies using cache when available'
+runs:
+ using: "composite"
+ steps:
+ - name: Get yarn cache directory path
+ shell: bash
+ id: yarn-cache-dir-path
+ run: echo "dir=$(node src/electron/script/yarn cache dir)" >> $GITHUB_OUTPUT
+ - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ id: yarn-cache
+ with:
+ path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+ key: ${{ runner.os }}-yarn-${{ hashFiles('src/electron/yarn.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-yarn-
+ - name: Install Dependencies
+ shell: bash
+ run: |
+ cd src/electron
+ node script/yarn install --frozen-lockfile --prefer-offline
diff --git a/.github/actions/restore-cache-aks/action.yml b/.github/actions/restore-cache-aks/action.yml
new file mode 100644
index 0000000000000..b614b3a076dce
--- /dev/null
+++ b/.github/actions/restore-cache-aks/action.yml
@@ -0,0 +1,49 @@
+name: 'Restore Cache AKS'
+description: 'Restores Electron src cache via AKS'
+inputs:
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+runs:
+ using: "composite"
+ steps:
+ - name: Restore and Ensure Src Cache
+ shell: bash
+ run: |
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ cache_path=/mnt/win-cache/$DEPSHASH.tar
+ else
+ cache_path=/mnt/cross-instance-cache/$DEPSHASH.tar
+ fi
+
+ echo "Using cache key: $DEPSHASH"
+ echo "Checking for cache in: $cache_path"
+ if [ ! -f "$cache_path" ]; then
+ echo "Cache Does Not Exist for $DEPSHASH - exiting"
+ exit 1
+ else
+ echo "Found Cache for $DEPSHASH at $cache_path"
+ fi
+
+ echo "Persisted cache is $(du -sh $cache_path | cut -f1)"
+ if [ `du $cache_path | cut -f1` = "0" ]; then
+ echo "Cache is empty - exiting"
+ exit 1
+ fi
+
+ mkdir temp-cache
+ tar -xf $cache_path -C temp-cache
+ echo "Unzipped cache is $(du -sh temp-cache/src | cut -f1)"
+
+ if [ -d "temp-cache/src" ]; then
+ echo "Relocating Cache"
+ rm -rf src
+ mv temp-cache/src src
+ fi
+
+ if [ ! -d "src/third_party/blink" ]; then
+ echo "Cache was not correctly restored - exiting"
+ exit 1
+ fi
+
+ echo "Wiping Electron Directory"
+ rm -rf src/electron
diff --git a/.github/actions/restore-cache-azcopy/action.yml b/.github/actions/restore-cache-azcopy/action.yml
new file mode 100644
index 0000000000000..22e82e0f97843
--- /dev/null
+++ b/.github/actions/restore-cache-azcopy/action.yml
@@ -0,0 +1,124 @@
+name: 'Restore Cache AZCopy'
+description: 'Restores Electron src cache via AZCopy'
+inputs:
+ target-platform:
+ description: 'Target platform, should be linux, win, macos'
+runs:
+ using: "composite"
+ steps:
+ - name: Obtain SAS Key
+ continue-on-error: true
+ uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: sas-token
+ key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-1
+ enableCrossOsArchive: true
+ - name: Obtain SAS Key
+ continue-on-error: true
+ uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: sas-token
+ key: sas-key-${{ inputs.target-platform }}-${{ github.run_number }}-${{ github.run_attempt }}
+ enableCrossOsArchive: true
+ - name: Download Src Cache from AKS
+ # The cache will always exist here as a result of the checkout job
+ # Either it was uploaded to Azure in the checkout job for this commit
+ # or it was uploaded in the checkout job for a previous commit.
+ uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
+ with:
+ timeout_minutes: 30
+ max_attempts: 3
+ retry_on: error
+ shell: bash
+ command: |
+ sas_token=$(cat sas-token)
+ if [ -z "$sas_token" ]; then
+ echo "SAS Token not found; exiting src cache download early..."
+ exit 1
+ else
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ azcopy copy --log-level=ERROR \
+ "https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_WIN_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
+ else
+ azcopy copy --log-level=ERROR \
+ "https://${{ env.AZURE_AKS_CACHE_STORAGE_ACCOUNT }}.file.core.windows.net/${{ env.AZURE_AKS_CACHE_SHARE_NAME }}/${{ env.CACHE_PATH }}?$sas_token" $DEPSHASH.tar
+ fi
+ fi
+ env:
+ AZURE_AKS_CACHE_STORAGE_ACCOUNT: f723719aa87a34622b5f7f3
+ AZURE_AKS_CACHE_SHARE_NAME: pvc-f6a4089f-b082-4bee-a3f9-c3e1c0c02d8f
+ AZURE_AKS_WIN_CACHE_SHARE_NAME: pvc-71dec4f2-0d44-4fd1-a2c3-add049d70bdf
+ - name: Clean SAS Key
+ shell: bash
+ run: rm -f sas-token
+ - name: Unzip and Ensure Src Cache
+ if: ${{ inputs.target-platform == 'macos' }}
+ shell: bash
+ run: |
+ echo "Downloaded cache is $(du -sh $DEPSHASH.tar | cut -f1)"
+ if [ `du $DEPSHASH.tar | cut -f1` = "0" ]; then
+ echo "Cache is empty - exiting"
+ exit 1
+ fi
+
+ mkdir temp-cache
+ tar -xf $DEPSHASH.tar -C temp-cache
+ echo "Unzipped cache is $(du -sh temp-cache/src | cut -f1)"
+
+ if [ -d "temp-cache/src" ]; then
+ echo "Relocating Cache"
+ rm -rf src
+ mv temp-cache/src src
+
+ echo "Deleting zip file"
+ rm -rf $DEPSHASH.tar
+ fi
+
+ if [ ! -d "src/third_party/blink" ]; then
+ echo "Cache was not correctly restored - exiting"
+ exit 1
+ fi
+
+ echo "Wiping Electron Directory"
+ rm -rf src/electron
+
+ - name: Unzip and Ensure Src Cache (Windows)
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: powershell
+ run: |
+ $src_cache = "$env:DEPSHASH.tar"
+ $cache_size = $(Get-Item $src_cache).length
+ Write-Host "Downloaded cache is $cache_size"
+ if ($cache_size -eq 0) {
+ Write-Host "Cache is empty - exiting"
+ exit 1
+ }
+
+ $TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
+ $TEMP_DIR_PATH = $TEMP_DIR.FullName
+ C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
+
+ - name: Move Src Cache (Windows)
+ if: ${{ inputs.target-platform == 'win' }}
+ uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
+ with:
+ timeout_minutes: 30
+ max_attempts: 3
+ retry_on: error
+ shell: powershell
+ command: |
+ if (Test-Path "temp-cache\src") {
+ Write-Host "Relocating Cache"
+ Remove-Item -Recurse -Force src
+ Move-Item temp-cache\src src
+
+ Write-Host "Deleting zip file"
+ Remove-Item -Force $src_cache
+ }
+ if (-Not (Test-Path "src\third_party\blink")) {
+ Write-Host "Cache was not correctly restored - exiting"
+ exit 1
+ }
+
+ Write-Host "Wiping Electron Directory"
+ Remove-Item -Recurse -Force src\electron
diff --git a/.github/actions/set-chromium-cookie/action.yml b/.github/actions/set-chromium-cookie/action.yml
new file mode 100644
index 0000000000000..2011655e29b59
--- /dev/null
+++ b/.github/actions/set-chromium-cookie/action.yml
@@ -0,0 +1,58 @@
+name: 'Set Chromium Git Cookie'
+description: 'Sets an authenticated cookie from Chromium to allow for a higher request limit'
+runs:
+ using: "composite"
+ steps:
+ - name: Set the git cookie from chromium.googlesource.com (Unix)
+ if: ${{ runner.os != 'Windows' }}
+ shell: bash
+ run: |
+ if [[ -z "${{ env.CHROMIUM_GIT_COOKIE }}" ]]; then
+ echo "CHROMIUM_GIT_COOKIE is not set - cannot authenticate."
+ exit 0
+ fi
+
+ eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null
+ touch ~/.gitcookies
+ chmod 0600 ~/.gitcookies
+
+ git config --global http.cookiefile ~/.gitcookies
+
+ tr , \\t <<\__END__ >>~/.gitcookies
+ ${{ env.CHROMIUM_GIT_COOKIE }}
+ __END__
+ eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null
+
+ RESPONSE=$(curl -s -b ~/.gitcookies https://chromium-review.googlesource.com/a/accounts/self)
+ if [[ $RESPONSE == ")]}'"* ]]; then
+ # Extract account email for verification
+ EMAIL=$(echo "$RESPONSE" | tail -c +5 | jq -r '.email // "No email found"')
+ echo "Cookie authentication successful - authenticated as: $EMAIL"
+ else
+ echo "Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE is set correctly"
+ echo $RESPONSE
+ fi
+ - name: Set the git cookie from chromium.googlesource.com (Windows)
+ if: ${{ runner.os == 'Windows' }}
+ shell: cmd
+ run: |
+ if "%CHROMIUM_GIT_COOKIE_WINDOWS_STRING%"=="" (
+ echo CHROMIUM_GIT_COOKIE_WINDOWS_STRING is not set - cannot authenticate.
+ exit /b 0
+ )
+
+ git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
+ powershell -noprofile -nologo -command Write-Output "${{ env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}" >>"%USERPROFILE%\.gitcookies"
+
+ curl -s -b "%USERPROFILE%\.gitcookies" https://chromium-review.googlesource.com/a/accounts/self > response.txt
+
+ findstr /B /C:")]}'" response.txt > nul
+ if %ERRORLEVEL% EQU 0 (
+ echo Cookie authentication successful
+ powershell -NoProfile -Command "& {$content = Get-Content -Raw response.txt; $content = $content.Substring(4); try { $json = ConvertFrom-Json $content; if($json.email) { Write-Host 'Authenticated as:' $json.email } else { Write-Host 'No email found in response' } } catch { Write-Host 'Error parsing JSON:' $_ }}"
+ ) else (
+ echo Cookie authentication failed - ensure CHROMIUM_GIT_COOKIE_WINDOWS_STRING is set correctly
+ type response.txt
+ )
+
+ del response.txt
diff --git a/.github/config.yml b/.github/config.yml
index 62fe777031a70..e1b6e49e1777b 100644
--- a/.github/config.yml
+++ b/.github/config.yml
@@ -2,7 +2,9 @@
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖
- We use [semantic commit messages](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
+ ### Semantic PR titles
+
+ We use [semantic commit messages](https://github.com/electron/electron/blob/main/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
Examples of commit messages with semantic prefixes:
@@ -10,11 +12,18 @@ newPRWelcomeComment: |
- `feat: add app.isPackaged() method`
- `docs: app.isDefaultProtocolClient is now available on Linux`
+ ### Commit signing
+
+ This repo enforces [commit signatures](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) for all incoming PRs.
+ To sign your commits, see GitHub's documentation on [Telling Git about your signing key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key).
+
+ ### PR tips
+
Things that will help get your PR across the finish line:
- - Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md).
+ - Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/main/docs/development/coding-style.md).
- Run `npm run lint` locally to catch formatting errors earlier.
- - Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
+ - Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/main/docs/styleguide.md).
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.
@@ -25,17 +34,3 @@ newPRWelcomeComment: |
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉🎉🎉
-
-# Users authorized to run manual trop backports
-authorizedUsers:
- - alexeykuzmin
- - BinaryMuse
- - ckerr
- - codebytere
- - deepak1556
- - jkleinsc
- - MarshallOfSound
- - miniak
- - nitsakh
- - nornagon
- - zcbenz
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000000..04a32c3587dd0
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,68 @@
+# Keep GitHub Actions up to date with GitHub's Dependabot...
+# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
+# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: weekly
+ labels:
+ - "no-backport"
+ - "semver/none"
+ target-branch: main
+ - package-ecosystem: npm
+ directories:
+ - /
+ - /spec
+ - /npm
+ schedule:
+ interval: daily
+ labels:
+ - "no-backport"
+ open-pull-requests-limit: 2
+ target-branch: main
+ - package-ecosystem: npm
+ directories:
+ - /
+ - /spec
+ - /npm
+ schedule:
+ interval: daily
+ labels:
+ - "backport-check-skip"
+ open-pull-requests-limit: 0
+ target-branch: 33-x-y
+ - package-ecosystem: npm
+ directories:
+ - /
+ - /spec
+ - /npm
+ schedule:
+ interval: daily
+ labels:
+ - "backport-check-skip"
+ open-pull-requests-limit: 0
+ target-branch: 32-x-y
+ - package-ecosystem: npm
+ directories:
+ - /
+ - /spec
+ - /npm
+ schedule:
+ interval: daily
+ labels:
+ - "backport-check-skip"
+ open-pull-requests-limit: 0
+ target-branch: 31-x-y
+ - package-ecosystem: npm
+ directories:
+ - /
+ - /spec
+ - /npm
+ schedule:
+ interval: daily
+ labels:
+ - "backport-check-skip"
+ open-pull-requests-limit: 0
+ target-branch: 30-x-y
\ No newline at end of file
diff --git a/.github/main.workflow b/.github/main.workflow
deleted file mode 100644
index f33f94bd75896..0000000000000
--- a/.github/main.workflow
+++ /dev/null
@@ -1,10 +0,0 @@
-workflow "Clerk" {
- #TODO(codebytere): make this work properly on pull_request
- on = "repository_dispatch"
- resolves = "Check release notes"
-}
-
-action "Check release notes" {
- uses = "electron/clerk@master"
- secrets = [ "GITHUB_TOKEN" ]
-}
diff --git a/.github/problem-matchers/clang.json b/.github/problem-matchers/clang.json
new file mode 100644
index 0000000000000..35cf775305bd5
--- /dev/null
+++ b/.github/problem-matchers/clang.json
@@ -0,0 +1,18 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "clang",
+ "fromPath": "src/out/Default/args.gn",
+ "pattern": [
+ {
+ "regexp": "^(.+)[(:](\\d+)[:,](\\d+)\\)?:\\s+(warning|error):\\s+(.*)$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "severity": 4,
+ "message": 5
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problem-matchers/eslint-stylish.json b/.github/problem-matchers/eslint-stylish.json
new file mode 100644
index 0000000000000..a98afcfb11b94
--- /dev/null
+++ b/.github/problem-matchers/eslint-stylish.json
@@ -0,0 +1,22 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "eslint-stylish",
+ "pattern": [
+ {
+ "regexp": "^\\s*([^\\s].*)$",
+ "file": 1
+ },
+ {
+ "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
+ "line": 1,
+ "column": 2,
+ "severity": 3,
+ "message": 4,
+ "code": 5,
+ "loop": true
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/problem-matchers/patch-conflict.json b/.github/problem-matchers/patch-conflict.json
new file mode 100644
index 0000000000000..e8324448cbbfa
--- /dev/null
+++ b/.github/problem-matchers/patch-conflict.json
@@ -0,0 +1,24 @@
+{
+ "problemMatcher": [
+ {
+ "owner": "merge-conflict",
+ "pattern": [
+ {
+ "regexp": "^CONFLICT\\s\\(\\S+\\): (Merge conflict in \\S+)$",
+ "message": 1
+ }
+ ]
+ },
+ {
+ "owner": "patch-conflict",
+ "pattern": [
+ {
+ "regexp": "^error: (patch failed: (\\S+):(\\d+))$",
+ "message": 1,
+ "file": 2,
+ "line": 3
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644
index e39e44f5eff05..0000000000000
--- a/.github/stale.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 45
-# Number of days of inactivity before a stale issue is closed
-daysUntilClose: 7
-# Issues with these labels will never be considered stale
-exemptLabels:
- - fixme/bug
- - fixme/crash
- - fixme/regression
- - fixme/security
- - blocked
- - blocking-stable
- - needs-review
-# Label to use when marking an issue as stale
-staleLabel: stale
-# Comment to post when marking an issue as stale. Set to `false` to disable
-markComment: >
- This issue has been automatically marked as stale because it has not had
- recent activity and is not currently prioritized. It will be closed
- in a week if no further activity occurs :)
-
-# Comment to post when closing a stale issue. Set to `false` to disable
-closeComment: >
- If you still think this issue is relevant, please ping a maintainer or
- leave a comment!
\ No newline at end of file
diff --git a/.github/workflows/archaeologist-dig.yml b/.github/workflows/archaeologist-dig.yml
new file mode 100644
index 0000000000000..4be9246226ce8
--- /dev/null
+++ b/.github/workflows/archaeologist-dig.yml
@@ -0,0 +1,65 @@
+name: Archaeologist
+
+on:
+ pull_request:
+
+jobs:
+ archaeologist-dig:
+ name: Archaeologist Dig
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
+ with:
+ fetch-depth: 0
+ - name: Setup Node.js/npm
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
+ with:
+ node-version: 20.19.x
+ - name: Setting Up Dig Site
+ run: |
+ echo "remote: ${{ github.event.pull_request.head.repo.clone_url }}"
+ echo "sha ${{ github.event.pull_request.head.sha }}"
+ echo "base ref ${{ github.event.pull_request.base.ref }}"
+ git clone https://github.com/electron/electron.git electron
+ cd electron
+ mkdir -p artifacts
+ git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} && git fetch fork
+ git checkout ${{ github.event.pull_request.head.sha }}
+ git merge-base origin/${{ github.event.pull_request.base.ref }} HEAD > .dig-old
+ echo ${{ github.event.pull_request.head.sha }} > .dig-new
+ cp .dig-old artifacts
+
+ - name: Generating Types for SHA in .dig-new
+ uses: ./.github/actions/generate-types
+ with:
+ sha-file: .dig-new
+ filename: electron.new.d.ts
+ - name: Generating Types for SHA in .dig-old
+ uses: ./.github/actions/generate-types
+ with:
+ sha-file: .dig-old
+ filename: electron.old.d.ts
+ - name: Upload artifacts
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
+ with:
+ name: artifacts
+ path: electron/artifacts
+ include-hidden-files: true
+ - name: Set job output
+ run: |
+ git diff --no-index electron.old.d.ts electron.new.d.ts > patchfile || true
+ if [ -s patchfile ]; then
+ echo "Changes Detected"
+ echo "## Changes Detected" > $GITHUB_STEP_SUMMARY
+ echo "Looks like the \`electron.d.ts\` file changed." >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "\`\`\`\`\`\`diff" >> $GITHUB_STEP_SUMMARY
+ cat patchfile >> $GITHUB_STEP_SUMMARY
+ echo "\`\`\`\`\`\`" >> $GITHUB_STEP_SUMMARY
+ else
+ echo "No Changes Detected"
+ echo "## No Changes" > $GITHUB_STEP_SUMMARY
+ echo "We couldn't see any changes in the \`electron.d.ts\` artifact" >> $GITHUB_STEP_SUMMARY
+ fi
+ working-directory: ./electron/artifacts
diff --git a/.github/workflows/audit-branch-ci.yml b/.github/workflows/audit-branch-ci.yml
new file mode 100644
index 0000000000000..36ecf5423066f
--- /dev/null
+++ b/.github/workflows/audit-branch-ci.yml
@@ -0,0 +1,145 @@
+name: Audit CI on Branches
+
+on:
+ workflow_dispatch:
+ schedule:
+ # Run every 2 hours
+ - cron: '0 */2 * * *'
+
+permissions: {}
+
+jobs:
+ audit_branch_ci:
+ name: Audit CI on Branches
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ steps:
+ - run: npm install @actions/cache @electron/fiddle-core
+ - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ id: audit-errors
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const cache = require('@actions/cache');
+ const { ElectronVersions } = require('@electron/fiddle-core');
+
+ const runsWithErrors = [];
+
+ // Only want the most recent workflow run that wasn't skipped or cancelled
+ const isValidWorkflowRun = (run) => !['skipped', 'cancelled'].includes(run.conclusion);
+
+ const versions = await ElectronVersions.create(undefined, { ignoreCache: true });
+ const branches = versions.supportedMajors.map((branch) => `${branch}-x-y`);
+
+ for (const branch of ["main", ...branches]) {
+ const latestCheckRuns = new Map();
+ const allCheckRuns = await github.paginate(github.rest.checks.listForRef, {
+ owner: "electron",
+ repo: "electron",
+ ref: branch,
+ status: 'completed',
+ });
+
+ // Sort the check runs by completed_at so that multiple check runs on the
+ // same ref (like a scheduled workflow) only looks at the most recent one
+ for (const checkRun of allCheckRuns.filter(
+ (run) => !['skipped', 'cancelled'].includes(run.conclusion),
+ ).sort((a, b) => new Date(b.completed_at) - new Date(a.completed_at))) {
+ if (!latestCheckRuns.has(checkRun.name)) {
+ latestCheckRuns.set(checkRun.name, checkRun);
+ }
+ }
+
+ // Check for runs which had error annotations
+ for (const checkRun of Array.from(latestCheckRuns.values())) {
+ if (checkRun.name === "Audit CI on Branches") {
+ continue; // Skip the audit workflow itself
+ }
+
+ const annotations = (await github.rest.checks.listAnnotations({
+ owner: "electron",
+ repo: "electron",
+ check_run_id: checkRun.id,
+ })).data ?? [];
+
+ if (
+ annotations.find(
+ ({ annotation_level, message }) =>
+ annotation_level === "failure" &&
+ !message.startsWith("Process completed with exit code") &&
+ !message.startsWith("Response status code does not indicate success") &&
+ !/Unable to make request/.test(message) &&
+ !/The requested URL returned error/.test(message),
+ )
+ ) {
+ checkRun.hasErrorAnnotations = true;
+ } else {
+ continue;
+ }
+
+ // Check if this is a known failure from a previous audit run
+ const cacheKey = `check-run-error-annotations-${checkRun.id}`;
+ const cacheHit =
+ (await cache.restoreCache(['/dev/null'], cacheKey, undefined, {
+ lookupOnly: true,
+ })) !== undefined;
+
+ if (cacheHit) {
+ checkRun.isStale = true;
+ }
+
+ checkRun.branch = branch;
+ runsWithErrors.push(checkRun);
+
+ // Create a cache entry (only the name matters) to keep track of
+ // failures we've seen from previous runs to mark them as stale
+ if (!cacheHit) {
+ await cache.saveCache(['/dev/null'], cacheKey);
+ }
+ }
+ }
+
+ if (runsWithErrors.length > 0) {
+ core.setOutput('errorsFound', true);
+ core.summary.addHeading('⚠️ Runs with Errors');
+ core.summary.addTable([
+ [
+ { data: 'Branch', header: true },
+ { data: 'Workflow Run', header: true },
+ { data: 'Status', header: true },
+ ],
+ ...runsWithErrors
+ .sort(
+ (a, b) =>
+ a.branch.localeCompare(b.branch) ||
+ a.name.localeCompare(b.name),
+ )
+ .map((run) => [
+ run.branch,
+ `${run.name}`,
+ run.isStale
+ ? '📅 Stale'
+ : run.hasErrorAnnotations
+ ? '⚠️ Errors'
+ : '✅ Succeeded',
+ ]),
+ ]);
+
+ // Set this as failed so it's easy to scan runs to find failures
+ if (runsWithErrors.find((run) => !run.isStale)) {
+ process.exitCode = 1;
+ }
+ } else {
+ core.summary.addRaw('🎉 No runs with errors');
+ }
+
+ await core.summary.write();
+ - name: Send Slack message if errors
+ if: ${{ always() && steps.audit-errors.outputs.errorsFound && github.ref == 'refs/heads/main' }}
+ uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
+ with:
+ payload: |
+ link: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+ webhook: ${{ secrets.CI_ERRORS_SLACK_WEBHOOK_URL }}
+ webhook-type: webhook-trigger
diff --git a/.github/workflows/branch-created.yml b/.github/workflows/branch-created.yml
new file mode 100644
index 0000000000000..87c4aa933b49f
--- /dev/null
+++ b/.github/workflows/branch-created.yml
@@ -0,0 +1,128 @@
+name: Branch Created
+
+on:
+ workflow_dispatch:
+ inputs:
+ branch-name:
+ description: Branch name (e.g. `29-x-y`)
+ required: true
+ type: string
+ create:
+
+permissions: {}
+
+jobs:
+ release-branch-created:
+ name: Release Branch Created
+ if: ${{ github.event_name == 'workflow_dispatch' || (github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') && !startsWith(github.event.ref, 'roller')) }}
+ permissions:
+ contents: read
+ pull-requests: write
+ repository-projects: write # Required for labels
+ runs-on: ubuntu-latest
+ steps:
+ - name: Determine Major Version
+ id: check-major-version
+ env:
+ BRANCH_NAME: ${{ github.event.inputs.branch-name || github.event.ref }}
+ run: |
+ if [[ "$BRANCH_NAME" =~ ^([0-9]+)-x-y$ ]]; then
+ echo "MAJOR=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
+ else
+ echo "Not a release branch: $BRANCH_NAME"
+ fi
+ - name: New Release Branch Tasks
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GH_REPO: electron/electron
+ MAJOR: ${{ steps.check-major-version.outputs.MAJOR }}
+ NUM_SUPPORTED_VERSIONS: 3
+ run: |
+ PREVIOUS_MAJOR=$((MAJOR - 1))
+ UNSUPPORTED_MAJOR=$((MAJOR - NUM_SUPPORTED_VERSIONS - 1))
+
+ # Create new labels
+ gh label create $MAJOR-x-y --color 8d9ee8 || true
+ gh label create target/$MAJOR-x-y --color ad244f --description "PR should also be added to the \"${MAJOR}-x-y\" branch." || true
+ gh label create merged/$MAJOR-x-y --color 61a3c6 --description "PR was merged to the \"${MAJOR}-x-y\" branch." || true
+ gh label create in-flight/$MAJOR-x-y --color db69a6 || true
+ gh label create needs-manual-bp/$MAJOR-x-y --color 8b5dba || true
+
+ # Change color of old labels
+ gh label edit $UNSUPPORTED_MAJOR-x-y --color ededed || true
+ gh label edit target/$UNSUPPORTED_MAJOR-x-y --color ededed || true
+ gh label edit merged/$UNSUPPORTED_MAJOR-x-y --color ededed || true
+ gh label edit in-flight/$UNSUPPORTED_MAJOR-x-y --color ededed || true
+ gh label edit needs-manual-bp/$UNSUPPORTED_MAJOR-x-y --color ededed || true
+
+ # Add the new target label to any PRs which:
+ # * target the previous major
+ # * are in-flight for the previous major
+ # * need manual backport for the previous major
+ for PREVIOUS_MAJOR_LABEL in target/$PREVIOUS_MAJOR-x-y in-flight/$PREVIOUS_MAJOR-x-y needs-manual-bp/$PREVIOUS_MAJOR-x-y; do
+ PULL_REQUESTS=$(gh pr list --label $PREVIOUS_MAJOR_LABEL --jq .[].number --json number --limit 500)
+ if [[ $PULL_REQUESTS ]]; then
+ echo $PULL_REQUESTS | xargs -n 1 gh pr edit --add-label target/$MAJOR-x-y || true
+ fi
+ done
+ - name: Generate GitHub App token
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
+ org: electron
+ - name: Generate Release Project Board Metadata
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ id: generate-project-metadata
+ with:
+ script: |
+ const major = ${{ steps.check-major-version.outputs.MAJOR }}
+ const nextMajor = major + 1
+ const prevMajor = major - 1
+
+ core.setOutput("major", major)
+ core.setOutput("next-major", nextMajor)
+ core.setOutput("prev-major", prevMajor)
+ core.setOutput("prev-prev-major", prevMajor - 1)
+ core.setOutput("template-view", JSON.stringify({
+ major,
+ "next-major": nextMajor,
+ "prev-major": prevMajor,
+ }))
+ - name: Create Release Project Board
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ uses: dsanders11/project-actions/copy-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ id: create-release-board
+ with:
+ drafts: true
+ project-number: 64
+ # TODO - Set to public once GitHub fixes their GraphQL bug
+ # public: true
+ # TODO - Enable once GitHub doesn't require overly broad, read
+ # and write permission for repo "Contents" to link
+ # link-to-repository: electron/electron
+ template-view: ${{ steps.generate-project-metadata.outputs.template-view }}
+ title: ${{ steps.generate-project-metadata.outputs.major }}-x-y
+ token: ${{ steps.generate-token.outputs.token }}
+ - name: Dump Release Project Board Contents
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ run: gh project item-list ${{ steps.create-release-board.outputs.number }} --owner electron --format json | jq
+ env:
+ GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
+ - name: Find Previous Release Project Board
+ if: ${{ steps.check-major-version.outputs.MAJOR }}
+ uses: dsanders11/project-actions/find-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ id: find-prev-release-board
+ with:
+ fail-if-project-not-found: false
+ title: ${{ steps.generate-project-metadata.outputs.prev-prev-major }}-x-y
+ token: ${{ steps.generate-token.outputs.token }}
+ - name: Close Previous Release Project Board
+ if: ${{ steps.find-prev-release-board.outputs.number }}
+ uses: dsanders11/project-actions/close-project@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ project-number: ${{ steps.find-prev-release-board.outputs.number }}
+ token: ${{ steps.generate-token.outputs.token }}
diff --git a/.github/workflows/build-git-cache.yml b/.github/workflows/build-git-cache.yml
new file mode 100644
index 0000000000000..0fddbd4522a58
--- /dev/null
+++ b/.github/workflows/build-git-cache.yml
@@ -0,0 +1,74 @@
+name: Build Git Cache
+# This workflow updates git cache on the cross-instance cache volumes
+# It runs daily at midnight.
+
+on:
+ schedule:
+ - cron: "0 0 * * *"
+
+jobs:
+ build-git-cache-linux:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Build Git Cache
+ uses: ./src/electron/.github/actions/build-git-cache
+ with:
+ target-platform: linux
+
+ build-git-cache-windows:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
+ options: --user root --device /dev/fuse --cap-add SYS_ADMIN
+ volumes:
+ - /mnt/win-cache:/mnt/win-cache
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
+ TARGET_OS: 'win'
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Build Git Cache
+ uses: ./src/electron/.github/actions/build-git-cache
+ with:
+ target-platform: win
+
+ build-git-cache-macos:
+ runs-on: electron-arc-linux-amd64-32core
+ # This job updates the same git cache as linux, so it needs to run after the linux one.
+ needs: build-git-cache-linux
+ container:
+ image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Build Git Cache
+ uses: ./src/electron/.github/actions/build-git-cache
+ with:
+ target-platform: macos
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000000000..8fb0809874735
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,396 @@
+name: Build
+
+on:
+ workflow_dispatch:
+ inputs:
+ build-image-sha:
+ type: string
+ description: 'SHA for electron/build image'
+ default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
+ required: true
+ skip-macos:
+ type: boolean
+ description: 'Skip macOS builds'
+ default: false
+ required: false
+ skip-linux:
+ type: boolean
+ description: 'Skip Linux builds'
+ default: false
+ required: false
+ skip-windows:
+ type: boolean
+ description: 'Skip Windows builds'
+ default: false
+ required: false
+ skip-lint:
+ type: boolean
+ description: 'Skip lint check'
+ default: false
+ required: false
+ push:
+ branches:
+ - main
+ - '[1-9][0-9]-x-y'
+ pull_request:
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ setup:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ outputs:
+ docs: ${{ steps.filter.outputs.docs }}
+ src: ${{ steps.filter.outputs.src }}
+ build-image-sha: ${{ steps.set-output.outputs.build-image-sha }}
+ docs-only: ${{ steps.set-output.outputs.docs-only }}
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.0.2
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
+ id: filter
+ with:
+ filters: |
+ docs:
+ - 'docs/**'
+ src:
+ - '!docs/**'
+ - name: Set Outputs for Build Image SHA & Docs Only
+ id: set-output
+ run: |
+ if [ -z "${{ inputs.build-image-sha }}" ]; then
+ echo "build-image-sha=424eedbf277ad9749ffa9219068aa72ed4a5e373" >> "$GITHUB_OUTPUT"
+ else
+ echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
+ fi
+ echo "docs-only=${{ steps.filter.outputs.docs == 'true' && steps.filter.outputs.src == 'false' }}" >> "$GITHUB_OUTPUT"
+
+ # Lint Jobs
+ lint:
+ needs: setup
+ if: ${{ !inputs.skip-lint }}
+ uses: ./.github/workflows/pipeline-electron-lint.yml
+ with:
+ container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root"}'
+ secrets: inherit
+
+ # Docs Only Jobs
+ docs-only:
+ needs: setup
+ if: ${{ needs.setup.outputs.docs-only == 'true' }}
+ uses: ./.github/workflows/pipeline-electron-docs-only.yml
+ with:
+ container: '{"image":"ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}","options":"--user root"}'
+ secrets: inherit
+
+ # Checkout Jobs
+ checkout-macos:
+ needs: setup
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-macos}}
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
+ outputs:
+ build-image-sha: ${{ needs.setup.outputs.build-image-sha }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+ with:
+ generate-sas-token: 'true'
+ target-platform: macos
+
+ checkout-linux:
+ needs: setup
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-linux}}
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ DD_API_KEY: ${{ secrets.DD_API_KEY }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
+ PATCH_UP_APP_CREDS: ${{ secrets.PATCH_UP_APP_CREDS }}
+ outputs:
+ build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+ with:
+ target-platform: linux
+
+ checkout-windows:
+ needs: setup
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ needs.setup.outputs.build-image-sha }}
+ options: --user root --device /dev/fuse --cap-add SYS_ADMIN
+ volumes:
+ - /mnt/win-cache:/mnt/win-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
+ TARGET_OS: 'win'
+ ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
+ outputs:
+ build-image-sha: ${{ needs.setup.outputs.build-image-sha}}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+ with:
+ generate-sas-token: 'true'
+ target-platform: win
+
+ # GN Check Jobs
+ macos-gn-check:
+ uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
+ needs: checkout-macos
+ with:
+ target-platform: macos
+ target-archs: x64 arm64
+ check-runs-on: macos-15
+ gn-build-type: testing
+ secrets: inherit
+
+ linux-gn-check:
+ uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
+ needs: checkout-linux
+ with:
+ target-platform: linux
+ target-archs: x64 arm arm64
+ check-runs-on: electron-arc-linux-amd64-8core
+ check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ gn-build-type: testing
+ secrets: inherit
+
+ windows-gn-check:
+ uses: ./.github/workflows/pipeline-segment-electron-gn-check.yml
+ needs: checkout-windows
+ with:
+ target-platform: win
+ target-archs: x64 x86 arm64
+ check-runs-on: electron-arc-linux-amd64-8core
+ check-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-windows.outputs.build-image-sha }}","options":"--user root --device /dev/fuse --cap-add SYS_ADMIN","volumes":["/mnt/win-cache:/mnt/win-cache"]}'
+ gn-build-type: testing
+ secrets: inherit
+
+ # Build Jobs - These cascade into testing jobs
+ macos-x64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-macos
+ with:
+ build-runs-on: macos-15-xlarge
+ test-runs-on: macos-13
+ target-platform: macos
+ target-arch: x64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ macos-arm64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-macos
+ with:
+ build-runs-on: macos-15-xlarge
+ test-runs-on: macos-14
+ target-platform: macos
+ target-arch: arm64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ linux-x64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test-and-nan.yml
+ needs: checkout-linux
+ with:
+ build-runs-on: electron-arc-linux-amd64-32core
+ test-runs-on: electron-arc-linux-amd64-4core
+ build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
+ target-platform: linux
+ target-arch: x64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ linux-x64-asan:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-linux
+ with:
+ build-runs-on: electron-arc-linux-amd64-32core
+ test-runs-on: electron-arc-linux-amd64-4core
+ build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ test-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
+ target-platform: linux
+ target-arch: x64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ is-asan: true
+ secrets: inherit
+
+ linux-arm:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-linux
+ with:
+ build-runs-on: electron-arc-linux-amd64-32core
+ test-runs-on: electron-arc-linux-arm64-4core
+ build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ test-container: '{"image":"ghcr.io/electron/test:arm32v7-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init","volumes":["/home/runner/externals:/mnt/runner-externals"]}'
+ target-platform: linux
+ target-arch: arm
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ linux-arm64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-linux
+ with:
+ build-runs-on: electron-arc-linux-amd64-32core
+ test-runs-on: electron-arc-linux-arm64-4core
+ build-container: '{"image":"ghcr.io/electron/build:${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ test-container: '{"image":"ghcr.io/electron/test:arm64v8-${{ needs.checkout-linux.outputs.build-image-sha }}","options":"--user root --privileged --init"}'
+ target-platform: linux
+ target-arch: arm64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ windows-x64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-windows
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
+ with:
+ build-runs-on: electron-arc-windows-amd64-16core
+ test-runs-on: windows-latest
+ target-platform: win
+ target-arch: x64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ windows-x86:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-windows
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
+ with:
+ build-runs-on: electron-arc-windows-amd64-16core
+ test-runs-on: windows-latest
+ target-platform: win
+ target-arch: x86
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ windows-arm64:
+ permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+ uses: ./.github/workflows/pipeline-electron-build-and-test.yml
+ needs: checkout-windows
+ if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
+ with:
+ build-runs-on: electron-arc-windows-amd64-16core
+ test-runs-on: electron-hosted-windows-arm64-4core
+ target-platform: win
+ target-arch: arm64
+ is-release: false
+ gn-build-type: testing
+ generate-symbols: false
+ upload-to-storage: '0'
+ secrets: inherit
+
+ gha-done:
+ name: GitHub Actions Completed
+ runs-on: ubuntu-latest
+ needs: [docs-only, macos-x64, macos-arm64, linux-x64, linux-x64-asan, linux-arm, linux-arm64, windows-x64, windows-x86, windows-arm64]
+ if: always() && !contains(needs.*.result, 'failure')
+ steps:
+ - name: GitHub Actions Jobs Done
+ run: |
+ echo "All GitHub Actions Jobs are done"
diff --git a/.github/workflows/clean-src-cache.yml b/.github/workflows/clean-src-cache.yml
new file mode 100644
index 0000000000000..0c4c5919a0ca3
--- /dev/null
+++ b/.github/workflows/clean-src-cache.yml
@@ -0,0 +1,29 @@
+name: Clean Source Cache
+
+description: |
+ This workflow cleans up the source cache on the cross-instance cache volume
+ to free up space. It runs daily at midnight and clears files older than 15 days.
+
+on:
+ schedule:
+ - cron: "0 0 * * *"
+
+jobs:
+ clean-src-cache:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:bc2f48b2415a670de18d13605b1cf0eb5fdbaae1
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ - /mnt/win-cache:/mnt/win-cache
+ steps:
+ - name: Cleanup Source Cache
+ shell: bash
+ run: |
+ df -h /mnt/cross-instance-cache
+ find /mnt/cross-instance-cache -type f -mtime +15 -delete
+ df -h /mnt/cross-instance-cache
+ df -h /mnt/win-cache
+ find /mnt/win-cache -type f -mtime +15 -delete
+ df -h /mnt/win-cache
diff --git a/.github/workflows/issue-commented.yml b/.github/workflows/issue-commented.yml
new file mode 100644
index 0000000000000..b1bd13b2d009f
--- /dev/null
+++ b/.github/workflows/issue-commented.yml
@@ -0,0 +1,26 @@
+name: Issue Commented
+
+on:
+ issue_comment:
+ types:
+ - created
+
+permissions: {}
+
+jobs:
+ issue-commented:
+ name: Remove blocked/{need-info,need-repro} on comment
+ if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ - name: Remove label
+ env:
+ GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
+ ISSUE_URL: ${{ github.event.issue.html_url }}
+ run: |
+ gh issue edit $ISSUE_URL --remove-label 'blocked/need-repro','blocked/need-info ❌'
diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml
new file mode 100644
index 0000000000000..b21691b0ca9cd
--- /dev/null
+++ b/.github/workflows/issue-labeled.yml
@@ -0,0 +1,88 @@
+name: Issue Labeled
+
+on:
+ issues:
+ types: [labeled]
+
+permissions: # added using https://github.com/step-security/secure-workflows
+ contents: read
+
+jobs:
+ issue-labeled-with-status:
+ name: status/{confirmed,reviewed} label added
+ if: github.event.label.name == 'status/confirmed' || github.event.label.name == 'status/reviewed'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - name: Set status
+ uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ token: ${{ steps.generate-token.outputs.token }}
+ project-number: 90
+ field: Status
+ field-value: ✅ Triaged
+ fail-if-item-not-found: false
+ issue-labeled-blocked:
+ name: blocked/* label added
+ if: startsWith(github.event.label.name, 'blocked/')
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - name: Set status
+ uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ token: ${{ steps.generate-token.outputs.token }}
+ project-number: 90
+ field: Status
+ field-value: 🛑 Blocked
+ fail-if-item-not-found: false
+ issue-labeled-blocked-need-repro:
+ name: blocked/need-repro label added
+ if: github.event.label.name == 'blocked/need-repro'
+ permissions:
+ issues: write # for actions-cool/issues-helper to update issues
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check if comment needed
+ id: check-for-comment
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GH_REPO: electron/electron
+ run: |
+ set -eo pipefail
+ COMMENT_COUNT=$(gh issue view ${{ github.event.issue.number }} --comments --json comments | jq '[ .comments[] | select(.author.login == "electron-issue-triage" or .authorAssociation == "OWNER" or .authorAssociation == "MEMBER") | select(.body | startswith("")) ] | length')
+ if [[ $COMMENT_COUNT -eq 0 ]]; then
+ echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT"
+ fi
+ - name: Generate GitHub App token
+ if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ - name: Create comment
+ if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }}
+ uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
+ with:
+ actions: 'create-comment'
+ token: ${{ steps.generate-token.outputs.token }}
+ body: |
+
+
+ Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
+
+ Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use.
+
+ Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
+
+ Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml
new file mode 100644
index 0000000000000..fb564177fa1aa
--- /dev/null
+++ b/.github/workflows/issue-opened.yml
@@ -0,0 +1,148 @@
+name: Issue Opened
+
+on:
+ issues:
+ types:
+ - opened
+
+permissions: {}
+
+jobs:
+ add-to-issue-triage:
+ if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - name: Add to Issue Triage
+ uses: dsanders11/project-actions/add-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ field: Reporter
+ field-value: ${{ github.event.issue.user.login }}
+ project-number: 90
+ token: ${{ steps.generate-token.outputs.token }}
+ set-labels:
+ if: ${{ contains(github.event.issue.labels.*.name, 'bug :beetle:') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - run: npm install @electron/fiddle-core@1.3.3 mdast-util-from-markdown@2.0.0 unist-util-select@5.1.0 semver@7.6.0
+ - name: Add labels
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ id: add-labels
+ env:
+ ISSUE_BODY: ${{ github.event.issue.body }}
+ with:
+ github-token: ${{ steps.generate-token.outputs.token }}
+ script: |
+ const { fromMarkdown } = await import('${{ github.workspace }}/node_modules/mdast-util-from-markdown/index.js');
+ const { select } = await import('${{ github.workspace }}/node_modules/unist-util-select/index.js');
+ const semver = await import('${{ github.workspace }}/node_modules/semver/index.js');
+
+ const [ owner, repo ] = '${{ github.repository }}'.split('/');
+ const issue_number = ${{ github.event.issue.number }};
+
+ const tree = fromMarkdown(process.env.ISSUE_BODY);
+
+ const labels = [];
+
+ const electronVersion = select('heading:has(> text[value="Electron Version"]) + paragraph > text', tree)?.value.trim();
+ if (electronVersion !== undefined) {
+ // It's possible for multiple versions to be listed -
+ // for now check for comma or space separated version.
+ const versions = electronVersion.split(/, | /);
+ let hasSupportedVersion = false;
+
+ for (const version of versions) {
+ const major = semver.coerce(version, { loose: true })?.major;
+ if (major) {
+ const versionLabel = `${major}-x-y`;
+ let labelExists = false;
+
+ try {
+ await github.rest.issues.getLabel({
+ owner,
+ repo,
+ name: versionLabel,
+ });
+ labelExists = true;
+ } catch {}
+
+ const { ElectronVersions } = await import('${{ github.workspace }}/node_modules/@electron/fiddle-core/dist/index.js');
+ const electronVersions = await ElectronVersions.create(undefined, { ignoreCache: true });
+ const validVersions = [...electronVersions.supportedMajors, ...electronVersions.prereleaseMajors];
+
+ if (validVersions.includes(major)) {
+ hasSupportedVersion = true;
+ if (labelExists) {
+ labels.push(versionLabel);
+ }
+ }
+ }
+ }
+
+ if (!hasSupportedVersion) {
+ core.setOutput('unsupportedMajor', true);
+ labels.push('blocked/need-info ❌');
+ }
+ }
+
+ const operatingSystems = select('heading:has(> text[value="What operating system(s) are you using?"]) + paragraph > text', tree)?.value.trim().split(', ');
+ const platformLabels = new Set();
+ for (const operatingSystem of (operatingSystems ?? [])) {
+ switch (operatingSystem) {
+ case 'Windows':
+ platformLabels.add('platform/windows');
+ break;
+ case 'macOS':
+ platformLabels.add('platform/macOS');
+ break;
+ case 'Ubuntu':
+ case 'Other Linux':
+ platformLabels.add('platform/linux');
+ break;
+ }
+ }
+
+ if (platformLabels.size === 3) {
+ labels.push('platform/all');
+ } else {
+ labels.push(...platformLabels);
+ }
+
+ const gistUrl = select('heading:has(> text[value="Testcase Gist URL"]) + paragraph > text', tree)?.value.trim();
+ if (gistUrl !== undefined && gistUrl.startsWith('https://gist.github.com/')) {
+ labels.push('has-repro-gist');
+ }
+
+ if (labels.length) {
+ await github.rest.issues.addLabels({
+ owner,
+ repo,
+ issue_number,
+ labels,
+ });
+ }
+ - name: Create unsupported major comment
+ if: ${{ steps.add-labels.outputs.unsupportedMajor }}
+ uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
+ with:
+ actions: 'create-comment'
+ token: ${{ steps.generate-token.outputs.token }}
+ body: |
+
+
+ Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better!
+
+ The version of Electron reported in this issue has reached end-of-life and is [no longer supported](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline). If you're still experiencing this issue on a [supported version](https://www.electronjs.org/releases/stable) of Electron, please update this issue to reflect that version of Electron.
+
+ Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-info%20%E2%9D%8C label for this reason. This issue will be closed in 10 days if the above is not addressed.
diff --git a/.github/workflows/issue-transferred.yml b/.github/workflows/issue-transferred.yml
new file mode 100644
index 0000000000000..2e5543ae9ec5a
--- /dev/null
+++ b/.github/workflows/issue-transferred.yml
@@ -0,0 +1,27 @@
+name: Issue Transferred
+
+on:
+ issues:
+ types: [transferred]
+
+permissions: {}
+
+jobs:
+ issue-transferred:
+ name: Issue Transferred
+ runs-on: ubuntu-latest
+ if: ${{ !github.event.changes.new_repository.private }}
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - name: Remove from issue triage
+ uses: dsanders11/project-actions/delete-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ token: ${{ steps.generate-token.outputs.token }}
+ project-number: 90
+ item: ${{ github.event.changes.new_issue.html_url }}
+ fail-if-item-not-found: false
diff --git a/.github/workflows/issue-unlabeled.yml b/.github/workflows/issue-unlabeled.yml
new file mode 100644
index 0000000000000..a7080a896713d
--- /dev/null
+++ b/.github/workflows/issue-unlabeled.yml
@@ -0,0 +1,39 @@
+name: Issue Unlabeled
+
+on:
+ issues:
+ types: [unlabeled]
+
+permissions:
+ contents: read
+
+jobs:
+ issue-unlabeled-blocked:
+ name: All blocked/* labels removed
+ if: startsWith(github.event.label.name, 'blocked/') && github.event.issue.state == 'open'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check for any blocked labels
+ id: check-for-blocked-labels
+ run: |
+ set -eo pipefail
+ BLOCKED_LABEL_COUNT=$(echo '${{ toJSON(github.event.issue.labels.*.name) }}' | jq '[ .[] | select(startswith("blocked/")) ] | length')
+ if [[ $BLOCKED_LABEL_COUNT -eq 0 ]]; then
+ echo "NOT_BLOCKED=1" >> "$GITHUB_OUTPUT"
+ fi
+ - name: Generate GitHub App token
+ if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ org: electron
+ - name: Set status
+ if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }}
+ uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ token: ${{ steps.generate-token.outputs.token }}
+ project-number: 90
+ field: Status
+ field-value: 📥 Was Blocked
+ fail-if-item-not-found: false
diff --git a/.github/workflows/linux-publish.yml b/.github/workflows/linux-publish.yml
new file mode 100644
index 0000000000000..8cadd26d23bcc
--- /dev/null
+++ b/.github/workflows/linux-publish.yml
@@ -0,0 +1,87 @@
+name: Publish Linux
+
+on:
+ workflow_dispatch:
+ inputs:
+ build-image-sha:
+ type: string
+ description: 'SHA for electron/build image'
+ default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
+ upload-to-storage:
+ description: 'Uploads to Azure storage'
+ required: false
+ default: '1'
+ type: string
+ run-linux-publish:
+ description: 'Run the publish jobs vs just the build jobs'
+ type: boolean
+ default: false
+
+jobs:
+ checkout-linux:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+
+ publish-x64:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-linux
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-linux-amd64-32core
+ build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ target-platform: linux
+ target-arch: x64
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ strip-binaries: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-arm:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-linux
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-linux-amd64-32core
+ build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ target-platform: linux
+ target-arch: arm
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ strip-binaries: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-arm64:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-linux
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-linux-amd64-32core
+ build-container: '{"image":"ghcr.io/electron/build:${{ inputs.build-image-sha }}","options":"--user root","volumes":["/mnt/cross-instance-cache:/mnt/cross-instance-cache"]}'
+ target-platform: linux
+ target-arch: arm64
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ strip-binaries: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
diff --git a/.github/workflows/macos-publish.yml b/.github/workflows/macos-publish.yml
new file mode 100644
index 0000000000000..5a1cb497b8d1b
--- /dev/null
+++ b/.github/workflows/macos-publish.yml
@@ -0,0 +1,103 @@
+name: Publish MacOS
+
+on:
+ workflow_dispatch:
+ inputs:
+ build-image-sha:
+ type: string
+ description: 'SHA for electron/build image'
+ default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
+ required: true
+ upload-to-storage:
+ description: 'Uploads to Azure storage'
+ required: false
+ default: '1'
+ type: string
+ run-macos-publish:
+ description: 'Run the publish jobs vs just the build jobs'
+ type: boolean
+ default: false
+
+jobs:
+ checkout-macos:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
+ options: --user root
+ volumes:
+ - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+ with:
+ generate-sas-token: 'true'
+ target-platform: macos
+
+ publish-x64-darwin:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-macos
+ with:
+ environment: production-release
+ build-runs-on: macos-15-xlarge
+ target-platform: macos
+ target-arch: x64
+ target-variant: darwin
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-x64-mas:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-macos
+ with:
+ environment: production-release
+ build-runs-on: macos-15-xlarge
+ target-platform: macos
+ target-arch: x64
+ target-variant: mas
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-arm64-darwin:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-macos
+ with:
+ environment: production-release
+ build-runs-on: macos-15-xlarge
+ target-platform: macos
+ target-arch: arm64
+ target-variant: darwin
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-arm64-mas:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-macos
+ with:
+ environment: production-release
+ build-runs-on: macos-15-xlarge
+ target-platform: macos
+ target-arch: arm64
+ target-variant: mas
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
diff --git a/.github/workflows/non-maintainer-dependency-change.yml b/.github/workflows/non-maintainer-dependency-change.yml
new file mode 100644
index 0000000000000..4fef73fe2136e
--- /dev/null
+++ b/.github/workflows/non-maintainer-dependency-change.yml
@@ -0,0 +1,37 @@
+name: Check for Non-Maintainer Dependency Change
+
+on:
+ pull_request_target:
+ paths:
+ - 'yarn.lock'
+ - 'spec/yarn.lock'
+
+permissions: {}
+
+jobs:
+ check-for-non-maintainer-dependency-change:
+ name: Check for non-maintainer dependency change
+ if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.pull_request.author_association) && github.event.pull_request.user.type != 'Bot' && !github.event.pull_request.draft }}
+ permissions:
+ contents: read
+ pull-requests: write
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check for existing review
+ id: check-for-review
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_URL: ${{ github.event.pull_request.html_url }}
+ run: |
+ set -eo pipefail
+ REVIEW_COUNT=$(gh pr view $PR_URL --json reviews | jq '[ .reviews[] | select(.author.login == "github-actions") | select(.body | startswith("")) ] | length')
+ if [[ $REVIEW_COUNT -eq 0 ]]; then
+ echo "SHOULD_REVIEW=1" >> "$GITHUB_OUTPUT"
+ fi
+ - name: Request changes
+ if: ${{ steps.check-for-review.outputs.SHOULD_REVIEW }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_URL: ${{ github.event.pull_request.html_url }}
+ run: |
+ printf "\n\nHello @${{ github.event.pull_request.user.login }}! It looks like this pull request touches one of our dependency files, and per [our contribution policy](https://github.com/electron/electron/blob/main/CONTRIBUTING.md#dependencies-upgrades-policy) we do not accept these types of changes in PRs." | gh pr review $PR_URL -r --body-file=-
diff --git a/.github/workflows/pipeline-electron-build-and-test-and-nan.yml b/.github/workflows/pipeline-electron-build-and-test-and-nan.yml
new file mode 100644
index 0000000000000..f4a7ec5243566
--- /dev/null
+++ b/.github/workflows/pipeline-electron-build-and-test-and-nan.yml
@@ -0,0 +1,93 @@
+name: Electron Build & Test (+ Node + NaN) Pipeline
+
+on:
+ workflow_call:
+ inputs:
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux.'
+ required: true
+ target-arch:
+ type: string
+ description: 'Arch to build for, can be x64, arm64 or arm'
+ required: true
+ build-runs-on:
+ type: string
+ description: 'What host to run the build'
+ required: true
+ test-runs-on:
+ type: string
+ description: 'What host to run the tests on'
+ required: true
+ build-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ test-container:
+ type: string
+ description: 'JSON container information for testing'
+ required: false
+ default: '{"image":null}'
+ is-release:
+ description: 'Whether this build job is a release job'
+ required: true
+ type: boolean
+ default: false
+ gn-build-type:
+ description: 'The gn build type - testing or release'
+ required: true
+ type: string
+ default: testing
+ generate-symbols:
+ description: 'Whether or not to generate symbols'
+ required: true
+ type: boolean
+ default: false
+ upload-to-storage:
+ description: 'Whether or not to upload build artifacts to external storage'
+ required: true
+ type: string
+ default: '0'
+ is-asan:
+ description: 'Building the Address Sanitizer (ASan) Linux build'
+ required: false
+ type: boolean
+ default: false
+
+concurrency:
+ group: electron-build-and-test-and-nan-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+jobs:
+ build:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ with:
+ build-runs-on: ${{ inputs.build-runs-on }}
+ build-container: ${{ inputs.build-container }}
+ target-platform: ${{ inputs.target-platform }}
+ target-arch: ${{ inputs.target-arch }}
+ is-release: ${{ inputs.is-release }}
+ gn-build-type: ${{ inputs.gn-build-type }}
+ generate-symbols: ${{ inputs.generate-symbols }}
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+ test:
+ uses: ./.github/workflows/pipeline-segment-electron-test.yml
+ needs: build
+ with:
+ target-arch: ${{ inputs.target-arch }}
+ target-platform: ${{ inputs.target-platform }}
+ test-runs-on: ${{ inputs.test-runs-on }}
+ test-container: ${{ inputs.test-container }}
+ secrets: inherit
+ nn-test:
+ uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
+ needs: build
+ with:
+ target-arch: ${{ inputs.target-arch }}
+ target-platform: ${{ inputs.target-platform }}
+ test-runs-on: ${{ inputs.test-runs-on }}
+ test-container: ${{ inputs.test-container }}
+ gn-build-type: ${{ inputs.gn-build-type }}
+ secrets: inherit
diff --git a/.github/workflows/pipeline-electron-build-and-test.yml b/.github/workflows/pipeline-electron-build-and-test.yml
new file mode 100644
index 0000000000000..6a1a8ecd158ba
--- /dev/null
+++ b/.github/workflows/pipeline-electron-build-and-test.yml
@@ -0,0 +1,90 @@
+name: Electron Build & Test Pipeline
+
+on:
+ workflow_call:
+ inputs:
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux'
+ required: true
+ target-arch:
+ type: string
+ description: 'Arch to build for, can be x64, arm64 or arm'
+ required: true
+ build-runs-on:
+ type: string
+ description: 'What host to run the build'
+ required: true
+ test-runs-on:
+ type: string
+ description: 'What host to run the tests on'
+ required: true
+ build-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ test-container:
+ type: string
+ description: 'JSON container information for testing'
+ required: false
+ default: '{"image":null}'
+ is-release:
+ description: 'Whether this build job is a release job'
+ required: true
+ type: boolean
+ default: false
+ gn-build-type:
+ description: 'The gn build type - testing or release'
+ required: true
+ type: string
+ default: testing
+ generate-symbols:
+ description: 'Whether or not to generate symbols'
+ required: true
+ type: boolean
+ default: false
+ upload-to-storage:
+ description: 'Whether or not to upload build artifacts to external storage'
+ required: true
+ type: string
+ default: '0'
+ is-asan:
+ description: 'Building the Address Sanitizer (ASan) Linux build'
+ required: false
+ type: boolean
+ default: false
+
+concurrency:
+ group: electron-build-and-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+
+jobs:
+ build:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ with:
+ build-runs-on: ${{ inputs.build-runs-on }}
+ build-container: ${{ inputs.build-container }}
+ target-platform: ${{ inputs.target-platform }}
+ target-arch: ${{ inputs.target-arch }}
+ is-release: ${{ inputs.is-release }}
+ gn-build-type: ${{ inputs.gn-build-type }}
+ generate-symbols: ${{ inputs.generate-symbols }}
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ is-asan: ${{ inputs.is-asan}}
+ secrets: inherit
+ test:
+ uses: ./.github/workflows/pipeline-segment-electron-test.yml
+ needs: build
+ with:
+ target-arch: ${{ inputs.target-arch }}
+ target-platform: ${{ inputs.target-platform }}
+ test-runs-on: ${{ inputs.test-runs-on }}
+ test-container: ${{ inputs.test-container }}
+ is-asan: ${{ inputs.is-asan}}
+ secrets: inherit
diff --git a/.github/workflows/pipeline-electron-docs-only.yml b/.github/workflows/pipeline-electron-docs-only.yml
new file mode 100644
index 0000000000000..eb5441d148222
--- /dev/null
+++ b/.github/workflows/pipeline-electron-docs-only.yml
@@ -0,0 +1,42 @@
+name: Electron Docs Compile
+
+on:
+ workflow_call:
+ inputs:
+ container:
+ required: true
+ description: 'Container to run the docs-only ts compile in'
+ type: string
+
+concurrency:
+ group: electron-docs-only-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ docs-only:
+ name: Docs Only Compile
+ runs-on: electron-arc-linux-amd64-4core
+ timeout-minutes: 20
+ container: ${{ fromJSON(inputs.container) }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Run TS/JS compile
+ shell: bash
+ run: |
+ cd src/electron
+ node script/yarn create-typescript-definitions
+ node script/yarn tsc -p tsconfig.default_app.json --noEmit
+ for f in build/webpack/*.js
+ do
+ out="${f:29}"
+ if [ "$out" != "base.js" ]; then
+ node script/yarn webpack --config $f --output-filename=$out --output-path=./.tmp --env mode=development
+ fi
+ done
diff --git a/.github/workflows/pipeline-electron-lint.yml b/.github/workflows/pipeline-electron-lint.yml
new file mode 100644
index 0000000000000..6cdbff0259952
--- /dev/null
+++ b/.github/workflows/pipeline-electron-lint.yml
@@ -0,0 +1,84 @@
+name: Electron Lint
+
+on:
+ workflow_call:
+ inputs:
+ container:
+ required: true
+ description: 'Container to run lint in'
+ type: string
+
+concurrency:
+ group: electron-lint-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+
+jobs:
+ lint:
+ name: Lint
+ runs-on: electron-arc-linux-amd64-4core
+ timeout-minutes: 20
+ container: ${{ fromJSON(inputs.container) }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Setup third_party Depot Tools
+ shell: bash
+ run: |
+ # "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
+ git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
+ echo "$(pwd)/src/third_party/depot_tools" >> $GITHUB_PATH
+ - name: Download GN Binary
+ shell: bash
+ run: |
+ chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
+ gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
+
+ cipd ensure -ensure-file - -root . <<-CIPD
+ \$ServiceURL https://chrome-infra-packages.appspot.com/
+ @Subdir src/buildtools/linux64
+ gn/gn/linux-amd64 $gn_version
+ CIPD
+
+ buildtools_path="$(pwd)/src/buildtools"
+ echo "CHROMIUM_BUILDTOOLS_PATH=$buildtools_path" >> $GITHUB_ENV
+ - name: Download clang-format Binary
+ shell: bash
+ run: |
+ chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
+
+ mkdir -p src/buildtools
+ curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/buildtools/DEPS?format=TEXT" | base64 -d > src/buildtools/DEPS
+
+ gclient sync --spec="solutions=[{'name':'src/buildtools','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':True},'managed':False}]"
+ - name: Add ESLint problem matcher
+ shell: bash
+ run: echo "::add-matcher::src/electron/.github/problem-matchers/eslint-stylish.json"
+ - name: Run Lint
+ shell: bash
+ run: |
+ # gn.py tries to find a gclient root folder starting from the current dir.
+ # When it fails and returns "None" path, the whole script fails. Let's "fix" it.
+ touch .gclient
+ # Another option would be to checkout "buildtools" inside the Electron checkout,
+ # but then we would lint its contents (at least gn format), and it doesn't pass it.
+
+ cd src/electron
+ node script/yarn install --frozen-lockfile
+ node script/yarn lint
+ - name: Run Script Typechecker
+ shell: bash
+ run: |
+ cd src/electron
+ node script/yarn tsc -p tsconfig.script.json
+
diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml
new file mode 100644
index 0000000000000..ac7d2e78c939f
--- /dev/null
+++ b/.github/workflows/pipeline-segment-electron-build.yml
@@ -0,0 +1,207 @@
+name: Pipeline Segment - Electron Build
+
+on:
+ workflow_call:
+ inputs:
+ environment:
+ description: using the production or testing environment
+ required: false
+ type: string
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux'
+ required: true
+ target-arch:
+ type: string
+ description: 'Arch to build for, can be x64, arm64, ia32 or arm'
+ required: true
+ target-variant:
+ type: string
+ description: 'Variant to build for, no effect on non-macOS target platforms. Can be darwin, mas or all.'
+ default: all
+ build-runs-on:
+ type: string
+ description: 'What host to run the build'
+ required: true
+ build-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ is-release:
+ description: 'Whether this build job is a release job'
+ required: true
+ type: boolean
+ default: false
+ gn-build-type:
+ description: 'The gn build type - testing or release'
+ required: true
+ type: string
+ default: testing
+ generate-symbols:
+ description: 'Whether or not to generate symbols'
+ required: true
+ type: boolean
+ default: false
+ upload-to-storage:
+ description: 'Whether or not to upload build artifacts to external storage'
+ required: true
+ type: string
+ default: '0'
+ strip-binaries:
+ description: 'Strip the binaries before release (Linux only)'
+ required: false
+ type: boolean
+ default: false
+ is-asan:
+ description: 'Building the Address Sanitizer (ASan) Linux build'
+ required: false
+ type: boolean
+ default: false
+
+
+concurrency:
+ group: electron-build-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.target-variant }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
+ ELECTRON_ARTIFACTS_BLOB_STORAGE: ${{ secrets.ELECTRON_ARTIFACTS_BLOB_STORAGE }}
+ ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
+ SUDOWOODO_EXCHANGE_URL: ${{ secrets.SUDOWOODO_EXCHANGE_URL }}
+ SUDOWOODO_EXCHANGE_TOKEN: ${{ secrets.SUDOWOODO_EXCHANGE_TOKEN }}
+ GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || inputs.target-platform == 'win' && '--custom-var=checkout_win=True' || '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' }}
+ ELECTRON_OUT_DIR: Default
+
+jobs:
+ build:
+ defaults:
+ run:
+ shell: bash
+ runs-on: ${{ inputs.build-runs-on }}
+ container: ${{ fromJSON(inputs.build-container) }}
+ environment: ${{ inputs.environment }}
+ env:
+ TARGET_ARCH: ${{ inputs.target-arch }}
+ steps:
+ - name: Create src dir
+ run: |
+ mkdir src
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Free up space (macOS)
+ if: ${{ inputs.target-platform == 'macos' }}
+ uses: ./src/electron/.github/actions/free-space-macos
+ - name: Check disk space after freeing up space
+ if: ${{ inputs.target-platform == 'macos' }}
+ run: df -h
+ - name: Setup Node.js/npm
+ if: ${{ inputs.target-platform == 'macos' }}
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
+ with:
+ node-version: 20.19.x
+ cache: yarn
+ cache-dependency-path: src/electron/yarn.lock
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Install AZCopy
+ if: ${{ inputs.target-platform == 'macos' }}
+ run: brew install azcopy
+ - name: Set GN_EXTRA_ARGS for Linux
+ if: ${{ inputs.target-platform == 'linux' }}
+ run: |
+ if [ "${{ inputs.target-arch }}" = "arm" ]; then
+ if [ "${{ inputs.is-release }}" = true ]; then
+ GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false symbol_level=1'
+ else
+ GN_EXTRA_ARGS='target_cpu="arm" build_tflite_with_xnnpack=false'
+ fi
+ elif [ "${{ inputs.target-arch }}" = "arm64" ]; then
+ GN_EXTRA_ARGS='target_cpu="arm64" fatal_linker_warnings=false enable_linux_installer=false'
+ elif [ "${{ inputs.is-asan }}" = true ]; then
+ GN_EXTRA_ARGS='is_asan=true'
+ fi
+ echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Generate DEPS Hash
+ run: |
+ node src/electron/script/generate-deps-hash.js
+ DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
+ echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
+ echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
+ - name: Restore src cache via AZCopy
+ if: ${{ inputs.target-platform != 'linux' }}
+ uses: ./src/electron/.github/actions/restore-cache-azcopy
+ with:
+ target-platform: ${{ inputs.target-platform }}
+ - name: Restore src cache via AKS
+ if: ${{ inputs.target-platform == 'linux' }}
+ uses: ./src/electron/.github/actions/restore-cache-aks
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Fix Sync
+ if: ${{ inputs.target-platform != 'linux' }}
+ uses: ./src/electron/.github/actions/fix-sync
+ with:
+ target-platform: ${{ inputs.target-platform }}
+ env:
+ ELECTRON_DEPOT_TOOLS_DISABLE_LOG: true
+ - name: Init Build Tools
+ run: |
+ e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
+ - name: Run Electron Only Hooks
+ run: |
+ e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
+ - name: Regenerate DEPS Hash
+ run: |
+ (cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
+ echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
+ - name: Add CHROMIUM_BUILDTOOLS_PATH to env
+ run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
+ - name: Setup Number of Ninja Processes
+ run: |
+ echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform != 'macos' && '300' || '200' }}" >> $GITHUB_ENV
+ - name: Free up space (macOS)
+ if: ${{ inputs.target-platform == 'macos' }}
+ uses: ./src/electron/.github/actions/free-space-macos
+ - name: Build Electron
+ if: ${{ inputs.target-platform != 'macos' || (inputs.target-variant == 'all' || inputs.target-variant == 'darwin') }}
+ uses: ./src/electron/.github/actions/build-electron
+ with:
+ target-arch: ${{ inputs.target-arch }}
+ target-platform: ${{ inputs.target-platform }}
+ artifact-platform: ${{ inputs.target-platform == 'macos' && 'darwin' || inputs.target-platform }}
+ is-release: '${{ inputs.is-release }}'
+ generate-symbols: '${{ inputs.generate-symbols }}'
+ strip-binaries: '${{ inputs.strip-binaries }}'
+ upload-to-storage: '${{ inputs.upload-to-storage }}'
+ is-asan: '${{ inputs.is-asan }}'
+ - name: Set GN_EXTRA_ARGS for MAS Build
+ if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
+ run: |
+ echo "MAS_BUILD=true" >> $GITHUB_ENV
+ GN_EXTRA_ARGS='is_mas_build=true'
+ echo "GN_EXTRA_ARGS=$GN_EXTRA_ARGS" >> $GITHUB_ENV
+ - name: Build Electron (MAS)
+ if: ${{ inputs.target-platform == 'macos' && (inputs.target-variant == 'all' || inputs.target-variant == 'mas') }}
+ uses: ./src/electron/.github/actions/build-electron
+ with:
+ target-arch: ${{ inputs.target-arch }}
+ target-platform: ${{ inputs.target-platform }}
+ artifact-platform: 'mas'
+ is-release: '${{ inputs.is-release }}'
+ generate-symbols: '${{ inputs.generate-symbols }}'
+ upload-to-storage: '${{ inputs.upload-to-storage }}'
+ step-suffix: '(mas)'
diff --git a/.github/workflows/pipeline-segment-electron-gn-check.yml b/.github/workflows/pipeline-segment-electron-gn-check.yml
new file mode 100644
index 0000000000000..48fe703078145
--- /dev/null
+++ b/.github/workflows/pipeline-segment-electron-gn-check.yml
@@ -0,0 +1,162 @@
+name: Pipeline Segment - Electron GN Check
+
+on:
+ workflow_call:
+ inputs:
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux'
+ required: true
+ target-archs:
+ type: string
+ description: 'Archs to check for, can be x64, x86, arm64 or arm space separated'
+ required: true
+ check-runs-on:
+ type: string
+ description: 'What host to run the tests on'
+ required: true
+ check-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ gn-build-type:
+ description: 'The gn build type - testing or release'
+ required: true
+ type: string
+ default: testing
+
+concurrency:
+ group: electron-gn-check-${{ inputs.target-platform }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
+ GCLIENT_EXTRA_ARGS: ${{ inputs.target-platform == 'macos' && '--custom-var=checkout_mac=True --custom-var=host_os=mac' || (inputs.target-platform == 'linux' && '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True' || '--custom-var=checkout_win=True') }}
+ ELECTRON_OUT_DIR: Default
+
+jobs:
+ gn-check:
+ defaults:
+ run:
+ shell: bash
+ runs-on: ${{ inputs.check-runs-on }}
+ container: ${{ fromJSON(inputs.check-container) }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Cleanup disk space on macOS
+ if: ${{ inputs.target-platform == 'macos' }}
+ shell: bash
+ run: |
+ sudo mkdir -p $TMPDIR/del-target
+
+ tmpify() {
+ if [ -d "$1" ]; then
+ sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
+ fi
+ }
+ tmpify /Library/Developer/CoreSimulator
+ tmpify ~/Library/Developer/CoreSimulator
+ sudo rm -rf $TMPDIR/del-target
+ - name: Check disk space after freeing up space
+ if: ${{ inputs.target-platform == 'macos' }}
+ run: df -h
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Enable windows toolchain
+ if: ${{ inputs.target-platform == 'win' }}
+ run: |
+ echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
+ - name: Generate DEPS Hash
+ run: |
+ node src/electron/script/generate-deps-hash.js
+ DEPSHASH=v1-src-cache-$(cat src/electron/.depshash)
+ echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
+ echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
+ - name: Restore src cache via AZCopy
+ if: ${{ inputs.target-platform == 'macos' }}
+ uses: ./src/electron/.github/actions/restore-cache-azcopy
+ with:
+ target-platform: ${{ inputs.target-platform }}
+ - name: Restore src cache via AKS
+ if: ${{ inputs.target-platform == 'linux' || inputs.target-platform == 'win' }}
+ uses: ./src/electron/.github/actions/restore-cache-aks
+ with:
+ target-platform: ${{ inputs.target-platform }}
+ - name: Run Electron Only Hooks
+ run: |
+ echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]" > tmpgclient
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ echo "solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False,'install_sysroot':False,'checkout_win':True},'managed':False}]" > tmpgclient
+ echo "target_os=['win']" >> tmpgclient
+ fi
+ e d gclient runhooks --gclientfile=tmpgclient
+
+ # Fix VS Toolchain
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ rm -rf src/third_party/depot_tools/win_toolchain/vs_files
+ e d python3 src/build/vs_toolchain.py update --force
+ fi
+ - name: Regenerate DEPS Hash
+ run: |
+ (cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
+ echo "DEPSHASH=$(cat src/electron/.depshash)" >> $GITHUB_ENV
+ - name: Add CHROMIUM_BUILDTOOLS_PATH to env
+ run: echo "CHROMIUM_BUILDTOOLS_PATH=$(pwd)/src/buildtools" >> $GITHUB_ENV
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Default GN gen
+ run: |
+ cd src/electron
+ git pack-refs
+ - name: Run GN Check for ${{ inputs.target-archs }}
+ run: |
+ for target_cpu in ${{ inputs.target-archs }}
+ do
+ e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu $target_cpu
+ cd src
+ export GN_EXTRA_ARGS="target_cpu=\"$target_cpu\""
+ if [ "${{ inputs.target-platform }}" = "linux" ]; then
+ if [ "$target_cpu" = "arm" ]; then
+ export GN_EXTRA_ARGS="$GN_EXTRA_ARGS build_tflite_with_xnnpack=false"
+ elif [ "$target_cpu" = "arm64" ]; then
+ export GN_EXTRA_ARGS="$GN_EXTRA_ARGS fatal_linker_warnings=false enable_linux_installer=false"
+ fi
+ fi
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ export GN_EXTRA_ARGS="$GN_EXTRA_ARGS use_v8_context_snapshot=true target_os=\"win\""
+ fi
+
+ e build --only-gen
+
+ e d gn check out/Default //electron:electron_lib
+ e d gn check out/Default //electron:electron_app
+ e d gn check out/Default //electron/shell/common:mojo
+ e d gn check out/Default //electron/shell/common:plugin
+
+ # Check the hunspell filenames
+ node electron/script/gen-hunspell-filenames.js --check
+ node electron/script/gen-libc++-filenames.js --check
+ cd ..
+ done
+ - name: Wait for active SSH sessions
+ if: always() && !cancelled()
+ shell: bash
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
diff --git a/.github/workflows/pipeline-segment-electron-test.yml b/.github/workflows/pipeline-segment-electron-test.yml
new file mode 100644
index 0000000000000..17cf3f2398b98
--- /dev/null
+++ b/.github/workflows/pipeline-segment-electron-test.yml
@@ -0,0 +1,264 @@
+name: Pipeline Segment - Electron Test
+
+on:
+ workflow_call:
+ inputs:
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux'
+ required: true
+ target-arch:
+ type: string
+ description: 'Arch to build for, can be x64, arm64 or arm'
+ required: true
+ test-runs-on:
+ type: string
+ description: 'What host to run the tests on'
+ required: true
+ test-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ is-asan:
+ description: 'Building the Address Sanitizer (ASan) Linux build'
+ required: false
+ type: boolean
+ default: false
+
+concurrency:
+ group: electron-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ inputs.is-asan }}-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+
+env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
+ ELECTRON_OUT_DIR: Default
+ ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
+
+jobs:
+ test:
+ defaults:
+ run:
+ shell: bash
+ runs-on: ${{ inputs.test-runs-on }}
+ container: ${{ fromJSON(inputs.test-container) }}
+ strategy:
+ fail-fast: false
+ matrix:
+ build-type: ${{ inputs.target-platform == 'macos' && fromJSON('["darwin","mas"]') || (inputs.target-platform == 'win' && fromJSON('["win"]') || fromJSON('["linux"]')) }}
+ shard: ${{ inputs.target-platform == 'linux' && fromJSON('[1, 2, 3]') || fromJSON('[1, 2]') }}
+ env:
+ BUILD_TYPE: ${{ matrix.build-type }}
+ TARGET_ARCH: ${{ inputs.target-arch }}
+ ARTIFACT_KEY: ${{ matrix.build-type }}_${{ inputs.target-arch }}
+ steps:
+ - name: Fix node20 on arm32 runners
+ if: ${{ inputs.target-arch == 'arm' && inputs.target-platform == 'linux' }}
+ run: |
+ cp $(which node) /mnt/runner-externals/node20/bin/
+ - name: Install Git on Windows arm64 runners
+ if: ${{ inputs.target-arch == 'arm64' && inputs.target-platform == 'win' }}
+ shell: powershell
+ run: |
+ Set-ExecutionPolicy Bypass -Scope Process -Force
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
+ choco install -y --no-progress git.install --params "'/GitAndUnixToolsOnPath'"
+ choco install -y --no-progress git
+ choco install -y --no-progress python --version 3.11.9
+ choco install -y --no-progress visualstudio2022-workload-vctools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64"
+ echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
+ - name: Setup Node.js/npm
+ if: ${{ inputs.target-platform == 'win' }}
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
+ with:
+ node-version: 20.19.x
+ - name: Add TCC permissions on macOS
+ if: ${{ inputs.target-platform == 'macos' }}
+ run: |
+ configure_user_tccdb () {
+ local values=$1
+ local dbPath="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
+ local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
+ sqlite3 "$dbPath" "$sqlQuery"
+ }
+
+ configure_sys_tccdb () {
+ local values=$1
+ local dbPath="/Library/Application Support/com.apple.TCC/TCC.db"
+ local sqlQuery="INSERT OR REPLACE INTO access VALUES($values);"
+ sudo sqlite3 "$dbPath" "$sqlQuery"
+ }
+
+ userValuesArray=(
+ "'kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+ "'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+ "'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+ )
+ for values in "${userValuesArray[@]}"; do
+ # Sonoma and higher have a few extra values
+ # Ref: https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/configure-tccdb-macos.sh
+ if [ "$OSTYPE" = "darwin23" ]; then
+ configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
+ configure_sys_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
+ else
+ configure_user_tccdb "$values"
+ configure_sys_tccdb "$values"
+ fi
+ done
+ - name: Turn off the unexpectedly quit dialog on macOS
+ if: ${{ inputs.target-platform == 'macos' }}
+ run: defaults write com.apple.CrashReporter DialogType server
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Get Depot Tools
+ timeout-minutes: 5
+ run: |
+ git config --global core.filemode false
+ git config --global core.autocrlf false
+ git config --global branch.autosetuprebase always
+ git config --global core.fscache true
+ git config --global core.preloadindex true
+ git clone --filter=tree:0 https://chromium.googlesource.com/chromium/tools/depot_tools.git
+ # Ensure depot_tools does not update.
+ test -d depot_tools && cd depot_tools
+ touch .disable_auto_update
+ - name: Add Depot Tools to PATH
+ run: echo "$(pwd)/depot_tools" >> $GITHUB_PATH
+ - name: Load ASan specific environment variables
+ if: ${{ inputs.is-asan == true }}
+ run: |
+ echo "ARTIFACT_KEY=${{ matrix.build-type }}_${{ inputs.target-arch }}_asan" >> $GITHUB_ENV
+ echo "DISABLE_CRASH_REPORTER_TESTS=true" >> $GITHUB_ENV
+ echo "IS_ASAN=true" >> $GITHUB_ENV
+ - name: Download Generated Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: generated_artifacts_${{ env.ARTIFACT_KEY }}
+ path: ./generated_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
+ - name: Download Src Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: src_artifacts_${{ env.ARTIFACT_KEY }}
+ path: ./src_artifacts_${{ matrix.build-type }}_${{ inputs.target-arch }}
+ - name: Restore Generated Artifacts
+ run: ./src/electron/script/actions/restore-artifacts.sh
+ - name: Unzip Dist, Mksnapshot & Chromedriver (win)
+ if: ${{ inputs.target-platform == 'win' }}
+ shell: powershell
+ run: |
+ Set-ExecutionPolicy Bypass -Scope Process -Force
+ cd src/out/Default
+ Expand-Archive -Force dist.zip -DestinationPath ./
+ Expand-Archive -Force chromedriver.zip -DestinationPath ./
+ Expand-Archive -Force mksnapshot.zip -DestinationPath ./
+ - name: Unzip Dist, Mksnapshot & Chromedriver (unix)
+ if: ${{ inputs.target-platform != 'win' }}
+ run: |
+ cd src/out/Default
+ unzip -:o dist.zip
+ unzip -:o chromedriver.zip
+ unzip -:o mksnapshot.zip
+ - name: Import & Trust Self-Signed Codesigning Cert on MacOS
+ if: ${{ inputs.target-platform == 'macos' && inputs.target-arch == 'x64' }}
+ run: |
+ sudo security authorizationdb write com.apple.trust-settings.admin allow
+ cd src/electron
+ ./script/codesign/generate-identity.sh
+ - name: Install Datadog CLI
+ run: |
+ cd src/electron
+ node script/yarn global add @datadog/datadog-ci
+ - name: Run Electron Tests
+ shell: bash
+ env:
+ MOCHA_REPORTER: mocha-multi-reporters
+ MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
+ ELECTRON_DISABLE_SECURITY_WARNINGS: 1
+ ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
+ DISPLAY: ':99.0'
+ NPM_CONFIG_MSVS_VERSION: '2022'
+ run: |
+ cd src/electron
+ export ELECTRON_TEST_RESULTS_DIR=`pwd`/junit
+ # Get which tests are on this shard
+ tests_files=$(node script/split-tests ${{ matrix.shard }} ${{ inputs.target-platform == 'linux' && 3 || 2 }})
+
+ # Run tests
+ if [ "${{ inputs.target-platform }}" != "linux" ]; then
+ echo "About to start tests"
+ if [ "${{ inputs.target-platform }}" = "win" ]; then
+ if [ "${{ inputs.target-arch }}" = "x86" ]; then
+ export npm_config_arch="ia32"
+ fi
+ if [ "${{ inputs.target-arch }}" = "arm64" ]; then
+ export ELECTRON_FORCE_TEST_SUITE_EXIT="true"
+ fi
+ fi
+ node script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
+ else
+ chown :builduser .. && chmod g+w ..
+ chown -R :builduser . && chmod -R g+w .
+ chmod 4755 ../out/Default/chrome-sandbox
+ runuser -u builduser -- git config --global --add safe.directory $(pwd)
+ if [ "${{ inputs.is-asan }}" == "true" ]; then
+ cd ..
+ ASAN_SYMBOLIZE="$PWD/tools/valgrind/asan/asan_symbolize.py --executable-path=$PWD/out/Default/electron"
+ export ASAN_OPTIONS="symbolize=0 handle_abort=1"
+ export G_SLICE=always-malloc
+ export NSS_DISABLE_ARENA_FREE_LIST=1
+ export NSS_DISABLE_UNLOAD=1
+ export LLVM_SYMBOLIZER_PATH=$PWD/third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer
+ export MOCHA_TIMEOUT=180000
+ echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
+ cd electron
+ runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files | $ASAN_SYMBOLIZE
+ else
+ runuser -u builduser -- xvfb-run script/actions/run-tests.sh script/yarn test --runners=main --trace-uncaught --enable-logging --files $tests_files
+ fi
+ fi
+ - name: Upload Test results to Datadog
+ env:
+ DD_ENV: ci
+ DD_SERVICE: electron
+ DD_API_KEY: ${{ secrets.DD_API_KEY }}
+ DD_CIVISIBILITY_LOGS_ENABLED: true
+ DD_TAGS: "os.architecture:${{ inputs.target-arch }},os.family:${{ inputs.target-platform }},os.platform:${{ inputs.target-platform }},asan:${{ inputs.is-asan }}"
+ run: |
+ if ! [ -z $DD_API_KEY ] && [ -f src/electron/junit/test-results-main.xml ]; then
+ export DATADOG_PATH=`node src/electron/script/yarn global bin`
+ $DATADOG_PATH/datadog-ci junit upload src/electron/junit/test-results-main.xml
+ fi
+ if: always() && !cancelled()
+ - name: Upload Test Artifacts
+ if: always() && !cancelled()
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
+ with:
+ name: test_artifacts_${{ env.ARTIFACT_KEY }}_${{ matrix.shard }}
+ path: src/electron/spec/artifacts
+ if-no-files-found: ignore
+ - name: Wait for active SSH sessions
+ if: always() && !cancelled()
+ shell: bash
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
diff --git a/.github/workflows/pipeline-segment-node-nan-test.yml b/.github/workflows/pipeline-segment-node-nan-test.yml
new file mode 100644
index 0000000000000..7b5e71c3cd347
--- /dev/null
+++ b/.github/workflows/pipeline-segment-node-nan-test.yml
@@ -0,0 +1,146 @@
+name: Pipeline Segment - Node/Nan Test
+
+on:
+ workflow_call:
+ inputs:
+ target-platform:
+ type: string
+ description: 'Platform to run on, can be macos, win or linux'
+ required: true
+ target-arch:
+ type: string
+ description: 'Arch to build for, can be x64, arm64 or arm'
+ required: true
+ test-runs-on:
+ type: string
+ description: 'What host to run the tests on'
+ required: true
+ test-container:
+ type: string
+ description: 'JSON container information for aks runs-on'
+ required: false
+ default: '{"image":null}'
+ gn-build-type:
+ description: 'The gn build type - testing or release'
+ required: true
+ type: string
+ default: testing
+
+concurrency:
+ group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
+ cancel-in-progress: ${{ github.ref_protected != true }}
+
+env:
+ CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
+ ELECTRON_OUT_DIR: Default
+ ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
+
+jobs:
+ node-tests:
+ name: Run Node.js Tests
+ runs-on: electron-arc-linux-amd64-8core
+ timeout-minutes: 30
+ env:
+ TARGET_ARCH: ${{ inputs.target-arch }}
+ BUILD_TYPE: linux
+ container: ${{ fromJSON(inputs.test-container) }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Init Build Tools
+ run: |
+ e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Download Generated Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
+ path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
+ - name: Download Src Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: src_artifacts_linux_${{ env.TARGET_ARCH }}
+ path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
+ - name: Restore Generated Artifacts
+ run: ./src/electron/script/actions/restore-artifacts.sh
+ - name: Unzip Dist
+ run: |
+ cd src/out/Default
+ unzip -:o dist.zip
+ - name: Setup Linux for Headless Testing
+ run: sh -e /etc/init.d/xvfb start
+ - name: Run Node.js Tests
+ run: |
+ cd src
+ node electron/script/node-spec-runner.js --default --jUnitDir=junit
+ - name: Wait for active SSH sessions
+ if: always() && !cancelled()
+ shell: bash
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
+ nan-tests:
+ name: Run Nan Tests
+ runs-on: electron-arc-linux-amd64-4core
+ timeout-minutes: 30
+ env:
+ TARGET_ARCH: ${{ inputs.target-arch }}
+ BUILD_TYPE: linux
+ container: ${{ fromJSON(inputs.test-container) }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Set Chromium Git Cookie
+ uses: ./src/electron/.github/actions/set-chromium-cookie
+ - name: Install Build Tools
+ uses: ./src/electron/.github/actions/install-build-tools
+ - name: Init Build Tools
+ run: |
+ e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
+ - name: Install Dependencies
+ uses: ./src/electron/.github/actions/install-dependencies
+ - name: Download Generated Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
+ path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
+ - name: Download Src Artifacts
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
+ with:
+ name: src_artifacts_linux_${{ env.TARGET_ARCH }}
+ path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
+ - name: Restore Generated Artifacts
+ run: ./src/electron/script/actions/restore-artifacts.sh
+ - name: Unzip Dist
+ run: |
+ cd src/out/Default
+ unzip -:o dist.zip
+ - name: Setup Linux for Headless Testing
+ run: sh -e /etc/init.d/xvfb start
+ - name: Run Nan Tests
+ run: |
+ cd src
+ node electron/script/nan-spec-runner.js
+ - name: Wait for active SSH sessions
+ shell: bash
+ if: always() && !cancelled()
+ run: |
+ while [ -f /var/.ssh-lock ]
+ do
+ sleep 60
+ done
diff --git a/.github/workflows/pull-request-labeled.yml b/.github/workflows/pull-request-labeled.yml
new file mode 100644
index 0000000000000..18b950c25b2a9
--- /dev/null
+++ b/.github/workflows/pull-request-labeled.yml
@@ -0,0 +1,41 @@
+name: Pull Request Labeled
+
+on:
+ pull_request_target:
+ types: [labeled]
+
+permissions: {}
+
+jobs:
+ pull-request-labeled-backport-requested:
+ name: backport/requested label added
+ if: github.event.label.name == 'backport/requested 🗳'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Trigger Slack workflow
+ uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
+ with:
+ webhook: ${{ secrets.BACKPORT_REQUESTED_SLACK_WEBHOOK_URL }}
+ webhook-type: webhook-trigger
+ payload: |
+ {
+ "url": "${{ github.event.pull_request.html_url }}"
+ }
+ pull-request-labeled-deprecation-review-complete:
+ name: deprecation-review/complete label added
+ if: github.event.label.name == 'deprecation-review/complete ✅'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
+ org: electron
+ - name: Set status
+ uses: dsanders11/project-actions/edit-item@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ token: ${{ steps.generate-token.outputs.token }}
+ project-number: 94
+ field: Status
+ field-value: ✅ Reviewed
diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml
new file mode 100644
index 0000000000000..ba07afcaa1edf
--- /dev/null
+++ b/.github/workflows/scorecards.yml
@@ -0,0 +1,55 @@
+name: Scorecards supply-chain security
+on:
+ # Only the default branch is supported.
+ branch_protection_rule:
+ schedule:
+ - cron: '44 17 * * 0'
+ push:
+ branches: [ "main" ]
+
+# Declare default permissions as read only.
+permissions: read-all
+
+jobs:
+ analysis:
+ name: Scorecards analysis
+ runs-on: ubuntu-latest
+ permissions:
+ # Needed to upload the results to code-scanning dashboard.
+ security-events: write
+ # Used to receive a badge.
+ id-token: write
+
+ steps:
+ - name: "Checkout code"
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ # This is a pre-submit / pre-release.
+ - name: "Run analysis"
+ uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
+ with:
+ results_file: results.sarif
+ results_format: sarif
+
+ # Publish the results for public repositories to enable scorecard badges. For more details, see
+ # https://github.com/ossf/scorecard-action#publishing-results.
+ # For private repositories, `publish_results` will automatically be set to `false`, regardless
+ # of the value entered here.
+ publish_results: true
+
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
+ # format to the repository Actions tab.
+ - name: "Upload artifact"
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: SARIF file
+ path: results.sarif
+ retention-days: 5
+
+ # Upload the results to GitHub's code scanning dashboard.
+ - name: "Upload to code-scanning"
+ uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
+ with:
+ sarif_file: results.sarif
diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml
new file mode 100644
index 0000000000000..1b96a50153e41
--- /dev/null
+++ b/.github/workflows/semantic.yml
@@ -0,0 +1,26 @@
+name: "Check Semantic Commit"
+
+on:
+ pull_request:
+ types:
+ - opened
+ - edited
+ - synchronize
+
+permissions:
+ contents: read
+
+jobs:
+ main:
+ permissions:
+ pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
+ statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
+ name: Validate PR Title
+ runs-on: ubuntu-latest
+ steps:
+ - name: semantic-pull-request
+ uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ validateSingleCommit: false
diff --git a/.github/workflows/stable-prep-items.yml b/.github/workflows/stable-prep-items.yml
new file mode 100644
index 0000000000000..576ddbc16c8b9
--- /dev/null
+++ b/.github/workflows/stable-prep-items.yml
@@ -0,0 +1,35 @@
+name: Check Stable Prep Items
+
+on:
+ schedule:
+ - cron: '0 */12 * * *'
+ workflow_dispatch:
+
+permissions: {}
+
+jobs:
+ check-stable-prep-items:
+ name: Check Stable Prep Items
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
+ org: electron
+ - name: Find Newest Release Project Board
+ id: find-project-number
+ env:
+ GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
+ run: |
+ set -eo pipefail
+ PROJECT_NUMBER=$(gh project list --owner electron --format json | jq -r '.projects | map(select(.title | test("^[0-9]+-x-y$"))) | max_by(.number) | .number')
+ echo "PROJECT_NUMBER=$PROJECT_NUMBER" >> "$GITHUB_OUTPUT"
+ - name: Update Completed Stable Prep Items
+ uses: dsanders11/project-actions/completed-by@2134fe7cc71c58b7ae259c82a8e63c6058255678 # v1.7.0
+ with:
+ field: Prep Status
+ field-value: ✅ Complete
+ project-number: ${{ steps.find-project-number.outputs.PROJECT_NUMBER }}
+ token: ${{ steps.generate-token.outputs.token }}
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644
index 0000000000000..7fd2e20fa5e5c
--- /dev/null
+++ b/.github/workflows/stale.yml
@@ -0,0 +1,52 @@
+name: 'Close stale issues'
+on:
+ workflow_dispatch:
+ schedule:
+ # 1:30am every day
+ - cron: '30 1 * * *'
+
+permissions: {}
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # tag: v9.1.0
+ with:
+ repo-token: ${{ steps.generate-token.outputs.token }}
+ days-before-stale: 90
+ days-before-close: 30
+ stale-issue-label: stale
+ operations-per-run: 1750
+ stale-issue-message: >
+ This issue has been automatically marked as stale. **If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the [latest version of Electron](https://www.electronjs.org/releases/stable) or in the [beta](https://www.electronjs.org/releases/beta)—please include it with your comment!
+ close-issue-message: >
+ This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
+ exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:,status/confirmed,stale-exempt,upgrade-follow-up"
+ only-pr-labels: not-a-real-label
+ pending-repro:
+ runs-on: ubuntu-latest
+ if: ${{ always() }}
+ needs: stale
+ steps:
+ - name: Generate GitHub App token
+ uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
+ id: generate-token
+ with:
+ creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+ - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # tag: v9.1.0
+ with:
+ repo-token: ${{ steps.generate-token.outputs.token }}
+ days-before-stale: -1
+ days-before-close: 10
+ remove-stale-when-updated: false
+ stale-issue-label: blocked/need-repro
+ stale-pr-label: not-a-real-label
+ operations-per-run: 1750
+ close-issue-message: >
+ Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
diff --git a/.github/workflows/windows-publish.yml b/.github/workflows/windows-publish.yml
new file mode 100644
index 0000000000000..e8b7c6172fdd8
--- /dev/null
+++ b/.github/workflows/windows-publish.yml
@@ -0,0 +1,89 @@
+name: Publish Windows
+
+on:
+ workflow_dispatch:
+ inputs:
+ build-image-sha:
+ type: string
+ description: 'SHA for electron/build image'
+ default: '424eedbf277ad9749ffa9219068aa72ed4a5e373'
+ required: true
+ upload-to-storage:
+ description: 'Uploads to Azure storage'
+ required: false
+ default: '1'
+ type: string
+ run-windows-publish:
+ description: 'Run the publish jobs vs just the build jobs'
+ type: boolean
+ default: false
+
+jobs:
+ checkout-windows:
+ runs-on: electron-arc-linux-amd64-32core
+ container:
+ image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
+ options: --user root --device /dev/fuse --cap-add SYS_ADMIN
+ volumes:
+ - /mnt/win-cache:/mnt/win-cache
+ - /var/run/sas:/var/run/sas
+ env:
+ CHROMIUM_GIT_COOKIE_WINDOWS_STRING: ${{ secrets.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
+ GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
+ TARGET_OS: 'win'
+ ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN: '1'
+ outputs:
+ build-image-sha: ${{ inputs.build-image-sha }}
+ steps:
+ - name: Checkout Electron
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ path: src/electron
+ fetch-depth: 0
+ - name: Checkout & Sync & Save
+ uses: ./src/electron/.github/actions/checkout
+ with:
+ generate-sas-token: 'true'
+ target-platform: win
+
+ publish-x64-win:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-windows
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-windows-amd64-16core
+ target-platform: win
+ target-arch: x64
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-arm64-win:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-windows
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-windows-amd64-16core
+ target-platform: win
+ target-arch: arm64
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
+
+ publish-x86-win:
+ uses: ./.github/workflows/pipeline-segment-electron-build.yml
+ needs: checkout-windows
+ with:
+ environment: production-release
+ build-runs-on: electron-arc-windows-amd64-16core
+ target-platform: win
+ target-arch: x86
+ is-release: true
+ gn-build-type: release
+ generate-symbols: true
+ upload-to-storage: ${{ inputs.upload-to-storage }}
+ secrets: inherit
diff --git a/.gitignore b/.gitignore
index 218dd25f4dd03..88d3b8b0a9870 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,24 +17,6 @@
*.xcodeproj
/.idea/
/dist/
-/external_binaries/
-/out/
-/vendor/.gclient
-/vendor/debian_jessie_mips64-sysroot/
-/vendor/debian_stretch_amd64-sysroot/
-/vendor/debian_stretch_arm-sysroot/
-/vendor/debian_stretch_arm64-sysroot/
-/vendor/debian_stretch_i386-sysroot/
-/vendor/gcc-4.8.3-d197-n64-loongson/
-/vendor/readme-gcc483-loongson.txt
-/vendor/download/
-/vendor/llvm-build/
-/vendor/llvm/
-/vendor/npm/
-/vendor/python_26/
-/vendor/native_mksnapshot
-/vendor/LICENSES.chromium.html
-/vendor/pyyaml
node_modules/
SHASUMS256.txt
**/package-lock.json
@@ -44,6 +26,7 @@ compile_commands.json
# npm package
/npm/dist
/npm/path.txt
+/npm/checksums.json
.npmrc
@@ -55,7 +38,7 @@ electron.d.ts
spec/.hash
# Eslint Cache
-.eslintcache
+.eslintcache*
# Generated native addon files
/spec/fixtures/native-addon/echo/build/
@@ -65,3 +48,8 @@ ts-gen
# Used to accelerate CI builds
.depshash
+
+# Used to accelerate builds after sync
+patches/mtime-cache.json
+
+spec/fixtures/logo.png
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index f6b899f682ac8..0000000000000
--- a/.gitmodules
+++ /dev/null
@@ -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
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 0000000000000..2601a3bb0c46d
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npm run precommit
\ No newline at end of file
diff --git a/.husky/pre-push b/.husky/pre-push
new file mode 100755
index 0000000000000..91eb47b1b4e5b
--- /dev/null
+++ b/.husky/pre-push
@@ -0,0 +1 @@
+npm run prepack
diff --git a/.lint-roller.json b/.lint-roller.json
new file mode 100644
index 0000000000000..bdbbd9172cff0
--- /dev/null
+++ b/.lint-roller.json
@@ -0,0 +1,13 @@
+{
+ "markdown-ts-check": {
+ "defaultImports": [
+ "import * as childProcess from 'node:child_process'",
+ "import * as fs from 'node:fs'",
+ "import * as path from 'node:path'",
+ "import { app, autoUpdater, contextBridge, crashReporter, dialog, BrowserWindow, ipcMain, ipcRenderer, Menu, MessageChannelMain, nativeImage, net, protocol, session, systemPreferences, Tray, utilityProcess, webFrame, webFrameMain } from 'electron'"
+ ],
+ "typings": [
+ "../electron.d.ts"
+ ]
+ }
+}
diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc
new file mode 100644
index 0000000000000..11be56cea63f2
--- /dev/null
+++ b/.markdownlint-cli2.jsonc
@@ -0,0 +1,32 @@
+{
+ "config": {
+ "extends": "@electron/lint-roller/configs/markdownlint.json",
+ "descriptive-link-text": false,
+ "link-image-style": {
+ "autolink": false,
+ "shortcut": false
+ },
+ "MD049": {
+ "style": "underscore"
+ },
+ "no-angle-brackets": true,
+ "no-curly-braces": true,
+ "no-inline-html": {
+ "allowed_elements": [
+ "br",
+ "details",
+ "img",
+ "li",
+ "summary",
+ "ul",
+ "unknown",
+ "Tabs",
+ "TabItem"
+ ]
+ },
+ "no-newline-in-links": true
+ },
+ "customRules": [
+ "./node_modules/@electron/lint-roller/markdownlint-rules/index.mjs"
+ ]
+}
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000000000..209e3ef4b6247
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+20
diff --git a/BUILD.gn b/BUILD.gn
index dd6a69b96e42c..3f1c2115820e0 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1,8 +1,15 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
+import("//components/os_crypt/sync/features.gni")
+import("//components/spellcheck/spellcheck_build_features.gni")
+import("//content/public/app/mac_helpers.gni")
+import("//extensions/buildflags/buildflags.gni")
import("//pdf/features.gni")
+import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
+import("//testing/test.gni")
+import("//third_party/electron_node/node.gni")
import("//third_party/ffmpeg/ffmpeg_options.gni")
import("//tools/generate_library_loader/generate_library_loader.gni")
import("//tools/grit/grit_rule.gni")
@@ -10,22 +17,34 @@ import("//tools/grit/repack.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//v8/gni/snapshot_toolchain.gni")
import("build/asar.gni")
+import("build/electron_paks.gni")
+import("build/extract_symbols.gni")
+import("build/js2c_toolchain.gni")
import("build/npm.gni")
+import("build/templated_file.gni")
import("build/tsc.gni")
import("build/webpack/webpack.gni")
import("buildflags/buildflags.gni")
-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")
import("//third_party/icu/config.gni")
import("//v8/gni/v8.gni")
+ import("build/rules.gni")
+
+ assert(
+ mac_deployment_target == "12.0",
+ "Chromium has updated the mac_deployment_target, please update this assert and flag this as a breaking change (docs/breaking-changes.md)")
}
if (is_linux) {
import("//build/config/linux/pkg_config.gni")
+ import("//tools/generate_stubs/rules.gni")
pkg_config("gio_unix") {
packages = [ "gio-unix-2.0" ]
@@ -37,26 +56,99 @@ if (is_linux) {
"gdk-pixbuf-2.0",
]
}
+
+ generate_library_loader("libnotify_loader") {
+ name = "LibNotifyLoader"
+ output_h = "libnotify_loader.h"
+ output_cc = "libnotify_loader.cc"
+ header = ""
+ config = ":libnotify_config"
+
+ functions = [
+ "notify_is_initted",
+ "notify_init",
+ "notify_get_server_caps",
+ "notify_get_server_info",
+ "notify_notification_new",
+ "notify_notification_add_action",
+ "notify_notification_set_image_from_pixbuf",
+ "notify_notification_set_timeout",
+ "notify_notification_set_urgency",
+ "notify_notification_set_hint",
+ "notify_notification_show",
+ "notify_notification_close",
+ ]
+ }
+
+ # Generates headers which contain stubs for extracting function ptrs
+ # from the gtk library. Function signatures for which stubs are
+ # required should be declared in the sig files.
+ generate_stubs("electron_gtk_stubs") {
+ sigs = [
+ "shell/browser/ui/electron_gdk.sigs",
+ "shell/browser/ui/electron_gdk_pixbuf.sigs",
+ ]
+ extra_header = "shell/browser/ui/electron_gtk.fragment"
+ output_name = "electron_gtk_stubs"
+ public_deps = [ "//ui/gtk:gtk_config" ]
+ logging_function = "LogNoop()"
+ logging_include = "ui/gtk/log_noop.h"
+ }
}
-branding = read_file("atom/app/BRANDING.json", "json")
+branding = read_file("shell/app/BRANDING.json", "json")
electron_project_name = branding.project_name
electron_product_name = branding.product_name
electron_mac_bundle_id = branding.mac_bundle_id
+if (override_electron_version != "") {
+ electron_version = override_electron_version
+} else {
+ # When building from source code tarball there is no git tag available and
+ # builders must explicitly pass override_electron_version in gn args.
+ # This read_file call will assert if there is no git information, without it
+ # gn will generate a malformed build configuration and ninja will get into
+ # infinite loop.
+ read_file(".git/packed-refs", "string")
+
+ # Set electron version from git tag.
+ electron_version = exec_script("script/get-git-version.py",
+ [],
+ "trim string",
+ [
+ ".git/packed-refs",
+ ".git/HEAD",
+ ])
+}
+
if (is_mas_build) {
assert(is_mac,
"It doesn't make sense to build a MAS build on a non-mac platform")
}
+if (enable_pdf_viewer) {
+ assert(enable_pdf, "PDF viewer support requires enable_pdf=true")
+ assert(enable_electron_extensions,
+ "PDF viewer support requires enable_electron_extensions=true")
+}
+
+if (enable_electron_extensions) {
+ assert(enable_extensions,
+ "Chrome extension support requires enable_extensions=true")
+}
+
config("branding") {
defines = [
- "ATOM_PRODUCT_NAME=\"$electron_product_name\"",
- "ATOM_PROJECT_NAME=\"$electron_project_name\"",
+ "ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
+ "ELECTRON_PROJECT_NAME=\"$electron_project_name\"",
]
}
-# We geneate the definitions twice here, once in //electron/electron.d.ts
+config("electron_lib_config") {
+ include_dirs = [ "." ]
+}
+
+# We generate the definitions twice here, once in //electron/electron.d.ts
# and once in $target_gen_dir
# The one in $target_gen_dir is used for the actual TSC build later one
# and the one in //electron/electron.d.ts is used by your IDE (vscode)
@@ -66,15 +158,11 @@ npm_action("build_electron_definitions") {
args = [ rebase_path("$target_gen_dir/tsc/typings/electron.d.ts") ]
inputs = auto_filenames.api_docs + [ "yarn.lock" ]
- outputs = [
- "$target_gen_dir/tsc/typings/electron.d.ts",
- ]
+ outputs = [ "$target_gen_dir/tsc/typings/electron.d.ts" ]
}
webpack_build("electron_browser_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+ deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.browser_bundle_deps
@@ -83,9 +171,7 @@ webpack_build("electron_browser_bundle") {
}
webpack_build("electron_renderer_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+ deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.renderer_bundle_deps
@@ -94,9 +180,7 @@ webpack_build("electron_renderer_bundle") {
}
webpack_build("electron_worker_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+ deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.worker_bundle_deps
@@ -105,9 +189,7 @@ webpack_build("electron_worker_bundle") {
}
webpack_build("electron_sandboxed_renderer_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+ deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.sandbox_bundle_deps
@@ -116,9 +198,7 @@ webpack_build("electron_sandboxed_renderer_bundle") {
}
webpack_build("electron_isolated_renderer_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+ deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.isolated_bundle_deps
@@ -126,70 +206,81 @@ webpack_build("electron_isolated_renderer_bundle") {
out_file = "$target_gen_dir/js2c/isolated_bundle.js"
}
-webpack_build("electron_content_script_bundle") {
- deps = [
- ":build_electron_definitions",
- ]
+webpack_build("electron_node_bundle") {
+ deps = [ ":build_electron_definitions" ]
- inputs = auto_filenames.content_script_bundle_deps
+ inputs = auto_filenames.node_bundle_deps
- config_file = "//electron/build/webpack/webpack.config.content_script.js"
- out_file = "$target_gen_dir/js2c/content_script_bundle.js"
+ config_file = "//electron/build/webpack/webpack.config.node.js"
+ out_file = "$target_gen_dir/js2c/node_init.js"
}
-copy("atom_js2c_copy") {
- sources = [
- "lib/common/asar.js",
- "lib/common/asar_init.js",
- ]
- outputs = [
- "$target_gen_dir/js2c/{{source_file_part}}",
- ]
+webpack_build("electron_utility_bundle") {
+ deps = [ ":build_electron_definitions" ]
+
+ inputs = auto_filenames.utility_bundle_deps
+
+ config_file = "//electron/build/webpack/webpack.config.utility.js"
+ out_file = "$target_gen_dir/js2c/utility_init.js"
}
-action("atom_js2c") {
+webpack_build("electron_preload_realm_bundle") {
+ deps = [ ":build_electron_definitions" ]
+
+ inputs = auto_filenames.preload_realm_bundle_deps
+
+ config_file = "//electron/build/webpack/webpack.config.preload_realm.js"
+ out_file = "$target_gen_dir/js2c/preload_realm_bundle.js"
+}
+
+action("electron_js2c") {
deps = [
- ":atom_js2c_copy",
":electron_browser_bundle",
- ":electron_content_script_bundle",
":electron_isolated_renderer_bundle",
+ ":electron_node_bundle",
+ ":electron_preload_realm_bundle",
":electron_renderer_bundle",
":electron_sandboxed_renderer_bundle",
+ ":electron_utility_bundle",
":electron_worker_bundle",
+ "//third_party/electron_node:node_js2c($electron_js2c_toolchain)",
]
- webpack_sources = [
+ sources = [
"$target_gen_dir/js2c/browser_init.js",
- "$target_gen_dir/js2c/renderer_init.js",
- "$target_gen_dir/js2c/worker_init.js",
- "$target_gen_dir/js2c/content_script_bundle.js",
"$target_gen_dir/js2c/isolated_bundle.js",
+ "$target_gen_dir/js2c/node_init.js",
+ "$target_gen_dir/js2c/preload_realm_bundle.js",
+ "$target_gen_dir/js2c/renderer_init.js",
"$target_gen_dir/js2c/sandbox_bundle.js",
+ "$target_gen_dir/js2c/utility_init.js",
+ "$target_gen_dir/js2c/worker_init.js",
]
- sources = webpack_sources + [
- "$target_gen_dir/js2c/asar.js",
- "$target_gen_dir/js2c/asar_init.js",
- ]
-
inputs = sources
- outputs = [
- "$root_gen_dir/atom_natives.cc",
- ]
+ outputs = [ "$root_gen_dir/electron_natives.cc" ]
+
+ script = "build/js2c.py"
+ out_dir =
+ get_label_info(":anything($electron_js2c_toolchain)", "root_out_dir")
+ args = [
+ rebase_path("$out_dir/node_js2c"),
+ rebase_path("$root_gen_dir"),
+ ] + rebase_path(outputs, root_gen_dir) +
+ rebase_path(sources, root_gen_dir)
+}
- script = "tools/js2c.py"
- args = [ rebase_path("//third_party/electron_node") ] +
- rebase_path(outputs, root_build_dir) +
- rebase_path(sources, root_build_dir)
+action("generate_config_gypi") {
+ outputs = [ "$root_gen_dir/config.gypi" ]
+ script = "script/generate-config-gypi.py"
+ inputs = [ "//third_party/electron_node/configure.py" ]
+ args = rebase_path(outputs) + [ target_cpu ]
}
target_gen_default_app_js = "$target_gen_dir/js/default_app"
typescript_build("default_app_js") {
- deps = [
- ":build_electron_definitions",
- ]
- type_root = rebase_path("$target_gen_dir/tsc/electron/typings")
+ deps = [ ":build_electron_definitions" ]
sources = filenames.default_app_ts_sources
@@ -200,16 +291,12 @@ typescript_build("default_app_js") {
copy("default_app_static") {
sources = filenames.default_app_static_sources
- outputs = [
- "$target_gen_default_app_js/{{source}}",
- ]
+ outputs = [ "$target_gen_default_app_js/{{source}}" ]
}
copy("default_app_octicon_deps") {
sources = filenames.default_app_octicon_sources
- outputs = [
- "$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}",
- ]
+ outputs = [ "$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}" ]
}
asar("default_app_asar") {
@@ -223,13 +310,11 @@ asar("default_app_asar") {
sources = get_target_outputs(":default_app_js") +
get_target_outputs(":default_app_static") +
get_target_outputs(":default_app_octicon_deps")
- outputs = [
- "$root_out_dir/resources/default_app.asar",
- ]
+ outputs = [ "$root_out_dir/resources/default_app.asar" ]
}
grit("resources") {
- source = "electron_resources.grd"
+ source = "build/electron_resources.grd"
outputs = [
"grit/electron_resources.h",
@@ -237,137 +322,198 @@ grit("resources") {
]
# Mojo manifest overlays are generated.
- source_is_generated = true
grit_flags = [
"-E",
"target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
]
- deps = [
- ":copy_shell_devtools_discovery_page",
- ]
+ deps = [ ":copy_shell_devtools_discovery_page" ]
output_dir = "$target_gen_dir"
}
copy("copy_shell_devtools_discovery_page") {
+ sources = [ "//content/shell/resources/shell_devtools_discovery_page.html" ]
+ outputs = [ "$target_gen_dir/shell_devtools_discovery_page.html" ]
+}
+
+npm_action("electron_version_args") {
+ script = "generate-version-json"
+
+ outputs = [ "$target_gen_dir/electron_version.args" ]
+
+ args = rebase_path(outputs) + [ "$electron_version" ]
+
+ inputs = [ "script/generate-version-json.js" ]
+}
+
+templated_file("electron_version_header") {
+ deps = [ ":electron_version_args" ]
+
+ template = "build/templates/electron_version.tmpl"
+ output = "$target_gen_dir/electron_version.h"
+
+ args_files = get_target_outputs(":electron_version_args")
+}
+
+templated_file("electron_win_rc") {
+ deps = [ ":electron_version_args" ]
+
+ template = "build/templates/electron_rc.tmpl"
+ output = "$target_gen_dir/win-resources/electron.rc"
+
+ args_files = get_target_outputs(":electron_version_args")
+}
+
+copy("electron_win_resource_files") {
sources = [
- "//content/shell/resources/shell_devtools_discovery_page.html",
- ]
- outputs = [
- "$target_gen_dir/shell_devtools_discovery_page.html",
+ "shell/browser/resources/win/electron.ico",
+ "shell/browser/resources/win/resource.h",
]
+ outputs = [ "$target_gen_dir/win-resources/{{source_file_part}}" ]
}
-if (is_linux) {
- generate_library_loader("libnotify_loader") {
- name = "LibNotifyLoader"
- output_h = "libnotify_loader.h"
- output_cc = "libnotify_loader.cc"
- header = ""
- config = ":libnotify_config"
+templated_file("electron_version_file") {
+ deps = [ ":electron_version_args" ]
- functions = [
- "notify_is_initted",
- "notify_init",
- "notify_get_server_caps",
- "notify_get_server_info",
- "notify_notification_new",
- "notify_notification_add_action",
- "notify_notification_set_image_from_pixbuf",
- "notify_notification_set_timeout",
- "notify_notification_set_hint_string",
- "notify_notification_show",
- "notify_notification_close",
- ]
- }
+ template = "build/templates/version_string.tmpl"
+ output = "$root_build_dir/version"
+
+ args_files = get_target_outputs(":electron_version_args")
}
-source_set("manifests") {
- sources = [
- "//electron/atom/app/manifests.cc",
- "//electron/atom/app/manifests.h",
+group("electron_win32_resources") {
+ public_deps = [
+ ":electron_win_rc",
+ ":electron_win_resource_files",
]
+}
- include_dirs = [ "//electron" ]
+action("electron_fuses") {
+ script = "build/fuses/build.py"
- deps = [
- "//electron/atom/common/api:mojo",
- "//printing/buildflags",
- "//services/proxy_resolver/public/cpp:manifest",
- "//services/service_manager/public/cpp",
+ inputs = [ "build/fuses/fuses.json5" ]
+
+ outputs = [
+ "$target_gen_dir/fuses.h",
+ "$target_gen_dir/fuses.cc",
]
- if (enable_basic_printing) {
- deps += [ "//components/services/pdf_compositor/public/cpp:manifest" ]
- }
+ args = rebase_path(outputs)
+}
- if (enable_print_preview) {
- deps += [ "//chrome/services/printing/public/cpp:manifest" ]
- }
+action("electron_generate_node_defines") {
+ script = "build/generate_node_defines.py"
+
+ inputs = [
+ "//third_party/electron_node/src/tracing/trace_event_common.h",
+ "//third_party/electron_node/src/tracing/trace_event.h",
+ "//third_party/electron_node/src/util.h",
+ ]
+
+ outputs = [
+ "$target_gen_dir/push_and_undef_node_defines.h",
+ "$target_gen_dir/pop_node_defines.h",
+ ]
+
+ args = [ rebase_path(target_gen_dir) ] + rebase_path(inputs)
}
-static_library("electron_lib") {
- configs += [ "//v8:external_startup_data" ]
- configs += [ "//third_party/electron_node:node_internals" ]
+source_set("electron_lib") {
+ configs += [
+ "//v8:external_startup_data",
+ "//third_party/electron_node:node_external_config",
+ ]
- public_configs = [ ":branding" ]
+ public_configs = [
+ ":branding",
+ ":electron_lib_config",
+ ]
deps = [
- ":atom_js2c",
- ":manifests",
+ ":electron_fuses",
+ ":electron_generate_node_defines",
+ ":electron_js2c",
+ ":electron_version_header",
":resources",
- "atom/common/api:mojo",
"buildflags",
"chromium_src:chrome",
- "native_mate",
+ "chromium_src:chrome_spellchecker",
+ "shell/common:mojo",
+ "shell/common:plugin",
+ "shell/common:web_contents_utility",
+ "shell/services/node/public/mojom",
"//base:base_static",
"//base/allocator:buildflags",
+ "//chrome:strings",
+ "//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
+ "//components/autofill/core/common:features",
"//components/certificate_transparency",
+ "//components/compose:buildflags",
+ "//components/embedder_support:user_agent",
+ "//components/input:input",
+ "//components/language/core/browser",
"//components/net_log",
+ "//components/network_hints/browser",
+ "//components/network_hints/common:mojo_bindings",
+ "//components/network_hints/renderer",
"//components/network_session_configurator/common",
+ "//components/omnibox/browser:buildflags",
+ "//components/os_crypt/async/browser",
+ "//components/os_crypt/async/browser:key_provider_interface",
+ "//components/os_crypt/sync",
+ "//components/pref_registry",
"//components/prefs",
- "//components/spellcheck/renderer",
+ "//components/security_state/content",
+ "//components/upload_list",
+ "//components/user_prefs",
"//components/viz/host",
"//components/viz/service",
+ "//components/webrtc",
"//content/public/browser",
"//content/public/child",
- "//content/public/common:service_names",
"//content/public/gpu",
"//content/public/renderer",
"//content/public/utility",
"//device/bluetooth",
+ "//device/bluetooth/public/cpp",
"//gin",
"//media/capture/mojom:video_capture",
- "//media/mojo/interfaces",
+ "//media/mojo/mojom",
+ "//media/mojo/mojom:web_speech_recognition",
"//net:extras",
"//net:net_resources",
- "//net:net_with_v8",
- "//ppapi/host",
- "//ppapi/proxy",
- "//ppapi/shared_impl",
"//printing/buildflags",
- "//services/audio/public/mojom:constants",
+ "//services/device/public/cpp/bluetooth:bluetooth",
"//services/device/public/cpp/geolocation",
+ "//services/device/public/cpp/hid",
"//services/device/public/mojom",
"//services/proxy_resolver:lib",
"//services/video_capture/public/mojom:constants",
- "//services/viz/privileged/interfaces/compositing",
+ "//services/viz/privileged/mojom/compositing",
+ "//services/viz/public/mojom",
"//skia",
"//third_party/blink/public:blink",
+ "//third_party/blink/public:blink_devtools_inspector_resources",
+ "//third_party/blink/public/platform/media",
"//third_party/boringssl",
- "//third_party/electron_node:node_lib",
+ "//third_party/electron_node:libnode",
+ "//third_party/inspector_protocol:crdtp",
"//third_party/leveldatabase",
"//third_party/libyuv",
- "//third_party/webrtc_overrides:init_webrtc",
+ "//third_party/webrtc_overrides:webrtc_component",
"//third_party/widevine/cdm:headers",
+ "//third_party/zlib/google:zip",
+ "//ui/base:ozone_buildflags",
"//ui/base/idle",
+ "//ui/compositor",
"//ui/events:dom_keycode_converter",
"//ui/gl",
"//ui/native_theme",
"//ui/shell_dialogs",
"//ui/views",
+ "//ui/views/controls/webview",
"//v8",
"//v8:v8_libplatform",
]
@@ -375,11 +521,10 @@ static_library("electron_lib") {
public_deps = [
"//base",
"//base:i18n",
- "//content/public/app:both",
+ "//content/public/app",
]
include_dirs = [
- "chromium_src",
".",
"$target_gen_dir",
@@ -388,48 +533,41 @@ static_library("electron_lib") {
"//third_party/blink/renderer",
]
- defines = [ "V8_DEPRECATION_WARNINGS" ]
+ defines = [
+ "BLINK_MOJO_IMPL=1",
+ "V8_DEPRECATION_WARNINGS",
+ ]
libs = []
if (is_linux) {
defines += [ "GDK_DISABLE_DEPRECATION_WARNINGS" ]
}
- extra_source_filters = []
- if (!is_linux) {
- extra_source_filters += [
- "*\bx/*",
- "*_x11.h",
- "*_x11.cc",
- "*_gtk.h",
- "*_gtk.cc",
- "*\blibrary_loaders/*",
- ]
- }
- if (!is_win) {
- extra_source_filters += [
- "*\bwin_*.h",
- "*\bwin_*.cc",
+ if (!is_mas_build) {
+ deps += [
+ "//components/crash/core/app",
+ "//components/crash/core/browser",
]
}
- if (!is_posix) {
- extra_source_filters += [
- "*_posix.cc",
- "*_posix.h",
- ]
+
+ deps += [ "//electron/build/config:generate_mas_config" ]
+
+ sources = filenames.lib_sources
+ if (is_win) {
+ sources += filenames.lib_sources_win
}
if (is_mac) {
- extra_source_filters += [
- "*_views.cc",
- "*_views.h",
- "*\bviews/*",
- ]
+ sources += filenames.lib_sources_mac
+ }
+ if (is_posix) {
+ sources += filenames.lib_sources_posix
+ }
+ if (is_linux) {
+ sources += filenames.lib_sources_linux
+ }
+ if (!is_mac) {
+ sources += filenames.lib_sources_views
}
-
- set_sources_assignment_filter(
- sources_assignment_filter + extra_source_filters)
- sources = filenames.lib_sources
- set_sources_assignment_filter(sources_assignment_filter)
if (is_component_build) {
defines += [ "NODE_SHARED_MODE" ]
@@ -437,70 +575,114 @@ static_library("electron_lib") {
if (enable_fake_location_provider) {
sources += [
- "atom/browser/fake_location_provider.cc",
- "atom/browser/fake_location_provider.h",
+ "shell/browser/fake_location_provider.cc",
+ "shell/browser/fake_location_provider.h",
]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
+ "//components/remote_cocoa/browser",
+ "//content/browser:mac_helpers",
"//ui/accelerated_widget_mac",
]
+
+ if (!is_mas_build) {
+ deps += [ "//third_party/crashpad/crashpad/client" ]
+ }
+
+ frameworks = [
+ "AuthenticationServices.framework",
+ "AVFoundation.framework",
+ "Carbon.framework",
+ "LocalAuthentication.framework",
+ "QuartzCore.framework",
+ "Quartz.framework",
+ "Security.framework",
+ "SecurityInterface.framework",
+ "ServiceManagement.framework",
+ "StoreKit.framework",
+ ]
+
+ weak_frameworks = [ "QuickLookThumbnailing.framework" ]
+
sources += [
- "atom/browser/ui/views/autofill_popup_view.cc",
- "atom/browser/ui/views/autofill_popup_view.h",
+ "shell/browser/ui/views/autofill_popup_view.cc",
+ "shell/browser/ui/views/autofill_popup_view.h",
]
if (is_mas_build) {
- sources += [ "atom/browser/api/atom_api_app_mas.mm" ]
+ sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
+ sources -= [ "shell/browser/auto_updater_mac.mm" ]
sources -= [
- "atom/browser/auto_updater_mac.mm",
- "atom/common/crash_reporter/crash_reporter_mac.h",
- "atom/common/crash_reporter/crash_reporter_mac.mm",
+ "shell/app/electron_crash_reporter_client.cc",
+ "shell/app/electron_crash_reporter_client.h",
+ "shell/common/crash_keys.cc",
+ "shell/common/crash_keys.h",
]
- defines += [ "MAS_BUILD" ]
} else {
- libs += [
+ frameworks += [
"Squirrel.framework",
- "ReactiveCocoa.framework",
+ "ReactiveObjC.framework",
"Mantle.framework",
]
- cflags_objcc = [
- "-F",
- rebase_path("external_binaries", root_build_dir),
+
+ deps += [
+ "//third_party/squirrel.mac:reactiveobjc_framework+link",
+ "//third_party/squirrel.mac:squirrel_framework+link",
]
- # ReactiveCocoa which is used by Squirrel requires using __weak.
- cflags_objcc += [ "-fobjc-weak" ]
+ # ReactiveObjC which is used by Squirrel requires using __weak.
+ cflags_objcc = [ "-fobjc-weak" ]
}
}
if (is_linux) {
+ libs = [ "xshmfence" ]
deps += [
+ ":electron_gtk_stubs",
":libnotify_loader",
"//build/config/linux/gtk",
- "//chrome/browser/ui/libgtkui",
+ "//components/crash/content/browser",
"//dbus",
"//device/bluetooth",
- "//third_party/breakpad:client",
+ "//third_party/crashpad/crashpad/client",
+ "//ui/base/ime/linux",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
- "//ui/views/controls/webview",
+ "//ui/gtk:gtk_config",
+ "//ui/linux:linux_ui",
+ "//ui/linux:linux_ui_factory",
"//ui/wm",
]
+ if (ozone_platform_x11) {
+ sources += filenames.lib_sources_linux_x11
+ public_deps += [
+ "//ui/base/x",
+ "//ui/ozone/platform/x11",
+ ]
+ }
configs += [ ":gio_unix" ]
- include_dirs += [ "//third_party/breakpad" ]
defines += [
# Disable warnings for g_settings_list_schemas.
"GLIB_DISABLE_DEPRECATION_WARNINGS",
]
- sources += filenames.lib_sources_nss
+ sources += [
+ "shell/browser/certificate_manager_model.cc",
+ "shell/browser/certificate_manager_model.h",
+ "shell/browser/linux/x11_util.cc",
+ "shell/browser/linux/x11_util.h",
+ "shell/browser/ui/gtk_util.cc",
+ "shell/browser/ui/gtk_util.h",
+ ]
}
if (is_win) {
libs += [ "dwmapi.lib" ]
+ sources += [ "shell/common/asar/archive_win.cc" ]
deps += [
+ "//components/app_launch_prefetch",
+ "//components/crash/core/app:crash_export_thunks",
"//ui/native_theme:native_theme_browser",
- "//ui/views/controls/webview",
"//ui/wm",
"//ui/wm/public",
]
@@ -510,89 +692,83 @@ static_library("electron_lib") {
]
}
- if ((is_mac && !is_mas_build) || is_win) {
+ if (enable_plugins) {
sources += [
- "atom/common/crash_reporter/crash_reporter_crashpad.cc",
- "atom/common/crash_reporter/crash_reporter_crashpad.h",
+ "shell/browser/electron_plugin_info_host_impl.cc",
+ "shell/browser/electron_plugin_info_host_impl.h",
+ "shell/common/plugin_info.cc",
+ "shell/common/plugin_info.h",
]
- deps += [ "//third_party/crashpad/crashpad/client" ]
- }
-
- if (enable_pdf) {
- deps += [ "//pdf" ]
}
- if (enable_run_as_node) {
+ if (enable_printing) {
sources += [
- "atom/app/node_main.cc",
- "atom/app/node_main.h",
- ]
- }
-
- if (enable_osr) {
- sources += [
- "atom/browser/osr/osr_host_display_client.cc",
- "atom/browser/osr/osr_host_display_client.h",
- "atom/browser/osr/osr_host_display_client_mac.mm",
- "atom/browser/osr/osr_render_widget_host_view.cc",
- "atom/browser/osr/osr_render_widget_host_view.h",
- "atom/browser/osr/osr_video_consumer.cc",
- "atom/browser/osr/osr_video_consumer.h",
- "atom/browser/osr/osr_view_proxy.cc",
- "atom/browser/osr/osr_view_proxy.h",
- "atom/browser/osr/osr_web_contents_view.cc",
- "atom/browser/osr/osr_web_contents_view.h",
- "atom/browser/osr/osr_web_contents_view_mac.mm",
+ "shell/browser/printing/print_view_manager_electron.cc",
+ "shell/browser/printing/print_view_manager_electron.h",
+ "shell/browser/printing/printing_utils.cc",
+ "shell/browser/printing/printing_utils.h",
+ "shell/renderer/printing/print_render_frame_helper_delegate.cc",
+ "shell/renderer/printing/print_render_frame_helper_delegate.h",
]
deps += [
- "//components/viz/service",
- "//services/viz/public/interfaces",
- "//ui/compositor",
+ "//chrome/services/printing/public/mojom",
+ "//components/printing/common:mojo_interfaces",
]
+ if (is_mac) {
+ deps += [ "//chrome/services/mac_notifications/public/mojom" ]
+ }
}
- if (enable_desktop_capturer) {
- if (is_component_build && is_win) {
- # On windows the implementation relies on unexported
- # DxgiDuplicatorController class.
- deps += [ "//third_party/webrtc/modules/desktop_capture" ]
- }
- sources += [
- "atom/browser/api/atom_api_desktop_capturer.cc",
- "atom/browser/api/atom_api_desktop_capturer.h",
+ if (enable_electron_extensions) {
+ sources += filenames.lib_sources_extensions
+ deps += [
+ "shell/browser/extensions/api:api_registration",
+ "shell/common/extensions/api",
+ "shell/common/extensions/api:extensions_features",
+ "//chrome/browser/resources:component_extension_resources",
+ "//components/guest_view/common:mojom",
+ "//components/update_client:update_client",
+ "//components/zoom",
+ "//extensions/browser",
+ "//extensions/browser/api:api_provider",
+ "//extensions/browser/updater",
+ "//extensions/common",
+ "//extensions/common:core_api_provider",
+ "//extensions/renderer",
]
}
- if (enable_view_api) {
- sources += [
- "atom/browser/api/views/atom_api_box_layout.cc",
- "atom/browser/api/views/atom_api_box_layout.h",
- "atom/browser/api/views/atom_api_button.cc",
- "atom/browser/api/views/atom_api_button.h",
- "atom/browser/api/views/atom_api_label_button.cc",
- "atom/browser/api/views/atom_api_label_button.h",
- "atom/browser/api/views/atom_api_layout_manager.cc",
- "atom/browser/api/views/atom_api_layout_manager.h",
- "atom/browser/api/views/atom_api_md_text_button.cc",
- "atom/browser/api/views/atom_api_md_text_button.h",
- "atom/browser/api/views/atom_api_resize_area.cc",
- "atom/browser/api/views/atom_api_resize_area.h",
- "atom/browser/api/views/atom_api_text_field.cc",
- "atom/browser/api/views/atom_api_text_field.h",
+ if (enable_pdf) {
+ # Printing depends on some //pdf code, so it needs to be built even if the
+ # pdf viewer isn't enabled.
+ deps += [
+ "//pdf",
+ "//pdf:features",
]
}
-
- if (enable_basic_printing) {
+ if (enable_pdf_viewer) {
+ deps += [
+ "//chrome/browser/resources/pdf:resources",
+ "//components/pdf/browser",
+ "//components/pdf/browser:interceptors",
+ "//components/pdf/common:constants",
+ "//components/pdf/common:util",
+ "//components/pdf/renderer",
+ "//pdf",
+ "//pdf:content_restriction",
+ ]
sources += [
- "atom/browser/printing/print_preview_message_handler.cc",
- "atom/browser/printing/print_preview_message_handler.h",
- "atom/renderer/printing/print_render_frame_helper_delegate.cc",
- "atom/renderer/printing/print_render_frame_helper_delegate.h",
+ "shell/browser/electron_pdf_document_helper_client.cc",
+ "shell/browser/electron_pdf_document_helper_client.h",
+ "shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.cc",
+ "shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h",
]
}
- if (enable_pepper_flash) {
- deps += [ "components/pepper_flash" ]
+ sources += get_target_outputs(":electron_fuses")
+
+ if (allow_runtime_configurable_key_storage) {
+ defines += [ "ALLOW_RUNTIME_CONFIGURABLE_KEY_STORAGE" ]
}
}
@@ -611,59 +787,82 @@ if (is_mac) {
electron_login_helper_name = "$electron_product_name Login Helper"
electron_framework_version = "A"
+ mac_xib_bundle_data("electron_xibs") {
+ sources = [ "shell/common/resources/mac/MainMenu.xib" ]
+ }
+
bundle_data("electron_framework_resources") {
- public_deps = [
- ":packed_resources",
- ]
+ public_deps = [ ":packed_resources" ]
sources = []
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
public_deps += [ "//third_party/icu:icudata" ]
}
if (v8_use_external_startup_data) {
- sources += [ "$root_out_dir/natives_blob.bin" ]
public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
- sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
+ sources += [ "$root_out_dir/$v8_context_snapshot_filename" ]
public_deps += [ "//tools/v8_context_snapshot" ]
} else {
sources += [ "$root_out_dir/snapshot_blob.bin" ]
}
}
- outputs = [
- "{{bundle_resources_dir}}/{{source_file_part}}",
- ]
+ outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
- if (!is_component_build) {
+ if (!is_component_build && is_component_ffmpeg) {
bundle_data("electron_framework_libraries") {
sources = []
public_deps = []
- if (is_component_ffmpeg) {
- sources += [ "$root_out_dir/libffmpeg.dylib" ]
- public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
- }
- outputs = [
- "{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
- ]
+ sources += [ "$root_out_dir/libffmpeg.dylib" ]
+ public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
+ outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
}
} else {
group("electron_framework_libraries") {
}
}
- bundle_data("electron_crashpad_helper") {
+ # Add the ANGLE .dylibs in the Libraries directory of the Framework.
+ bundle_data("electron_angle_binaries") {
sources = [
- "$root_out_dir/crashpad_handler",
+ "$root_out_dir/egl_intermediates/libEGL.dylib",
+ "$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
+ outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
+ public_deps = [ "//ui/gl:angle_library_copy" ]
+ }
- outputs = [
- "{{bundle_resources_dir}}/{{source_file_part}}",
+ # Add the SwiftShader .dylibs in the Libraries directory of the Framework.
+ bundle_data("electron_swiftshader_binaries") {
+ sources = [
+ "$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
+ "$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
+ outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
+ public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
+ }
- public_deps = [
- "//third_party/crashpad/crashpad/handler:crashpad_handler",
- ]
+ group("electron_angle_library") {
+ deps = [ ":electron_angle_binaries" ]
+ }
+
+ group("electron_swiftshader_library") {
+ deps = [ ":electron_swiftshader_binaries" ]
+ }
+
+ bundle_data("electron_crashpad_helper") {
+ sources = [ "$root_out_dir/chrome_crashpad_handler" ]
+
+ outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
+
+ public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
+
+ if (is_asan) {
+ # crashpad_handler requires the ASan runtime at its @executable_path.
+ sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
+ public_deps += [ "//build/config/sanitizers:copy_sanitizer_runtime" ]
+ }
}
mac_framework_bundle("electron_framework") {
@@ -673,49 +872,42 @@ if (is_mac) {
"Resources",
"Libraries",
]
+ if (!is_mas_build) {
+ framework_contents += [ "Helpers" ]
+ }
public_deps = [
+ ":electron_framework_libraries",
":electron_lib",
]
deps = [
+ ":electron_angle_library",
":electron_framework_libraries",
":electron_framework_resources",
+ ":electron_swiftshader_library",
+ ":electron_xibs",
+ "//third_party/electron_node:libnode",
]
if (!is_mas_build) {
deps += [ ":electron_crashpad_helper" ]
}
- info_plist = "atom/common/resources/mac/Info.plist"
+ info_plist = "shell/common/resources/mac/Info.plist"
- electron_version = read_file("ELECTRON_VERSION", "trim string")
extra_substitutions = [
- "ATOM_BUNDLE_ID=$electron_mac_bundle_id.framework",
+ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.framework",
"ELECTRON_VERSION=$electron_version",
]
include_dirs = [ "." ]
sources = filenames.framework_sources
-
- libs = [
- "AVFoundation.framework",
- "Carbon.framework",
- "LocalAuthentication.framework",
- "QuartzCore.framework",
- "Quartz.framework",
- "Security.framework",
- "SecurityInterface.framework",
- "ServiceManagement.framework",
- "StoreKit.framework",
- ]
-
- if (enable_osr) {
- libs += [ "IOSurface.framework" ]
- }
+ frameworks = [ "IOSurface.framework" ]
ldflags = [
- "-F",
- rebase_path("external_binaries", root_build_dir),
"-Wl,-install_name,@rpath/$output_name.framework/$output_name",
"-rpath",
"@loader_path/Libraries",
+
+ # Required for exporting all symbols of libuv.
+ "-Wl,-force_load,obj/third_party/electron_node/deps/uv/libuv.a",
]
if (is_component_build) {
ldflags += [
@@ -723,103 +915,147 @@ if (is_mac) {
"@executable_path/../../../../../..",
]
}
- }
- mac_app_bundle("electron_helper_app") {
- output_name = electron_helper_name
- deps = [
- ":electron_framework+link",
- ]
- if (!is_mas_build) {
- deps += [ "//sandbox/mac:seatbelt" ]
+ # For component ffmpeg under non-component build, it is linked from
+ # @loader_path. However the ffmpeg.dylib is moved to a different place
+ # when generating app bundle, and we should change to link from @rpath.
+ if (is_component_ffmpeg && !is_component_build) {
+ ldflags += [ "-Wcrl,installnametool,-change,@loader_path/libffmpeg.dylib,@rpath/libffmpeg.dylib" ]
}
- defines = [ "HELPER_EXECUTABLE" ]
- sources = filenames.app_sources
- sources += [ "atom/common/atom_constants.cc" ]
- include_dirs = [ "." ]
- info_plist = "atom/renderer/resources/mac/Info.plist"
- extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
- ldflags = [
- "-rpath",
- "@executable_path/../../..",
- ]
- if (is_component_build) {
- ldflags += [
+ }
+
+ template("electron_helper_app") {
+ mac_app_bundle(target_name) {
+ assert(defined(invoker.helper_name_suffix))
+
+ output_name = electron_helper_name + invoker.helper_name_suffix
+ deps = [
+ ":electron_framework+link",
+ "//electron/build/config:generate_mas_config",
+ ]
+ if (!is_mas_build) {
+ deps += [ "//sandbox/mac:seatbelt" ]
+ }
+ defines = [ "HELPER_EXECUTABLE" ]
+ sources = [
+ "shell/app/electron_main_mac.cc",
+ "shell/app/uv_stdio_fix.cc",
+ "shell/app/uv_stdio_fix.h",
+ ]
+ include_dirs = [ "." ]
+ info_plist = "shell/renderer/resources/mac/Info.plist"
+ extra_substitutions =
+ [ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
+ ldflags = [
"-rpath",
- "@executable_path/../../../../../..",
+ "@executable_path/../../..",
]
+ if (is_component_build) {
+ ldflags += [
+ "-rpath",
+ "@executable_path/../../../../../..",
+ ]
+ }
+ }
+ }
+
+ foreach(helper_params, content_mac_helpers) {
+ _helper_target = helper_params[0]
+ _helper_bundle_id = helper_params[1]
+ _helper_suffix = helper_params[2]
+ electron_helper_app("electron_helper_app_${_helper_target}") {
+ helper_name_suffix = _helper_suffix
+ }
+ }
+
+ template("stripped_framework") {
+ action(target_name) {
+ assert(defined(invoker.framework))
+
+ script = "//electron/build/strip_framework.py"
+
+ forward_variables_from(invoker, [ "deps" ])
+ inputs = [ "$root_out_dir/" + invoker.framework ]
+ outputs = [ "$target_out_dir/stripped_frameworks/" + invoker.framework ]
+
+ args = rebase_path(inputs) + rebase_path(outputs)
}
}
+ stripped_framework("stripped_mantle_framework") {
+ framework = "Mantle.framework"
+ deps = [ "//third_party/squirrel.mac:mantle_framework" ]
+ }
+
+ stripped_framework("stripped_reactiveobjc_framework") {
+ framework = "ReactiveObjC.framework"
+ deps = [ "//third_party/squirrel.mac:reactiveobjc_framework" ]
+ }
+
+ stripped_framework("stripped_squirrel_framework") {
+ framework = "Squirrel.framework"
+ deps = [ "//third_party/squirrel.mac:squirrel_framework" ]
+ }
+
bundle_data("electron_app_framework_bundle_data") {
- sources = [
- "$root_out_dir/$electron_framework_name.framework",
- "$root_out_dir/$electron_helper_name.app",
- ]
+ sources = [ "$root_out_dir/$electron_framework_name.framework" ]
if (!is_mas_build) {
- sources += [
- "external_binaries/Mantle.framework",
- "external_binaries/ReactiveCocoa.framework",
- "external_binaries/Squirrel.framework",
- ]
+ sources += get_target_outputs(":stripped_mantle_framework") +
+ get_target_outputs(":stripped_reactiveobjc_framework") +
+ get_target_outputs(":stripped_squirrel_framework")
}
- outputs = [
- "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
- ]
+ outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
public_deps = [
":electron_framework+link",
- ":electron_helper_app",
+ ":stripped_mantle_framework",
+ ":stripped_reactiveobjc_framework",
+ ":stripped_squirrel_framework",
]
+
+ foreach(helper_params, content_mac_helpers) {
+ sources +=
+ [ "$root_out_dir/${electron_helper_name}${helper_params[2]}.app" ]
+ public_deps += [ ":electron_helper_app_${helper_params[0]}" ]
+ }
}
mac_app_bundle("electron_login_helper") {
output_name = electron_login_helper_name
sources = filenames.login_helper_sources
include_dirs = [ "." ]
- libs = [ "AppKit.framework" ]
- info_plist = "atom/app/resources/mac/loginhelper-Info.plist"
+ frameworks = [ "AppKit.framework" ]
+ info_plist = "shell/app/resources/mac/loginhelper-Info.plist"
extra_substitutions =
- [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
+ [ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.loginhelper" ]
}
bundle_data("electron_login_helper_app") {
- public_deps = [
- ":electron_login_helper",
- ]
- sources = [
- "$root_out_dir/$electron_login_helper_name.app",
- ]
- outputs = [
- "{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}",
- ]
+ public_deps = [ ":electron_login_helper" ]
+ sources = [ "$root_out_dir/$electron_login_helper_name.app" ]
+ outputs =
+ [ "{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}" ]
}
action("electron_app_lproj_dirs") {
outputs = []
- foreach(locale, locales_as_mac_outputs) {
+ foreach(locale, locales_as_apple_outputs) {
outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
}
script = "build/mac/make_locale_dirs.py"
args = rebase_path(outputs)
}
- foreach(locale, locales_as_mac_outputs) {
+ foreach(locale, locales_as_apple_outputs) {
bundle_data("electron_app_strings_${locale}_bundle_data") {
- sources = [
- "$target_gen_dir/app_infoplist_strings/$locale.lproj",
- ]
- outputs = [
- "{{bundle_resources_dir}}/$locale.lproj",
- ]
- public_deps = [
- ":electron_app_lproj_dirs",
- ]
+ sources = [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
+ outputs = [ "{{bundle_resources_dir}}/$locale.lproj" ]
+ public_deps = [ ":electron_app_lproj_dirs" ]
}
}
group("electron_app_strings_bundle_data") {
public_deps = []
- foreach(locale, locales_as_mac_outputs) {
+ foreach(locale, locales_as_apple_outputs) {
public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
}
}
@@ -831,37 +1067,121 @@ if (is_mac) {
]
sources = [
"$root_out_dir/resources/default_app.asar",
- "atom/browser/resources/mac/electron.icns",
- ]
- outputs = [
- "{{bundle_resources_dir}}/{{source_file_part}}",
+ "shell/browser/resources/mac/electron.icns",
]
+ outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
+ }
+
+ asar_hashed_info_plist("electron_app_plist") {
+ keys = [ "DEFAULT_APP_ASAR_HEADER_SHA" ]
+ hash_targets = [ ":default_app_asar_header_hash" ]
+ plist_file = "shell/browser/resources/mac/Info.plist"
}
mac_app_bundle("electron_app") {
output_name = electron_product_name
- sources = filenames.app_sources
- sources += [ "atom/common/atom_constants.cc" ]
+ sources = [
+ "shell/app/electron_main_mac.cc",
+ "shell/app/uv_stdio_fix.cc",
+ "shell/app/uv_stdio_fix.h",
+ ]
include_dirs = [ "." ]
deps = [
":electron_app_framework_bundle_data",
+ ":electron_app_plist",
":electron_app_resources",
+ ":electron_fuses",
+ "//electron/build/config:generate_mas_config",
+ "//electron/buildflags",
]
if (is_mas_build) {
deps += [ ":electron_login_helper_app" ]
}
- info_plist = "atom/browser/resources/mac/Info.plist"
- extra_substitutions = [ "ATOM_BUNDLE_ID=$electron_mac_bundle_id" ]
+ info_plist_target = ":electron_app_plist"
+ extra_substitutions = [
+ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id",
+ "ELECTRON_VERSION=$electron_version",
+ ]
ldflags = [
"-rpath",
"@executable_path/../Frameworks",
]
}
+
+ if (enable_dsyms) {
+ extract_symbols("electron_framework_syms") {
+ binary = "$root_out_dir/$electron_framework_name.framework/Versions/$electron_framework_version/$electron_framework_name"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name"
+ deps = [ ":electron_framework" ]
+ }
+
+ foreach(helper_params, content_mac_helpers) {
+ _helper_target = helper_params[0]
+ _helper_bundle_id = helper_params[1]
+ _helper_suffix = helper_params[2]
+ extract_symbols("electron_helper_syms_${_helper_target}") {
+ binary = "$root_out_dir/$electron_helper_name${_helper_suffix}.app/Contents/MacOS/$electron_helper_name${_helper_suffix}"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/$electron_helper_name${_helper_suffix}.dSYM/Contents/Resources/DWARF/$electron_helper_name${_helper_suffix}"
+ deps = [ ":electron_helper_app_${_helper_target}" ]
+ }
+ }
+
+ extract_symbols("electron_app_syms") {
+ binary = "$root_out_dir/$electron_product_name.app/Contents/MacOS/$electron_product_name"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/$electron_product_name.dSYM/Contents/Resources/DWARF/$electron_product_name"
+ deps = [ ":electron_app" ]
+ }
+
+ extract_symbols("egl_syms") {
+ binary = "$root_out_dir/libEGL.dylib"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/libEGL.dylib.dSYM/Contents/Resources/DWARF/libEGL.dylib"
+ deps = [ "//third_party/angle:libEGL" ]
+ }
+
+ extract_symbols("gles_syms") {
+ binary = "$root_out_dir/libGLESv2.dylib"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libGLESv2.dylib"
+ deps = [ "//third_party/angle:libGLESv2" ]
+ }
+
+ extract_symbols("crashpad_handler_syms") {
+ binary = "$root_out_dir/chrome_crashpad_handler"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ dsym_file = "$root_out_dir/chrome_crashpad_handler.dSYM/Contents/Resources/DWARF/chrome_crashpad_handler"
+ deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
+ }
+
+ group("electron_symbols") {
+ deps = [
+ ":egl_syms",
+ ":electron_app_syms",
+ ":electron_framework_syms",
+ ":gles_syms",
+ ]
+
+ if (!is_mas_build) {
+ deps += [ ":crashpad_handler_syms" ]
+ }
+
+ foreach(helper_params, content_mac_helpers) {
+ _helper_target = helper_params[0]
+ deps += [ ":electron_helper_syms_${_helper_target}" ]
+ }
+ }
+ } else {
+ group("electron_symbols") {
+ }
+ }
} else {
windows_manifest("electron_app_manifest") {
sources = [
- "atom/browser/resources/win/disable_window_filtering.manifest",
- "atom/browser/resources/win/dpi_aware.manifest",
+ "shell/browser/resources/win/disable_window_filtering.manifest",
+ "shell/browser/resources/win/dpi_aware.manifest",
as_invoker_manifest,
common_controls_manifest,
default_compatibility_manifest,
@@ -870,26 +1190,38 @@ if (is_mac) {
executable("electron_app") {
output_name = electron_project_name
- sources = filenames.app_sources
+ if (is_win) {
+ sources = [ "shell/app/electron_main_win.cc" ]
+ } else if (is_linux) {
+ sources = [
+ "shell/app/electron_main_linux.cc",
+ "shell/app/uv_stdio_fix.cc",
+ "shell/app/uv_stdio_fix.h",
+ ]
+ }
include_dirs = [ "." ]
deps = [
":default_app_asar",
":electron_app_manifest",
":electron_lib",
+ ":electron_win32_resources",
":packed_resources",
+ "//components/crash/core/app",
"//content:sandbox_helper_win",
"//electron/buildflags",
+ "//third_party/electron_node:libnode",
"//ui/strings",
]
data = []
+ data_deps = []
data += [ "$root_out_dir/resources.pak" ]
data += [ "$root_out_dir/chrome_100_percent.pak" ]
if (enable_hidpi) {
data += [ "$root_out_dir/chrome_200_percent.pak" ]
}
- foreach(locale, locales) {
+ foreach(locale, platform_pak_locales) {
data += [ "$root_out_dir/locales/$locale.pak" ]
}
@@ -897,34 +1229,52 @@ if (is_mac) {
data += [ "$root_out_dir/resources/default_app.asar" ]
}
- public_deps = [
- "//tools/v8_context_snapshot:v8_context_snapshot",
- ]
+ if (use_v8_context_snapshot) {
+ public_deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
+ }
+
+ if (is_linux) {
+ data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
+ }
if (is_win) {
sources += [
- # TODO: we should be generating our .rc files more like how chrome does
- "atom/browser/resources/win/atom.ico",
- "atom/browser/resources/win/atom.rc",
- "atom/browser/resources/win/resource.h",
+ "$target_gen_dir/win-resources/electron.rc",
+ "shell/browser/resources/win/resource.h",
]
+ deps += [
+ "//chrome/app:exit_code_watcher",
+ "//components/crash/core/app:run_as_crashpad_handler",
+ ]
+
+ ldflags = [ "/DELAYLOAD:ffmpeg.dll" ]
+
libs = [
"comctl32.lib",
"uiautomationcore.lib",
"wtsapi32.lib",
]
- configs += [ "//build/config/win:windowed" ]
-
- ldflags = [
- # Windows 7 doesn't have these DLLs.
- # TODO: are there other DLLs we need to list here to be win7
- # compatible?
- "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
- "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
+ configs -= [ "//build/config/win:console" ]
+ configs += [
+ "//build/config/win:windowed",
+ "//build/config/win:delayloads",
]
+ if (current_cpu == "x86") {
+ # Set the initial stack size to 0.5MiB, instead of the 1.5MiB needed by
+ # Chrome's main thread. This saves significant memory on threads (like
+ # those in the Windows thread pool, and others) whose stack size we can
+ # only control through this setting. Because Chrome's main thread needs
+ # a minimum 1.5 MiB stack, the main thread (in 32-bit builds only) uses
+ # fibers to switch to a 1.5 MiB stack before running any other code.
+ ldflags += [ "/STACK:0x80000" ]
+ } else {
+ # Increase the initial stack size. The default is 1MB, this is 8MB.
+ ldflags += [ "/STACK:0x800000" ]
+ }
+
# This is to support renaming of electron.exe. node-gyp has hard-coded
# executable names which it will recognise as node. This module definition
# file claims that the electron executable is in fact named "node.exe",
@@ -932,15 +1282,63 @@ if (is_mac) {
# See https://github.com/nodejs/node-gyp/commit/52ceec3a6d15de3a8f385f43dbe5ecf5456ad07a
ldflags += [ "/DEF:" + rebase_path("build/electron.def", root_build_dir) ]
inputs = [
+ "shell/browser/resources/win/electron.ico",
"build/electron.def",
]
}
if (is_linux) {
- ldflags = [ "-pie" ]
+ ldflags = [
+ "-pie",
+
+ # Required for exporting all symbols of libuv.
+ "-Wl,--whole-archive",
+ "obj/third_party/electron_node/deps/uv/libuv.a",
+ "-Wl,--no-whole-archive",
+ ]
if (!is_component_build && is_component_ffmpeg) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
+
+ if (is_linux) {
+ deps += [ "//sandbox/linux:chrome_sandbox" ]
+ }
+ }
+ }
+
+ if (is_official_build) {
+ if (is_linux) {
+ _target_executable_suffix = ""
+ _target_shared_library_suffix = ".so"
+ } else if (is_win) {
+ _target_executable_suffix = ".exe"
+ _target_shared_library_suffix = ".dll"
+ }
+
+ extract_symbols("electron_app_symbols") {
+ binary = "$root_out_dir/$electron_project_name$_target_executable_suffix"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ deps = [ ":electron_app" ]
+ }
+
+ extract_symbols("egl_symbols") {
+ binary = "$root_out_dir/libEGL$_target_shared_library_suffix"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ deps = [ "//third_party/angle:libEGL" ]
+ }
+
+ extract_symbols("gles_symbols") {
+ binary = "$root_out_dir/libGLESv2$_target_shared_library_suffix"
+ symbol_dir = "$root_out_dir/breakpad_symbols"
+ deps = [ "//third_party/angle:libGLESv2" ]
+ }
+
+ group("electron_symbols") {
+ deps = [
+ ":egl_symbols",
+ ":electron_app_symbols",
+ ":gles_symbols",
+ ]
}
}
}
@@ -964,104 +1362,219 @@ template("dist_zip") {
action(target_name) {
script = "//electron/build/zip.py"
- deps = [
- ":$_runtime_deps_target",
- ]
+ deps = [ ":$_runtime_deps_target" ]
forward_variables_from(invoker,
[
"outputs",
"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",
]
}
}
copy("electron_license") {
- sources = [
- "LICENSE",
- ]
- outputs = [
- "$root_build_dir/{{source_file_part}}",
- ]
+ sources = [ "LICENSE" ]
+ outputs = [ "$root_build_dir/{{source_file_part}}" ]
}
copy("chromium_licenses") {
- deps = [
- "//components/resources:about_credits",
- ]
- sources = [
- "$root_gen_dir/components/resources/about_credits.html",
- ]
- outputs = [
- "$root_build_dir/LICENSES.chromium.html",
- ]
+ deps = [ "//components/resources:about_credits" ]
+ sources = [ "$root_gen_dir/components/resources/about_credits.html" ]
+ outputs = [ "$root_build_dir/LICENSES.chromium.html" ]
}
group("licenses") {
data_deps = [
- ":electron_license",
":chromium_licenses",
- ]
-}
-
-copy("electron_version") {
- sources = [
- "ELECTRON_VERSION",
- ]
- outputs = [
- "$root_build_dir/version",
+ ":electron_license",
]
}
dist_zip("electron_dist_zip") {
data_deps = [
":electron_app",
+ ":electron_version_file",
":licenses",
- ":electron_version",
]
if (is_linux) {
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
}
- outputs = [
- "$root_build_dir/dist.zip",
- ]
+ deps = data_deps
+ outputs = [ "$root_build_dir/dist.zip" ]
}
dist_zip("electron_ffmpeg_zip") {
- data_deps = [
- "//third_party/ffmpeg",
- ]
- outputs = [
- "$root_build_dir/ffmpeg.zip",
- ]
+ data_deps = [ "//third_party/ffmpeg" ]
+ deps = data_deps
+ outputs = [ "$root_build_dir/ffmpeg.zip" ]
+}
+
+electron_chromedriver_deps = [
+ ":licenses",
+ "//chrome/test/chromedriver:chromedriver_server",
+ "//electron/buildflags",
+]
+
+group("electron_chromedriver") {
+ testonly = true
+ public_deps = electron_chromedriver_deps
}
dist_zip("electron_chromedriver_zip") {
testonly = true
- data_deps = [
- "//chrome/test/chromedriver",
- ":licenses",
- ]
- outputs = [
- "$root_build_dir/chromedriver.zip",
- ]
+ data_deps = electron_chromedriver_deps
+ deps = data_deps
+ outputs = [ "$root_build_dir/chromedriver.zip" ]
+}
+
+mksnapshot_deps = [
+ ":licenses",
+ "//v8:mksnapshot($v8_snapshot_toolchain)",
+]
+
+if (use_v8_context_snapshot) {
+ mksnapshot_deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)" ]
+}
+
+group("electron_mksnapshot") {
+ public_deps = mksnapshot_deps
}
dist_zip("electron_mksnapshot_zip") {
- data_deps = [
- "//v8:mksnapshot($v8_snapshot_toolchain)",
- "//tools/v8_context_snapshot:v8_context_snapshot_generator",
- ":licenses",
+ data_deps = mksnapshot_deps
+ deps = data_deps
+ outputs = [ "$root_build_dir/mksnapshot.zip" ]
+}
+
+copy("hunspell_dictionaries") {
+ sources = hunspell_dictionaries + hunspell_licenses
+ outputs = [ "$target_gen_dir/electron_hunspell/{{source_file_part}}" ]
+}
+
+dist_zip("hunspell_dictionaries_zip") {
+ data_deps = [ ":hunspell_dictionaries" ]
+ deps = data_deps
+ flatten = true
+
+ outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
+}
+
+copy("libcxx_headers") {
+ sources = libcxx_headers + libcxx_licenses + [
+ "//buildtools/third_party/libc++/__assertion_handler",
+ "//buildtools/third_party/libc++/__config_site",
+ ]
+ outputs = [ "$target_gen_dir/electron_libcxx_include/{{source_root_relative_dir}}/{{source_file_part}}" ]
+}
+
+dist_zip("libcxx_headers_zip") {
+ data_deps = [ ":libcxx_headers" ]
+ deps = data_deps
+ flatten = true
+ flatten_relative_to =
+ rebase_path(
+ "$target_gen_dir/electron_libcxx_include/third_party/libc++/src",
+ "$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" ]
+ deps = data_deps
+ flatten = true
+ flatten_relative_to = rebase_path(
+ "$target_gen_dir/electron_libcxxabi_include/third_party/libc++abi/src",
+ "$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" ]
+}
+
+##### node_headers
+
+node_dir = "../third_party/electron_node"
+node_headers_dir = "$root_gen_dir/node_headers"
+
+copy("zlib_headers") {
+ sources = [
+ "$node_dir/deps/zlib/zconf.h",
+ "$node_dir/deps/zlib/zlib.h",
]
- outputs = [
- "$root_build_dir/mksnapshot.zip",
+ outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ]
+}
+
+copy("node_gypi_headers") {
+ deps = [ ":generate_config_gypi" ]
+ sources = [
+ "$node_dir/common.gypi",
+ "$root_gen_dir/config.gypi",
]
+ outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ]
}
-group("electron") {
+action("node_version_header") {
+ inputs = [ "$node_dir/src/node_version.h" ]
+ outputs = [ "$node_headers_dir/include/node/node_version.h" ]
+ script = "script/node/generate_node_version_header.py"
+ args = rebase_path(inputs) + rebase_path(outputs)
+ if (node_module_version != "") {
+ args += [ "$node_module_version" ]
+ }
+}
+
+action("generate_node_headers") {
+ deps = [ ":generate_config_gypi" ]
+ script = "script/node/generate_node_headers.py"
+ outputs = [ "$root_gen_dir/node_headers.json" ]
+}
+
+action("tar_node_headers") {
+ deps = [ ":copy_node_headers" ]
+ outputs = [ "$root_gen_dir/node_headers.tar.gz" ]
+ script = "script/tar.py"
+ args = [
+ rebase_path("$root_gen_dir/node_headers"),
+ rebase_path(outputs[0]),
+ ]
+}
+
+group("copy_node_headers") {
public_deps = [
- ":electron_app",
+ ":generate_node_headers",
+ ":node_gypi_headers",
+ ":node_version_header",
+ ":zlib_headers",
]
}
+
+group("node_headers") {
+ public_deps = [ ":tar_node_headers" ]
+}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 33caac1a2f798..819fb406e6ef1 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,46 +1,135 @@
-# Contributor Covenant Code of Conduct:
+# Code of Conduct
-## Our Pledge
+As a member project of the OpenJS Foundation, Electron uses [Contributor Covenant v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct) as their code of conduct. The full text is included [below](#contributor-covenant-code-of-conduct) in English, and translations are available from the Contributor Covenant organisation:
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+* [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
+* [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/0)
-## Our Standards
+## Contributor Covenant Code of Conduct
-Examples of behavior that contributes to creating a positive environment include:
+### Our Pledge
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
-Examples of unacceptable behavior by participants include:
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
+### Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+### Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+### Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+### Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+[coc@electronjs.org](mailto:coc@electronjs.org).
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+### Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+#### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+#### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
-## Our Responsibilities
+#### 3. Temporary Ban
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
-## Scope
+#### 4. Permanent Ban
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
-## Enforcement
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [coc@electronjs.org](mailto:coc@electronjs.org). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+### Attribution
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
-## Attribution
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/inclusion).
-This Code of Conduct is adapted from the [Contributor-Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
+[homepage]: https://www.contributor-covenant.org
-[homepage]: https://contributor-covenant.org
-[version]: https://contributor-covenant.org/version/1/4/
+For answers to common questions about this code of conduct, see the FAQ at
+https://www.contributor-covenant.org/faq. Translations are available at
+https://www.contributor-covenant.org/translations.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 414f83db905db..c7cd2de29bc52 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,7 +12,7 @@ propose changes to this document in a pull request.
## [Issues](https://electronjs.org/docs/development/issues)
-Issues are created [here](https://github.com/electron/electron/issues/new).
+Issues are created [here](https://github.com/electron/electron/issues/new/choose).
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
@@ -20,13 +20,23 @@ Issues are created [here](https://github.com/electron/electron/issues/new).
* [Triaging a Bug Report](https://electronjs.org/docs/development/issues#triaging-a-bug-report)
* [Resolving a Bug Report](https://electronjs.org/docs/development/issues#resolving-a-bug-report)
-### Issue Maintenance and Closure
-* If an issue is inactive for 45 days (no activity of any kind), it will be
-marked for closure with `stale`.
-* If after this label is applied, no further activity occurs in the next 7 days,
-the issue will be closed.
- * If an issue has been closed and you still feel it's relevant, feel free to
- ping a maintainer or add a comment!
+### Issue Closure
+
+Bug reports will be closed if the issue has been inactive and the latest affected version no longer receives support. At the moment, Electron maintains its three latest major versions, with a new major version being released every 8 weeks. (For more information on Electron's release cadence, see [this blog post](https://electronjs.org/blog/8-week-cadence).)
+
+_If an issue has been closed and you still feel it's relevant, feel free to ping a maintainer or add a comment!_
+
+### Languages
+
+We accept issues in _any_ language.
+When an issue is posted in a language besides English, it is acceptable and encouraged to post an English-translated copy as a reply.
+Anyone may post the translated reply.
+In most cases, a quick pass through translation software is sufficient.
+Having the original text _as well as_ the translation can help mitigate translation errors.
+
+Responses to posted issues may or may not be in the original language.
+
+**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)
@@ -37,24 +47,28 @@ dependencies, and tools contained in the `electron/electron` repository.
* [Step 1: Fork](https://electronjs.org/docs/development/pull-requests#step-1-fork)
* [Step 2: Build](https://electronjs.org/docs/development/pull-requests#step-2-build)
* [Step 3: Branch](https://electronjs.org/docs/development/pull-requests#step-3-branch)
-* [The Process of Making Changes](https://electronjs.org/docs/development/pull-requests#the-process-of-making-changes)
+* [Making Changes](https://electronjs.org/docs/development/pull-requests#making-changes)
* [Step 4: Code](https://electronjs.org/docs/development/pull-requests#step-4-code)
* [Step 5: Commit](https://electronjs.org/docs/development/pull-requests#step-5-commit)
* [Commit message guidelines](https://electronjs.org/docs/development/pull-requests#commit-message-guidelines)
* [Step 6: Rebase](https://electronjs.org/docs/development/pull-requests#step-6-rebase)
* [Step 7: Test](https://electronjs.org/docs/development/pull-requests#step-7-test)
* [Step 8: Push](https://electronjs.org/docs/development/pull-requests#step-8-push)
- * [Step 8: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-8-opening-the-pull-request)
- * [Step 9: Discuss and Update](#step-9-discuss-and-update)
+ * [Step 9: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-9-opening-the-pull-request)
+ * [Step 10: Discuss and Update](https://electronjs.org/docs/development/pull-requests#step-10-discuss-and-update)
* [Approval and Request Changes Workflow](https://electronjs.org/docs/development/pull-requests#approval-and-request-changes-workflow)
- * [Step 10: Landing](https://electronjs.org/docs/development/pull-requests#step-10-landing)
+ * [Step 11: Landing](https://electronjs.org/docs/development/pull-requests#step-11-landing)
* [Continuous Integration Testing](https://electronjs.org/docs/development/pull-requests#continuous-integration-testing)
+### Dependencies Upgrades Policy
+
+Dependencies in Electron's `package.json` or `yarn.lock` files should only be altered by maintainers. For security reasons, we will not accept PRs that alter our `package.json` or `yarn.lock` files. We invite contributors to make requests updating these files in our issue tracker. If the change is significantly complicated, draft PRs are welcome, with the understanding that these PRs will be closed in favor of a duplicate PR submitted by an Electron maintainer.
+
## Style Guides
See [Coding Style](https://electronjs.org/docs/development/coding-style) for information about which standards Electron adheres to in different parts of its codebase.
## Further Reading
-For more in-depth guides on developing Electron, see
-[/docs/development](/docs/development/README.md)
\ No newline at end of file
+For more in-depth guides on developing Electron, see
+[/docs/development](/docs/development/README.md).
diff --git a/DEPS b/DEPS
index 6e5d1268bdd60..ae229b6c7ea52 100644
--- a/DEPS
+++ b/DEPS
@@ -1,32 +1,34 @@
-gclient_gn_args_file = 'src/build/config/gclient_args.gni'
-gclient_gn_args = [
- 'build_with_chromium',
- 'checkout_android',
- 'checkout_android_native_support',
- 'checkout_libaom',
- 'checkout_nacl',
- 'checkout_oculus_sdk'
-]
+gclient_gn_args_from = 'src'
vars = {
'chromium_version':
- 'f200986dfaabd6aad6a4b37dad7aae42fec349e9',
+ '139.0.7256.0',
'node_version':
- '229bd3245b2f54c12ea9ad0abcadbc209f8023dc',
+ 'v22.16.0',
'nan_version':
- '960dd6c70fc9eb136efdf37b4bef18fadbc3436f',
+ 'e14bdcd1f72d62bca1d541b66da43130384ec213',
+ 'squirrel.mac_version':
+ '0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',
+ 'reactiveobjc_version':
+ '74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
+ 'mantle_version':
+ '78d3966b3c331292ea29ec38661b25df0a245948',
+ 'engflow_reclient_configs_version':
+ '955335c30a752e9ef7bff375baab5e0819b6c00d',
- 'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
- 'requests_version': 'e4d59bedfd3c7f4f254f4f5d036587bcd8152458',
- 'boto_git': 'https://github.com/boto',
'chromium_git': 'https://chromium.googlesource.com',
'electron_git': 'https://github.com/electron',
- # FIXME: Once https://github.com/nodejs/nan/pull/857 lands this should point at nodejs/nan
- 'nodejs_git': 'https://github.com/marshallofsound',
- 'requests_git': 'https://github.com/kennethreitz',
+ 'nodejs_git': 'https://github.com/nodejs',
'yaml_git': 'https://github.com/yaml',
+ 'squirrel_git': 'https://github.com/Squirrel',
+ 'reactiveobjc_git': 'https://github.com/ReactiveCocoa',
+ 'mantle_git': 'https://github.com/Mantle',
+ 'engflow_git': 'https://github.com/EngFlow',
+
+ # The path of the sysroots.json file.
+ 'sysroots_json_path': 'electron/script/sysroots.json',
# KEEP IN SYNC WITH utils.js FILE
'yarn_version': '1.15.2',
@@ -34,32 +36,33 @@ vars = {
# To be able to build clean Chromium from sources.
'apply_patches': True,
- # Python interface to Amazon Web Services. Is used for releases only.
- 'checkout_boto': False,
+ # To use an mtime cache for patched files to speed up builds.
+ 'use_mtime_cache': True,
# To allow in-house builds to checkout those manually.
'checkout_chromium': True,
'checkout_node': True,
'checkout_nan': True,
+ 'checkout_pgo_profiles': True,
# It's only needed to parse the native tests configurations.
'checkout_pyyaml': False,
- # Python "requests" module is used for releases only.
- 'checkout_requests': False,
+ # Can be used to disable the sysroot hooks.
+ 'install_sysroot': True,
+
+ 'use_rts': False,
+
+ 'mac_xcode_version': 'default',
+
+ 'generate_location_tags': False,
# To allow running hooks without parsing the DEPS tree
'process_deps': True,
- # It is always needed for normal Electron builds,
- # but might be impossible for custom in-house builds.
- 'download_external_binaries': True,
-
'checkout_nacl':
False,
- 'checkout_libaom':
- True,
- 'checkout_oculus_sdk':
+ 'checkout_openxr':
False,
'build_with_chromium':
True,
@@ -67,6 +70,8 @@ vars = {
False,
'checkout_android_native_support':
False,
+ 'checkout_clang_tidy':
+ True,
}
deps = {
@@ -79,71 +84,127 @@ deps = {
'condition': 'checkout_nan and process_deps',
},
'src/third_party/electron_node': {
- 'url': (Var("electron_git")) + '/node.git@' + (Var("node_version")),
+ 'url': (Var("nodejs_git")) + '/node.git@' + (Var("node_version")),
'condition': 'checkout_node and process_deps',
},
- 'src/electron/vendor/pyyaml': {
+ 'src/third_party/pyyaml': {
'url': (Var("yaml_git")) + '/pyyaml.git@' + (Var("pyyaml_version")),
'condition': 'checkout_pyyaml and process_deps',
},
- 'src/electron/vendor/boto': {
- 'url': Var('boto_git') + '/boto.git' + '@' + Var('boto_version'),
- 'condition': 'checkout_boto and process_deps',
+ 'src/third_party/squirrel.mac': {
+ 'url': Var("squirrel_git") + '/Squirrel.Mac.git@' + Var("squirrel.mac_version"),
+ 'condition': 'process_deps',
},
- 'src/electron/vendor/requests': {
- 'url': Var('requests_git') + '/requests.git' + '@' + Var('requests_version'),
- 'condition': 'checkout_requests and process_deps',
+ 'src/third_party/squirrel.mac/vendor/ReactiveObjC': {
+ 'url': Var("reactiveobjc_git") + '/ReactiveObjC.git@' + Var("reactiveobjc_version"),
+ 'condition': 'process_deps'
},
+ 'src/third_party/squirrel.mac/vendor/Mantle': {
+ 'url': Var("mantle_git") + '/Mantle.git@' + Var("mantle_version"),
+ 'condition': 'process_deps',
+ },
+ 'src/third_party/engflow-reclient-configs': {
+ 'url': Var("engflow_git") + '/reclient-configs.git@' + Var("engflow_reclient_configs_version"),
+ 'condition': 'process_deps'
+ }
}
+pre_deps_hooks = [
+ {
+ 'name': 'generate_mtime_cache',
+ 'condition': '(checkout_chromium and apply_patches and use_mtime_cache) and process_deps',
+ 'pattern': 'src/electron',
+ 'action': [
+ 'python3',
+ 'src/electron/script/patches-mtime-cache.py',
+ 'generate',
+ '--cache-file',
+ 'src/electron/patches/mtime-cache.json',
+ '--patches-config',
+ 'src/electron/patches/config.json',
+ ],
+ },
+]
+
hooks = [
{
'name': 'patch_chromium',
'condition': '(checkout_chromium and apply_patches) and process_deps',
'pattern': 'src/electron',
'action': [
- 'python',
+ 'python3',
'src/electron/script/apply_all_patches.py',
'src/electron/patches/config.json',
],
},
{
- 'name': 'electron_external_binaries',
- 'pattern': 'src/electron/script/update-external-binaries.py',
- 'condition': 'download_external_binaries',
+ 'name': 'apply_mtime_cache',
+ 'condition': '(checkout_chromium and apply_patches and use_mtime_cache) and process_deps',
+ 'pattern': 'src/electron',
'action': [
- 'python',
- 'src/electron/script/update-external-binaries.py',
+ 'python3',
+ 'src/electron/script/patches-mtime-cache.py',
+ 'apply',
+ '--cache-file',
+ 'src/electron/patches/mtime-cache.json',
],
},
{
'name': 'electron_npm_deps',
'pattern': 'src/electron/package.json',
'action': [
- 'python',
+ 'python3',
'-c',
- 'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python", "script/lib/npx.py", "yarn@' + (Var("yarn_version")) + '", "install", "--frozen-lockfile"]);',
+ 'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python3", "script/lib/npx.py", "yarn@' + (Var("yarn_version")) + '", "install", "--frozen-lockfile"]);',
],
},
{
- 'name': 'setup_boto',
- 'pattern': 'src/electron',
- 'condition': 'checkout_boto and process_deps',
- 'action': [
- 'python',
- '-c',
- 'import os, subprocess; os.chdir(os.path.join("src", "electron", "vendor", "boto")); subprocess.check_call(["python", "setup.py", "build"]);',
- ],
+ 'name': 'sysroot_arm',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and checkout_arm',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=arm'],
},
{
- 'name': 'setup_requests',
- 'pattern': 'src/electron',
- 'condition': 'checkout_requests and process_deps',
- 'action': [
- 'python',
- '-c',
- 'import os, subprocess; os.chdir(os.path.join("src", "electron", "vendor", "requests")); subprocess.check_call(["python", "setup.py", "build"]);',
- ],
+ 'name': 'sysroot_arm64',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and checkout_arm64',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=arm64'],
+ },
+ {
+ 'name': 'sysroot_x86',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and (checkout_x86 or checkout_x64)',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=x86'],
+ },
+ {
+ 'name': 'sysroot_mips',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and checkout_mips',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=mips'],
+ },
+ {
+ 'name': 'sysroot_mips64',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and checkout_mips64',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=mips64el'],
+ },
+ {
+ 'name': 'sysroot_x64',
+ 'pattern': '.',
+ 'condition': 'install_sysroot and checkout_linux and checkout_x64',
+ 'action': ['python3', 'src/build/linux/sysroot_scripts/install-sysroot.py',
+ '--sysroots-json-path=' + Var('sysroots_json_path'),
+ '--arch=x64'],
},
]
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index bae76aaf3cb7e..0000000000000
--- a/Dockerfile
+++ /dev/null
@@ -1,47 +0,0 @@
-FROM ubuntu:18.04
-
-RUN groupadd --gid 1000 builduser \
- && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
-
-# Set up TEMP directory
-ENV TEMP=/tmp
-RUN chmod a+rwx /tmp
-
-# Install Linux packages
-ADD build/install-build-deps.sh /setup/install-build-deps.sh
-RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
- curl \
- libnotify-bin \
- locales \
- lsb-release \
- nano \
- python-dbus \
- python-pip \
- python-setuptools \
- sudo \
- vim-nox \
- wget \
- && /setup/install-build-deps.sh --syms --no-prompt --no-chromeos-fonts --lib32 --arm \
- && rm -rf /var/lib/apt/lists/*
-
-# Install Node.js
-RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
- && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs \
- && rm -rf /var/lib/apt/lists/*
-
-# crcmod is required by gsutil, which is used for filling the gclient git cache
-RUN pip install -U crcmod
-
-# dbusmock is needed for Electron tests
-RUN pip install python-dbusmock
-
-RUN mkdir /tmp/workspace
-RUN chown builduser:builduser /tmp/workspace
-
-# Add xvfb init script
-ADD tools/xvfb-init.sh /etc/init.d/xvfb
-RUN chmod a+x /etc/init.d/xvfb
-
-USER builduser
-WORKDIR /home/builduser
diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7
deleted file mode 100644
index a84467c3b9462..0000000000000
--- a/Dockerfile.arm32v7
+++ /dev/null
@@ -1,61 +0,0 @@
-FROM arm32v7/ubuntu:18.04
-
-RUN groupadd --gid 1000 builduser \
- && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
-
-# Set up TEMP directory
-ENV TEMP=/tmp
-RUN chmod a+rwx /tmp
-
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
- bison \
- build-essential \
- clang \
- curl \
- gperf \
- git \
- libasound2 \
- libasound2-dev \
- libcap-dev \
- libcups2-dev \
- libdbus-1-dev \
- libgconf-2-4 \
- libgconf2-dev \
- libgnome-keyring-dev \
- libgtk2.0-0 \
- libgtk2.0-dev \
- libgtk-3-0 \
- libgtk-3-dev \
- libnotify-bin \
- libnss3 \
- libnss3-dev \
- libxss1 \
- libxtst-dev \
- libxtst6 \
- lsb-release \
- locales \
- nano \
- python-setuptools \
- python-pip \
- python-dbusmock \
- sudo \
- unzip \
- wget \
- xvfb \
-&& rm -rf /var/lib/apt/lists/*
-
-# Install Node.js
-RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
- && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs \
- && rm -rf /var/lib/apt/lists/*
-
-# crcmod is required by gsutil, which is used for filling the gclient git cache
-RUN pip install -U crcmod
-
-ADD tools/xvfb-init.sh /etc/init.d/xvfb
-RUN chmod a+x /etc/init.d/xvfb
-
-RUN usermod -aG sudo builduser
-RUN echo 'builduser ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers
-
-WORKDIR /home/builduser
diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8
deleted file mode 100644
index 50f72bf98d521..0000000000000
--- a/Dockerfile.arm64v8
+++ /dev/null
@@ -1,65 +0,0 @@
-FROM arm64v8/ubuntu:16.04
-
-RUN groupadd --gid 1000 builduser \
- && useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
-
-# Set up TEMP directory
-ENV TEMP=/tmp
-RUN chmod a+rwx /tmp
-
-RUN dpkg --add-architecture armhf
-
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
- bison \
- build-essential \
- clang \
- curl \
- gperf \
- git \
- libasound2 \
- libasound2-dev \
- libc6:armhf \
- libcap-dev \
- libcups2-dev \
- libdbus-1-dev \
- libgconf-2-4 \
- libgconf2-dev \
- libgnome-keyring-dev \
- libgtk2.0-0 \
- libgtk2.0-dev \
- libgtk-3-0 \
- libgtk-3-dev \
- libnotify-bin \
- libnss3 \
- libnss3-dev \
- libstdc++6:armhf \
- libxss1 \
- libxtst-dev \
- libxtst6 \
- lsb-release \
- locales \
- nano \
- python-setuptools \
- python-pip \
- python-dbusmock \
- sudo \
- unzip \
- wget \
- xvfb \
-&& rm -rf /var/lib/apt/lists/*
-
-# Install Node.js
-RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
- && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs \
- && rm -rf /var/lib/apt/lists/*
-
-# crcmod is required by gsutil, which is used for filling the gclient git cache
-RUN pip install -U crcmod
-
-ADD tools/xvfb-init.sh /etc/init.d/xvfb
-RUN chmod a+x /etc/init.d/xvfb
-
-RUN usermod -aG sudo builduser
-RUN echo 'builduser ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers
-
-WORKDIR /home/builduser
diff --git a/ELECTRON_VERSION b/ELECTRON_VERSION
deleted file mode 100644
index b07f1a3d5c027..0000000000000
--- a/ELECTRON_VERSION
+++ /dev/null
@@ -1 +0,0 @@
-7.0.0-nightly.20190613
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 54ff135e7920e..536d54efc3fd3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,5 @@
-Copyright (c) 2013-2019 GitHub Inc.
+Copyright (c) Electron contributors
+Copyright (c) 2013-2020 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/README.md b/README.md
index d2f55b962545c..2ab98ce41009b 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,21 @@
[](https://electronjs.org)
+[](https://github.com/electron/electron/actions/workflows/build.yml)
+[](https://discord.gg/electronjs)
-[](https://circleci.com/gh/electron/electron/tree/master)
-[](https://windows-ci.electronjs.org/project/AppVeyor/electron/branch/master)
-[](https://github.visualstudio.com/electron/_build/latest?definitionId=36)
-[](https://david-dm.org/electron/electron?type=dev)
-[](https://atom-slack.herokuapp.com/)
-
-:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱.
-View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
+:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
+View these docs in other languages on our [Crowdin](https://crowdin.com/project/electron) project.
The Electron framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
-[Chromium](https://www.chromium.org) and is used by the [Atom
-editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).
+[Chromium](https://www.chromium.org) and is used by the
+[Visual Studio Code](https://github.com/Microsoft/vscode/) and many other [apps](https://electronjs.org/apps).
-Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
+Follow [@electronjs](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the Contributor Covenant
-[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).
+[code of conduct](https://github.com/electron/electron/tree/main/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to [coc@electronjs.org](mailto:coc@electronjs.org).
@@ -30,43 +26,36 @@ The preferred method is to install Electron as a development dependency in your
app:
```sh
-npm install electron --save-dev [--save-exact]
+npm install electron --save-dev
```
-The `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic
-versioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see
+For more installation options and troubleshooting tips, see
+[installation](docs/tutorial/installation.md). For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
-For more installation options and troubleshooting tips, see
-[installation](docs/tutorial/installation.md).
+## Platform support
+
+Each Electron release provides binaries for macOS, Windows, and Linux.
+
+* macOS (Big Sur and up): Electron provides 64-bit Intel and Apple Silicon / ARM binaries for macOS.
+* Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice).
+* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
+ * Ubuntu 18.04 and newer
+ * Fedora 32 and newer
+ * Debian 10 and newer
-## Quick start & Electron Fiddle
+## Electron Fiddle
Use [`Electron Fiddle`](https://github.com/electron/fiddle)
to build, run, and package small Electron experiments, to see code examples for all of Electron's APIs, and
to try out different versions of Electron. It's designed to make the start of your journey with
Electron easier.
-Alternatively, clone and run the
-[electron/electron-quick-start](https://github.com/electron/electron-quick-start)
-repository to see a minimal Electron app in action:
-
-```sh
-git clone https://github.com/electron/electron-quick-start
-cd electron-quick-start
-npm install
-npm start
-```
-
## Resources for learning Electron
-- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
-- [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments
-- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
-- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
-- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
-- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron
-- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs
+* [electronjs.org/docs](https://electronjs.org/docs) - All of Electron's documentation
+* [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments
+* [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - Sample starter apps created by the community
## Programmatic usage
@@ -76,7 +65,7 @@ binary. Use this to spawn Electron from Node scripts:
```javascript
const electron = require('electron')
-const proc = require('child_process')
+const proc = require('node:child_process')
// will print something similar to /Users/maf/.../Electron
console.log(electron)
@@ -87,11 +76,15 @@ const child = proc.spawn(electron)
### Mirrors
-- [China](https://npm.taobao.org/mirrors/electron)
+* [China](https://npmmirror.com/mirrors/electron/)
+
+See the [Advanced Installation Instructions](https://www.electronjs.org/docs/latest/tutorial/installation#mirror) to learn how to use a custom mirror.
-## Documentation Translations
+## Documentation translations
-Find documentation translations in [electron/i18n](https://github.com/electron/i18n).
+We crowdsource translations for our documentation via [Crowdin](https://crowdin.com/project/electron).
+We currently accept translations for Chinese (Simplified), French, German, Japanese, Portuguese,
+Russian, and Spanish.
## Contributing
@@ -100,10 +93,10 @@ If you are interested in reporting/fixing issues and contributing directly to th
## Community
Info on reporting bugs, getting help, finding third-party tools and sample apps,
-and more can be found in the [support document](docs/tutorial/support.md#finding-support).
+and more can be found on the [Community page](https://www.electronjs.org/community).
## License
-[MIT](https://github.com/electron/electron/blob/master/LICENSE)
+[MIT](https://github.com/electron/electron/blob/main/LICENSE)
-When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).
+When using Electron logos, make sure to follow [OpenJS Foundation Trademark Policy](https://trademark-policy.openjsf.org/).
diff --git a/SECURITY.md b/SECURITY.md
index c113ff00e06f0..ebf5d628d18ee 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,11 +2,16 @@
The Electron team and community take security bugs in Electron seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
-To report a security issue, email [security@electronjs.org](mailto:security@electronjs.org) and include the word "SECURITY" in the subject line.
+To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/electron/electron/security/advisories/new) tab.
The Electron team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
-Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [Node Security Project](https://nodesecurity.io/report).
+Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [npm contact form](https://www.npmjs.com/support) by selecting "I'm reporting a security vulnerability".
+
+## The Electron Security Notification Process
+
+For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md) Governance document.
## Learning More About Security
+
To learn more about securing an Electron application, please see the [security tutorial](docs/tutorial/security.md).
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 2b3fca16df4fd..0000000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,130 +0,0 @@
-# The config expects the following environment variables to be set:
-# - "GN_CONFIG" Build type. One of {'debug', 'testing', 'release'}.
-# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
-# e.g. 'target_cpu="x86"' to build for a 32bit platform.
-# https://gn.googlesource.com/gn/+/master/docs/reference.md#target_cpu
-# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordningly
-# if you pass a custom value for 'target_cpu'.
-# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
-# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
-# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
-# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
-# Is used in some publishing scripts, but does NOT affect the Electron binary.
-# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
-# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
-# Otherwise the release will be uploaded to the Github Releases.
-# (The value is only checked if "ELECTRON_RELEASE" is defined.)
-#
-# The publishing scripts expect access tokens to be defined as env vars,
-# but those are not covered here.
-#
-# AppVeyor docs on variables:
-# https://www.appveyor.com/docs/environment-variables/
-# https://www.appveyor.com/docs/build-configuration/#secure-variables
-# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
-
-# Uncomment these lines to enable RDP
-#on_finish:
-# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-
-version: 1.0.{build}
-build_cloud: libcc-20
-image: libcc-20-vs2017-15.9
-environment:
- GIT_CACHE_PATH: C:\Users\electron\libcc_cache
- ELECTRON_OUT_DIR: Default
- ELECTRON_ENABLE_STACK_DUMPING: 1
-notifications:
- - provider: Webhook
- url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
- method: POST
- headers:
- x-mission-control-secret:
- secure: 90BLVPcqhJPG7d24v0q/RRray6W3wDQ8uVQlQjOHaBWkw1i8FoA1lsjr2C/v1dVok+tS2Pi6KxDctPUkwIb4T27u4RhvmcPzQhVpfwVJAG9oNtq+yKN7vzHfg7k/pojEzVdJpQLzeJGcSrZu7VY39Q==
- on_build_success: false
- on_build_failure: true
- on_build_status_changed: false
-build_script:
- - ps: >-
- if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
- Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
- }
- - echo "Building $env:GN_CONFIG build"
- - git config --global core.longpaths true
- - cd ..
- - ps: if (Test-Path src\electron) { Remove-Item src\electron -Recurse }
- - 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 --reset
- - cd src
- - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
- - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS%"
- - gn check out/Default //electron:electron_lib
- - gn check out/Default //electron:electron_app
- - gn check out/Default //electron:manifests
- - gn check out/Default //electron/atom/common/api:mojo
- - ninja -C out/Default electron:electron_app
- - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- - ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- - ninja -C out/Default electron:electron_dist_zip
- - ninja -C out/Default electron:electron_mksnapshot_zip
- - ninja -C out/Default electron:electron_chromedriver_zip
- - 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') {
- ninja -C out/Default third_party/breakpad:dump_syms
- }
- - if "%GN_CONFIG%"=="release" ( python electron\script\dump-symbols.py -d %cd%\out\Default\breakpad_symbols -v)
- - ps: >-
- if ($env:GN_CONFIG -eq 'release') {
- python electron\script\zip-symbols.py
- appveyor PushArtifact out/Default/symbols.zip
- }
- - python electron/script/check-zip-manifest.py out/Default/dist.zip electron/script/dist_zip.win.%TARGET_ARCH%.manifest
-test_script:
- # Workaround for https://github.com/appveyor/ci/issues/2420
- - set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- - ps: >-
- if ((-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) {
- $env:RUN_TESTS="true"
- }
- - ps: >-
- if ($env:RUN_TESTS -eq 'true') {
- New-Item .\out\Default\gen\node_headers\Release -Type directory
- Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
- } else {
- echo "Skipping tests for $env:GN_CONFIG build"
- }
- - cd electron
- - if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --ci --enable-logging)
- - cd ..
- - if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- - echo "About to verify mksnapshot"
- - if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- - echo "Done verifying mksnapshot"
-deploy_script:
- - cd electron
- - ps: >-
- if (Test-Path Env:\ELECTRON_RELEASE) {
- if (Test-Path Env:\UPLOAD_TO_S3) {
- Write-Output "Uploading Electron release distribution to s3"
- & python script\upload.py --upload_to_s3
- } else {
- Write-Output "Uploading Electron release distribution to github releases"
- & python script\upload.py
- }
- }
diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc
deleted file mode 100644
index 17effdfa07729..0000000000000
--- a/atom/app/atom_content_client.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright (c) 2014 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/atom_content_client.h"
-
-#include
-#include
-
-#include "atom/common/options_switches.h"
-#include "base/command_line.h"
-#include "base/files/file_util.h"
-#include "base/strings/string_split.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "content/public/common/content_constants.h"
-#include "content/public/common/pepper_plugin_info.h"
-#include "electron/buildflags/buildflags.h"
-#include "ppapi/shared_impl/ppapi_permissions.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "url/url_constants.h"
-// In SHARED_INTERMEDIATE_DIR.
-#include "widevine_cdm_version.h" // NOLINT(build/include)
-
-#if defined(WIDEVINE_CDM_AVAILABLE)
-#include "base/native_library.h"
-#include "content/public/common/cdm_info.h"
-#include "media/base/video_codecs.h"
-#endif // defined(WIDEVINE_CDM_AVAILABLE)
-
-#if BUILDFLAG(ENABLE_PDF_VIEWER)
-#include "atom/common/atom_constants.h"
-#include "pdf/pdf.h"
-#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
-
-namespace atom {
-
-namespace {
-
-#if defined(WIDEVINE_CDM_AVAILABLE)
-bool IsWidevineAvailable(
- base::FilePath* cdm_path,
- std::vector* codecs_supported,
- base::flat_set* session_types_supported,
- base::flat_set* modes_supported) {
- static enum {
- NOT_CHECKED,
- FOUND,
- NOT_FOUND,
- } widevine_cdm_file_check = NOT_CHECKED;
-
- if (widevine_cdm_file_check == NOT_CHECKED) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- *cdm_path = command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
- if (!cdm_path->empty()) {
- *cdm_path = cdm_path->AppendASCII(
- base::GetNativeLibraryName(kWidevineCdmLibraryName));
- widevine_cdm_file_check = base::PathExists(*cdm_path) ? FOUND : NOT_FOUND;
- }
- }
-
- if (widevine_cdm_file_check == FOUND) {
- // Add the supported codecs as if they came from the component manifest.
- // This list must match the CDM that is being bundled with Chrome.
- codecs_supported->push_back(media::VideoCodec::kCodecVP8);
- codecs_supported->push_back(media::VideoCodec::kCodecVP9);
-#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- codecs_supported->push_back(media::VideoCodec::kCodecH264);
-#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
-
- // TODO(crbug.com/767941): Push persistent-license support info here once
- // we check in a new CDM that supports it on Linux.
- session_types_supported->insert(media::CdmSessionType::kTemporary);
-#if defined(OS_CHROMEOS)
- session_types_supported->insert(media::CdmSessionType::kPersistentLicense);
-#endif // defined(OS_CHROMEOS)
-
- modes_supported->insert(media::EncryptionMode::kCenc);
-
- return true;
- }
-
- return false;
-}
-#endif // defined(WIDEVINE_CDM_AVAILABLE)
-
-#if BUILDFLAG(ENABLE_PEPPER_FLASH)
-content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
- const std::string& version) {
- content::PepperPluginInfo plugin;
-
- plugin.is_out_of_process = true;
- plugin.name = content::kFlashPluginName;
- plugin.path = path;
- plugin.permissions = ppapi::PERMISSION_ALL_BITS;
-
- std::vector flash_version_numbers = base::SplitString(
- version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
- if (flash_version_numbers.empty())
- flash_version_numbers.push_back("11");
- // |SplitString()| puts in an empty string given an empty string. :(
- else if (flash_version_numbers[0].empty())
- flash_version_numbers[0] = "11";
- if (flash_version_numbers.size() < 2)
- flash_version_numbers.push_back("2");
- if (flash_version_numbers.size() < 3)
- flash_version_numbers.push_back("999");
- if (flash_version_numbers.size() < 4)
- flash_version_numbers.push_back("999");
- // E.g., "Shockwave Flash 10.2 r154":
- plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
- flash_version_numbers[1] + " r" +
- flash_version_numbers[2];
- plugin.version = base::JoinString(flash_version_numbers, ".");
- content::WebPluginMimeType swf_mime_type(content::kFlashPluginSwfMimeType,
- content::kFlashPluginSwfExtension,
- content::kFlashPluginSwfDescription);
- plugin.mime_types.push_back(swf_mime_type);
- content::WebPluginMimeType spl_mime_type(content::kFlashPluginSplMimeType,
- content::kFlashPluginSplExtension,
- content::kFlashPluginSplDescription);
- plugin.mime_types.push_back(spl_mime_type);
-
- return plugin;
-}
-
-void AddPepperFlashFromCommandLine(
- base::CommandLine* command_line,
- std::vector* plugins) {
- base::FilePath flash_path =
- command_line->GetSwitchValuePath(switches::kPpapiFlashPath);
- if (flash_path.empty())
- return;
-
- auto flash_version =
- command_line->GetSwitchValueASCII(switches::kPpapiFlashVersion);
-
- plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
-}
-#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
-
-void ComputeBuiltInPlugins(std::vector* plugins) {
-#if BUILDFLAG(ENABLE_PDF_VIEWER)
- content::PepperPluginInfo pdf_info;
- pdf_info.is_internal = true;
- pdf_info.is_out_of_process = true;
- pdf_info.name = "Chromium PDF Viewer";
- pdf_info.description = "Portable Document Format";
- pdf_info.path = base::FilePath::FromUTF8Unsafe(kPdfPluginPath);
- content::WebPluginMimeType pdf_mime_type(kPdfPluginMimeType, "pdf",
- "Portable Document Format");
- pdf_info.mime_types.push_back(pdf_mime_type);
- pdf_info.internal_entry_points.get_interface = chrome_pdf::PPP_GetInterface;
- pdf_info.internal_entry_points.initialize_module =
- chrome_pdf::PPP_InitializeModule;
- pdf_info.internal_entry_points.shutdown_module =
- chrome_pdf::PPP_ShutdownModule;
- pdf_info.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
- plugins->push_back(pdf_info);
-#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
-}
-
-void ConvertStringWithSeparatorToVector(std::vector* vec,
- const char* separator,
- const char* cmd_switch) {
- auto* command_line = base::CommandLine::ForCurrentProcess();
- auto string_with_separator = command_line->GetSwitchValueASCII(cmd_switch);
- if (!string_with_separator.empty())
- *vec = base::SplitString(string_with_separator, separator,
- base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
-}
-
-} // namespace
-
-AtomContentClient::AtomContentClient() {}
-
-AtomContentClient::~AtomContentClient() {}
-
-base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
- return l10n_util::GetStringUTF16(message_id);
-}
-
-base::StringPiece AtomContentClient::GetDataResource(
- int resource_id,
- ui::ScaleFactor scale_factor) const {
- return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
- resource_id, scale_factor);
-}
-
-gfx::Image& AtomContentClient::GetNativeImageNamed(int resource_id) const {
- return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(
- resource_id);
-}
-
-base::RefCountedMemory* AtomContentClient::GetDataResourceBytes(
- int resource_id) const {
- return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- resource_id);
-}
-
-void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
- std::vector splited;
- ConvertStringWithSeparatorToVector(&splited, ",",
- switches::kServiceWorkerSchemes);
- for (const std::string& scheme : splited)
- schemes->service_worker_schemes.push_back(scheme);
- schemes->service_worker_schemes.push_back(url::kFileScheme);
-
- ConvertStringWithSeparatorToVector(&splited, ",", switches::kStandardSchemes);
- for (const std::string& scheme : splited)
- schemes->standard_schemes.push_back(scheme);
- schemes->standard_schemes.push_back("chrome-extension");
-
- ConvertStringWithSeparatorToVector(&splited, ",", switches::kSecureSchemes);
- for (const std::string& scheme : splited)
- schemes->secure_schemes.push_back(scheme);
-
- ConvertStringWithSeparatorToVector(&splited, ",",
- switches::kBypassCSPSchemes);
- for (const std::string& scheme : splited)
- schemes->csp_bypassing_schemes.push_back(scheme);
-
- ConvertStringWithSeparatorToVector(&splited, ",", switches::kCORSSchemes);
- for (const std::string& scheme : splited)
- schemes->cors_enabled_schemes.push_back(scheme);
-}
-
-void AtomContentClient::AddPepperPlugins(
- std::vector* plugins) {
-#if BUILDFLAG(ENABLE_PEPPER_FLASH)
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- AddPepperFlashFromCommandLine(command_line, plugins);
-#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
- ComputeBuiltInPlugins(plugins);
-}
-
-void AtomContentClient::AddContentDecryptionModules(
- std::vector* cdms,
- std::vector* cdm_host_file_paths) {
- if (cdms) {
-#if defined(WIDEVINE_CDM_AVAILABLE)
- base::FilePath cdm_path;
- std::vector video_codecs_supported;
- base::flat_set session_types_supported;
- base::flat_set encryption_modes_supported;
- if (IsWidevineAvailable(&cdm_path, &video_codecs_supported,
- &session_types_supported,
- &encryption_modes_supported)) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- auto cdm_version_string =
- command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion);
- // CdmInfo needs |path| to be the actual Widevine library,
- // not the adapter, so adjust as necessary. It will be in the
- // same directory as the installed adapter.
- const base::Version version(cdm_version_string);
- DCHECK(version.IsValid());
-
- content::CdmCapability capability(
- video_codecs_supported, encryption_modes_supported,
- session_types_supported, base::flat_set());
-
- cdms->push_back(content::CdmInfo(
- kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path,
- kWidevineCdmFileSystemId, capability, kWidevineKeySystem, false));
- }
-#endif // defined(WIDEVINE_CDM_AVAILABLE)
- }
-}
-
-bool AtomContentClient::IsDataResourceGzipped(int resource_id) const {
- return ui::ResourceBundle::GetSharedInstance().IsGzipped(resource_id);
-}
-
-} // namespace atom
diff --git a/atom/app/atom_content_client.h b/atom/app/atom_content_client.h
deleted file mode 100644
index 9c7034df435a0..0000000000000
--- a/atom/app/atom_content_client.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2014 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_ATOM_CONTENT_CLIENT_H_
-#define ATOM_APP_ATOM_CONTENT_CLIENT_H_
-
-#include
-#include
-#include
-
-#include "content/public/common/content_client.h"
-
-namespace atom {
-
-class AtomContentClient : public content::ContentClient {
- public:
- AtomContentClient();
- ~AtomContentClient() override;
-
- protected:
- // content::ContentClient:
- base::string16 GetLocalizedString(int message_id) const override;
- base::StringPiece GetDataResource(int resource_id,
- ui::ScaleFactor) const override;
- gfx::Image& GetNativeImageNamed(int resource_id) const override;
- base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override;
- void AddAdditionalSchemes(Schemes* schemes) override;
- void AddPepperPlugins(
- std::vector* plugins) override;
- void AddContentDecryptionModules(
- std::vector* cdms,
- std::vector* cdm_host_file_paths) override;
- bool IsDataResourceGzipped(int resource_id) const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AtomContentClient);
-};
-
-} // namespace atom
-
-#endif // ATOM_APP_ATOM_CONTENT_CLIENT_H_
diff --git a/atom/app/atom_library_main.h b/atom/app/atom_library_main.h
deleted file mode 100644
index 71207f0fd7909..0000000000000
--- a/atom/app/atom_library_main.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_ATOM_LIBRARY_MAIN_H_
-#define ATOM_APP_ATOM_LIBRARY_MAIN_H_
-
-#include "build/build_config.h"
-#include "electron/buildflags/buildflags.h"
-
-#if defined(OS_MACOSX)
-extern "C" {
-__attribute__((visibility("default"))) int AtomMain(int argc, char* argv[]);
-
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
-__attribute__((visibility("default"))) int AtomInitializeICUandStartNode(
- int argc,
- char* argv[]);
-#endif
-}
-#endif // OS_MACOSX
-
-#endif // ATOM_APP_ATOM_LIBRARY_MAIN_H_
diff --git a/atom/app/atom_library_main.mm b/atom/app/atom_library_main.mm
deleted file mode 100644
index bd241ca2f74f1..0000000000000
--- a/atom/app/atom_library_main.mm
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/atom_library_main.h"
-
-#include "atom/app/atom_main_delegate.h"
-#include "atom/app/node_main.h"
-#include "atom/common/atom_command_line.h"
-#include "atom/common/mac/main_application_bundle.h"
-#include "base/at_exit.h"
-#include "base/i18n/icu_util.h"
-#include "base/mac/bundle_locations.h"
-#include "base/mac/scoped_nsautorelease_pool.h"
-#include "content/public/app/content_main.h"
-
-int AtomMain(int argc, char* argv[]) {
- atom::AtomMainDelegate delegate;
- content::ContentMainParams params(&delegate);
- params.argc = argc;
- params.argv = const_cast(argv);
- atom::AtomCommandLine::Init(argc, argv);
- return content::ContentMain(params);
-}
-
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
-int AtomInitializeICUandStartNode(int argc, char* argv[]) {
- base::AtExitManager atexit_manager;
- base::mac::ScopedNSAutoreleasePool pool;
- base::mac::SetOverrideFrameworkBundlePath(
- atom::MainApplicationBundlePath()
- .Append("Contents")
- .Append("Frameworks")
- .Append(ATOM_PRODUCT_NAME " Framework.framework"));
- base::i18n::InitializeICU();
- return atom::NodeMain(argc, argv);
-}
-#endif
diff --git a/atom/app/atom_login_helper.mm b/atom/app/atom_login_helper.mm
deleted file mode 100644
index 7e9585d80b6a6..0000000000000
--- a/atom/app/atom_login_helper.mm
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2017 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#import
-
-int main(int argc, char* argv[]) {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSArray* pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents];
- pathComponents = [pathComponents
- subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)];
- NSString* path = [NSString pathWithComponents:pathComponents];
- [[NSWorkspace sharedWorkspace] launchApplication:path];
- [pool drain];
- return 0;
-}
diff --git a/atom/app/atom_main.cc b/atom/app/atom_main.cc
deleted file mode 100644
index beef50e64f03b..0000000000000
--- a/atom/app/atom_main.cc
+++ /dev/null
@@ -1,252 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/atom_main.h"
-
-#include
-#include
-#include
-#include
-
-#if defined(OS_WIN)
-#include // windows.h must be included first
-
-#include // ensures that ATL statics like `_AtlWinModule` are initialized (it's an issue in static debug build)
-#include
-#include
-#include
-
-#include "atom/app/atom_main_delegate.h"
-#include "atom/app/command_line_args.h"
-#include "atom/common/crash_reporter/win/crash_service_main.h"
-#include "base/environment.h"
-#include "base/process/launch.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/win/windows_version.h"
-#include "content/public/app/sandbox_helper_win.h"
-#include "sandbox/win/src/sandbox_types.h"
-#elif defined(OS_LINUX) // defined(OS_WIN)
-#include
-#include
-#include "atom/app/atom_main_delegate.h" // NOLINT
-#include "content/public/app/content_main.h"
-#else // defined(OS_LINUX)
-#include
-#include
-#include
-#include "atom/app/atom_library_main.h"
-#endif // defined(OS_MACOSX)
-
-#include "atom/app/node_main.h"
-#include "atom/common/atom_command_line.h"
-#include "atom/common/atom_constants.h"
-#include "base/at_exit.h"
-#include "base/i18n/icu_util.h"
-#include "electron/buildflags/buildflags.h"
-
-#if defined(HELPER_EXECUTABLE) && !defined(MAS_BUILD)
-#include "sandbox/mac/seatbelt_exec.h" // nogncheck
-#endif
-
-namespace {
-
-ALLOW_UNUSED_TYPE bool IsEnvSet(const char* name) {
-#if defined(OS_WIN)
- size_t required_size;
- getenv_s(&required_size, nullptr, 0, name);
- return required_size != 0;
-#else
- char* indicator = getenv(name);
- return indicator && indicator[0] != '\0';
-#endif
-}
-
-#if defined(OS_POSIX)
-void FixStdioStreams() {
- // libuv may mark stdin/stdout/stderr as close-on-exec, which interferes
- // with chromium's subprocess spawning. As a workaround, we detect if these
- // streams are closed on startup, and reopen them as /dev/null if necessary.
- // Otherwise, an unrelated file descriptor will be assigned as stdout/stderr
- // which may cause various errors when attempting to write to them.
- //
- // For details see https://github.com/libuv/libuv/issues/2062
- struct stat st;
- if (fstat(STDIN_FILENO, &st) < 0 && errno == EBADF)
- ignore_result(freopen("/dev/null", "r", stdin));
- if (fstat(STDOUT_FILENO, &st) < 0 && errno == EBADF)
- ignore_result(freopen("/dev/null", "w", stdout));
- if (fstat(STDERR_FILENO, &st) < 0 && errno == EBADF)
- ignore_result(freopen("/dev/null", "w", stderr));
-}
-#endif
-
-} // namespace
-
-#if defined(OS_WIN)
-
-namespace crash_reporter {
-extern const char kCrashpadProcess[];
-}
-
-int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
- struct Arguments {
- int argc = 0;
- wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
-
- ~Arguments() { LocalFree(argv); }
- } arguments;
-
- if (!arguments.argv)
- return -1;
-
-#ifdef _DEBUG
- // Don't display assert dialog boxes in CI test runs
- static const char* kCI = "ELECTRON_CI";
- bool is_ci = IsEnvSet(kCI);
- if (!is_ci) {
- for (int i = 0; i < arguments.argc; ++i) {
- if (!_wcsicmp(arguments.argv[i], L"--ci")) {
- is_ci = true;
- _putenv_s(kCI, "1"); // set flag for child processes
- break;
- }
- }
- }
- if (is_ci) {
- _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
-
- _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
-
- _set_error_mode(_OUT_TO_STDERR);
- }
-#endif
-
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
- bool run_as_node = IsEnvSet(atom::kRunAsNode);
-#else
- bool run_as_node = false;
-#endif
-
- // Make sure the output is printed to console.
- if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE"))
- base::RouteStdioToConsole(false);
-
-#ifndef DEBUG
- // Chromium has its own TLS subsystem which supports automatic destruction
- // of thread-local data, and also depends on memory allocation routines
- // provided by the CRT. The problem is that the auto-destruction mechanism
- // uses a hidden feature of the OS loader which calls a callback on thread
- // exit, but only after all loaded DLLs have been detached. Since the CRT is
- // also a DLL, it happens that by the time Chromium's `OnThreadExit` function
- // is called, the heap functions, though still in memory, no longer perform
- // their duties, and when Chromium calls `free` on its buffer, it triggers
- // an access violation error.
- // We work around this problem by invoking Chromium's `OnThreadExit` in time
- // from within the CRT's atexit facility, ensuring the heap functions are
- // still active. The second invocation from the OS loader will be a no-op.
- extern void NTAPI OnThreadExit(PVOID module, DWORD reason, PVOID reserved);
- atexit([]() { OnThreadExit(nullptr, DLL_THREAD_DETACH, nullptr); });
-#endif
-
- std::vector argv(arguments.argc);
- std::transform(arguments.argv, arguments.argv + arguments.argc, argv.begin(),
- [](auto& a) { return _strdup(base::WideToUTF8(a).c_str()); });
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
- if (run_as_node) {
- base::AtExitManager atexit_manager;
- base::i18n::InitializeICU();
- auto ret = atom::NodeMain(argv.size(), argv.data());
- std::for_each(argv.begin(), argv.end(), free);
- return ret;
- }
-#endif
-
- base::CommandLine::Init(argv.size(), argv.data());
- const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
- if (cmd_line.GetSwitchValueASCII("type") ==
- crash_reporter::kCrashpadProcess) {
- return crash_service::Main(&argv);
- }
-
- if (!atom::CheckCommandLineArguments(arguments.argc, arguments.argv))
- return -1;
-
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- content::InitializeSandboxInfo(&sandbox_info);
- atom::AtomMainDelegate delegate;
-
- content::ContentMainParams params(&delegate);
- params.instance = instance;
- params.sandbox_info = &sandbox_info;
- atom::AtomCommandLine::Init(arguments.argc, arguments.argv);
- return content::ContentMain(params);
-}
-
-#elif defined(OS_LINUX) // defined(OS_WIN)
-
-int main(int argc, char* argv[]) {
- FixStdioStreams();
-
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
- if (IsEnvSet(atom::kRunAsNode)) {
- base::i18n::InitializeICU();
- base::AtExitManager atexit_manager;
- return atom::NodeMain(argc, argv);
- }
-#endif
-
- atom::AtomMainDelegate delegate;
- content::ContentMainParams params(&delegate);
- params.argc = argc;
- params.argv = const_cast(argv);
- atom::AtomCommandLine::Init(argc, argv);
- return content::ContentMain(params);
-}
-
-#else // defined(OS_LINUX)
-
-int main(int argc, char* argv[]) {
- FixStdioStreams();
-
-#if BUILDFLAG(ENABLE_RUN_AS_NODE)
- if (IsEnvSet(atom::kRunAsNode)) {
- return AtomInitializeICUandStartNode(argc, argv);
- }
-#endif
-
-#if defined(HELPER_EXECUTABLE) && !defined(MAS_BUILD)
- uint32_t exec_path_size = 0;
- int rv = _NSGetExecutablePath(NULL, &exec_path_size);
- if (rv != -1) {
- fprintf(stderr, "_NSGetExecutablePath: get length failed\n");
- abort();
- }
-
- std::unique_ptr exec_path(new char[exec_path_size]);
- rv = _NSGetExecutablePath(exec_path.get(), &exec_path_size);
- if (rv != 0) {
- fprintf(stderr, "_NSGetExecutablePath: get path failed\n");
- abort();
- }
- sandbox::SeatbeltExecServer::CreateFromArgumentsResult seatbelt =
- sandbox::SeatbeltExecServer::CreateFromArguments(exec_path.get(), argc,
- argv);
- if (seatbelt.sandbox_required) {
- if (!seatbelt.server) {
- fprintf(stderr, "Failed to create seatbelt sandbox server.\n");
- abort();
- }
- if (!seatbelt.server->InitializeSandbox()) {
- fprintf(stderr, "Failed to initialize sandbox.\n");
- abort();
- }
- }
-#endif // defined(HELPER_EXECUTABLE) && !defined(MAS_BUILD)
-
- return AtomMain(argc, argv);
-}
-
-#endif // defined(OS_MACOSX)
diff --git a/atom/app/atom_main.h b/atom/app/atom_main.h
deleted file mode 100644
index 30663a429e936..0000000000000
--- a/atom/app/atom_main.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_ATOM_MAIN_H_
-#define ATOM_APP_ATOM_MAIN_H_
-
-#include "content/public/app/content_main.h"
-
-#endif // ATOM_APP_ATOM_MAIN_H_
diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc
deleted file mode 100644
index 95c655999add5..0000000000000
--- a/atom/app/atom_main_delegate.cc
+++ /dev/null
@@ -1,329 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/atom_main_delegate.h"
-
-#include
-#include
-#include
-
-#if defined(OS_LINUX)
-#include // for g_setenv()
-#endif
-
-#include "atom/app/atom_content_client.h"
-#include "atom/browser/atom_browser_client.h"
-#include "atom/browser/atom_gpu_client.h"
-#include "atom/browser/feature_list.h"
-#include "atom/browser/relauncher.h"
-#include "atom/common/options_switches.h"
-#include "atom/renderer/atom_renderer_client.h"
-#include "atom/renderer/atom_sandboxed_renderer_client.h"
-#include "atom/utility/atom_content_utility_client.h"
-#include "base/command_line.h"
-#include "base/debug/stack_trace.h"
-#include "base/environment.h"
-#include "base/logging.h"
-#include "base/mac/bundle_locations.h"
-#include "base/path_service.h"
-#include "chrome/common/chrome_paths.h"
-#include "content/public/common/content_switches.h"
-#include "electron/buildflags/buildflags.h"
-#include "ipc/ipc_buildflags.h"
-#include "services/service_manager/embedder/switches.h"
-#include "services/service_manager/sandbox/switches.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_switches.h"
-
-#if defined(OS_MACOSX)
-#include "atom/app/atom_main_delegate_mac.h"
-#endif
-
-#if defined(OS_WIN)
-#include "base/win/win_util.h"
-#if defined(_WIN64)
-#include "atom/common/crash_reporter/crash_reporter_win.h"
-#endif
-#endif
-
-namespace atom {
-
-namespace {
-
-const char* kRelauncherProcess = "relauncher";
-
-bool IsBrowserProcess(base::CommandLine* cmd) {
- std::string process_type = cmd->GetSwitchValueASCII(::switches::kProcessType);
- return process_type.empty();
-}
-
-// Returns true if this subprocess type needs the ResourceBundle initialized
-// and resources loaded.
-bool SubprocessNeedsResourceBundle(const std::string& process_type) {
- return
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
- // The zygote process opens the resources for the renderers.
- process_type == service_manager::switches::kZygoteProcess ||
-#endif
-#if defined(OS_MACOSX)
- // Mac needs them too for scrollbar related images and for sandbox
- // profiles.
- process_type == ::switches::kPpapiPluginProcess ||
- process_type == ::switches::kPpapiBrokerProcess ||
- process_type == ::switches::kGpuProcess ||
-#endif
- process_type == ::switches::kRendererProcess ||
- process_type == ::switches::kUtilityProcess;
-}
-
-#if defined(OS_WIN)
-void InvalidParameterHandler(const wchar_t*,
- const wchar_t*,
- const wchar_t*,
- unsigned int,
- uintptr_t) {
- // noop.
-}
-#endif
-
-} // namespace
-
-void LoadResourceBundle(const std::string& locale) {
- const bool initialized = ui::ResourceBundle::HasSharedInstance();
- if (initialized)
- ui::ResourceBundle::CleanupSharedInstance();
-
- // Load other resource files.
- base::FilePath pak_dir;
-#if defined(OS_MACOSX)
- pak_dir =
- base::mac::FrameworkBundlePath().Append(FILE_PATH_LITERAL("Resources"));
-#else
- base::PathService::Get(base::DIR_MODULE, &pak_dir);
-#endif
-
- ui::ResourceBundle::InitSharedInstanceWithLocale(
- locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- bundle.ReloadLocaleResources(locale);
- bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL("resources.pak")),
- ui::SCALE_FACTOR_NONE);
-#if BUILDFLAG(ENABLE_PDF_VIEWER)
- NOTIMPLEMENTED()
- << "Hi, whoever's fixing PDF support! Thanks! The pdf "
- "viewer resources haven't been ported over to the GN build yet, so "
- "you'll probably need to change this bit of code.";
- bundle.AddDataPackFromPath(
- pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")),
- ui::GetSupportedScaleFactors()[0]);
-#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
-}
-
-AtomMainDelegate::AtomMainDelegate() {}
-
-AtomMainDelegate::~AtomMainDelegate() {}
-
-bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
- auto* command_line = base::CommandLine::ForCurrentProcess();
-
- logging::LoggingSettings settings;
-#if defined(OS_WIN)
-#if defined(_WIN64)
- crash_reporter::CrashReporterWin::SetUnhandledExceptionFilter();
-#endif
-
- // On Windows the terminal returns immediately, so we add a new line to
- // prevent output in the same line as the prompt.
- if (IsBrowserProcess(command_line))
- std::wcout << std::endl;
-#if defined(DEBUG)
- // Print logging to debug.log on Windows
- settings.logging_dest = logging::LOG_TO_ALL;
- base::FilePath log_filename;
- base::PathService::Get(base::DIR_EXE, &log_filename);
- log_filename = log_filename.AppendASCII("debug.log");
- settings.log_file = log_filename.value().c_str();
- settings.lock_log = logging::LOCK_LOG_FILE;
- settings.delete_old = logging::DELETE_OLD_LOG_FILE;
-#else
- settings.logging_dest =
- logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR;
-#endif // defined(DEBUG)
-#else // defined(OS_WIN)
- settings.logging_dest =
- logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR;
-#endif // !defined(OS_WIN)
-
- // Only enable logging when --enable-logging is specified.
- auto env = base::Environment::Create();
- if (!command_line->HasSwitch(::switches::kEnableLogging) &&
- !env->HasVar("ELECTRON_ENABLE_LOGGING")) {
- settings.logging_dest = logging::LOG_NONE;
- logging::SetMinLogLevel(logging::LOG_NUM_SEVERITIES);
- }
-
- logging::InitLogging(settings);
-
- // Logging with pid and timestamp.
- logging::SetLogItems(true, false, true, false);
-
- // Enable convient stack printing. This is enabled by default in non-official
- // builds.
- if (env->HasVar("ELECTRON_ENABLE_STACK_DUMPING"))
- base::debug::EnableInProcessStackDumping();
-
- if (env->HasVar("ELECTRON_DISABLE_SANDBOX"))
- command_line->AppendSwitch(service_manager::switches::kNoSandbox);
-
- chrome::RegisterPathProvider();
-
-#if defined(OS_MACOSX)
- OverrideChildProcessPath();
- OverrideFrameworkBundlePath();
- SetUpBundleOverrides();
-#endif
-
-#if defined(OS_WIN)
- // Ignore invalid parameter errors.
- _set_invalid_parameter_handler(InvalidParameterHandler);
- // Disable the ActiveVerifier, which is used by Chrome to track possible
- // bugs, but no use in Electron.
- base::win::DisableHandleVerifier();
-
- if (IsBrowserProcess(command_line))
- base::win::PinUser32();
-#endif
-
- content_client_ = std::make_unique();
- SetContentClient(content_client_.get());
-
- return false;
-}
-
-void AtomMainDelegate::PostEarlyInitialization(bool is_running_tests) {
- std::string custom_locale;
- ui::ResourceBundle::InitSharedInstanceWithLocale(
- custom_locale, nullptr, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
- auto* cmd_line = base::CommandLine::ForCurrentProcess();
- if (cmd_line->HasSwitch(::switches::kLang)) {
- const std::string locale = cmd_line->GetSwitchValueASCII(::switches::kLang);
- const base::FilePath locale_file_path =
- ui::ResourceBundle::GetSharedInstance().GetLocaleFilePath(locale, true);
- if (!locale_file_path.empty()) {
- custom_locale = locale;
-#if defined(OS_LINUX)
- /* When built with USE_GLIB, libcc's GetApplicationLocaleInternal() uses
- * glib's g_get_language_names(), which keys off of getenv("LC_ALL") */
- g_setenv("LC_ALL", custom_locale.c_str(), TRUE);
-#endif
- }
- }
-
-#if defined(OS_MACOSX)
- if (custom_locale.empty())
- l10n_util::OverrideLocaleWithCocoaLocale();
-#endif
-
- LoadResourceBundle(custom_locale);
-
- AtomBrowserClient::SetApplicationLocale(
- l10n_util::GetApplicationLocale(custom_locale));
-}
-
-void AtomMainDelegate::PreSandboxStartup() {
- auto* command_line = base::CommandLine::ForCurrentProcess();
-
- std::string process_type =
- command_line->GetSwitchValueASCII(::switches::kProcessType);
-
- // Initialize ResourceBundle which handles files loaded from external
- // sources. The language should have been passed in to us from the
- // browser process as a command line flag.
- if (SubprocessNeedsResourceBundle(process_type)) {
- std::string locale = command_line->GetSwitchValueASCII(::switches::kLang);
- LoadResourceBundle(locale);
- }
-
- // Only append arguments for browser process.
- if (!IsBrowserProcess(command_line))
- return;
-
- // Allow file:// URIs to read other file:// URIs by default.
- command_line->AppendSwitch(::switches::kAllowFileAccessFromFiles);
-
-#if defined(OS_MACOSX)
- // Enable AVFoundation.
- command_line->AppendSwitch("enable-avfoundation");
-#endif
-}
-
-void AtomMainDelegate::PreCreateMainMessageLoop() {
- // This is initialized early because the service manager reads some feature
- // flags and we need to make sure the feature list is initialized before the
- // service manager reads the features.
- InitializeFeatureList();
-#if defined(OS_MACOSX)
- RegisterAtomCrApp();
-#endif
-}
-
-content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
- browser_client_.reset(new AtomBrowserClient);
- return browser_client_.get();
-}
-
-content::ContentGpuClient* AtomMainDelegate::CreateContentGpuClient() {
- gpu_client_.reset(new AtomGpuClient);
- return gpu_client_.get();
-}
-
-content::ContentRendererClient*
-AtomMainDelegate::CreateContentRendererClient() {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableSandbox) ||
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- service_manager::switches::kNoSandbox)) {
- renderer_client_.reset(new AtomSandboxedRendererClient);
- } else {
- renderer_client_.reset(new AtomRendererClient);
- }
-
- return renderer_client_.get();
-}
-
-content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() {
- utility_client_.reset(new AtomContentUtilityClient);
- return utility_client_.get();
-}
-
-int AtomMainDelegate::RunProcess(
- const std::string& process_type,
- const content::MainFunctionParams& main_function_params) {
- if (process_type == kRelauncherProcess)
- return relauncher::RelauncherMain(main_function_params);
- else
- return -1;
-}
-
-#if defined(OS_MACOSX)
-bool AtomMainDelegate::ShouldSendMachPort(const std::string& process_type) {
- return process_type != kRelauncherProcess;
-}
-
-bool AtomMainDelegate::DelaySandboxInitialization(
- const std::string& process_type) {
- return process_type == kRelauncherProcess;
-}
-#endif
-
-bool AtomMainDelegate::ShouldLockSchemeRegistry() {
- return false;
-}
-
-bool AtomMainDelegate::ShouldCreateFeatureList() {
- return false;
-}
-
-} // namespace atom
diff --git a/atom/app/atom_main_delegate.h b/atom/app/atom_main_delegate.h
deleted file mode 100644
index de30536a061e0..0000000000000
--- a/atom/app/atom_main_delegate.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
-#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
-
-#include
-#include
-
-#include "content/public/app/content_main_delegate.h"
-#include "content/public/common/content_client.h"
-
-namespace atom {
-
-void LoadResourceBundle(const std::string& locale);
-
-class AtomMainDelegate : public content::ContentMainDelegate {
- public:
- AtomMainDelegate();
- ~AtomMainDelegate() override;
-
- protected:
- // content::ContentMainDelegate:
- bool BasicStartupComplete(int* exit_code) override;
- void PreSandboxStartup() override;
- void PreCreateMainMessageLoop() override;
- void PostEarlyInitialization(bool is_running_tests) override;
- content::ContentBrowserClient* CreateContentBrowserClient() override;
- content::ContentGpuClient* CreateContentGpuClient() override;
- content::ContentRendererClient* CreateContentRendererClient() override;
- content::ContentUtilityClient* CreateContentUtilityClient() override;
- int RunProcess(
- const std::string& process_type,
- const content::MainFunctionParams& main_function_params) override;
-#if defined(OS_MACOSX)
- bool ShouldSendMachPort(const std::string& process_type) override;
- bool DelaySandboxInitialization(const std::string& process_type) override;
-#endif
- bool ShouldLockSchemeRegistry() override;
- bool ShouldCreateFeatureList() override;
-
- private:
-#if defined(OS_MACOSX)
- void OverrideChildProcessPath();
- void OverrideFrameworkBundlePath();
- void SetUpBundleOverrides();
-#endif
-
- std::unique_ptr browser_client_;
- std::unique_ptr content_client_;
- std::unique_ptr gpu_client_;
- std::unique_ptr renderer_client_;
- std::unique_ptr utility_client_;
-
- DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
-};
-
-} // namespace atom
-
-#endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_
diff --git a/atom/app/atom_main_delegate_mac.h b/atom/app/atom_main_delegate_mac.h
deleted file mode 100644
index 18b65da6ee191..0000000000000
--- a/atom/app/atom_main_delegate_mac.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 Slack Technologies, Inc. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
-#define ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
-
-namespace atom {
-
-// Initializes NSApplication.
-void RegisterAtomCrApp();
-
-} // namespace atom
-
-#endif // ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
diff --git a/atom/app/atom_main_delegate_mac.mm b/atom/app/atom_main_delegate_mac.mm
deleted file mode 100644
index 4f7dbc515f7e0..0000000000000
--- a/atom/app/atom_main_delegate_mac.mm
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2014 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/atom_main_delegate.h"
-
-#include
-
-#include "atom/browser/mac/atom_application.h"
-#include "atom/common/application_info.h"
-#include "atom/common/mac/main_application_bundle.h"
-#include "base/files/file_path.h"
-#include "base/files/file_util.h"
-#include "base/mac/bundle_locations.h"
-#include "base/mac/foundation_util.h"
-#include "base/mac/scoped_nsautorelease_pool.h"
-#include "base/path_service.h"
-#include "base/strings/sys_string_conversions.h"
-#include "content/public/common/content_paths.h"
-
-namespace atom {
-
-namespace {
-
-base::FilePath GetFrameworksPath() {
- return MainApplicationBundlePath().Append("Contents").Append("Frameworks");
-}
-
-base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path,
- const std::string& name) {
- return frameworks_path.Append(name + " Helper.app")
- .Append("Contents")
- .Append("MacOS")
- .Append(name + " Helper");
-}
-
-} // namespace
-
-void AtomMainDelegate::OverrideFrameworkBundlePath() {
- base::mac::SetOverrideFrameworkBundlePath(
- GetFrameworksPath().Append(ATOM_PRODUCT_NAME " Framework.framework"));
-}
-
-void AtomMainDelegate::OverrideChildProcessPath() {
- base::FilePath frameworks_path = GetFrameworksPath();
- base::FilePath helper_path =
- GetHelperAppPath(frameworks_path, ATOM_PRODUCT_NAME);
- if (!base::PathExists(helper_path))
- helper_path = GetHelperAppPath(frameworks_path, GetApplicationName());
- if (!base::PathExists(helper_path))
- LOG(FATAL) << "Unable to find helper app";
- base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
-}
-
-void AtomMainDelegate::SetUpBundleOverrides() {
- base::mac::ScopedNSAutoreleasePool pool;
- NSBundle* bundle = MainApplicationBundle();
- std::string base_bundle_id =
- base::SysNSStringToUTF8([bundle bundleIdentifier]);
- NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
- if (team_id)
- base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
- base::mac::SetBaseBundleID(base_bundle_id.c_str());
-}
-
-void RegisterAtomCrApp() {
- // Force the NSApplication subclass to be used.
- [AtomApplication sharedApplication];
-}
-
-} // namespace atom
diff --git a/atom/app/command_line_args.cc b/atom/app/command_line_args.cc
deleted file mode 100644
index 23e870cf4a32a..0000000000000
--- a/atom/app/command_line_args.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2018 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/command_line_args.h"
-
-namespace {
-
-bool IsUrlArg(const base::CommandLine::CharType* arg) {
- // the first character must be a letter for this to be a URL
- auto c = *arg;
- if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) {
- for (auto* p = arg + 1; *p; ++p) {
- c = *p;
-
- // colon indicates that the argument starts with a URI scheme
- if (c == ':') {
- // it could also be a Windows filesystem path
- if (p == arg + 1)
- break;
-
- return true;
- }
-
- // white-space before a colon means it's not a URL
- if (c == ' ' || (0x9 <= c && c <= 0xD))
- break;
- }
- }
-
- return false;
-}
-
-} // namespace
-
-namespace atom {
-
-bool CheckCommandLineArguments(int argc, base::CommandLine::CharType** argv) {
- const base::CommandLine::StringType dashdash(2, '-');
- bool block_args = false;
- for (int i = 0; i < argc; ++i) {
- if (argv[i] == dashdash)
- break;
- if (block_args) {
- return false;
- } else if (IsUrlArg(argv[i])) {
- block_args = true;
- }
- }
- return true;
-}
-
-} // namespace atom
diff --git a/atom/app/command_line_args.h b/atom/app/command_line_args.h
deleted file mode 100644
index 2c0acc1648ff3..0000000000000
--- a/atom/app/command_line_args.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2018 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_COMMAND_LINE_ARGS_H_
-#define ATOM_APP_COMMAND_LINE_ARGS_H_
-
-#include "base/command_line.h"
-
-namespace atom {
-
-bool CheckCommandLineArguments(int argc, base::CommandLine::CharType** argv);
-
-} // namespace atom
-
-#endif // ATOM_APP_COMMAND_LINE_ARGS_H_
diff --git a/atom/app/manifests.cc b/atom/app/manifests.cc
deleted file mode 100644
index 112ff6ee0d884..0000000000000
--- a/atom/app/manifests.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2019 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/manifests.h"
-
-#include "base/no_destructor.h"
-#include "electron/atom/common/api/api.mojom.h"
-#include "printing/buildflags/buildflags.h"
-#include "services/proxy_resolver/public/cpp/manifest.h"
-#include "services/service_manager/public/cpp/manifest_builder.h"
-
-#if BUILDFLAG(ENABLE_PRINTING)
-#include "components/services/pdf_compositor/public/cpp/manifest.h"
-#endif
-
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
-#include "chrome/services/printing/public/cpp/manifest.h"
-#endif
-
-namespace {
-
-// TODO(https://crbug.com/781334): Remove these helpers and just update the
-// manifest definitions to be marked out-of-process. This is here only to avoid
-// extra churn when transitioning away from content_packaged_services.
-service_manager::Manifest MakeOutOfProcess(
- const service_manager::Manifest& manifest) {
- // cpplint.py emits a false positive [build/include_what_you_use]
- service_manager::Manifest copy(manifest); // NOLINT
- copy.options.execution_mode =
- service_manager::Manifest::ExecutionMode::kOutOfProcessBuiltin;
- return copy;
-}
-
-} // namespace
-
-const service_manager::Manifest& GetElectronContentBrowserOverlayManifest() {
- static base::NoDestructor manifest{
- service_manager::ManifestBuilder()
- .WithDisplayName("Electron (browser process)")
- .RequireCapability("device", "device:geolocation_control")
- .RequireCapability("proxy_resolver", "factory")
- .RequireCapability("chrome_printing", "converter")
- .RequireCapability("pdf_compositor", "compositor")
- .ExposeInterfaceFilterCapability_Deprecated(
- "navigation:frame", "renderer",
- service_manager::Manifest::InterfaceList<
- atom::mojom::ElectronBrowser>())
- .Build()};
- return *manifest;
-}
-
-const std::vector&
-GetElectronBuiltinServiceManifests() {
- static base::NoDestructor> manifests{{
- MakeOutOfProcess(proxy_resolver::GetManifest()),
-#if BUILDFLAG(ENABLE_PRINTING)
- MakeOutOfProcess(printing::GetPdfCompositorManifest()),
-#endif
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
- MakeOutOfProcess(GetChromePrintingManifest()),
-#endif
- }};
- return *manifests;
-}
diff --git a/atom/app/manifests.h b/atom/app/manifests.h
deleted file mode 100644
index 2602d954783f2..0000000000000
--- a/atom/app/manifests.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) 2019 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_MANIFESTS_H_
-#define ATOM_APP_MANIFESTS_H_
-
-#include
-
-#include "services/service_manager/public/cpp/manifest.h"
-
-const service_manager::Manifest& GetElectronContentBrowserOverlayManifest();
-const std::vector&
-GetElectronBuiltinServiceManifests();
-
-#endif // ATOM_APP_MANIFESTS_H_
diff --git a/atom/app/node_main.cc b/atom/app/node_main.cc
deleted file mode 100644
index 3b0d7b23c492f..0000000000000
--- a/atom/app/node_main.cc
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include "atom/app/node_main.h"
-
-#include
-#include
-
-#include "atom/app/uv_task_runner.h"
-#include "atom/browser/javascript_environment.h"
-#include "atom/browser/node_debugger.h"
-#include "atom/common/api/electron_bindings.h"
-#include "atom/common/atom_version.h"
-#include "atom/common/crash_reporter/crash_reporter.h"
-#include "atom/common/native_mate_converters/string16_converter.h"
-#include "atom/common/node_bindings.h"
-#include "atom/common/node_includes.h"
-#include "base/command_line.h"
-#include "base/feature_list.h"
-#include "base/task/thread_pool/thread_pool.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "gin/array_buffer.h"
-#include "gin/public/isolate_holder.h"
-#include "gin/v8_initializer.h"
-#include "native_mate/dictionary.h"
-
-#if defined(_WIN64)
-#include "atom/common/crash_reporter/crash_reporter_win.h"
-#endif
-
-namespace atom {
-
-int NodeMain(int argc, char* argv[]) {
- base::CommandLine::Init(argc, argv);
-
- int exit_code = 1;
- {
- // Feed gin::PerIsolateData with a task runner.
- argv = uv_setup_args(argc, argv);
- uv_loop_t* loop = uv_default_loop();
- scoped_refptr uv_task_runner(new UvTaskRunner(loop));
- base::ThreadTaskRunnerHandle handle(uv_task_runner);
-
- // Initialize feature list.
- auto feature_list = std::make_unique();
- feature_list->InitializeFromCommandLine("", "");
- base::FeatureList::SetInstance(std::move(feature_list));
-
- gin::V8Initializer::LoadV8Snapshot(
- gin::V8Initializer::V8SnapshotFileType::kWithAdditionalContext);
- gin::V8Initializer::LoadV8Natives();
-
- // V8 requires a task scheduler apparently
- base::ThreadPoolInstance::CreateAndStartWithDefaultParams("Electron");
-
- // Initialize gin::IsolateHolder.
- JavascriptEnvironment gin_env(loop);
-#if defined(_WIN64)
- crash_reporter::CrashReporterWin::SetUnhandledExceptionFilter();
-#endif
-
- // Explicitly register electron's builtin modules.
- NodeBindings::RegisterBuiltinModules();
-
- int exec_argc;
- const char** exec_argv;
- node::Init(&argc, const_cast(argv), &exec_argc, &exec_argv);
-
- node::Environment* env = node::CreateEnvironment(
- node::CreateIsolateData(gin_env.isolate(), loop, gin_env.platform()),
- gin_env.context(), argc, argv, exec_argc, exec_argv);
-
- // Enable support for v8 inspector.
- NodeDebugger node_debugger(env);
- node_debugger.Start();
-
- mate::Dictionary process(gin_env.isolate(), env->process_object());
-#if defined(OS_WIN)
- process.SetMethod("log", &ElectronBindings::Log);
-#endif
- process.SetMethod("crash", &ElectronBindings::Crash);
-
- // Setup process.crashReporter.start in child node processes
- auto reporter = mate::Dictionary::CreateEmpty(gin_env.isolate());
- reporter.SetMethod("start", &crash_reporter::CrashReporter::StartInstance);
- process.Set("crashReporter", reporter);
-
- mate::Dictionary versions;
- if (process.Get("versions", &versions)) {
- versions.SetReadOnly(ATOM_PROJECT_NAME, ATOM_VERSION_STRING);
- }
-
- node::LoadEnvironment(env);
-
- bool more;
- do {
- more = uv_run(env->event_loop(), UV_RUN_ONCE);
- gin_env.platform()->DrainTasks(env->isolate());
- if (more == false) {
- node::EmitBeforeExit(env);
-
- // Emit `beforeExit` if the loop became alive either after emitting
- // event, or after running some callbacks.
- more = uv_loop_alive(env->event_loop());
- if (uv_run(env->event_loop(), UV_RUN_NOWAIT) != 0)
- more = true;
- }
- } while (more == true);
-
- node_debugger.Stop();
- exit_code = node::EmitExit(env);
- node::RunAtExit(env);
- gin_env.platform()->DrainTasks(env->isolate());
- gin_env.platform()->CancelPendingDelayedTasks(env->isolate());
- gin_env.platform()->UnregisterIsolate(env->isolate());
-
- node::FreeEnvironment(env);
- }
-
- // According to "src/gin/shell/gin_main.cc":
- //
- // gin::IsolateHolder waits for tasks running in ThreadPool in its
- // destructor and thus must be destroyed before ThreadPool starts skipping
- // CONTINUE_ON_SHUTDOWN tasks.
- base::ThreadPoolInstance::Get()->Shutdown();
-
- v8::V8::Dispose();
-
- return exit_code;
-}
-
-} // namespace atom
diff --git a/atom/app/node_main.h b/atom/app/node_main.h
deleted file mode 100644
index b02b7cd5aca54..0000000000000
--- a/atom/app/node_main.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_NODE_MAIN_H_
-#define ATOM_APP_NODE_MAIN_H_
-
-namespace atom {
-
-int NodeMain(int argc, char* argv[]);
-
-} // namespace atom
-
-#endif // ATOM_APP_NODE_MAIN_H_
diff --git a/atom/app/uv_task_runner.cc b/atom/app/uv_task_runner.cc
deleted file mode 100644
index 60befc6db8ff4..0000000000000
--- a/atom/app/uv_task_runner.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#include
-
-#include "atom/app/uv_task_runner.h"
-
-#include "base/stl_util.h"
-
-namespace atom {
-
-UvTaskRunner::UvTaskRunner(uv_loop_t* loop) : loop_(loop) {}
-
-UvTaskRunner::~UvTaskRunner() {
- for (auto& iter : tasks_) {
- uv_unref(reinterpret_cast(iter.first));
- delete iter.first;
- }
-}
-
-bool UvTaskRunner::PostDelayedTask(const base::Location& from_here,
- base::OnceClosure task,
- base::TimeDelta delay) {
- auto* timer = new uv_timer_t;
- timer->data = this;
- uv_timer_init(loop_, timer);
- uv_timer_start(timer, UvTaskRunner::OnTimeout, delay.InMilliseconds(), 0);
- tasks_[timer] = std::move(task);
- return true;
-}
-
-bool UvTaskRunner::RunsTasksInCurrentSequence() const {
- return true;
-}
-
-bool UvTaskRunner::PostNonNestableDelayedTask(const base::Location& from_here,
- base::OnceClosure task,
- base::TimeDelta delay) {
- return PostDelayedTask(from_here, std::move(task), delay);
-}
-
-// static
-void UvTaskRunner::OnTimeout(uv_timer_t* timer) {
- UvTaskRunner* self = static_cast(timer->data);
- if (!ContainsKey(self->tasks_, timer))
- return;
-
- std::move(self->tasks_[timer]).Run();
- self->tasks_.erase(timer);
- uv_timer_stop(timer);
- uv_close(reinterpret_cast(timer), UvTaskRunner::OnClose);
-}
-
-// static
-void UvTaskRunner::OnClose(uv_handle_t* handle) {
- delete reinterpret_cast(handle);
-}
-
-} // namespace atom
diff --git a/atom/app/uv_task_runner.h b/atom/app/uv_task_runner.h
deleted file mode 100644
index 578024d70486b..0000000000000
--- a/atom/app/uv_task_runner.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2015 GitHub, Inc.
-// Use of this source code is governed by the MIT license that can be
-// found in the LICENSE file.
-
-#ifndef ATOM_APP_UV_TASK_RUNNER_H_
-#define ATOM_APP_UV_TASK_RUNNER_H_
-
-#include