mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
8 Commits
roller/nod
...
build-win-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5647226c3f | ||
|
|
e0ffe69212 | ||
|
|
f6f2c70bbf | ||
|
|
d5ead17629 | ||
|
|
a727936a1f | ||
|
|
eb76a7652b | ||
|
|
029147bdeb | ||
|
|
5717f1010b |
67
.github/actions/build-electron/action.yml
vendored
67
.github/actions/build-electron/action.yml
vendored
@@ -37,15 +37,14 @@ runs:
|
|||||||
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
- name: Set GN_EXTRA_ARGS for Windows
|
- name: Set GN_EXTRA_ARGS for Windows
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{inputs.target-arch != 'x64' && inputs.target-platform == 'win' }}
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
run: |
|
run: |
|
||||||
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\""
|
GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"${{ inputs.target-arch }}\" use_v8_context_snapshot=true target_os=\"win\""
|
||||||
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
|
||||||
- name: Add Clang problem matcher
|
- name: Add Clang problem matcher
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
|
run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
|
||||||
- name: Build Electron ${{ inputs.step-suffix }}
|
- name: Build Electron ${{ inputs.step-suffix }}
|
||||||
if: ${{ inputs.target-platform != 'win' }}
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
rm -rf "src/out/Default/Electron Framework.framework"
|
rm -rf "src/out/Default/Electron Framework.framework"
|
||||||
@@ -71,37 +70,14 @@ runs:
|
|||||||
|
|
||||||
# Upload build stats to Datadog
|
# Upload build stats to Datadog
|
||||||
if ! [ -z $DD_API_KEY ]; then
|
if ! [ -z $DD_API_KEY ]; then
|
||||||
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
|
if [ "$TARGET_PLATFORM" = "win" ]; then
|
||||||
|
npx node electron/script/build-stats.mjs out/Default/siso.exe.INFO --upload-stats || true
|
||||||
|
else
|
||||||
|
npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
|
echo "Skipping build-stats.mjs upload because DD_API_KEY is not set"
|
||||||
fi
|
fi
|
||||||
- name: Build Electron (Windows) ${{ inputs.step-suffix }}
|
|
||||||
if: ${{ inputs.target-platform == 'win' }}
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
cd src\electron
|
|
||||||
git pack-refs
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
$env:NINJA_SUMMARIZE_BUILD = 1
|
|
||||||
if ("${{ inputs.is-release }}" -eq "true") {
|
|
||||||
e build --target electron:release_build
|
|
||||||
} else {
|
|
||||||
e build --target electron:testing_build
|
|
||||||
}
|
|
||||||
Copy-Item out\Default\.ninja_log out\electron_ninja_log
|
|
||||||
node electron\script\check-symlinks.js
|
|
||||||
|
|
||||||
# Upload build stats to Datadog
|
|
||||||
if ($env:DD_API_KEY) {
|
|
||||||
try {
|
|
||||||
npx node electron\script\build-stats.mjs out\Default\siso.exe.INFO --upload-stats
|
|
||||||
} catch {
|
|
||||||
Write-Host "Build stats upload failed, continuing..."
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "Skipping build-stats.mjs upload because DD_API_KEY is not set"
|
|
||||||
}
|
|
||||||
- name: Verify dist.zip ${{ inputs.step-suffix }}
|
- name: Verify dist.zip ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -126,15 +102,7 @@ runs:
|
|||||||
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
|
||||||
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
|
||||||
|
|
||||||
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
|
||||||
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 }}
|
- name: Generate Cross-Arch Snapshot (arm/arm64) ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
if: ${{ (inputs.target-arch == 'arm' || inputs.target-arch == 'arm64') && inputs.target-platform == 'linux' }}
|
||||||
@@ -168,12 +136,6 @@ runs:
|
|||||||
fi
|
fi
|
||||||
electron/script/zip_manifests/check-zip-manifest.py out/Default/chromedriver.zip electron/script/zip_manifests/chromedriver_zip.$target_os.${{ inputs.target-arch }}.manifest
|
electron/script/zip_manifests/check-zip-manifest.py out/Default/chromedriver.zip electron/script/zip_manifests/chromedriver_zip.$target_os.${{ inputs.target-arch }}.manifest
|
||||||
fi
|
fi
|
||||||
- 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 }}
|
- name: Profile Windows Toolchain ${{ inputs.step-suffix }}
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
|
||||||
@@ -227,7 +189,7 @@ runs:
|
|||||||
script/release/uploaders/upload.py --verbose
|
script/release/uploaders/upload.py --verbose
|
||||||
fi
|
fi
|
||||||
- name: Generate siso report
|
- name: Generate siso report
|
||||||
if: ${{ inputs.target-platform != 'win' && !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
@@ -236,17 +198,6 @@ runs:
|
|||||||
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH" >> $GITHUB_ENV
|
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH" >> $GITHUB_ENV
|
||||||
cat siso_report.txt
|
cat siso_report.txt
|
||||||
echo "SISO REPORT AT $SISO_REPORT_PATH"
|
echo "SISO REPORT AT $SISO_REPORT_PATH"
|
||||||
- name: Generate siso report (Windows)
|
|
||||||
if: ${{ inputs.target-platform == 'win' && !cancelled() }}
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
cd src
|
|
||||||
e d siso report -C out\Default > siso_report.txt
|
|
||||||
$SISO_REPORT_PATH = Get-Content "siso_report.txt" | Select-String "report file:\s*(.+)" | ForEach-Object {
|
|
||||||
$_.Matches.Groups[1].Value.Trim()
|
|
||||||
}
|
|
||||||
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH"
|
|
||||||
echo "SISO_REPORT_PATH=$SISO_REPORT_PATH" >> $env:GITHUB_ENV
|
|
||||||
- name: Generate Artifact Key
|
- name: Generate Artifact Key
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -11,12 +11,12 @@ on:
|
|||||||
skip-macos:
|
skip-macos:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Skip macOS builds'
|
description: 'Skip macOS builds'
|
||||||
default: false
|
default: true
|
||||||
required: false
|
required: false
|
||||||
skip-linux:
|
skip-linux:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Skip Linux builds'
|
description: 'Skip Linux builds'
|
||||||
default: false
|
default: true
|
||||||
required: false
|
required: false
|
||||||
skip-windows:
|
skip-windows:
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
# Checkout Jobs
|
# Checkout Jobs
|
||||||
checkout-macos:
|
checkout-macos:
|
||||||
needs: setup
|
needs: setup
|
||||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-macos}}
|
if: ${{ needs.setup.outputs.src == 'true' && inputs.skip-macos == 'false'}}
|
||||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -137,7 +137,7 @@ jobs:
|
|||||||
|
|
||||||
checkout-linux:
|
checkout-linux:
|
||||||
needs: setup
|
needs: setup
|
||||||
if: ${{ !inputs.skip-linux}}
|
if: ${{ inputs.skip-linux == 'false' }}
|
||||||
runs-on: electron-arc-centralus-linux-amd64-32core
|
runs-on: electron-arc-centralus-linux-amd64-32core
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -372,8 +372,9 @@ jobs:
|
|||||||
needs: checkout-windows
|
needs: checkout-windows
|
||||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||||
test-runs-on: windows-latest
|
test-runs-on: windows-latest
|
||||||
|
build-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"]}'
|
||||||
target-platform: win
|
target-platform: win
|
||||||
target-arch: x64
|
target-arch: x64
|
||||||
is-release: false
|
is-release: false
|
||||||
@@ -391,8 +392,9 @@ jobs:
|
|||||||
needs: checkout-windows
|
needs: checkout-windows
|
||||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||||
test-runs-on: windows-latest
|
test-runs-on: windows-latest
|
||||||
|
build-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"]}'
|
||||||
target-platform: win
|
target-platform: win
|
||||||
target-arch: x86
|
target-arch: x86
|
||||||
is-release: false
|
is-release: false
|
||||||
@@ -410,8 +412,9 @@ jobs:
|
|||||||
needs: checkout-windows
|
needs: checkout-windows
|
||||||
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
if: ${{ needs.setup.outputs.src == 'true' && !inputs.skip-windows }}
|
||||||
with:
|
with:
|
||||||
build-runs-on: electron-arc-centralus-windows-amd64-16core
|
build-runs-on: electron-arc-centralus-linux-amd64-32core
|
||||||
test-runs-on: windows-11-arm
|
test-runs-on: windows-11-arm
|
||||||
|
build-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"]}'
|
||||||
target-platform: win
|
target-platform: win
|
||||||
target-arch: arm64
|
target-arch: arm64
|
||||||
is-release: false
|
is-release: false
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ jobs:
|
|||||||
- name: Install AZCopy
|
- name: Install AZCopy
|
||||||
if: ${{ inputs.target-platform == 'macos' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
run: brew install azcopy
|
run: brew install azcopy
|
||||||
|
- name: Enable windows toolchain
|
||||||
|
if: ${{ inputs.target-platform == 'win' }}
|
||||||
|
run: |
|
||||||
|
echo "ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN=1" >> $GITHUB_ENV
|
||||||
- name: Set GN_EXTRA_ARGS for Linux
|
- name: Set GN_EXTRA_ARGS for Linux
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform == 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -155,13 +159,15 @@ jobs:
|
|||||||
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
echo "DEPSHASH=$DEPSHASH" >> $GITHUB_ENV
|
||||||
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
echo "CACHE_PATH=$DEPSHASH.tar" >> $GITHUB_ENV
|
||||||
- name: Restore src cache via AZCopy
|
- name: Restore src cache via AZCopy
|
||||||
if: ${{ inputs.target-platform != 'linux' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
uses: ./src/electron/.github/actions/restore-cache-azcopy
|
||||||
with:
|
with:
|
||||||
target-platform: ${{ inputs.target-platform }}
|
target-platform: ${{ inputs.target-platform }}
|
||||||
- name: Restore src cache via AKS
|
- name: Restore src cache via AKS
|
||||||
if: ${{ inputs.target-platform == 'linux' }}
|
if: ${{ inputs.target-platform != 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/restore-cache-aks
|
uses: ./src/electron/.github/actions/restore-cache-aks
|
||||||
|
with:
|
||||||
|
target-platform: ${{ inputs.target-platform }}
|
||||||
- name: Checkout Electron
|
- name: Checkout Electron
|
||||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
|
||||||
with:
|
with:
|
||||||
@@ -169,7 +175,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Fix Sync
|
- name: Fix Sync
|
||||||
if: ${{ inputs.target-platform != 'linux' }}
|
if: ${{ inputs.target-platform == 'macos' }}
|
||||||
uses: ./src/electron/.github/actions/fix-sync
|
uses: ./src/electron/.github/actions/fix-sync
|
||||||
with:
|
with:
|
||||||
target-platform: ${{ inputs.target-platform }}
|
target-platform: ${{ inputs.target-platform }}
|
||||||
@@ -178,9 +184,21 @@ jobs:
|
|||||||
- name: Init Build Tools
|
- name: Init Build Tools
|
||||||
run: |
|
run: |
|
||||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --remote-build siso
|
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --remote-build siso
|
||||||
|
e sanitize-config
|
||||||
- name: Run Electron Only Hooks
|
- name: Run Electron Only Hooks
|
||||||
run: |
|
run: |
|
||||||
e d gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
rm -rf src/third_party/depot_tools/win_toolchain/vs_files*
|
||||||
|
fi
|
||||||
|
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 "target_os=['win']" >> tmpgclient
|
||||||
|
fi
|
||||||
|
gclient runhooks --gclientfile=tmpgclient
|
||||||
|
# Fix VS Toolchain
|
||||||
|
if [ "${{ inputs.target-platform }}" = "win" ]; then
|
||||||
|
e d python3 src/build/vs_toolchain.py update --force
|
||||||
|
fi
|
||||||
- name: Regenerate DEPS Hash
|
- name: Regenerate DEPS Hash
|
||||||
run: |
|
run: |
|
||||||
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
(cd src/electron && git checkout .) && node src/electron/script/generate-deps-hash.js
|
||||||
@@ -218,3 +236,11 @@ jobs:
|
|||||||
generate-symbols: '${{ inputs.generate-symbols }}'
|
generate-symbols: '${{ inputs.generate-symbols }}'
|
||||||
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
upload-to-storage: '${{ inputs.upload-to-storage }}'
|
||||||
step-suffix: '(mas)'
|
step-suffix: '(mas)'
|
||||||
|
- name: Wait for active SSH sessions
|
||||||
|
shell: bash
|
||||||
|
if: always() && !cancelled()
|
||||||
|
run: |
|
||||||
|
while [ -f /var/.ssh-lock ]
|
||||||
|
do
|
||||||
|
sleep 60
|
||||||
|
done
|
||||||
|
|||||||
@@ -39,18 +39,18 @@ def init(ctx):
|
|||||||
"clang_large": step_config["platforms"]["default"],
|
"clang_large": step_config["platforms"]["default"],
|
||||||
})
|
})
|
||||||
|
|
||||||
if runtime.os == "windows":
|
# Add additional Windows SDK headers needed by Electron
|
||||||
# Add additional Windows SDK headers needed by Electron
|
win_toolchain_dir = win_sdk.toolchain_dir(ctx)
|
||||||
win_toolchain_dir = win_sdk.toolchain_dir(ctx)
|
if win_toolchain_dir:
|
||||||
if win_toolchain_dir:
|
sdk_version = gn_logs.read(ctx).get("windows_sdk_version")
|
||||||
sdk_version = gn_logs.read(ctx).get("windows_sdk_version")
|
step_config["input_deps"][win_toolchain_dir + ":headers"].extend([
|
||||||
step_config["input_deps"][win_toolchain_dir + ":headers"].extend([
|
# third_party/electron_node/deps/uv/include/uv/win.h includes mswsock.h
|
||||||
# third_party/electron_node/deps/uv/include/uv/win.h includes mswsock.h
|
path.join(win_toolchain_dir, "Windows Kits", "10/Include", sdk_version, "um/mswsock.h"),
|
||||||
path.join(win_toolchain_dir, "Windows Kits/10/Include", sdk_version, "um/mswsock.h"),
|
# third_party/electron_node/src/debug_utils.cc includes lm.h
|
||||||
# third_party/electron_node/src/debug_utils.cc includes lm.h
|
path.join(win_toolchain_dir, "Windows Kits", "10/Include", sdk_version, "um/Lm.h"),
|
||||||
path.join(win_toolchain_dir, "Windows Kits/10/Include", sdk_version, "um/Lm.h"),
|
])
|
||||||
])
|
|
||||||
|
if runtime.os == "windows":
|
||||||
# Update platforms to match our default siso config instead of reclient configs.
|
# Update platforms to match our default siso config instead of reclient configs.
|
||||||
step_config["platforms"].update({
|
step_config["platforms"].update({
|
||||||
"clang-cl": step_config["platforms"]["default"],
|
"clang-cl": step_config["platforms"]["default"],
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ support_mixed_sandbox_with_zygote.patch
|
|||||||
build_add_electron_tracing_category.patch
|
build_add_electron_tracing_category.patch
|
||||||
worker_context_will_destroy.patch
|
worker_context_will_destroy.patch
|
||||||
frame_host_manager.patch
|
frame_host_manager.patch
|
||||||
crashpad_pid_check.patch
|
|
||||||
network_service_allow_remote_certificate_verification_logic.patch
|
network_service_allow_remote_certificate_verification_logic.patch
|
||||||
add_contentgpuclient_precreatemessageloop_callback.patch
|
add_contentgpuclient_precreatemessageloop_callback.patch
|
||||||
picture-in-picture.patch
|
picture-in-picture.patch
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Cheng Zhao <zcbenz@gmail.com>
|
|
||||||
Date: Tue, 4 Jun 2019 11:30:12 +0900
|
|
||||||
Subject: crashpad_pid_check.patch
|
|
||||||
|
|
||||||
When both browser process and renderer process are connecting to the pipe,
|
|
||||||
the API may return the PID of browser process as real_pid, which is different
|
|
||||||
from the PID of renderer process.
|
|
||||||
|
|
||||||
This is caused by the crashReporter getting started after the sanbox, after
|
|
||||||
we redesign crashReporter's API to make it alwasy start before the
|
|
||||||
sanbox, we can remove this patch.
|
|
||||||
|
|
||||||
See following links for more:
|
|
||||||
https://github.com/electron/electron/pull/18483#discussion_r292703588
|
|
||||||
https://github.com/electron/electron/pull/18483#issuecomment-501090683
|
|
||||||
|
|
||||||
diff --git a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
|
||||||
index 8af53a62b088fececd558f1436a84d4c2c4feabd..7d9913ae189708475c08d123a404eb5b125ecccc 100644
|
|
||||||
--- a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
|
||||||
+++ b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
|
||||||
@@ -448,9 +448,16 @@ bool ExceptionHandlerServer::ServiceClientConnection(
|
|
||||||
DWORD real_pid = 0;
|
|
||||||
if (get_named_pipe_client_process_id(service_context.pipe(), &real_pid) &&
|
|
||||||
message.registration.client_process_id != real_pid) {
|
|
||||||
+ // Electron: When both browser process and renderer process are connecting
|
|
||||||
+ // to the pipe, the API may return the PID of browser process as real_pid,
|
|
||||||
+ // which is different from the PID of renderer process.
|
|
||||||
+ //
|
|
||||||
+ // I don't understand why Chromium does not have this issue.
|
|
||||||
+#if 0
|
|
||||||
LOG(ERROR) << "forged client pid, real pid: " << real_pid
|
|
||||||
<< ", got: " << message.registration.client_process_id;
|
|
||||||
return false;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -11,7 +11,6 @@ feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
|
|||||||
support_v8_sandboxed_pointers.patch
|
support_v8_sandboxed_pointers.patch
|
||||||
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
|
build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
|
||||||
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
|
fix_expose_the_built-in_electron_module_via_the_esm_loader.patch
|
||||||
enable_crashpad_linux_node_processes.patch
|
|
||||||
fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch
|
fix_lazyload_fs_in_esm_loaders_to_apply_asar_patches.patch
|
||||||
chore_expose_importmoduledynamically_and.patch
|
chore_expose_importmoduledynamically_and.patch
|
||||||
test_formally_mark_some_tests_as_flaky.patch
|
test_formally_mark_some_tests_as_flaky.patch
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: VerteDinde <keeleymhammond@gmail.com>
|
|
||||||
Date: Sun, 20 Nov 2022 21:45:20 -0800
|
|
||||||
Subject: fix: enable crashpad for ELECTRON_RUN_AS_NODE linux processes
|
|
||||||
|
|
||||||
Passes the crashpad handler PID and crashdump signal file descriptor
|
|
||||||
to child processes spawned with `ELECTRON_RUN_AS_NODE` which is used
|
|
||||||
by the crashpad client to connect with the handler process.
|
|
||||||
|
|
||||||
diff --git a/lib/child_process.js b/lib/child_process.js
|
|
||||||
index 17c6b69c118a759f9fcf254a035f1a07fcc4059f..c8576fbf889d13f951a9ad2ffeb93389cfe2445b 100644
|
|
||||||
--- a/lib/child_process.js
|
|
||||||
+++ b/lib/child_process.js
|
|
||||||
@@ -62,6 +62,7 @@ let debug = require('internal/util/debuglog').debuglog(
|
|
||||||
);
|
|
||||||
const { Buffer } = require('buffer');
|
|
||||||
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
|
|
||||||
+const { getCrashdumpSignalFD, getCrashpadHandlerPID } = process._linkedBinding('electron_common_crashpad_support');
|
|
||||||
|
|
||||||
const {
|
|
||||||
AbortError,
|
|
||||||
@@ -156,7 +157,6 @@ function fork(modulePath, args = [], options) {
|
|
||||||
ArrayPrototypeSplice(execArgv, index - 1, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-
|
|
||||||
args = [...execArgv, modulePath, ...args];
|
|
||||||
|
|
||||||
if (typeof options.stdio === 'string') {
|
|
||||||
@@ -638,6 +638,22 @@ function normalizeSpawnArguments(file, args, options) {
|
|
||||||
'options.windowsVerbatimArguments');
|
|
||||||
}
|
|
||||||
|
|
||||||
+ const env = options.env || { ...process.env };
|
|
||||||
+
|
|
||||||
+ if ((process.platform === 'linux') &&
|
|
||||||
+ ObjectPrototypeHasOwnProperty(env, 'ELECTRON_RUN_AS_NODE') &&
|
|
||||||
+ (file === process.execPath)) {
|
|
||||||
+ // On Linux, pass the file descriptor which crashpad handler process
|
|
||||||
+ // uses to monitor the child process and PID of the handler process.
|
|
||||||
+ // https://source.chromium.org/chromium/chromium/src/+/110.0.5415.0:components/crash/core/app/crashpad_linux.cc;l=199-206
|
|
||||||
+ const fd = getCrashdumpSignalFD();
|
|
||||||
+ const pid = getCrashpadHandlerPID();
|
|
||||||
+ if (fd !== -1 && pid !== -1) {
|
|
||||||
+ env.CRASHDUMP_SIGNAL_FD = fd;
|
|
||||||
+ env.CRASHPAD_HANDLER_PID = pid;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (options.shell) {
|
|
||||||
validateArgumentNullCheck(options.shell, 'options.shell');
|
|
||||||
if (args.length > 0 && !emittedDEP0190Already) {
|
|
||||||
@@ -680,8 +696,6 @@ function normalizeSpawnArguments(file, args, options) {
|
|
||||||
ArrayPrototypeUnshift(args, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
- // Shallow copy to guarantee changes won't impact process.env
|
|
||||||
- const env = options.env || { ...process.env };
|
|
||||||
const envPairs = [];
|
|
||||||
|
|
||||||
// process.env.NODE_V8_COVERAGE always propagates, making it possible to
|
|
||||||
@@ -9,7 +9,11 @@ elif [ "`uname`" == "Darwin" ]; then
|
|||||||
BUILD_TYPE="mas"
|
BUILD_TYPE="mas"
|
||||||
fi
|
fi
|
||||||
elif [ "`uname`" == "Linux" ]; then
|
elif [ "`uname`" == "Linux" ]; then
|
||||||
BUILD_TYPE="linux"
|
if [ "$ELECTRON_DEPOT_TOOLS_WIN_TOOLCHAIN" == "1" ]; then
|
||||||
|
BUILD_TYPE="win"
|
||||||
|
else
|
||||||
|
BUILD_TYPE="linux"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Unsupported platform"
|
echo "Unsupported platform"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ const startServer = async () => {
|
|||||||
function waitForCrash (): Promise<CrashInfo> {
|
function waitForCrash (): Promise<CrashInfo> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
emitter.once('crash', (crash) => {
|
emitter.once('crash', (crash) => {
|
||||||
|
console.log('crash fired', crash);
|
||||||
resolve(crash);
|
resolve(crash);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -69,6 +70,7 @@ const startServer = async () => {
|
|||||||
const fields = {} as Record<string, any>;
|
const fields = {} as Record<string, any>;
|
||||||
const files = {} as Record<string, Buffer>;
|
const files = {} as Record<string, Buffer>;
|
||||||
busboy.on('file', (fieldname, file) => {
|
busboy.on('file', (fieldname, file) => {
|
||||||
|
console.log('Receiving file for :', fieldname);
|
||||||
const chunks = [] as Array<Buffer>;
|
const chunks = [] as Array<Buffer>;
|
||||||
file.on('data', (chunk) => {
|
file.on('data', (chunk) => {
|
||||||
chunks.push(chunk);
|
chunks.push(chunk);
|
||||||
@@ -81,10 +83,12 @@ const startServer = async () => {
|
|||||||
fields[fieldname] = val;
|
fields[fieldname] = val;
|
||||||
});
|
});
|
||||||
busboy.on('finish', () => {
|
busboy.on('finish', () => {
|
||||||
|
console.log('On finish');
|
||||||
// breakpad id must be 16 hex digits.
|
// breakpad id must be 16 hex digits.
|
||||||
const reportId = Math.random().toString(16).split('.')[1].padStart(16, '0');
|
const reportId = Math.random().toString(16).split('.')[1].padStart(16, '0');
|
||||||
res.end(reportId, async () => {
|
res.end(reportId, async () => {
|
||||||
req.socket.destroy();
|
req.socket.destroy();
|
||||||
|
console.log('Emmitting crash:', fields);
|
||||||
emitter.emit('crash', { ...fields, ...files });
|
emitter.emit('crash', { ...fields, ...files });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -138,10 +142,15 @@ function waitForNewFileInDir (dir: string): Promise<string[]> {
|
|||||||
ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_TESTS)('crashReporter module', function () {
|
ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_TESTS)('crashReporter module', function () {
|
||||||
describe('should send minidump', () => {
|
describe('should send minidump', () => {
|
||||||
it('when renderer crashes', async () => {
|
it('when renderer crashes', async () => {
|
||||||
|
console.log('starting server for renderer crash test');
|
||||||
const { port, waitForCrash } = await startServer();
|
const { port, waitForCrash } = await startServer();
|
||||||
|
console.log('Done starting server for renderer crash test');
|
||||||
runCrashApp('renderer', port);
|
runCrashApp('renderer', port);
|
||||||
|
console.log('Waiting for renderer crash');
|
||||||
const crash = await waitForCrash();
|
const crash = await waitForCrash();
|
||||||
|
console.log('Renderer crash received');
|
||||||
checkCrash('renderer', crash);
|
checkCrash('renderer', crash);
|
||||||
|
console.log('Renderer crash checked');
|
||||||
expect(crash.mainProcessSpecific).to.be.undefined();
|
expect(crash.mainProcessSpecific).to.be.undefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user