Compare commits

..

326 Commits

Author SHA1 Message Date
Electron Bot
edac24c9be Bump v7.1.13 2020-02-20 09:38:02 -08:00
Electron Bot
0251f5aa93 Revert "Bump v7.1.13"
This reverts commit cccd3778f8.
2020-02-19 15:31:15 -08:00
Electron Bot
cccd3778f8 Bump v7.1.13 2020-02-19 15:28:25 -08:00
trop[bot]
680f3432ae build: only strip binaries on linux (#22288)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-19 18:25:59 -05:00
John Kleinschmidt
420fb46121 Revert "Bump v7.1.13"
This reverts commit d7247bc77d.
2020-02-19 11:19:33 -05:00
trop[bot]
6ef605eaa2 doc: remove accidental deprecation (#22266)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-19 13:44:26 +09:00
Electron Bot
d7247bc77d Bump v7.1.13 2020-02-18 12:21:15 -08:00
trop[bot]
5e6e118595 build: preserve timestamps when stripping files (#22094) (#22261)
* build: preserve timestamps when stripping files

Resolves an issue where the binaries in mksnapshot.zip were not getting stripped.

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
(cherry picked from commit 5e49aafe55)

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-18 15:19:43 -05:00
trop[bot]
b1f19970e7 fix: don't include breakpad_symbols dir in dsym.zip (#22220)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-18 12:23:01 -05:00
Shelley Vohr
c30ecc38d0 fix: crash on custom printing margins (#22164) (#22187) 2020-02-17 09:44:53 +09:00
trop[bot]
14d9b8a8b4 fix: no-arg console.log is undefined (#22173)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-02-14 15:32:47 +09:00
Shelley Vohr
f0d872947d chore: default to sys printer and prevent bad default crash (#22012) 2020-02-12 17:45:53 +00:00
Cheng Zhao
40a212e132 fix: make webRequest work with WebSocket (7-1-x) (#22141)
* fix: make webRequest work with WebSocket

* test: install modules for spec-main
2020-02-12 15:14:57 +09:00
Shelley Vohr
cb9b3b29af fix: keep references to active menus created by api Menu (#22151)
Without this such menus would be destroyed by js garbage collector even
when they are still displayed.

Co-authored-by: CezaryKulakowski <50166166+CezaryKulakowski@users.noreply.github.com>
2020-02-12 09:00:03 +09:00
trop[bot]
da65c881e2 ci: strip mksnapshot binaries on Linux (#22156)
Related to #21086.

Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2020-02-11 15:45:08 -05:00
Electron Bot
aa5e51dbe0 Bump v7.1.12 2020-02-10 11:08:32 -08:00
trop[bot]
b5d38bfff0 fix: flash plugin (#22109)
* fix: flash plugin

Fixes https://github.com/electron/electron/issues/20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
2020-02-10 10:49:43 +09:00
trop[bot]
a3054443f4 fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor (#22112)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-10 10:47:43 +09:00
Jeremy Apthorp
1f631ca337 ci: fix ELECTRON_OUT_DIR (#21994) (#22020) 2020-02-05 10:31:03 +09:00
Jeremy Apthorp
e7576019e9 fix: use legacy base::Value serializers for ipc (7-1-x) (#21922) 2020-01-31 11:38:55 -08:00
trop[bot]
77448c75c6 fix: return path from netLog.stopLogging (#21988)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-31 11:21:52 -08:00
Robo
538ebabf7e fix: crash with icu when input locale is invalid (#21969)
* fix: crash with icu when input locale is invalid

Backports https://github.com/unicode-org/icu/pull/632

* spec: add regression tests
2020-01-31 14:35:54 +09:00
Electron Bot
d17dfabfcb Bump v7.1.11 2020-01-29 18:23:02 -08:00
trop[bot]
b6cb396893 fix: ensure web_contents is not nullptr in UpdateDraggableRegions (#21964)
* fix: ensure web_contents is not nullptr in UpdateDraggableRegions

This is a speculative fix for a crash in `UpdateDraggableRegions` that we've noticed

* Update atom_api_browser_window_mac.mm

* Update atom_api_browser_window_mac.mm

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-01-29 17:43:43 -08:00
Alexey Kuzmin
4da56797c3 chore: fix linter errors in .mm files (#21934) 2020-01-29 17:04:25 +00:00
trop[bot]
570e4f6a34 fix: use powerMonitor.on() only after app is ready (#21941)
* fix: use powerMonitor.on() only after app is ready

powerMonitor can't be used until the app is ready; however, on Linux,
powerMonitor.on() was called as soon as lib/browser/api/power-monitor.ts
was loaded.

This patch takes @vladimiry's suggestion of wrapping that in an
app.on('ready') handler to prevent powerMonitor.on() from being called
prematurely.

Fixes #21716

* refactor: handle import powerMonitor timing issue

Fix the previous commit's app-is-ready handler by checking to see if
app is already ready when power-monitor.ts is loaded.

* refactor: use app.whenReady() for simpler logic

* chore: use a consistent comment formatting style

Co-authored-by: Charles Kerr <ckerr@github.com>
2020-01-29 18:44:56 +09:00
trop[bot]
8c5a2c0a4a fix: About Panel credits should be dark mode aware (#21924)
* fix: about panel credits should be dark mode aware

* use textColor for automatic adaptability

Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-28 17:05:22 +09:00
trop[bot]
1c1e9fc7a7 docs: clean up context bridge API docs (#21916) 2020-01-28 02:01:51 +00:00
Jeremy Apthorp
0a3a0def25 chore: remove comented code in renderer_ipc (#21918) 2020-01-27 17:08:03 -08:00
Shelley Vohr
ae9ee76e56 fix: window.print() only working once (#21911) 2020-01-27 23:09:21 +00:00
trop[bot]
7908013a49 Update browser-window.md (#21900)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-01-27 14:55:58 +09:00
Robo
c7bb1d0300 fix: font rendering with hi-dpi transitions on Catalina (#21872)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1902508
2020-01-23 10:46:09 -08:00
trop[bot]
4cf67fea52 docs: added info on bookmark return values for securityScopedBookmarks (#21873) 2020-01-22 18:37:43 -08:00
trop[bot]
2c29a4e93d fix: Windows checkboxChecked edge case (#21860)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-23 09:33:05 +09:00
Electron Bot
04234f41f2 Bump v7.1.10 2020-01-22 11:14:27 -08:00
Samuel Attard
0799c8721c fix: backport patch for zero-size pixels in blink (#21857) 2020-01-22 16:39:05 +09:00
Cheng Zhao
442174da0f fix: call SetCanActivate in setFocusable (#21855) 2020-01-22 14:45:04 +09:00
Samuel Attard
ef94a79cac refactor: try just using regular [Sync] for MessageSync (#21776) 2020-01-22 10:39:27 +09:00
trop[bot]
38afcff63a fix: crash when restoring minimized hidden window (#21820)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-20 15:43:42 +09:00
trop[bot]
7ddfffb723 fix: pass full response headers in net module (#21770)
* fix: pass full response headers in net module

* chore: put helper classes in annoymouse namespace

* fix: use hasOwnProperty to test key

* chore: shorter class name

* fix: 7.x has different type for raw headers

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-15 16:06:05 +09:00
Robo
f8e601adaf Fix memory leak in generator functions (#21773)
Backports https://chromium-review.googlesource.com/c/v8/v8/+/1967317
2020-01-15 09:56:58 +09:00
trop[bot]
dd27520637 fix: stream protocols not completing (#21758)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-01-14 16:09:37 +09:00
Electron Bot
85c07d0715 Bump v7.1.9 2020-01-13 09:10:46 -08:00
Cheng Zhao
4dac36d111 fix: disable private macOS APIs in MAS build except for CAContext/CALayerHost (7-1-x) (#21575)
* fix: add patch to disable remote accessibility APIs

* fix: add patch to disable private window frame APIs

* fix: add patch to disable NSURLFileTypeMappings API
2020-01-13 09:09:07 -08:00
trop[bot]
ae27218296 fix: don't fallback to OpenFolderViaShell (#21749)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-01-13 14:55:55 +09:00
trop[bot]
c92efa4ec5 fix: prefer occluded rather than unloading layout info (#21750)
Co-authored-by: loc <andy@slack-corp.com>
2020-01-13 14:55:24 +09:00
Milan Burda
cbf499b18a fix: load window-setup in sandboxed renderer (#21696) 2020-01-13 10:25:20 +09:00
trop[bot]
7b1117e186 fix: don't unnecessarily copy draggable regions (#21723)
In some calls to `BrowserWindow::UpdateDraggableRegions` the parameter
`regions` points to object's variable `draggable_regions_` which we later
try to update with data received in the parameter. In these cases coping
is unnecessary. Additionally after this code is executed `draggable_regions_`
would be empty and as a result whole window would be undraggable.

Co-authored-by: CezaryKulakowski <50166166+CezaryKulakowski@users.noreply.github.com>
2020-01-13 10:04:59 +09:00
trop[bot]
3bd3d9440a docs: responseHeaders should be Record<string, string[]> (#21742)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-01-13 09:51:47 +09:00
trop[bot]
704cdd3a2b fix: avoid contextBridge double free on garbage collection (#21736)
* fix: reset next/prev pointers for life-monitored nodes

* fix: don't double-delete nodes in a linked list

Co-authored-by: loc <andy@slack-corp.com>
2020-01-10 16:55:59 -08:00
trop[bot]
c56e5abd8c fix: Notification crash in before-quit (#21719) 2020-01-10 09:08:09 -08:00
Electron Bot
ec61041d41 Bump v7.1.8 2020-01-08 11:40:06 -08:00
trop[bot]
32b51bce75 refactor: throw error for getLastCrashReport if crashReporter not started (#21683) 2020-01-07 09:15:21 -05:00
trop[bot]
e0576ef11a fix: highlight defaulted button correctly (#21652) 2020-01-03 11:03:03 -05:00
trop[bot]
a889ec7957 fix: SimpleURLLoaderWrapper redirects (#21566) (#21645) 2020-01-01 09:32:26 +09:00
Electron Bot
bef0dd868b Bump v7.1.7 2019-12-19 06:49:00 -08:00
Electron Bot
3d74cacefe Revert "Bump v7.1.7"
This reverts commit 0b1248c8e6.
2019-12-19 06:47:37 -08:00
Electron Bot
0b1248c8e6 Bump v7.1.7 2019-12-19 05:56:00 -08:00
Jeremy Apthorp
0569c929a1 fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains (#21572) 2019-12-19 05:54:19 -08:00
trop[bot]
2dc42971ce docs: update webContents.printToPDF() example for promisified API (#21550)
References: https://github.com/electron/electron/pull/16795 https://github.com/electron/electron/pull/17907
2019-12-18 15:20:52 +09:00
Electron Bot
577d0483e9 Bump v7.1.6 2019-12-17 14:43:26 -08:00
John Kleinschmidt
a3fde67056 Revert "Bump v7.1.6"
This reverts commit fc800837bd.
2019-12-17 13:52:26 -08:00
Shelley Vohr
79aebdffb7 fix: MediaKey globalShortcuts not working on macOS (#21548) 2019-12-17 13:39:18 -08:00
Electron Bot
fc800837bd Bump v7.1.6 2019-12-16 17:26:41 -08:00
Shelley Vohr
58469efd1c Revert "Bump v7.1.6"
This reverts commit f17dc63c16.
2019-12-16 17:23:47 -08:00
Shelley Vohr
80c36602fd Revert "Bump v7.1.7"
This reverts commit f910704838.
2019-12-16 17:23:12 -08:00
Electron Bot
f910704838 Bump v7.1.7 2019-12-16 17:15:21 -08:00
Electron Bot
f17dc63c16 Bump v7.1.6 2019-12-16 17:15:04 -08:00
John Kleinschmidt
04b0d61323 Revert "Bump v7.1.6"
This reverts commit 544b4c5209.
2019-12-16 17:07:15 -08:00
Electron Bot
544b4c5209 Bump v7.1.6 2019-12-16 13:54:16 -08:00
Milan Burda
b35f37ea5a refactor: export internalWindowOpen from guest-window-manager (#21542) 2019-12-16 13:52:04 -08:00
Milan Burda
7f0bbd27b1 fix: enforce parent-child relationship in custom postMessage() handler (#21528) 2019-12-16 13:51:20 -08:00
trop[bot]
3b557bcf2e docs: update installation docs to reflect latest @electron/get changes (#21539) 2019-12-16 09:45:30 -08:00
Robo
ef2f0580d9 fix: select box not rendered properly with OOPIF (#21526)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1879597
2019-12-15 22:46:16 -05:00
trop[bot]
425d2fa6f1 fix: quit after Chromium is fully started (#21505) 2019-12-14 14:08:27 -05:00
Electron Bot
1409056baf Bump v7.1.5 2019-12-13 11:48:14 -08:00
Samuel Attard
72cb493023 Revert "Bump v7.1.5"
This reverts commit 383e75796a.
2019-12-13 13:43:09 -05:00
trop[bot]
1e7f26e5fd fix: avoid contextBridge crash when RenderFrame address is reused (#21514)
* fix: avoid contextBridge crash when RenderFrame address is reused

Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net>

* make routing_id_ const
2019-12-13 13:39:50 -05:00
Electron Bot
383e75796a Bump v7.1.5 2019-12-13 08:07:11 -08:00
loc
1edfffae25 fix: workaround for hang when preventDefault-ing nativeWindowOpen (7-1-x) (#21497)
* fix: enable workaround for nativeWindowOpen hang

* add test

* test: ensure window doesn't leak into other test
2019-12-13 11:06:11 -05:00
trop[bot]
96e7b443fc fix: sourcemaps not loading with network service (#21494)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1525270
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1852212
2019-12-12 17:29:49 -08:00
Robo
8f728af13a fix: avoid Electron.dsym files in the main app bundle (#21447) (#21487)
* ci: CHECK_DIST_MANIFEST in release builds

* fix: skip Electron.dSYM on macOS app zip
2019-12-12 16:27:17 +09:00
trop[bot]
281b0741f7 fix: name and expirationDate should be optional when setting cookie (#21454) (#21481)
* fix: correctly set cookie date

* fix: name is not required for setting cookie

* test: clear cookie after each cookie test

* test: should test session property

* chore: style fixes
2019-12-12 09:18:51 +09:00
Cheng Zhao
38c43ab48f fix: hiding window menu should work on startup (#21436) (#21449)
* fix: menu visibility should not be overwritten on startup

* fix: removing menu for window without global menubar

* test: setMenu tests are not for mac
2019-12-11 15:41:29 +09:00
trop[bot]
d1d3d1bd1f fix: restore accessibility window title on macOS (#21466)
Electron's `AtomNSWindow` implements `accessibilityAttributeValue` to
provide various accessibility info to the OS, including window titles.

Chromium 75 changed to Apple's newer accessibility API for window titles
in the super class that `AtomNSWindow` inherits from. macOS still
supports both the old and new style APIs, but it will prefer the new
style if it is implemented.  This means the Electron window title is
being ignored because the newer API at the Chromium level has taken
precedence.

By implementing the newer accessibility API in `AtomNSWindow`, this
restores correct accessibility window titles in macOS Electron apps.

This is a regression has been present since Electron 6.0.0 (the first
release including the Chromium change above).
2019-12-10 22:07:55 -05:00
trop[bot]
89a7bdb566 fix: window menu should handle keys correctly (#21453) 2019-12-10 10:05:28 -08:00
Electron Bot
09d59f2b83 Bump v7.1.4 2019-12-09 13:34:26 -08:00
Samuel Attard
ebec22045d Revert "Bump v7.1.4"
This reverts commit a2c4000b84.
2019-12-09 13:32:40 -08:00
Electron Bot
a2c4000b84 Bump v7.1.4 2019-12-09 11:30:37 -08:00
trop[bot]
9010838f21 fix: fix ClientRequest.getUploadProgress (#21425) 2019-12-09 11:18:29 -08:00
trop[bot]
6fe40ca797 docs: fix return type of getPrinters (#21422) 2019-12-08 10:38:04 -08:00
Shelley Vohr
101b971f36 fix: pass noLink and checkboxChecked correctly on Windows (#21406) 2019-12-06 18:20:05 -08:00
trop[bot]
6156254886 fix: ensure persistence store still exists when GC runs (#21417)
Fix a bad access crash that happens when a render frame is deleted (window closed) and garbage collection runs afterward.
2019-12-06 12:35:47 -08:00
Electron Bot
d0e4bd3fc9 chore: bump chromium in DEPS to 78.0.3904.130 (#21413) 2019-12-06 11:29:19 -08:00
trop[bot]
3e5213b4e9 fix: Fix compositor recycling when creating new BrowserView (#21400)
In #20829, we fixed compositor recycling when switching between
BrowserViews, but it turns out that there is one additional case that we
need to handle. When we create a completely new BrowserView instance, it
starts of as visible (even when it hasn't been added to the window),
which means that it will need its own compositor instead of using the
recycled compositor.

To fix this, lets make BrowserViews hidden by default until they're
added to the window. See also #19988. This is a potentially breaking
change given that the initial value of `document.visibilityState` will
now be `hidden`, but given the experimental status of BrowserViews, I
think this is a fine change to make. The old behavior can be restored
with `webPreferences: { show: true }`.

Notes: Fix compositor recycling when creating new BrowserView
2019-12-05 15:55:29 -06:00
Electron Bot
7ba8855ac1 chore: bump chromium in DEPS to 78.0.3904.129 (#21394) 2019-12-05 10:40:18 -08:00
Electron Bot
c3e0ae9646 chore: bump chromium in DEPS to 78.0.3904.128 (#21381) 2019-12-04 09:52:00 -08:00
trop[bot]
4b456bf3cb chore: remove unused shell/common/crash_reporter/win/crash_service.cc (#21375) 2019-12-04 16:40:30 +09:00
Electron Bot
2a4bdfff98 chore: bump chromium in DEPS to 78.0.3904.127 (#21367) 2019-12-03 08:16:43 -08:00
trop[bot]
c4baee0dab fix: backgroundThrottling rwh assignment (#21357)
* fix: backgroundThrottling rwh assignment

* fix: disable DOM timer throttling

* chore: fix typo
2019-12-02 15:42:32 -08:00
Electron Bot
15688c6d6e Bump v7.1.3 2019-12-02 12:31:58 -08:00
trop[bot]
aa4d7f1799 fix: ensure no node globals passively leak when nodeIntegration is disabled (#21354) 2019-12-02 12:27:40 -08:00
Jeremy Apthorp
0476eb67ab refactor: rewrite the net module to simplify state tracking (#21304)
* refactor: rewrite the net module to simplify state tracking (#21244)

* un-ginify some things

* lint

* qualify util::Promise

* network::mojom::URLResponseHead -> network::ResourceResponseHead

* fix build

* Update api-net-spec.ts

* Update api-net-spec.ts

* Init -> InitWith
2019-12-02 12:26:47 -08:00
Electron Bot
69aebc05e5 chore: bump chromium to 78.0.3904.126 (7-1-x) (#21346)
* chore: bump chromium in DEPS to 78.0.3904.125

* chore: bump chromium in DEPS to 78.0.3904.126
2019-12-02 10:09:38 -08:00
Electron Bot
98d06f6e5c chore: bump chromium in DEPS to 78.0.3904.124 (#21339) 2019-11-30 16:21:41 -08:00
Electron Bot
7d321a90aa chore: bump chromium to 78.0.3904.123 (7-1-x) (#21307)
* chore: bump chromium in DEPS to 78.0.3904.121

* chore: bump chromium in DEPS to 78.0.3904.122

* chore: bump chromium in DEPS to 78.0.3904.123
2019-11-29 11:38:40 -08:00
trop[bot]
cfddc0a125 build: disable strip_absolute_paths_from_debug_symbols on debug.gn (#21317) 2019-11-29 17:21:44 +09:00
Jeremy Apthorp
ade70463c1 fix: restore --ignore-connections-limit functionality (#21286) (#21299) 2019-11-27 16:26:17 +09:00
Jeremy Apthorp
4cb983ed40 ci: generate debug symbols on Linux (#18676) (#21279) 2019-11-26 17:33:31 -08:00
trop[bot]
79b3fcb2ab fix: allow reading body from non-2xx responses in net.request (#21055) (#21295)
* fix: allow reading body from non-2xx responses in net.request (#21055)

* fix(urlrequest): allow non-2xx repsponse results

- closes #21046

* test(net): add test cases to verify non-2xx body

* test(session): update spec to match clientrequest behavior

* test(net): update test cases to match clientrequest behavior

* spec: clean up async net spec

* Update api-session-spec.js

* chore: fixup test as per original PR to master
2019-11-26 17:32:56 -08:00
Electron Bot
4cfa7be79d chore: bump chromium to 78.0.3904.120 (7-1-x) (#21252)
* chore: bump chromium in DEPS to 78.0.3904.116

* chore: bump chromium in DEPS to 78.0.3904.117

* chore: bump chromium in DEPS to 78.0.3904.118

* chore: bump chromium in DEPS to 78.0.3904.119

* chore: bump chromium in DEPS to 78.0.3904.120
2019-11-26 13:12:25 -08:00
Samuel Attard
67bcc2a972 fix: reloadIgnoringCache() should ignore the cache (#21263) (#21284) 2019-11-25 13:09:41 -08:00
Jeremy Apthorp
449bdcfda2 fix: record cpu_profiler data for main process (#21187) (#21277)
* fix: record cpu_profiler data for main process

* kick ci
2019-11-25 12:56:31 -08:00
trop[bot]
e70adc8f83 fix: add missing early return (#21281) 2019-11-25 12:50:41 -08:00
trop[bot]
a6ae1ca755 spec: skip flaky <webview>.capturePage() test on Windows (#21211) 2019-11-22 15:31:19 -05:00
trop[bot]
b6fb8d3a63 docs: remove string literal type from window events (#21246) 2019-11-21 14:50:38 -08:00
Electron Bot
5462a2c197 chore: bump chromium in DEPS to 78.0.3904.115 (#21239) 2019-11-21 12:08:06 -05:00
Jeremy Apthorp
de428e9a7a fix: implement 'login' event for net.ClientRequest (#21135)
* fix: implement 'login' event for net.ClientRequest (#21096)

* fix patch

* lint

* include mojo header in atom_browser_context.h

* fix compile

* kick ci

* URLRequest -> URLRequestNS

* fix ts

* no ts in js
2019-11-21 12:06:23 -05:00
Cheng Zhao
fbe36e2365 fix: menu should not be garbage-collected when popuping (7-1-x) (#21225)
* fix: retain menu when popuping

* test: menu should not be garbage-collected when popuping
2019-11-21 07:14:24 +09:00
Electron Bot
5ac12c9e44 chore: bump chromium in DEPS to 78.0.3904.114 (#21228) 2019-11-20 10:04:55 -08:00
Robo
8d11391cb4 fix: focus with OOPIF embedded inside <webview> (#21223) 2019-11-20 09:11:27 -08:00
Electron Bot
e82f453f71 Bump v7.1.2 2019-11-19 12:59:32 -08:00
John Kleinschmidt
abc187d651 Revert "Bump v7.1.2"
This reverts commit d7ce600503.
2019-11-19 15:57:57 -05:00
John Kleinschmidt
913ef7890f Revert "Bump v7.1.3"
This reverts commit bcb24bcdd1.
2019-11-19 15:57:54 -05:00
Electron Bot
bcb24bcdd1 Bump v7.1.3 2019-11-19 12:41:57 -08:00
Electron Bot
d7ce600503 Bump v7.1.2 2019-11-19 12:40:06 -08:00
trop[bot]
d16f29f7fc build: use python3 to download external binaries (#21213)
* build: use python3 to download external binaries

* Update config.py
2019-11-19 15:39:10 -05:00
John Kleinschmidt
3b77af7ac3 Revert "Bump v7.1.2"
This reverts commit 0a241479cb.
2019-11-19 14:41:23 -05:00
Electron Bot
0a241479cb Bump v7.1.2 2019-11-19 10:34:40 -08:00
Robo
1c8177c542 fix: disable Touch Bar typing suggestions with autocorrect=off and spellcheck=false (#21192)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1917603
2019-11-19 13:32:09 -05:00
Electron Bot
3f148fc3aa chore: bump chromium in DEPS to 78.0.3904.113 (#21199) 2019-11-19 09:45:52 -08:00
Robo
dd2310df48 fix: allow chromium to handle WM_NCCALCSIZE for frameless windows (#21164) (#21205) 2019-11-19 08:36:29 -08:00
Charles Kerr
9bc81be9d0 docs: document webkitdirectory breaking change (#21178)
Manually backport #20934. See that PR for details.
2019-11-19 08:03:22 -08:00
trop[bot]
dc90c1153e fix: stream protocols sometimes flake out (#21179)
* fix: stream protocols sometimes flake out

* Update shell/browser/net/node_stream_loader.cc

Co-Authored-By: Charles Kerr <ckerr@github.com>
2019-11-19 06:35:02 -08:00
trop[bot]
7beb7b9a12 docs: fix isMactemplateImage type definition (#21181) 2019-11-18 21:04:12 -08:00
Robo
b6198b1648 fix: backport libuv patch for uv_spawn() ENOMEM on empty env (#21140) 2019-11-18 10:21:17 -08:00
Jeremy Apthorp
16ff7b17a0 fix: implement login event for WebContents (#21097) 2019-11-18 10:14:43 -08:00
Robo
0d8be47c0f fix: incorrect size of windows on differently scaled monitors (#21138)
* Revert "fix: handle WM_GETMINMAXINFO instead of letting chromium do it (#19928) (#20000)"

This reverts commit 182f63d3a3.

* fix: don't reset the width and height when correcting window placement
2019-11-18 09:58:13 -08:00
Electron Bot
c4ab79e7ae chore: bump chromium to 78.0.3904.112 (7-1-x) (#21109)
* chore: bump chromium in DEPS to 78.0.3904.105

* chore: bump chromium in DEPS to 78.0.3904.106

* chore: bump chromium in DEPS to 78.0.3904.107

* chore: bump chromium in DEPS to 78.0.3904.109

* chore: bump chromium in DEPS to 78.0.3904.111

* chore: bump chromium in DEPS to 78.0.3904.112
2019-11-18 09:12:29 -08:00
Cheng Zhao
49d91c7fc8 fix: webRequest should be able to modify CORS headers (7-1-x) (#21123)
* test: move webRequest spec to main runner (#19992)

* fix: webRequest should be able to modify CORS headers (#21099)
2019-11-15 14:56:52 +09:00
Milan Burda
2b84b1ea43 fix: NativeImage serialization of <webview>.capturePage() result (#20825) (#21104) 2019-11-14 10:36:02 +00:00
Electron Bot
4bb6f57657 chore: bump chromium to 78.0.3904.104 (7-1-x) (#21060) 2019-11-12 15:59:30 -08:00
Electron Bot
db47a846da chore: bump chromium in DEPS to 78.0.3904.100 (#21049) 2019-11-08 15:26:27 -05:00
Electron Bot
a3c951b14b Bump v7.1.1 2019-11-07 13:00:09 -08:00
loc
c5abb17569 fix: allow iframe-initiated HTML fullscreen to exit while in macOS fullscreen (7-1-x) (#21021)
* fix: explicitly resize the contents when exiting html fullscreen while in OS fullscreen

* test: ensure HTML fullscreen toggles while in OS fullscreen
2019-11-07 12:58:50 -08:00
Electron Bot
1b0ba71973 chore: bump chromium in DEPS to 78.0.3904.99 (#21033) 2019-11-07 15:46:26 -05:00
Robo
8dd004235b fix: webrequest api typings (#21038)
* fix: webrequest api typings

* Update web-request.md
2019-11-07 11:46:26 -08:00
Robo
55955c3d79 fix: crash on exit in aura platforms with webview (#21022)
* fix: backport upstream patch for shutdown of X11 windows

* fix: check for validity of guest webcontents
2019-11-07 11:31:42 -05:00
trop[bot]
5b33e9d9b7 fixes widget host fetching from render view host (#21013) 2019-11-06 15:06:34 -08:00
trop[bot]
6871b448ad fix: proper i18n of recentDocuments item (#20957) 2019-11-06 13:57:53 -08:00
trop[bot]
7a1b3c5f2d fix: Fix broken globalShortcuts.registerAll() on non-macOS platforms (#20983)
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
2019-11-06 13:37:22 -08:00
trop[bot]
2e8349c520 fix: correctly emplace optional values in the value converter (#21008)
* fix: correctly emplace optional values in the value converter

* chore: replace optional with nullopt when the conversion failed
2019-11-06 13:32:38 -08:00
Electron Bot
d63150502b chore: bump chromium in DEPS to 78.0.3904.98 (#20999) 2019-11-06 10:41:22 -05:00
trop[bot]
daa61688b1 docs: fix win.setIcon ts type (#20980)
* docs: fix win.setIcon ts type

* test: update smoke tests
2019-11-05 21:25:57 -08:00
trop[bot]
0a3b0391f4 chore: emit the document-start and document-end events in a sandboxed renderer (#20991) 2019-11-05 19:25:07 -08:00
Samuel Attard
1b66c03e41 chore: upgrade ts generator for better type safety (#20975) (#20977)
* chore: upgrade ts generator for better type safety

* spec: fix tests
2019-11-05 15:20:29 -08:00
trop[bot]
92362da082 docs: update installation instructions for proxies (#20978) 2019-11-05 13:45:27 -08:00
Electron Bot
16e468137f chore: bump chromium in DEPS to 78.0.3904.95 (#20973) 2019-11-05 11:07:12 -05:00
Electron Bot
b27a34eb91 Bump v7.1.0 2019-11-04 16:16:14 -08:00
Samuel Attard
18176b48b4 chore: prepare for 7.1.0 2019-11-04 16:15:24 -08:00
Milan Burda
317f0cec68 fix: cannot access nativeTheme via electron.remote (#20938) (#20961) 2019-11-04 16:11:43 -08:00
Samuel Attard
49009236d9 fix: capture the promise global to avoid userland mutation (#20925) (#20947) 2019-11-04 15:58:55 -08:00
Samuel Attard
976c7d122a feat: add a new contextBridge module (#20789)
* feat: add a new contextBridge module (#20307)

* feat: add a new contextBridge module

* chore: fix docs linting

* feat: add support for function arguments being proxied

* chore: ensure that contextBridge can only be used when contextIsolation is enabled

* docs: getReverseBinding can be null

* docs: fix broken links in md file

* feat: add support for promises in function parameters

* fix: linting failure for explicit constructor

* Update atom_api_context_bridge.cc

* chore: update docs and API design as per feedback

* refactor: remove reverse bindings and handle GC'able functions across the bridge

* chore: only expose debugGC in testing builds

* fix: do not proxy promises as objects

* spec: add complete spec coverage for contextBridge

* spec: add tests for null/undefined and the anti-overwrite logic

* chore: fix linting

* spec: add complex nested back-and-forth function calling

* fix: expose contextBridge in sandboxed renderers

* refactor: improve security of default_app using the new contextBridge module

* s/bindAPIInMainWorld/exposeInMainWorld

* chore: sorry for this commit, its a big one, I fixed like everything and refactored a lot

* chore: remove PassedValueCache as it is unused now

Values transferred from context A to context B are now cachde in the RenderFramePersistenceStore

* chore: move to anonymous namespace

* refactor: remove PassValueToOtherContextWithCache

* chore: remove commented unused code blocks

* chore: remove .only

* chore: remote commented code

* refactor: extract RenderFramePersistenceStore

* spec: ensure it works with numbered keys

* fix: handle number keys correctly

* fix: sort out the linter

* spec: update default_app asar spec for removed file

* refactor: change signatures to return v8 objects directly rather than the mate dictionary handle

* refactor: use the v8 serializer to support cloneable buffers and other object types

* chore: fix linting

* fix: handle hash collisions with a linked list in the map

* fix: enforce a recursion limit on the context bridge

* chore: fix linting

* chore: remove TODO

* chore: adapt for PR feedback

* chore: remove .only

* chore: clean up docs and clean up the proxy map when objects are released

* chore: ensure we cache object values that are cloned through the V8 serializer

* docs: mark contextBridge as experimental (#20638)

* docs: mark contextBridge as experimental

This commit didn't make it to the original PR, quick addition here

* Update context-bridge.md

* chore: update for 7-0-x differences

* chore: update callback header

* chore: add v8 serializer converter, cherry picked from 2fad53e66b

* chore: update for 7-0-x differences
2019-11-04 14:56:03 -08:00
Samuel Attard
ef548b6592 chore: prepare for 7.1.0 2019-11-04 14:35:16 -08:00
trop[bot]
37c1df6ce1 fix: don't copy tray image when it's set (#20935) 2019-11-04 14:17:15 -08:00
Electron Bot
d9068b7175 chore: bump chromium to 78.0.3904.94 (7-0-x) (#20930)
* chore: bump chromium in DEPS to 78.0.3904.93

* chore: bump chromium in DEPS to 78.0.3904.94
2019-11-04 09:35:39 -05:00
Electron Bot
cac0a4fe3c Bump v7.0.1 2019-11-01 09:46:44 -07:00
John Kleinschmidt
e6807b387c ci: Revert CircleCI changes (#20916)
* Revert "build: lengthen wait times and retries for CircleCI releases (#20893)"

This reverts commit 41b32cf5d9.

* Revert "ci: verify CircleCI job number before returning job url (#20864)"

This reverts commit b97c3aca2d.

* Revert "build: run publish jobs in the secure context and enable sccache (#20863)"

This reverts commit 055b5d274e.

* Revert "ci: use CircleCI 2.1 config and v2 APIs (#20852)"

This reverts commit 1841742586.
2019-11-01 12:44:53 -04:00
Electron Bot
f6f73a5a78 Revert "Bump v7.0.1"
This reverts commit 7bad919bee.
2019-11-01 08:28:33 -07:00
Electron Bot
7bad919bee Bump v7.0.1 2019-11-01 08:09:20 -07:00
Electron Bot
667db6fa67 chore: bump chromium in DEPS to 78.0.3904.92 (#20913) 2019-11-01 11:06:43 -04:00
John Kleinschmidt
022ee3793b build: allow CircleCI timeout and retry to be set via env variables (7-0-x) (#20912)
* build: allow circleci timeout and retry to be set via env variables

* check for more statuses and run indefinitely
2019-11-01 11:05:57 -04:00
Electron Bot
5c0e8c5fd3 Revert "Bump v7.0.1"
This reverts commit 961436f300.
2019-11-01 05:09:48 -07:00
Electron Bot
961436f300 Bump v7.0.1 2019-11-01 05:07:26 -07:00
trop[bot]
e2c7e4b1ad fix: use Unicode version of ShellExecute() in OpenExternalOnWorkerThread() (#20905) 2019-11-01 08:05:57 -04:00
Electron Bot
d12b0eefe0 Revert "Bump v7.0.1"
This reverts commit 8dfb8c5589.
2019-10-31 13:22:22 -07:00
Electron Bot
8dfb8c5589 Bump v7.0.1 2019-10-31 13:19:55 -07:00
John Kleinschmidt
57bb08e084 Revert "Bump v7.0.1" (#20895)
This reverts commit 0de78019c8.
2019-10-31 15:11:45 -04:00
Electron Bot
03e0905519 Revert "Bump v7.0.2"
This reverts commit b6717a6644.
2019-10-31 12:07:12 -07:00
Electron Bot
b6717a6644 Bump v7.0.2 2019-10-31 11:57:41 -07:00
trop[bot]
41b32cf5d9 build: lengthen wait times and retries for CircleCI releases (#20893)
* build: lengthen wait times and retries for CircleCI releases

* Review suggestions
2019-10-31 14:53:05 -04:00
trop[bot]
176f4728d7 docs: clean up performance checklist formatting (#20887)
* docs: fix list formatting in performance checklist

* docs: remove unused link ref
2019-10-31 09:52:42 -07:00
Electron Bot
0de78019c8 Bump v7.0.1 2019-10-31 09:02:29 -07:00
trop[bot]
1926169c91 fix: swapped labels on open/save gtkdialog (#20882) 2019-10-31 08:42:35 -07:00
Electron Bot
25b3ee29cf chore: bump chromium in DEPS to 78.0.3904.88 (#20873) 2019-10-31 10:54:20 -04:00
trop[bot]
2228e5ac65 build: do not try to run non existent VSTS release builds (#20877) 2019-10-31 10:04:53 -04:00
Electron Bot
92cace3998 Revert "Bump v7.0.1"
This reverts commit 7dc858be02.
2019-10-30 17:06:52 -07:00
Electron Bot
7dc858be02 Bump v7.0.1 2019-10-30 17:05:00 -07:00
Electron Bot
7ffa127f0f Revert "Bump v7.0.1"
This reverts commit f423312090.
2019-10-30 17:01:39 -07:00
Electron Bot
f423312090 Bump v7.0.1 2019-10-30 17:00:10 -07:00
Electron Bot
4cacd15730 Revert "Bump v7.0.1"
This reverts commit 37eeaf32ad.
2019-10-30 16:45:49 -07:00
Electron Bot
37eeaf32ad Bump v7.0.1 2019-10-30 16:42:36 -07:00
trop[bot]
b97c3aca2d ci: verify CircleCI job number before returning job url (#20864) 2019-10-30 19:40:01 -04:00
Electron Bot
2e07877c28 Revert "Bump v7.0.1"
This reverts commit d8bd7654c6.
2019-10-30 16:05:51 -07:00
Electron Bot
d8bd7654c6 Bump v7.0.1 2019-10-30 16:00:48 -07:00
Electron Bot
f979e0cfbc Revert "Bump v7.0.1"
This reverts commit 1582824d33.
2019-10-30 15:59:42 -07:00
Electron Bot
1582824d33 Bump v7.0.1 2019-10-30 15:50:34 -07:00
John Kleinschmidt
71009fd61e docs: Update the sccache name (#20860)
* docs: Update the sccache name (#20462)

(cherry picked from commit b3e7657159)

* Update sccache name in circleCI
2019-10-30 18:48:55 -04:00
trop[bot]
055b5d274e build: run publish jobs in the secure context and enable sccache (#20863) 2019-10-30 18:45:47 -04:00
trop[bot]
1841742586 ci: use CircleCI 2.1 config and v2 APIs (#20852)
* ci: use circleci 2.1

* Check for pipeline status and add comments
2019-10-30 17:33:50 -04:00
Birunthan Mohanathas
3841ac9b6d fix: Disable compositor recycling only for attached views (7-0-x) (#20846)
Backport of #20829

Notes: Fix flicker when switching between `BrowserView`s
2019-10-30 16:56:49 -04:00
trop[bot]
ed1c2a47f1 build: optimize the CI path where we update the patch files (#20854)
Currently the happy checkout takes 7 minutes and the sad checkout takes
30 minutes.  This updates our CI to run checkout twice for every job to
make the sad checkout take nearer 10 minutes instead.
2019-10-30 15:43:05 -04:00
Electron Bot
bcc4f67784 chore: bump chromium to 78.0.3904.86 (7-0-x) (#20823)
* chore: bump chromium in DEPS to 78.0.3904.83

* chore: bump chromium in DEPS to 78.0.3904.86
2019-10-30 12:17:18 -04:00
Milan Burda
771d4dc374 fix: devtools extensions not loading (#20791) (#20844) 2019-10-30 11:35:50 -04:00
Milan Burda
b1fb7c7bfb fix: properly generate requestID in webContents.printToPDF() (#20769) (#20810) 2019-10-30 14:38:29 +09:00
Milan Burda
725dac35ab fix: pass frameId to v8Util.setRemoteCallbackFreer() (#20732) (#20814) 2019-10-30 14:35:37 +09:00
trop[bot]
6e32da3798 fix: prevent menu gc during popup (#20808) 2019-10-29 16:25:08 +09:00
trop[bot]
32ac551ca5 fix: deprecation warnings in Electron code (#20804) 2019-10-29 15:39:05 +09:00
trop[bot]
b90ac55d2d docs: the ipc main listener being removed can have args (#20806) 2019-10-29 15:35:06 +09:00
Electron Bot
e797639d6d chore: bump chromium to 78.0.3904.82 (7-0-x) (#20758) 2019-10-28 10:46:28 -07:00
trop[bot]
a31d041f03 docs: add the performance doc to the table of contents (#20748) 2019-10-28 10:27:35 -04:00
trop[bot]
6b70f0e8e6 docs: Performance checklist (#20757)
* docs: First draft of perf checklist

* docs: More words

* docs: Use standard in code example

* docs: fix broken link

* Update docs/tutorial/performance.md

Co-Authored-By: Charles Kerr <ckerr@github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Charles Kerr <ckerr@github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: loc <andy@slack-corp.com>

* Update docs/tutorial/performance.md

Co-Authored-By: loc <andy@slack-corp.com>

* docs: Implement suggestions

* docs: Include VSCode talk

* chore: Pass linter

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/performance.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Apply suggestions from code review

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

* Update performance.md

* fix: The process link
2019-10-28 09:56:55 -04:00
trop[bot]
b1357ab12b docs: fix process.getSystemVersion() type (#20768) 2019-10-27 11:21:03 -07:00
Electron Bot
ffdec7a661 chore: bump chromium to 78.0.3904.78 (7-0-x) (#20722) 2019-10-25 09:22:52 -07:00
Milan Burda
50822bc8d4 fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously (#20632) (#20715) 2019-10-24 09:50:48 +09:00
trop[bot]
85164223cb chore: update build_bring_back_node_with_ltcg_configuration.patch (#20708)
* chore: update build_bring_back_node_with_ltcg_configuration.patch

set default value for node_with_ltcg=true

* fix: move ltcg definition to Release configuration
2019-10-23 17:19:16 -07:00
Jeremy Apthorp
5cb6ba2883 chore: bump chromium to 78.0.3904.68 (7-0-x) (#20643)
* chore: bump chromium to 78.0.3904.68

* update chromium patches

* explicitly cancel redirects when the mode is 'error'
2019-10-23 13:53:11 -04:00
Jeremy Apthorp
e23030b69e fix: properly free remote objects (7-0-x) (#20693) 2019-10-23 10:31:48 -07:00
trop[bot]
d417bbdcfd fix: use xib file to construct macOS Menu (#20670)
* fix: use xib file to construct macOS Menu

* add nib files back to zip manifests

* address final review comments
2019-10-22 16:48:36 +09:00
trop[bot]
e6f92f3f30 ci: add macOS debug builds (#20573)
* ci: add macOS debug builds

* Fix mac debug builds

* Fix debug build

* Update comment for desktop_capturer (from #19848)
2019-10-21 16:52:51 -04:00
Robo
3b59f12495 fix: backport libuv patch for fs.mkdir/mkdirSync on invlaid names (#20629)
Backports https://github.com/libuv/libuv/pull/2375
2019-10-21 15:43:47 -04:00
Electron Bot
3083693e67 Bump v7.0.0 2019-10-21 12:36:53 -07:00
Robo
2a2f7e7090 fix: add patch to node for native module size issue on windows (#20614) (#20626) 2019-10-18 14:40:16 -07:00
Milan Burda
f4c697d7a1 test: skip desktopCapturer / remote module tests when the features are disabled (#20576) 2019-10-16 08:09:13 -07:00
Electron Bot
944690e79b Bump v7.0.0-beta.7 2019-10-15 11:08:05 -07:00
trop[bot]
ae303ade7d spec: allow "Yu Gothic" as a Japanese sans-serif font on Windows (#20570) 2019-10-14 12:38:27 -07:00
trop[bot]
19162f4bac fix: append network switches to network service process (#20558) 2019-10-13 21:09:14 -07:00
trop[bot]
ee53f8cef6 fix: do not manually parse content-type (#20544) 2019-10-11 16:03:15 -07:00
trop[bot]
4463715714 fix: properly register custom url evt handling (#20523) 2019-10-10 23:15:53 +02:00
Milan Burda
f6894da715 fix: when building with enable_plugins=false (#20507) 2019-10-10 14:11:17 +02:00
Jaime Bernardo
1657908fa8 build: fix build with Visual Studio 2019 (7-0-x) (#20502)
* fix: build angle dependency with VS 2019

Applies upstream patch to angle, fixing build errors when building
the angle dependency with the STL shipped with Visual Studio 2019.

Can be removed after this commit comes from upstream:
755417dd79

* fix: build v8 dependency with VS 2019

Applies upstream patch to v8, fixing build errors when building
the v8 dependency with the STL shipped with Visual Studio 2019.

Can be removed after this commit comes from upstream:
53e62affd3

* fix: build perfetto dependency with VS 2019

Applies upstream patch to perfetto, fixing build errors when building
the perfetto dependency with the STL shipped with Visual Studio 2019.

Can be removed after this commit comes from upstream:
f10b2053be

* fix: build quiche dependency with VS 2019

Applies upstream patch to quiche, fixing build errors when building
the quiche dependency with the STL shipped with Visual Studio 2019.

Can be removed after this commit comes from upstream:
https://quiche.googlesource.com/quiche/+/c1e9121f16559b084bb80afc6922f0316d082160
2019-10-09 22:32:38 +02:00
Cheng Zhao
26d059b3ea fix: cookies.get should be able to filter domain (#20471) (#20496)
* fix: use GetAllCookies when url is empty

* test: get cookie without url
2019-10-09 11:32:01 -04:00
Electron Bot
49aaa2fe96 Bump v7.0.0-beta.6 2019-10-08 15:19:26 -07:00
Samuel Attard
0a9b201c34 feat: nativeTheme.themeSource and a few nativeTheme fixes (#20486)
* feat: add nativeTheme.themeSource to allow apps to override Chromiums theme choice (#19960)

* feat: add nativeTheme.shouldUseDarkColorsOverride to allow apps to override Chromiums theme choice

* spec: add tests for shouldUseDarkColorsOverride

* chore: add missing forward declarations

* refactor: rename overrideShouldUseDarkColors to themeSource

* chore: only run appLevelAppearance specs on Mojave and up

* chore: update patch with more info and no define

* Update spec-main/api-native-theme-spec.ts

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Update api-native-theme-spec.ts

* Update api-native-theme-spec.ts

* Update api-native-theme-spec.ts

* fix: don't expose nativeTheme in the renderer process (#20139)

Exposing these in the renderer didn't make sense as they weren't backed
by the same instance / value store.  This API should be browser only
especially now that we have nativeTheme.themeSource.  Exposing in
//common was a mistake from the beginning.

* fix: emit updated on NativeTheme on the UI thread to avoid DCHECK (#20137)

* fix: emit updated on NativeTheme on the UI thread to avoid DCHECK

* Update atom_api_native_theme.cc

* spec: wait a few ticks for async events to emit so that test events do not leak into each other

* chore: add SetGTKDarkThemeEnabled(enabled) internal helper to allow dynamic theme selection on linux (#19964)

This is just a after-creation setter for the `darkTheme` constructor option.  This is delibrately
a method and not a property as there is no getter.

* spec: remove leftover .only
2019-10-08 18:18:00 -04:00
Shelley Vohr
e17cd837ef fix: enable worker threads in ELECTRON_RUN_AS_NODE (#20456) 2019-10-08 15:08:46 -04:00
trop[bot]
981208b66c fix: properly free IsolateData in node_main (#20476) 2019-10-08 14:30:15 +02:00
Robo
77af675511 fix: fs.watch() behavior change in node >= 10.16.0 (#20430)
This reverts the patch from https://github.com/electron/node/pull/100
which never got merged due to reasons outlined in https://github.com/libuv/libuv/pull/2313

* Adds new patches that backports https://github.com/libuv/libuv/pull/2459
  and https://github.com/libuv/libuv/pull/2460

Based on https://github.com/nodejs/node/issues/29460
2019-10-07 13:06:08 -07:00
trop[bot]
a92ee9443d test: close window before destroying browserView (#20420) 2019-10-04 10:26:32 +02:00
trop[bot]
23a52c02a3 fix: recentDocuments menu role on macOS (#20410) 2019-10-03 09:52:24 +02:00
Milan Burda
8536f62826 fix: allow paths to asar archives to contain the .asar extension in directories (#20342) (#20401) 2019-10-02 18:03:44 +09:00
trop[bot]
312f14ee88 fix: correctly crash when there is no crashReporter (#20395)
* fix: correctly crash when there is no crashReporter

* test: correctly crash when there is crashReporter
2019-10-01 15:23:16 -04:00
Birunthan Mohanathas
1f660c67c6 fix: Make the --disable-color-correct-rendering switch work again (backport) (#20359) 2019-09-30 10:47:05 -07:00
Shelley Vohr
325bdfaf23 fix: free screen capturers after usage ends (#20280)
* fix: free screen and window capturers immediately after we're finished with them (#20156)

fix #17937, #19908

* fix: reset capturers at the very end (#20270)
2019-09-25 10:10:44 -04:00
trop[bot]
e3dcdba2db fix: correct 'Entire screen' to ' Entire Screen' (#20302) 2019-09-20 07:44:43 -07:00
John Kleinschmidt
6b5a2c550a ci: actually kill leftover processes on WOA testing (#20289)
* ci: only kill WOA processes if they are running

(cherry picked from commit 844752cd97)

* ci: actually kill leftover processes on WOA testing

(cherry picked from commit a76d2d8e53)
2019-09-19 14:34:32 -04:00
trop[bot]
21e702a563 docs: improve and add examples for clipboard (#20279)
* docs: improve and add examples for clipboard

* address feedback from jkleinsc review
2019-09-18 16:31:00 -07:00
Electron Bot
f79cfae3c2 Bump v7.0.0-beta.5 2019-09-18 13:43:24 -07:00
trop[bot]
51ffe25f45 build: add WOA node headers to checksum file (#20261) 2019-09-18 16:23:13 -04:00
Electron Bot
0a0d7a8202 chore: bump chromium to 78.0.3905.1 (7-0-x) (#20062)
* chore: bump chromium in DEPS to 78.0.3899.1

* chore: bump chromium in DEPS to 78.0.3900.1

* chore: bump chromium in DEPS to 78.0.3900.2

* chore: bump chromium in DEPS to 78.0.3901.1

* chore: bump chromium in DEPS to 78.0.3902.1

* chore: remove tts.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1717595

* build: disable widevine cdm component

https://chromium-review.googlesource.com/c/chromium/src/+/1767596

* chore: bump chromium in DEPS to 78.0.3903.1

* build: redo network_context.h mojification

187df411f2%5E%21/#F7

* build: disable widevine

Disable widevine, atleast for the moment by deleting the patch and removing
the build argument.

> At the moment its horribly broken, we would have to look into fixing on all
> three platforms now that upstream also supports linux.

* chore: bump chromium in DEPS to 78.0.3904.1

* update pepper_flash.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1771371

* chore: bump chromium in DEPS to 78.0.3905.1

* Update patches

* Convert Web Speech Synthesis API over to Mojo

https://chromium-review.googlesource.com/c/chromium/src/+/1717595
(cherry picked from commit e0163b0185)

* Update patches

* CookieInclusionStatus: Support warnings and multiple exclusion reasons

https://chromium-review.googlesource.com/c/chromium/src/+/1756157
(cherry picked from commit ab2f5ac40b)

* Pass request_unadjusted_movement to lock mouse

https://chromium-review.googlesource.com/c/chromium/src/+/1767098
(cherry picked from commit a17daff6f1)

* chore: rename thread_pool to thread_pool_instance

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1773663
(cherry picked from commit 8547b09de8)

* Remove the typemap from network::mojom::URLResponseHead.

https://chromium-review.googlesource.com/c/chromium/src/+/1758653
(cherry picked from commit a768ad210d)

* ServiceWorker: Make Extension WebRequestAPI aware of service worker update check script requests

https://chromium-review.googlesource.com/c/chromium/src/+/1782230
(cherry picked from commit 615d33517a)

* Convert CertVerifierClient to new Mojo types

https://bugs.chromium.org/p/chromium/issues/detail?id=955171
(cherry picked from commit ac5e8dbce5)

* Convert DataPipeGetterPtr and DataPipeGetterRequest to new Mojo types

https://chromium-review.googlesource.com/c/chromium/src/+/1787760
https://chromium-review.googlesource.com/c/chromium/src/+/1787659
(cherry picked from commit 8611783898)

* Add tts patch

* build: fix compilation with MSSTL

(cherry picked from commit 4d8cb7de9b)
2019-09-18 16:04:23 -04:00
trop[bot]
421490c6b3 fix: strip chrome-sandbox typo (#20258) 2019-09-18 09:44:02 -07:00
trop[bot]
068e12d909 fix: crash when exiting simple fullscreen on macOS (#20220) 2019-09-17 08:59:32 -07:00
trop[bot]
d251642c83 build: handle arm64 node headers (#20193)
* build: handle arm64 node headers

(cherry picked from commit ff1f224d96)

* node.lib for arm64 needs to go to specific dir
2019-09-11 17:03:49 -04:00
trop[bot]
27ceeb5e94 build: get all the release assets when looking for one to delete (#20164)
* build: get all the release assets when looking for one to delete

yeah we totally have more than 30....

* Update upload-to-github.js
2019-09-09 06:14:57 -07:00
trop[bot]
4ac616b681 fix: resolve crash loading file based serviceworkers (#20142) 2019-09-05 21:15:17 -07:00
trop[bot]
fc677b7cf6 fix: Debug builds on Windows. (#20140) 2019-09-05 18:02:40 -07:00
trop[bot]
d25e511fc0 fix: ensure document.visibilityState aligns with the visibility of the TopLevelWindow (#20134)
* fix: ensure document.visibilityState aligns with the visibility of the TopLevelWindow

* chore: disable the specs on linux on CI
2019-09-05 16:46:35 -07:00
trop[bot]
b4ba2f6d55 build: don't wait until job requests return in case some jobs fail to return (#20136) 2019-09-05 14:01:36 -04:00
John Kleinschmidt
f967d73a13 ci: run tests on WOA hardware (7-0-x) (#20091)
* ci: run tests on WOA hardware (#20031)

* ci: run tests on WOA hardware

* Temporarily disable test until #20008 is resolved

* deterministically run tests in sorted order

(cherry picked from commit bedc5f7da9)

* use request instead of blur to detect openExternal success

* use blur event on mac, sigh

* oh, right, still gotta open an actual url

* Disable test until #20008 is resolved
2019-09-04 19:22:29 -04:00
trop[bot]
c923aa2fde fix: ensure modeL_ exists before calling delegate methods (#20116)
This is a speculative fix for a crash we are seeing in `menuDidClose`.  We
can't repro the crash but the traces have it happening in this method
and just by reading through the impl the only part that jumps out as
Might Crash is this `model_` call.  Other methods in the menu controller
check `model_` before using it so it probably makes sense to do that here
as well.
2019-09-04 15:21:10 -07:00
trop[bot]
dec2078e54 build: add WOA release to list of releases (#20112)
* build: add WOA release to list of releases

* Add job count info for sudowoodo

* Add verification of all assets

* Fix linting and add logic to wait before printing out results
2019-09-04 14:32:46 -07:00
Cheng Zhao
2d16034854 fix: implement ses.getBlobData() for NetworkService (#20041) (#20105)
* pass data pipe to JS

* implement reading buffer

* re-enable ses.getBlobData test

* remove AtomBlobReader
2019-09-04 08:39:06 -07:00
trop[bot]
4ce431829f Revert "fix: make sure that menu bar gets focus even when you click an item to focus it first (#19710)" (#20036)
This reverts commit 27b2747b61.
2019-09-03 23:19:46 -07:00
trop[bot]
430b355258 fix: strip chrome_sandbox executable (#20083) 2019-09-03 09:49:34 -07:00
trop[bot]
638ca05702 fix: ensure that the "top" coordinate of the inner frame is correct (#20053)
On multi-monitor setups where the monitors are not all origined at 0 on
the Y coordinate (E.g. vertical stacked monitors) the maximize
calculation was incorrect as it assumed top was "0".  This instead
adjusts the math to calculate the correct top value.
2019-08-30 17:05:23 -07:00
Electron Bot
9e7cce3d2b Bump v7.0.0-beta.4 2019-08-30 09:59:13 -07:00
Electron Bot
c7a3142bab chore: bump chromium to 78.0.3896.6 (7-0-x) (#19609)
* chore: Bump 78.0.3894.0

* chore: bump chromium to 32e0bab929213da1019992bf31d29 (master) (#19488)

* chore: bump chromium to cbeb16cf544f79c1990f1eae4d4fe (master) (#19610)

Co-authored-by: Erick Zhao <erickzhao@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by Micha Hanselmann <DeerMichel@github.com>

* chore: bump chromium to 62327c655093c821aa0fcfc6db53f5fd943e08c7 (master) (#19792)

* chore: bump chromium in DEPS to f3bf493731e868e1f5f48e7e1adc02ea5eccfbbd

* chore: bump chromium in DEPS to 4db0c87d4aa6f27ffa0b5fc77d20e10047962484

* chore: bump chromium in DEPS to d933a504c264dc8fe85267f47aef3588531875b5

* chore: bump chromium in DEPS to 34afdb68980f581ae911b85b727bc17e126cf5f9

* update disable-redraw-lock.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1600387

* update desktop_media_list.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1729156

* update notification_provenance.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1742779

* update printing.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1646772

* update verbose_generate_bpad_syms.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1745986

* update patch metadata

* remove printing_compositor manifests

https://chromium-review.googlesource.com/c/chromium/src/+/1742734

* update for URLLoaderFactoryType enum

https://chromium-review.googlesource.com/c/chromium/src/+/1754716

* remove gin string16 converter

https://chromium-review.googlesource.com/c/chromium/src/+/1750093

* ClearCompositorFrame() has been removed

https://chromium-review.googlesource.com/c/chromium/src/+/1746301

* message_loop -> message_loop_current

https://chromium-review.googlesource.com/c/chromium/src/+/1738552

* include resource_response header

* pdf compositor no longer uses service manager

https://chromium-review.googlesource.com/c/chromium/src/+/1742734

* chore: bump chromium in DEPS to 00d5933101d8d8dc9546eadbe7ee1b41077e6db1

* pane focus fns aren't pure virtual anymore

https://chromium-review.googlesource.com/c/chromium/src/+/1708767

* fix: make std::hash value-non-const

broken by https://chromium-review.googlesource.com/c/chromium/src/+/1711202

* update swiftshader in zip_manifests

https://swiftshader-review.googlesource.com/c/SwiftShader/+/34911

* address feedback from @deepak1556

* don't enable kLegacyWindowsDWriteFontFallback

https://chromium-review.googlesource.com/c/chromium/src/+/1753006

* chore: bump chromium in DEPS to 84497314005e1968da06804f8fde539d9872310e

* update printing.patch

remove bottom diff owing to https://chromium-review.googlesource.com/c/chromium/src/+/1678182 and update for https://chromium-review.googlesource.com/c/chromium/src/+/1678182

* convert CookieChangeListener to new Mojo types

https://chromium-review.googlesource.com/c/chromium/src/+/1753371

* rename ui::ClipboardType -> ui::ClipboardBuffer

https://chromium-review.googlesource.com/c/chromium/src/+/1758730

* logging::LoggingSettings log_file -> log_file_path

https://chromium-review.googlesource.com/c/chromium/src/+/1699477

* roll DEPS to latest lkgr

* fix: override GetFontLookupTableCacheDir()

When Chromium goes to use its fallback font table creation code paths,
it creates the cache directory it uses by calling
GetFontLookupTableCacheDir() with a path that doesn't exist in Electron.
To ensure that a legitimate file path is created, we need to override it
with Electron's DIR_USER_DATA so it doesn't use chrome::DIR_USER_DATA.

* chore: bump chromium in DEPS to 6758a0879931bc4df630a80a36c82d7855ae3155

* update pthread_fchdir patch

https://chromium-review.googlesource.com/c/chromium/src/+/1759149

* update printing patch

* update cookie usage and fn signatures

https://chromium-review.googlesource.com/c/chromium/src/+/1758437

* chore: bump chromium in DEPS to bdaca97e1cc27fb977e56f30f74cdb906da9527e

* remove fix_make_std_hash_value-non-const.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1762335

* Convert enum to enum class for FocusManager::FocusChangeReason

https://chromium-review.googlesource.com/c/chromium/src/+/1767281

* roll DEPS to latest lkgr

* update dom_storage_limits.patch

https://chromium-review.googlesource.com/c/chromium/src/+/1767556

* chore: remove pre network service classes from shell/browser/net (#19644)

* refactor: rm IOThread class

* chore: rm expose-net-observer-api.patch

* chore: rm unused shell/browser/net/ classes

* chore: mv CertVerifierClient to separate header

* chore: rm url_request_context_getter references

* chore: update patches

* Require task posters to specify an explicit destination

https://chromium-review.googlesource.com/c/chromium/src/+/1769080

* chore: Revert "Cleanup: Remove Menu Subtitles/Sublabels"

* chore: Bump chromium 78.0.3896.0

* build: add checkout_openxr=False to DEPS

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1745502

* chore: update patches

* Convert TrustedURLLoaderHeaderClient and TrustedHeaderClient to new mojo types

https://chromium-review.googlesource.com/c/chromium/src/+/1767298
https://chromium-review.googlesource.com/c/chromium/src/+/1768841

* skia: more rect api simplifications

https://skia-review.googlesource.com/c/skia/+/237038

* iwyu

* test: fix clearAuthCache test (#20015)

* fix: nws13n: make ses.setUserAgent work  (#20014)

* refactor tests to better control window creation

* fix: nws13n: make ses.setUserAgent work

* chore: update v8 patches

* Add enterprise policy for renderer CIG.

https://chromium-review.googlesource.com/c/chromium/src/+/1758589

* Convert enum to enum class for Wigdet::FrameType

https://chromium-review.googlesource.com/c/chromium/src/+/1767292

* [JJI] Convert to use string16 for data from JavaScript/Java

https://chromium-review.googlesource.com/c/chromium/src/+/1750093

* chore: Bump chromium 78.0.3896.6
2019-08-30 12:57:57 -04:00
trop[bot]
b6f5e26eab fix: honor cursor blink rate (#20044)
* fix: honor cursor blink rate on macOS

* fix: honor cursor blink rate on Linux

* fix: honor cursor blink rate on Windows

* refactor: clean up os_win cursor blink logic

* remove unneeded include
2019-08-30 08:41:01 -07:00
Cheng Zhao
3330647834 chore: cache URLLoaderFactory per-session (#19998) (#20021)
* cache the URLLoaderFactory in AtomBrowserContext

* use cached loader factory in AtomURLLoaderFactory
2019-08-29 15:21:09 -07:00
Eugene
bb8c7dfc7e fix: allow unsandboxed renderers to request new privileges (7-0-x) (#19999)
* fix: allow unsandboxed renderers to request new privileges

* add test
2019-08-29 08:27:18 -07:00
trop[bot]
4dea193854 fix: i18n of gtk msgbox buttons (#19982)
* fix: i18n of gtk msgbox buttons

similar to #19756 (12df0e8) but for messageboxes

* refactor: DRY the gtk+ button mnemonics

* fix: don't compile gtk_util on non-Linux platforms

rename from `gtk_util.[cc,h]` to `util_gtk.[cc,h]` so that it gets
picked up by the `extra_source_filters` rule in `BUILD.gn`.

* fix: make linter happy

It really shows that I cannot build locally atm... :P
2019-08-29 16:19:22 +09:00
trop[bot]
080c2c9218 fix: gtk_init() called 2x in AtomBrowserMainParts (#20012)
Fixes #19984.
2019-08-29 15:49:28 +09:00
Heilig Benedek
182f63d3a3 fix: handle WM_GETMINMAXINFO instead of letting chromium do it (#19928) (#20000)
* fix: remove WM_GETMINMAXINFO workaround since it's no longer needed

* fix: handle WM_GETMINMAXINFO ourselves

* fix: remove part of the chromium WM_GETMINMAXINFO handler
2019-08-28 09:31:55 -05:00
Robo
d3e0c461f6 feat: migrate webRequest module to NetworkService (#19979)
* feat: associate InProgressRequest with requests (#19648)

* feat: migrate webRequest module to NetworkService (Part 4) (#19679)

* chore: use gin in WebRequest

* Add stubs for APIs

* feat: migrate webRequest module to NetworkService (Part 5) (#19714)

* Pass WebRequest to ProxyingURLLoaderFactory

* Call WebRequestAPI in InProgressRequest

* Store the listeners

* Pass the request and response

* Add stub to handle the events

* Use extensions::WebRequestInfo

* Make sure webRequest is managed by Session

* chore: make creation of WebRequestNS more clear

* fix: check WebContents for service workers

* feat: migrate webRequest module to NetworkService (Part 6) (#19752)

* Implement OnBeforeSendHeaders

* Pass the request

* Handle simple listeners

* Handle response listeners

* Read responses from listener

* feat: migrate webRequest module to NetworkService (Part 7) (#19820)

* fix: gin treats Function as Dictionary when doing convertions

* fix: check if listener exists

* fix: listener callback should be executed in next tick

* feat: make InProgressRequest work

* test: re-enable protocol test that relies on webRequest

* chore: merge conditions

* feat: migrate webRequest module to NetworkService (Part 8) (#19841)

* fix: fill uploadData property

* fix: requestHeaders in onBeforeSendHeaders

* fix: responseHeaders in onHeadersReceived

* fix: header keys should not be lowercased

* fix: gin::Dictionary::Get succeeds even though key does not exist...

* fix: throw for invalid filters

* test: re-enable api-web-request-spec

* chore: do not use deprecated base::Value API

* feat: migrate webRequest module to NetworkService (Part 9) (#19976)

* no need to get WebContents for URLLoaderFactory

* consult embedder for network_factory created in net module

* set disable_web_security to false

* re-enable webRequest tests in net module
2019-08-27 16:38:15 -04:00
Jeremy Apthorp
b09a1c7607 feat: HTTP preconnect feature minimal for electronjs (#19952)
* feat: HTTP preconnect feature minimal for electronjs

* fix type of PreconnectRequest::PreconnectRequest impl

* roll back past https://chromium-review.googlesource.com/c/chromium/src/+/1713306

* mark docs as experimental

* fix lint
2019-08-27 10:09:31 -05:00
trop[bot]
7cc1efd2e6 fix: don't call SetBounds on restore (#19957) 2019-08-27 07:52:03 -07:00
trop[bot]
324096aa37 fix: ensure that reloads retain modified window background colors (#19974) 2019-08-27 07:50:35 -07:00
Shelley Vohr
d780a16d78 fix: add default media usage strings to info.plist (#19948) 2019-08-27 10:36:05 -04:00
trop[bot]
005ef96ac0 fix: command-line scheme switch values' spillover (#19941)
* fix: command-line scheme switch values' spillover

The value of one of the scheme command-line switches
shouldn't spill over into other switches.

Fixes #19911

* chore: make linter happy
2019-08-26 10:46:35 -07:00
trop[bot]
4f74be084a fix: adjust window size in NCCALCSIZE instead of adding insets (#19942) 2019-08-26 10:07:54 -07:00
trop[bot]
b7c2188d09 fix: crash on input file handler dialog (#19917)
* fix: crash on input file handler dialog

* invert cancellation logic
2019-08-24 18:04:24 -05:00
trop[bot]
192326c7c5 docs: clarify dock.bounce usage (#19907) 2019-08-23 15:24:55 -07:00
Heilig Benedek
1af064a144 feat: enable picture-in-picture mode for video tags (#19914) 2019-08-23 15:24:42 -07:00
trop[bot]
6061fcce40 build: use a lower process count for publish builds with no sccache (#19916) 2019-08-23 14:02:04 -07:00
Samuel Attard
e68a9486da fix: remove white screen flicker by disabling compositor recycling (#19901) 2019-08-23 01:14:36 -07:00
trop[bot]
dd8bcb67ba fix: notify views of content view size change (#19898) 2019-08-22 15:54:39 -07:00
trop[bot]
27661d8e7b fix: extern Parse impl for Windows debug builds (#19895)
* fix: extern Parse impl for Windows debug builds

Applies a patch to node.
Externs node::options_parser::Parse implementation for
node::DebugOptions to fix the Windows Debug build.

* fixup: merge extern parse impl patch
2019-08-22 14:56:01 -07:00
trop[bot]
94ddcc4742 build: start building Windows on Arm builds (#19874) 2019-08-22 08:01:54 -07:00
trop[bot]
2515087322 build: ninja count should be 2*cores + 2 (#19866) 2019-08-21 14:02:59 -05:00
trop[bot]
36a5ba0d4d fix: race condition in NodeStreamLoader (#19869)
* fix: race condition in NodeStreamLoader

* nit: add comments
2019-08-21 10:27:20 -07:00
trop[bot]
241b2a98af fix: trim branch name before comparing to master (#19855) 2019-08-20 19:01:16 -07:00
trop[bot]
9b2e3d1d0b docs: update documentation under tutorials (#19844) 2019-08-20 11:08:39 -07:00
trop[bot]
67cb05b435 chore: bump node to v12.8.1 (7-0-x) (#19835)
* chore: bump node in DEPS to v12.8.1

* test: disable parallel/test-http2-reset-flood

Disabled new Worker test owing to a threading issue where the Worker
segfaults on worker.on('message', () => {}). We've disabled failing
worker tests previously as we don't offer first-class support for them
in Electron.
2019-08-19 19:40:24 -07:00
trop[bot]
3f5222b047 fix: fall back to default logs path in getPath('logs') (#19836) 2019-08-19 19:02:04 -07:00
trop[bot]
28e7e6492d chore: upgrades-wg owns DEPS (#19833) 2019-08-19 14:04:04 -07:00
Pedro Pontes
23f7f63405 fix: always use new site instance for a new navigation (backport). (#19827) 2019-08-19 13:20:18 -07:00
trop[bot]
99eaa0d1bb add missing return desc (#19800) 2019-08-16 13:26:04 -07:00
trop[bot]
543dbaf412 MessageBoxOptions.icon should allow string (#19797) 2019-08-16 13:25:35 -07:00
trop[bot]
5901293628 docs: add exemplary fiddle for launch in fiddle feat (#19785)
* add fit-screen

* new url format

* nit
2019-08-16 08:56:18 -07:00
trop[bot]
30543cec74 fix: use GTK3 stock i18n strings (#19783)
* fix: use GTK3 stock i18n strings

* address feedback from @ckerr
2019-08-15 12:12:56 -07:00
trop[bot]
66aeeac8df fix: ensure child_process.fork() doesn't modify main (#19776) 2019-08-15 10:18:21 -07:00
trop[bot]
b03bc4de83 fix: make sure that menu bar gets focus even when you click an item to focus it first (#19762) 2019-08-14 19:21:51 -07:00
Electron Bot
601c3f97ea Bump v7.0.0-beta.3 2019-08-14 17:54:38 -07:00
trop[bot]
d01a8eaa39 feat: add new nativeTheme API (#19758)
* feat: add new nativeTheme API

* chore: deprecate and clean up old systemPreferences theme APIs in favor of new nativeTheme module

* chore: clean up and deprecate things per feedback

* chore: add tests for deprecate and clean up invert impl

* build: when is a boolean not a boolean???
2019-08-14 17:53:20 -07:00
trop[bot]
54e1c11b2b chore: revert activation of the uv_loop on incoming IPC messages (#19737)
This reverts commit 8028c57b42.
2019-08-13 15:22:55 -07:00
trop[bot]
c1ad66b104 fix: crash in window.print() (#19728)
* fix: crash in window.print()

* add preliminary tests
2019-08-13 08:01:32 -07:00
trop[bot]
a905259646 chore: bump node to v12.8.0 (master) (#19726)
* chore: bump node in DEPS to v12.7.0

* chore: update node patches v12.6 to v12.7

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: update build gn patch

* chore: bump node in DEPS to v12.8.0

* chore: update node patches v12.7 to v12.8

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: Add patch to revert crypto createhash changes

The original node commit contains changes/calls to functions that are not supported in boringssl.

* disable node tests

* Remove outdated patch, already merged upstream
2019-08-12 20:53:38 -07:00
trop[bot]
356045ff57 fix: avoid losing focus on inputs when opening menu (Windows/Linux) (#19706)
* remove cause of issue

* remove comment
2019-08-12 19:45:08 -07:00
trop[bot]
a9f69bf732 fix: don't handle browser messages before document element is created (#19722)
* fix: don't handle browser messages before document element is created

* fix: bind ElectronApiServiceImpl later

DidCreateDocumentElement is called before the ElectronApiServiceImpl
gets bound.

* chore: add comment
2019-08-12 19:34:21 -07:00
trop[bot]
3e181b8efc docs: update hasShadow for win and linux (#19691) 2019-08-08 18:52:56 -07:00
trop[bot]
171c76e3cb fix: return correct bounds on will-resize (#19680) 2019-08-08 07:50:11 -07:00
Erick Zhao
0299f69fd1 fix: normalize behavior of win.setOpacity() for invalid number values across operating systems (#19535) (#19673) 2019-08-07 13:11:12 -07:00
Electron Bot
0bdb7b164c Bump v7.0.0-beta.2 2019-08-07 09:03:21 -07:00
trop[bot]
ea9cfc127c fix: crash on print cancellation and silent print settings (#19668)
* fix: crash on print cancellation

* fix: update printing patch for new options

* refactor: use DictionaryValue for printBackground
2019-08-07 08:44:48 -07:00
trop[bot]
0afb1a8188 fix: handle edge behavior for about panel on Linux (#19625)
* fix: graceful About dialog fail/exit (Linux)

* Allow current to travel along path with no electrical impedance
2019-08-05 20:57:04 -07:00
trop[bot]
f154dbda40 docs: remove implicit 'any' and 'Object' types from the docs (#19630)
* docs: remove implicit 'any' and 'Object' types from the docs

* docs: more docs improvements, remove all remaining empty interfaces

* chore: update tests for better types
2019-08-05 20:56:42 -07:00
trop[bot]
c3013d2e9f fix: clearRecentDocuments role on Windows (#19638)
* fix: clear recent documents on windows

* chore: don't check for version < win 7
2019-08-05 17:16:20 -07:00
trop[bot]
3272564eac fix: make child windows not crash when ipc messages are received (#19632)
* fix: make child windows not crash when ipc messages are received

This also adds a path forward for apps using child windows with
nodeIntegration to migrate into a non-leaky way of doing it.

1. Ensure that if ipcNative is missing we don't crash rather log that it
is missing
2. Add a hidden option `--enable-node-leakage-in-renderers` (temporary
measure) to allow app devs to opt in to leaking node in child windows
3. Bypasses the Opener() check if renderer process reuse is enabled
(which would prevent the leak anyway)

So the path forward is: it no longer crashes --> folks use the hidden
option --> folks opt in to renderer process reuse.

* Apply suggestions from code review

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Update shell/renderer/atom_renderer_client.cc

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>
2019-08-05 15:11:01 -07:00
trop[bot]
a0f4632461 fix: crash on window.print() (#19623) 2019-08-05 07:52:08 -07:00
trop[bot]
8ddf837d49 fix: expose setMenuBarVisibility again (#19579) 2019-08-02 19:06:47 -07:00
Samuel Attard
9822953d31 build: lock chromium major to 78 on 7-0-x (#19552)
* build: lock chromium major to 78 on 7-0-x

* chore: update patches

* fix geometry.mojom

* Adopt more inclusive language in //net

https://chromium-review.googlesource.com/c/chromium/src/+/1718348

* [mojo] Introduce ServiceFactory API

https://chromium-review.googlesource.com/c/chromium/src/+/1717474
2019-08-02 15:41:41 -04:00
trop[bot]
c6061cce41 doc: add missing MenuItem roles (#19555) 2019-07-31 19:12:52 -07:00
trop[bot]
a9602682c5 fix: use WeakPtr to detect deletion (#19558) 2019-07-31 19:12:32 -07:00
Electron Bot
b7e5213afc Bump v7.0.0-beta.1 2019-07-31 13:36:10 -07:00
Samuel Attard
9b70d9aa68 Revert "Bump v7.0.0-beta.1"
This reverts commit d9bfac32e3.
2019-07-31 13:30:47 -07:00
Electron Bot
d9bfac32e3 Bump v7.0.0-beta.1 2019-07-31 11:07:14 -07:00
Samuel Attard
9e815afc02 build: fix first beta version choosing logic 2019-07-31 11:01:25 -07:00
3019 changed files with 144223 additions and 208944 deletions

View File

@@ -1 +0,0 @@
config-staging

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +0,0 @@
const cp = require('child_process');
const fs = require('fs-extra');
const path = require('path');
const yaml = require('js-yaml');
const STAGING_DIR = path.resolve(__dirname, '..', 'config-staging');
function copyAndExpand(dir = './') {
const absDir = path.resolve(__dirname, dir);
const targetDir = path.resolve(STAGING_DIR, dir);
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir);
}
for (const file of fs.readdirSync(absDir)) {
if (!file.endsWith('.yml')) {
if (fs.statSync(path.resolve(absDir, file)).isDirectory()) {
copyAndExpand(path.join(dir, file));
}
continue;
}
fs.writeFileSync(path.resolve(targetDir, file), yaml.dump(yaml.load(fs.readFileSync(path.resolve(absDir, file), 'utf8')), {
noRefs: true,
}));
}
}
if (fs.pathExists(STAGING_DIR)) fs.removeSync(STAGING_DIR);
copyAndExpand();
const output = cp.spawnSync(process.env.CIRCLECI_BINARY || 'circleci', ['config', 'pack', STAGING_DIR]);
fs.writeFileSync(path.resolve(STAGING_DIR, 'built.yml'), output.stdout.toString());

View File

@@ -1,51 +0,0 @@
executor:
name: linux-docker
size: medium
steps:
- checkout:
path: src/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 src/buildtools/linux64
gn/gn/linux-amd64 $gn_version
CIPD
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
- run:
name: Download clang-format Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
sha1_path='buildtools/linux64/clang-format.sha1'
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
- 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 --frozen-lockfile
node script/yarn lint
- run:
name: Run Script Typechecker
command: |
cd src/electron
node script/yarn tsc -p tsconfig.script.json

View File

@@ -1,10 +0,0 @@
{
"name": "@electron/circleci-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"dependencies": {
"fs-extra": "^10.1.0",
"js-yaml": "^4.1.0"
}
}

View File

@@ -1,43 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
universalify "^2.0.0"
optionalDependencies:
graceful-fs "^4.1.6"
universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

View File

@@ -3,6 +3,5 @@
set -e
mkdir -p ~/.ssh
echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts
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

View File

@@ -1,4 +0,0 @@
---
Checks: '-modernize-use-nullptr'
InheritParentConfig: true
...

View File

@@ -1,58 +0,0 @@
# 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
```
## Goma
If you are a maintainer [with Goma access](../docs/development/goma.md) it should be automatically configured and authenticated when you spin up a new codespaces instance. You can validate this by checking `e d goma_auth info` or by checking that your build-tools configuration has a goma mode of `cluster`.
## 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
```

View File

@@ -1,66 +0,0 @@
{
"dockerComposeFile": "docker-compose.yml",
"service": "buildtools",
"onCreateCommand": ".devcontainer/on-create-command.sh",
"updateContentCommand": ".devcontainer/update-content-command.sh",
"workspaceFolder": "/workspaces/gclient/src/electron",
"forwardPorts": [8088, 6080, 5901],
"portsAttributes": {
"8088": {
"label": "Goma Control Panel",
"onAutoForward": "silent"
},
"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",
"dbaeumer.vscode-eslint",
"shakram02.bash-beautify",
"marshallofsound.gnls-electron",
"CircleCI.circleci"
],
"settings": {
"editor.tabSize": 2,
"bashBeautify.tabSize": 2,
"typescript.tsdk": "node_modules/typescript/lib",
"[gn]": {
"editor.formatOnSave": true
},
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"
}
}
}
}

View File

@@ -1,19 +0,0 @@
version: '3'
services:
buildtools:
image: ghcr.io/electron/devcontainer:3d8d44d0f15b05bef6149e448f9cc522111847e9
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

View File

@@ -1,82 +0,0 @@
#!/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 "
{
\"goma\": \"$1\",
\"root\": \"/workspaces/gclient\",
\"remotes\": {
\"electron\": {
\"origin\": \"https://github.com/electron/electron.git\"
}
},
\"gen\": {
\"args\": [
\"import(\\\"//electron/build/args/testing.gn\\\")\",
\"import(\\\"/home/builduser/.electron_build_tools/third_party/goma.gn\\\")\"
],
\"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\"
}
" >$buildtools/configs/evm.testing.json
}
# Start out as cache only
write_config cache-only
e use testing
# Attempt to auth to the goma service via codespaces tokens
# if it works we can use the goma cluster
export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN
if e d goma_auth login; then
echo "$GITHUB_USER has GOMA access - switching to cluster mode"
write_config cluster
fi
else
echo "build-tools testing config already exists"
# Re-auth with the goma cluster regardless.
NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true
fi

View File

@@ -1,10 +0,0 @@
#!/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

View File

@@ -1,2 +1,3 @@
*
!tools/xvfb-init.sh
!build/install-build-deps.sh

View File

@@ -4,3 +4,4 @@
APPVEYOR_CLOUD_TOKEN=
CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
VSTS_TOKEN=

View File

@@ -1,5 +1,4 @@
{
"root": true,
"extends": "standard",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
@@ -7,19 +6,18 @@
"browser": true
},
"rules": {
"semi": ["error", "always"],
"no-var": "error",
"no-unused-vars": "off",
"guard-for-in": "error",
"no-unused-vars": 0,
"no-global-assign": 0,
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": true
"ignoreRestSiblings": false
}],
"prefer-const": ["error", {
"destructuring": "all"
}],
"standard/no-callback-literal": "off"
"node/no-deprecated-api": 0
},
"parserOptions": {
"ecmaVersion": 6,
@@ -27,19 +25,9 @@
},
"overrides": [
{
"files": "*.ts",
"files": "*.js",
"rules": {
"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"
"@typescript-eslint/no-unused-vars": "off"
}
}
]

View File

@@ -1,5 +0,0 @@
# Atom --> Electron rename
d9321f4df751fa32813fab1b6387bbd61bd681d0
34c4c8d5088fa183f56baea28809de6f2a427e02
# Enable JS Semicolons
5d657dece4102e5e5304d42e8004b6ad64c0fcda

27
.gitattributes vendored
View File

@@ -1,30 +1,3 @@
# `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
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
*.proto text eol=lf
*.py text eol=lf
*.ps1 text eol=lf
*.sh text eol=lf
*.ts text eol=lf
*.txt text eol=lf

23
.github/CODEOWNERS vendored
View File

@@ -3,17 +3,20 @@
# 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/patch-owners
/patches/ @electron/wg-upgrades
DEPS @electron/wg-upgrades
# Releases WG
/docs/breaking-changes.md @electron/wg-releases
/npm/ @electron/wg-releases
/script/release @electron/wg-releases
# Docs & Tooling WG
/default_app/ @electron/wg-docs-tools
/docs/ @electron/wg-docs-tools
# 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
# Releases WG
/npm/ @electron/wg-releases
/script/release @electron/wg-releases

58
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View File

@@ -0,0 +1,58 @@
---
name: Bug report
about: Create a report to help us improve Electron
---
<!-- As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->
### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->
* [ ] 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:**
* <!-- (output of `node_modules/.bin/electron --version`) e.g. 4.0.3 -->
* **Operating System:**
* <!-- (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64 -->
* **Last Known Working Electron version:**
* <!-- (if applicable) e.g. 3.1.0 -->
### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
### Actual Behavior
<!-- A clear and concise description of what actually happened. -->
### To Reproduce
<!--
Your best chance of getting this bug looked at quickly is to provide an example.
-->
<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->
<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->
<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
```sh
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
```
-->
### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
### Additional Information
<!-- Add any other context about the problem here. -->

View File

@@ -0,0 +1,27 @@
---
name: Feature request
about: Suggest an idea for Electron
---
<!-- As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->
### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->
* [ ] 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
<!-- Is your feature request related to a problem? Please add a clear and concise description of what the problem is. -->
### Proposed Solution
<!-- Describe the solution you'd like in a clear and concise manner -->
### Alternatives Considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
### Additional Information
<!-- Add any other context about the problem here. -->

View File

@@ -1,81 +0,0 @@
name: Bug Report
description: Report an Electron bug
title: "[Bug]: "
labels: "bug :beetle:"
projects: ["electron/90"]
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/support#currently-supported-versions).
placeholder: 17.0.0
validations:
required: true
- type: dropdown
attributes:
label: What operating system are you using?
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: If you can reproduce the issue in a standalone test case, please use [Electron Fiddle](https://github.com/electron/fiddle) to create one and to publish it as a [GitHub gist](https://gist.github.com) and put the gist URL here. This is **the best way** to ensure this issue is triaged quickly.
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.

View File

@@ -1,40 +0,0 @@
name: Feature Request
description: Suggest an idea for Electron
title: "[Feature Request]: "
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

View File

@@ -0,0 +1,25 @@
---
name: Mac App Store Private API Rejection
about: Your app was rejected from the Mac App Store for using private API's
---
<!-- As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->
### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->
* [ ] 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:**
* <!-- (output of `node_modules/.bin/electron --version`) e.g. 4.0.3 -->
### Rejection Email
<!-- Paste the contents of your rejection email here, censoring any private information such as app names.-->
### Additional Information
<!-- Add any other context about the problem here. -->

View File

@@ -1,30 +0,0 @@
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.

View File

@@ -0,0 +1,10 @@
---
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**.

View File

@@ -1,10 +1,9 @@
#### Description of Change
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
-->
#### Checklist
@@ -12,10 +11,11 @@ Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.
- [ ] PR description included and stakeholders cc'd
- [ ] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation, tutorials, templates and examples are changed or added
- [ ] [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).
- [ ] 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).
#### Release Notes
Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->
Notes: <!-- Please add a one-line description for app developers to read in the release notes, or `no-notes` if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->

20
.github/config.yml vendored
View File

@@ -2,7 +2,7 @@
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖
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.
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.
Examples of commit messages with semantic prefixes:
@@ -12,9 +12,9 @@ newPRWelcomeComment: |
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/main/docs/development/coding-style.md).
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/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/main/docs/styleguide.md).
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.
@@ -25,3 +25,17 @@ 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

10
.github/main.workflow vendored Normal file
View File

@@ -0,0 +1,10 @@
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" ]
}

25
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
# 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!

View File

@@ -1,165 +0,0 @@
name: Branch Created
on:
create:
permissions: {}
jobs:
release-branch-created:
name: Release Branch Created
if: ${{ github.event.ref_type == 'branch' && endsWith(github.event.ref, '-x-y') }}
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
run: |
if [[ ${{ github.event.ref }} =~ ^([0-9]+)-x-y$ ]]; then
echo "MAJOR=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "Not a release branch: ${{ github.event.ref }}"
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
id: generate-token
with:
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
org: electron
- name: Create Release Project Board
if: ${{ steps.check-major-version.outputs.MAJOR }}
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
MAJOR: ${{ steps.check-major-version.outputs.MAJOR }}
ELECTRON_ORG_ID: "O_kgDOAMybxg"
ELECTRON_REPO_ID: "R_kgDOAI8xSw"
TEMPLATE_PROJECT_ID: "PVT_kwDOAMybxs4AQvib"
run: |
# Copy template to create new project board
PROJECT_ID=$(gh api graphql -f query='mutation ($ownerId: ID!, $projectId: ID!, $title: String!) {
copyProjectV2(input: {
includeDraftIssues: true,
ownerId: $ownerId,
projectId: $projectId,
title: $title
}) {
projectV2 {
id
}
}
}' -f ownerId=$ELECTRON_ORG_ID -f projectId=$TEMPLATE_PROJECT_ID -f title="${MAJOR}-x-y" | jq -r '.data.copyProjectV2.projectV2.id')
# Make the new project public
gh api graphql -f query='mutation ($projectId: ID!) {
updateProjectV2(input: {
projectId: $projectId,
public: true,
}) {
projectV2 {
id
}
}
}' -f projectId=$PROJECT_ID
# Link the new project to the Electron repository
gh api graphql -f query='mutation ($projectId: ID!, $repositoryId: ID!) {
linkProjectV2ToRepository(input: {
projectId: $projectId,
repositoryId: $repositoryId
}) {
clientMutationId
}
}' -f projectId=$PROJECT_ID -f repositoryId=$ELECTRON_REPO_ID
# Get all draft issues on the new project board
gh api graphql -f query='query ($id: ID!) {
node(id: $id) {
... on ProjectV2 {
items(first: 100) {
nodes {
... on ProjectV2Item {
id
content {
... on DraftIssue { id title
body
}
}
}
}
}
}
}
}' -f id=$PROJECT_ID > issues.json
PROJECT_ITEMS=$(jq '.data.node.items.nodes[] | select(.content.id != null) | .id' issues.json)
#
# Do template replacement for draft issues
#
echo "{\"major\": $MAJOR, \"next-major\": $((MAJOR + 1)), \"prev-major\": $((MAJOR - 1))}" > variables.json
# npx mustache is annoyingly slow, so install mustache directly
yarn add -D mustache
for PROJECT_ITEM_ID in $PROJECT_ITEMS; do
# These are done with the raw output flag and sent to file to better retain formatting
jq -r ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.title" issues.json > title.txt
jq -r ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.body" issues.json > body.txt
./node_modules/.bin/mustache variables.json title.txt new_title.txt
./node_modules/.bin/mustache variables.json body.txt new_body.txt
# Only update draft issues which had content change when interpolated
if ! cmp --silent -- new_title.txt title.txt || ! cmp --silent -- new_body.txt body.txt; then
DRAFT_ISSUE_ID=$(jq ".data.node.items.nodes[] | select(.id == $PROJECT_ITEM_ID) | .content.id" issues.json)
gh api graphql -f query='mutation ($draftIssueId: ID!, $title: String!, $body: String!) {
updateProjectV2DraftIssue(input: {
draftIssueId: $draftIssueId,
title: $title,
body: $body
}) {
draftIssue {
id
}
}
}' -f draftIssueId=$DRAFT_ISSUE_ID -f title="$(cat new_title.txt)" -f body="$(cat new_body.txt)"
fi
done

View File

@@ -1,26 +0,0 @@
name: Issue Commented
on:
issue_comment:
types:
- created
permissions: {}
jobs:
issue-commented:
name: Remove blocked/need-repro on comment
if: ${{ contains(github.event.issue.labels.*.name, 'blocked/need-repro') && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
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'

View File

@@ -1,70 +0,0 @@
name: Issue Labeled
on:
issues:
types: [labeled]
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Set status
uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2
with:
github_token: ${{ steps.generate-token.outputs.token }}
organization: electron
project_number: 90
content_id: ${{ github.event.issue.node_id }}
field: Status
value: 🛑 Blocked
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 == "github-actions" or .authorAssociation == "OWNER" or .authorAssociation == "MEMBER") | select(.body | startswith("<!-- blocked/need-repro -->")) ] | 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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
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@275328970dbc3bfc3bc43f5fe741bf3638300c0a # v3.3.3
with:
actions: 'create-comment'
token: ${{ steps.generate-token.outputs.token }}
body: |
<!-- blocked/need-repro -->
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.

View File

@@ -1,40 +0,0 @@
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/')
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
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: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2
with:
github_token: ${{ steps.generate-token.outputs.token }}
organization: electron
project_number: 90
content_id: ${{ github.event.issue.node_id }}
field: Status
value: 📥 Was Blocked

View File

@@ -1,30 +0,0 @@
name: Pull Request Labeled
on:
pull_request:
types: [labeled]
permissions:
contents: read
jobs:
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
id: generate-token
with:
creds: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }}
org: electron
- name: Set status
uses: dsanders11/update-project-action@7ade91760df70df76770a238abee7a4869e01cf8
with:
github_token: ${{ steps.generate-token.outputs.token }}
organization: electron
project_number: 94
content_id: ${{ github.event.pull_request.node_id }}
field: Status
value: ✅ Reviewed

View File

@@ -1,54 +0,0 @@
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@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.1.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # tag=v2.1.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@0b7f8abb1508181956e8e162db84b466c27e18ce # tag=v3.1.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@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # tag=v2.1.27
with:
sarif_file: results.sarif

View File

@@ -1,26 +0,0 @@
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@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # tag: v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false

View File

@@ -1,52 +0,0 @@
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # tag: v6.0.1
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"
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@cc6751b3b5e4edc5b9a4ad0a021ac455653b6dc8 # v1.0.0
id: generate-token
with:
creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
- uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # tag: v6.0.1
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.

View File

@@ -1,74 +0,0 @@
name: Update AppVeyor Image
# Run chron daily Mon-Fri
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
permissions:
contents: write
pull-requests: write
jobs:
bake-appveyor-image:
name: Bake AppVeyor Image
permissions:
contents: write
pull-requests: write # to create a new PR with updated Appveyor images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
fetch-depth: 0
- name: Yarn install
run: |
node script/yarn.js install --frozen-lockfile
- name: Set Repo for Commit
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Check AppVeyor Image
env:
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
run: |
node ./script/prepare-appveyor
if [ -f ./image_version.txt ]; then
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
rm image_version.txt
fi
- name: (Optionally) Update Appveyor Image
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: mikefarah/yq@1c7dc0e88aad311c89889bc5ce5d8f96931a1bd0 # v4.27.2
with:
cmd: |
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor-woa.yml" > "appveyor-woa2.yml"
- name: (Optionally) Generate Commit Diff
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
run: |
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
patch -f appveyor.yml < appveyor.diff
rm appveyor2.yml appveyor.diff
- name: (Optionally) Generate Commit Diff for WOA
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
run: |
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
patch -f appveyor-woa.yml < appveyor-woa.diff
rm appveyor-woa2.yml appveyor-woa.diff
- name: (Optionally) Commit and Pull Request
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'build: update appveyor image to latest version'
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: bump-appveyor-image
delete-branch: true
reviewers: electron/wg-releases
title: 'build: update appveyor image to latest version'
labels: semver/none,no-backport
body: |
This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.
Notes: none

27
.gitignore vendored
View File

@@ -17,6 +17,24 @@
*.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
@@ -26,7 +44,6 @@ compile_commands.json
# npm package
/npm/dist
/npm/path.txt
/npm/checksums.json
.npmrc
@@ -38,7 +55,7 @@ electron.d.ts
spec/.hash
# Eslint Cache
.eslintcache*
.eslintcache
# Generated native addon files
/spec/fixtures/native-addon/echo/build/
@@ -48,9 +65,3 @@ ts-gen
# Used to accelerate CI builds
.depshash
.depshash-target
# Used to accelerate builds after sync
patches/mtime-cache.json
spec/fixtures/logo.png

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[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

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run precommit

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npm run prepack

View File

@@ -1,6 +0,0 @@
{
"default": false,
"no-trailing-spaces": {
"br_spaces": 0
}
}

View File

@@ -1,3 +0,0 @@
{
"extends": "@electron/lint-roller/configs/markdownlint.json"
}

1
.nvmrc
View File

@@ -1 +0,0 @@
16

1493
BUILD.gn

File diff suppressed because it is too large Load Diff

View File

@@ -1,135 +1,46 @@
# Code of Conduct
# Contributor Covenant Code of Conduct:
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:
## Our Pledge
* [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)
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 Code of Conduct
## Our Standards
### Our Pledge
Examples of behavior that contributes to creating a positive environment include:
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.
* 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 pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Examples of unacceptable behavior by participants include:
### 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
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* 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
* 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
### Enforcement Responsibilities
## Our 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.
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 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.
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.
### Scope
## 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.
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.
### Enforcement
## 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.
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.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
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.
### Enforcement Guidelines
## Attribution
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
This Code of Conduct is adapted from the [Contributor-Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
#### 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.
#### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**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.
#### 4. Permanent Ban
**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.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
### Attribution
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.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
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.
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

View File

@@ -20,23 +20,25 @@ 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 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!_
### 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!
### 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.
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.
**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)
@@ -47,28 +49,24 @@ 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)
* [Making Changes](https://electronjs.org/docs/development/pull-requests#making-changes)
* [The Process of Making Changes](https://electronjs.org/docs/development/pull-requests#the-process-of-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 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)
* [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)
* [Approval and Request Changes Workflow](https://electronjs.org/docs/development/pull-requests#approval-and-request-changes-workflow)
* [Step 11: Landing](https://electronjs.org/docs/development/pull-requests#step-11-landing)
* [Step 10: Landing](https://electronjs.org/docs/development/pull-requests#step-10-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
For more in-depth guides on developing Electron, see
[/docs/development](/docs/development/README.md)

125
DEPS
View File

@@ -1,31 +1,32 @@
gclient_gn_args_from = 'src'
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',
'checkout_openxr'
]
vars = {
'chromium_version':
'118.0.5991.0',
'78.0.3904.130',
'node_version':
'v18.17.1',
'v12.8.1',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
'0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',
'reactiveobjc_version':
'74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
'mantle_version':
'78d3966b3c331292ea29ec38661b25df0a245948',
'2ee313aaca52e2b478965ac50eb5082520380d1b',
'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',
'nodejs_git': 'https://github.com/nodejs',
'requests_git': 'https://github.com/kennethreitz',
'yaml_git': 'https://github.com/yaml',
'squirrel_git': 'https://github.com/Squirrel',
'reactiveobjc_git': 'https://github.com/ReactiveCocoa',
'mantle_git': 'https://github.com/Mantle',
# 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',
@@ -33,27 +34,27 @@ vars = {
# To be able to build clean Chromium from sources.
'apply_patches': True,
# To use an mtime cache for patched files to speed up builds.
'use_mtime_cache': True,
# Python interface to Amazon Web Services. Is used for releases only.
'checkout_boto': False,
# 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,
'use_rts': False,
'mac_xcode_version': 'default',
'generate_location_tags': False,
# Python "requests" module is used for releases only.
'checkout_requests': 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':
@@ -68,10 +69,6 @@ vars = {
False,
'checkout_android_native_support':
False,
'checkout_google_benchmark':
False,
'checkout_clang_tidy':
True,
}
deps = {
@@ -87,71 +84,67 @@ deps = {
'url': (Var("nodejs_git")) + '/node.git@' + (Var("node_version")),
'condition': 'checkout_node and process_deps',
},
'src/third_party/pyyaml': {
'src/electron/vendor/pyyaml': {
'url': (Var("yaml_git")) + '/pyyaml.git@' + (Var("pyyaml_version")),
'condition': 'checkout_pyyaml 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/boto': {
'url': Var('boto_git') + '/boto.git' + '@' + Var('boto_version'),
'condition': 'checkout_boto and process_deps',
},
'src/third_party/squirrel.mac/vendor/ReactiveObjC': {
'url': Var("reactiveobjc_git") + '/ReactiveObjC.git@' + Var("reactiveobjc_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/Mantle': {
'url': Var("mantle_git") + '/Mantle.git@' + Var("mantle_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': [
'python3',
'python',
'src/electron/script/apply_all_patches.py',
'src/electron/patches/config.json',
],
},
{
'name': 'apply_mtime_cache',
'condition': '(checkout_chromium and apply_patches and use_mtime_cache) and process_deps',
'pattern': 'src/electron',
'name': 'electron_external_binaries',
'pattern': 'src/electron/script/update-external-binaries.py',
'condition': 'download_external_binaries',
'action': [
'python3',
'src/electron/script/patches-mtime-cache.py',
'apply',
'--cache-file',
'src/electron/patches/mtime-cache.json',
'src/electron/script/update-external-binaries.py',
],
},
{
'name': 'electron_npm_deps',
'pattern': 'src/electron/package.json',
'action': [
'python3',
'python',
'-c',
'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"]);',
'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"]);',
],
},
{
'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': '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"]);',
],
},
]

50
Dockerfile Normal file
View File

@@ -0,0 +1,50 @@
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 dpkg --add-architecture i386
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 \
g++-multilib \
libgl1:i386 \
&& /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

59
Dockerfile.arm32v7 Normal file
View File

@@ -0,0 +1,59 @@
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 \
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

65
Dockerfile.arm64v8 Normal file
View File

@@ -0,0 +1,65 @@
FROM arm64v8/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 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 \
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 \
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
# dbusmock is needed for Electron tests
RUN pip install python-dbusmock
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

1
ELECTRON_VERSION Normal file
View File

@@ -0,0 +1 @@
7.1.13

View File

@@ -1,5 +1,4 @@
Copyright (c) Electron contributors
Copyright (c) 2013-2020 GitHub Inc.
Copyright (c) 2013-2019 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,22 +1,23 @@
[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/main.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/main)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/main?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.gg/electronjs)
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
View these docs in other languages on our [Crowdin](https://crowdin.com/project/electron) project.
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹 🇵🇱.
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
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).
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/main/CODE_OF_CONDUCT.md).
[code of conduct](https://github.com/electron/electron/tree/master/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).
@@ -27,23 +28,15 @@ The preferred method is to install Electron as a development dependency in your
app:
```sh
npm install electron --save-dev
npm install electron --save-dev [--save-exact]
```
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
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
[Electron versioning](docs/tutorial/electron-versioning.md).
## Platform support
Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (Catalina and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* 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 14.04 and newer
* Fedora 24 and newer
* Debian 8 and newer
For more installation options and troubleshooting tips, see
[installation](docs/tutorial/installation.md).
## Quick start & Electron Fiddle
@@ -65,10 +58,13 @@ 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
- [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
## Programmatic usage
@@ -78,7 +74,7 @@ binary. Use this to spawn Electron from Node scripts:
```javascript
const electron = require('electron')
const proc = require('node:child_process')
const proc = require('child_process')
// will print something similar to /Users/maf/.../Electron
console.log(electron)
@@ -89,15 +85,11 @@ const child = proc.spawn(electron)
### Mirrors
* [China](https://npmmirror.com/mirrors/electron/)
- [China](https://npm.taobao.org/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
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.
Find documentation translations in [electron/i18n](https://github.com/electron/i18n).
## Contributing
@@ -106,10 +98,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 on the [Community page](https://www.electronjs.org/community).
and more can be found in the [support document](docs/tutorial/support.md#finding-support).
## License
[MIT](https://github.com/electron/electron/blob/main/LICENSE)
[MIT](https://github.com/electron/electron/blob/master/LICENSE)
When using Electron logos, make sure to follow [OpenJS Foundation Trademark Policy](https://openjsf.org/wp-content/uploads/sites/84/2021/01/OpenJS-Foundation-Trademark-Policy-2021-01-12.docx.pdf).
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).

View File

@@ -2,16 +2,11 @@
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, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/electron/electron/security/advisories/new) tab.
To report a security issue, email [security@electronjs.org](mailto:security@electronjs.org) and include the word "SECURITY" in the subject line.
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 [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.
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).
## Learning More About Security
To learn more about securing an Electron application, please see the [security tutorial](docs/tutorial/security.md).

View File

@@ -1,108 +0,0 @@
# The config is used to bake appveyor images, not for running CI jobs.
# The config expects the following environment variables to be set:
# - "APPVEYOR_BAKE_IMAGE" e.g. 'electron-99.0.4767.0'. Name of the image to be baked.
# Typically named after the Chromium version on which the image is built.
# This can be set dynamically in the prepare-appveyor script.
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-112.0.5607.0-vs2022
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
ELECTRON_ENABLE_STACK_DUMPING: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
PYTHONIOENCODING: UTF-8
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# init:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - appveyor version
# - ps: $ErrorActionPreference = 'Stop'
# - ps: 'Write-Host "OS Build: $((Get-CimInstance Win32_OperatingSystem).BuildNumber)"'
# clone_folder: '%USERPROFILE%\image-bake-scripts'
# clone_script:
# - ps: Invoke-WebRequest "https://github.com/appveyor/build-images/archive/1f90d94e74c8243c909a09b994e527584dfcb838.zip" -OutFile "$env:temp\scripts.zip"
# - ps: Expand-Archive -Path "$env:temp\scripts.zip" -DestinationPath "$env:temp\scripts" -Force
# - ps: Copy-Item -Path "$env:temp\scripts\build-images-1f90d94e74c8243c909a09b994e527584dfcb838\scripts\Windows\*" -Destination $env:APPVEYOR_BUILD_FOLDER -Recurse
build_script:
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# - ps: .\init_server.ps1
# - ps: .\extend_system_volume.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - appveyor version
# - ps: .\install_path_utils.ps1
# - ps: .\install_powershell_core.ps1
# - ps: .\install_powershell_get.ps1
# - ps: .\install_7zip.ps1
# - ps: .\install_chocolatey.ps1
# - ps: .\install_webpi.ps1
# - ps: .\install_nuget.ps1
# - ps: .\install_pstools.ps1
# - ps: .\install_git.ps1
# - ps: .\install_git_lfs.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# END LINES FOR COMPLETELY NEW IMAGE
- git config --global core.longpaths true
- ps: >-
if (-not (Test-Path -Path C:\projects\src)) {
New-Item -Path C:\projects\src -ItemType Directory
}
- cd C:\projects\
- git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/electron/electron.git C:\projects\src\electron
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- update_depot_tools.bat
# Uncomment the following line if windows deps change
# - src\electron\script\setup-win-for-dev.bat
- >-
gclient config
--name "src\electron"
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- ps: cd src\electron
- ps: node script\generate-deps-hash.js
- ps: $depshash = Get-Content .\.depshash -Raw
- ps: Copy-Item -path .\.depshash -destination ..\.depshash
- ps: cd ..\..
- gclient sync --with_branch_heads --with_tags --nohooks
- ps: regsvr32 /s "C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\amd64\msdia140.dll"
- ps: set vs2022_install="C:\Program Files\Microsoft Visual Studio\2022\Community"
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - cd %USERPROFILE%\image-bake-scripts
# - appveyor version
# - ps: .\optimize_dotnet_runtime.ps1
# - ps: .\disable_windows_background_services.ps1
# - ps: .\enforce_windows_firewall.ps1
# - ps: .\cleanup_windows.ps1
# END LINES FOR COMPLETELY NEW IMAGE
on_image_bake:
- ps: >-
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
- ps: Remove-Item -Recurse -Force C:\projects\depot_tools
- ps: Remove-Item -Recurse -Force C:\projects\src\electron
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
# # on_finish:
# - ps: >-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

View File

@@ -1,322 +0,0 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor.yml
# IF APPLICABLE!!!!
#
#
# The config expects the following environment variables to be set:
# - "GN_CONFIG" Build type. One of {'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/+/main/docs/reference.md#var_target_cpu
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
# 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'}.
# 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_STORAGE" Set it to '1' upload a release to the Azure 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
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-118.0.5949.0
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
ELECTRON_ENABLE_STACK_DUMPING: 1
ELECTRON_ALSO_LOG_TO_STDERR: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
GYP_MSVS_HASH_27370823e7: 28622d16b1
PYTHONIOENCODING: UTF-8
matrix:
- job_name: Build Arm on X64 Windows
- job_name: Test On Windows On Arm Hardware
job_depends_on: Build Arm on X64 Windows
APPVEYOR_BUILD_WORKER_IMAGE: base-woa
APPVEYOR_BUILD_WORKER_CLOUD: electronhq-woa
clone_script:
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
# the first failed job cancels other jobs and fails entire build
matrix:
fast_finish: true
for:
- matrix:
only:
- job_name: Build Arm on X64 Windows
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- ps: >-
if (Test-Path -Path "$pwd\depot_tools") {
Remove-Item -Recurse -Force $pwd\depot_tools
}
- ps: >-
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
- depot_tools\bootstrap\win_tools.bat
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
Remove-Item -Recurse -Force $pwd\src\electron
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python3 $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron"
# Patches are applied in the image bake. Check depshash to see if patches have changed.
- ps: $env:RUN_GCLIENT_SYNC="false"
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw
- ps: cd src\electron
- ps: node script\generate-deps-hash.js
- ps: $depshash = Get-Content .\.depshash -Raw
- ps: cd ..\..
- ps: >-
if ($depshash_baked -ne $depshash) {
$env:RUN_GCLIENT_SYNC="true"
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- 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 shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default electron:node_headers
- python3 %LOCAL_GOMA_DIR%\goma_ctl.py stat
- ps: >-
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
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python3 electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
cd C:\projects\src
$missing_artifacts = $false
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif (
$artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (-not(Test-Path $artifact_file)) {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
deploy_script:
- cd electron
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python3 script\release\uploaders\upload.py --verbose
}
}
on_finish:
# Uncomment this lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
}
- matrix:
only:
- job_name: Test On Windows On Arm Hardware
environment:
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
- cd ..
- mkdir out\Default
- cd ..
- ps: |
# Download build artifacts
$apiUrl = 'https://ci.appveyor.com/api'
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
$artifacts_to_download = @('dist.zip','ffmpeg.zip','node_headers.zip','electron.lib')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build Arm on X64 Windows") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
# Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
# 7z x -y -osrc pdb.zip
}
}
- ps: |
$out_default_zips = @('dist.zip')
foreach($zip_name in $out_default_zips) {
7z x -y -osrc\out\Default $zip_name
}
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
- ps: 7z x -y -osrc node_headers.zip
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- ps: |
cd src
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
- set npm_config_nodedir=%cd%\out\Default\gen\node_headers
- set npm_config_arch=arm64
- cd electron
# Explicitly set npm_config_arch because the .env doesn't persist
- ps: >-
if ($env:TARGET_ARCH -eq 'ia32') {
$env:npm_config_arch = "ia32"
}
- echo Running main test suite & node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
- cd ..
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
on_finish:
# Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )

View File

@@ -1,22 +1,18 @@
# NOTE IF CHANGING THIS FILE, ALSO APPLY THE CHANGE TO appveyor-woa.yml
# IF APPLICABLE!!!!
#
#
# The config expects the following environment variables to be set:
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
# - "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/+/main/docs/reference.md#var_target_cpu
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordingly
# 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'}.
# - "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_STORAGE" Set it to '1' upload a release to the Azure bucket.
# Otherwise the release will be uploaded to the GitHub Releases.
# - "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,
@@ -27,296 +23,120 @@
# 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: electronhq-16-core
image: e-118.0.5949.0
build_cloud: libcc-20
image: vs2017-15.9-10.0.18362
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
ELECTRON_ENABLE_STACK_DUMPING: 1
ELECTRON_ALSO_LOG_TO_STDERR: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
GYP_MSVS_HASH_27370823e7: 28622d16b1
PYTHONIOENCODING: UTF-8
matrix:
- job_name: Build
- job_name: Test
job_depends_on: Build
clone_script:
- ps: git clone -q $("--branch=" + $Env:APPVEYOR_REPO_BRANCH) $("https://github.com/" + $Env:APPVEYOR_REPO_NAME + ".git") $Env:APPVEYOR_BUILD_FOLDER
- ps: if (!$Env:APPVEYOR_PULL_REQUEST_NUMBER) {$("git checkout -qf " + $Env:APPVEYOR_REPO_COMMIT)}
- ps: if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {git fetch -q origin +refs/pull/$($Env:APPVEYOR_PULL_REQUEST_NUMBER)/head; git checkout -qf FETCH_HEAD}
clone_folder: C:\projects\src\electron
skip_branch_with_pr: true
# the first failed job cancels other jobs and fails entire build
matrix:
fast_finish: true
for:
- matrix:
only:
- job_name: Build
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false"
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc-only change"
$env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- ps: >-
if (Test-Path -Path "$pwd\depot_tools") {
Remove-Item -Recurse -Force $pwd\depot_tools
}
- ps: >-
if (Test-Path -Path "$pwd\build-tools") {
Remove-Item -Recurse -Force $pwd\build-tools
}
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
- ps: New-Item -Name depot_tools\.disable_auto_update -ItemType File
- depot_tools\bootstrap\win_tools.bat
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
- ps: >-
if (Test-Path -Path "$pwd\src\electron") {
Remove-Item -Recurse -Force $pwd\src\electron
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python3 $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- gclient config --name "src\electron" --unmanaged %GCLIENT_EXTRA_ARGS% "https://github.com/electron/electron"
# Patches are applied in the image bake. Check depshash to see if patches have changed.
- ps: $env:RUN_GCLIENT_SYNC="false"
- ps: $depshash_baked = Get-Content .\src\.depshash -Raw
- ps: cd src\electron
- ps: node script\generate-deps-hash.js
- ps: $depshash = Get-Content .\.depshash -Raw
- ps: cd ..\..
- ps: >-
if ($depshash_baked -ne $depshash) {
$env:RUN_GCLIENT_SYNC="true"
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync --with_branch_heads --with_tags ) else ( gclient runhooks )
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- 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 shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default electron:node_headers
- python3 %LOCAL_GOMA_DIR%\goma_ctl.py stat
- ps: >-
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
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python3 electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
cd C:\projects\src
$missing_artifacts = $false
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
} elseif (
$artifact_name -eq 'node_headers.zip') {
$artifact_file = $artifact_name
} else {
$artifact_file = "out\Default\$artifact_name"
}
if (-not(Test-Path $artifact_file)) {
Write-warning "$artifact_name is missing and cannot be added to artifacts"
$missing_artifacts = $true
}
}
}
if ($missing_artifacts) {
throw "Build failed due to missing artifacts"
}
deploy_script:
- cd electron
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python3 script\release\uploaders\upload.py --verbose
}
}
on_finish:
# Uncomment this lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
}
- matrix:
only:
- job_name: Test
init:
- ps: |
if ($env:RUN_TESTS -ne 'true') {
Write-warning "Skipping tests for $env:APPVEYOR_PROJECT_NAME"; Exit-AppveyorBuild
}
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping build for doc only change"
Exit-AppveyorBuild
} else {
$global:LASTEXITCODE = 0
}
- cd ..
- mkdir out\Default
- cd ..
- ps: |
# Download build artifacts
$apiUrl = 'https://ci.appveyor.com/api'
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
$artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
# Uncomment the following lines to download the pdb.zip to show real stacktraces when crashes happen during testing
# Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/pdb.zip" -OutFile pdb.zip
# 7z x -y -osrc pdb.zip
}
}
- ps: |
$out_default_zips = @('dist.zip','chromedriver.zip','mksnapshot.zip')
foreach($zip_name in $out_default_zips) {
7z x -y -osrc\out\Default $zip_name
}
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
- ps: 7z x -y -osrc node_headers.zip
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- ps: |
cd src
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
- cd electron
# Explicitly set npm_config_arch because the .env doesn't persist
- ps: >-
if ($env:TARGET_ARCH -eq 'ia32') {
$env:npm_config_arch = "ia32"
}
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log
- echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log
- cd ..
- 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"
- echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
- echo "Done verifying mksnapshot"
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo "Done verifying chromedriver"
on_finish:
# Uncomment these lines to enable RDP
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
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 ..
- mkdir src
- 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="$env:GCLIENT_EXTRA_ARGS --custom-var=checkout_boto=True --custom-var=checkout_requests=True"
} else {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- >-
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/shell/common/api:mojo
- ninja -C out/Default electron:electron_app
- if "%GN_CONFIG%"=="testing" ( python C:\Users\electron\depot_tools\post_build_ninja_summary.py -C out\Default )
- 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
- 7z a node_headers.zip out\Default\gen\node_headers
- appveyor PushArtifact node_headers.zip
- appveyor PushArtifact out/Default/mksnapshot.zip
- appveyor PushArtifact out/Default/electron.lib
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python electron\script\zip-symbols.py
appveyor PushArtifact out/Default/symbols.zip
}
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/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:\TEST_WOA)) -And (-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\release\uploaders\upload.py --upload_to_s3
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py
}
} elseif (Test-Path Env:\TEST_WOA) {
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
}

84
azure-pipelines-woa.yml Normal file
View File

@@ -0,0 +1,84 @@
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: src\electron'
inputs:
TargetFolder: src\electron
- script: |
cd src\electron
node script/yarn.js install --frozen-lockfile
displayName: 'Yarn install'
- powershell: |
$localArtifactPath = "$pwd\dist.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/dist.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath
displayName: 'Download and extract dist.zip for test'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
$localArtifactPath = "$pwd\ffmpeg.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/ffmpeg.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath
displayName: 'Download and extract ffmpeg.zip for test'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
$localArtifactPath = "$pwd\src\node_headers.zip"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
cd src
& "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
displayName: 'Download node headers for test'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
$localArtifactPath = "$pwd\src\out\Default\electron.lib"
$serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/electron.lib"
Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
displayName: 'Download electron.lib for test'
env:
APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
- powershell: |
New-Item src\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
displayName: 'Setup node headers'
- script: |
cd src
set npm_config_nodedir=%cd%\out\Default\gen\node_headers
set npm_config_arch=arm64
cd electron
node script/yarn test -- --ci --enable-logging --verbose
displayName: 'Run Electron tests'
env:
ELECTRON_OUT_DIR: Default
IGNORE_YARN_INSTALL_ERROR: 1
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
condition: always()
- script: |
cd src
echo "Verifying non proprietary ffmpeg"
python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
displayName: 'Verify ffmpeg'
- powershell: |
Get-Process | Where Name Like "electron*" | Stop-Process
Get-Process | Where Name Like "MicrosoftEdge*" | Stop-Process
displayName: 'Kill processes left running from last test run'
condition: always()

View File

@@ -1,8 +0,0 @@
{
"plugins": [
"unicorn"
],
"rules": {
"unicorn/prefer-node-protocol": "error"
}
}

View File

@@ -1,62 +1,26 @@
is_electron_build = true
use_jumbo_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
node_module_version = 118
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 75
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
v8_embedder_string = "-electron.0"
# TODO: this breaks mksnapshot
v8_enable_snapshot_native_code_counters = false
# we use this api
v8_enable_javascript_promise_hooks = true
enable_cdm_host_verification = false
proprietary_codecs = true
ffmpeg_branding = "Chrome"
enable_printing = true
# Removes DLLs from the build, which are only meant to be used for Chromium development.
# See https://github.com/electron/electron/pull/17985
enable_basic_printing = true
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
# These are disabled because they cause the zip manifest to differ between
# testing and release builds.
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.
enable_pseudolocales = false
# Make application name configurable at runtime for cookie crypto
allow_runtime_configurable_key_storage = true
# CET shadow stack is incompatible with v8, until v8 is CET compliant
# enabling this flag causes main process crashes where CET is enabled
# Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=357
enable_cet_shadow_stack = false
# For similar reasons, disable CFI, which is not well supported in V8.
# Chromium doesn't have any problems with this because they do not run
# V8 in the browser process.
# Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=281
is_cfi = false
# TODO: fix this once sysroots have been updated.
use_qt = false
# https://chromium-review.googlesource.com/c/chromium/src/+/4365718
# TODO(codebytere): fix perfetto incompatibility with Node.js.
use_perfetto_client_library = false
# Disables the builtins PGO for V8
v8_builtins_profiling_log_file = ""
# https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr.md
# TODO(vertedinde): hunt down dangling pointers on Linux
enable_dangling_raw_ptr_checks = false
# This flag speeds up the performance of fork/execve on linux systems.
# Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4602858
v8_enable_private_mapping_fork_optimization = true
# TODO: Remove this and update CI to contain 10.14 SDK once
# crbug.com/986701 is fixed.
mac_sdk_min = "10.13"

10
build/args/debug.gn Normal file
View File

@@ -0,0 +1,10 @@
import("all.gn")
is_debug = true
is_component_build = true
# This may be guarded behind is_chrome_branded alongside
# proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
# explicitly override here to build OpenH264 encoder/FFmpeg decoder.
# The initialization of the decoder depends on whether ffmpeg has
# been built with H.264 support.
rtc_use_h264 = proprietary_codecs

View File

@@ -1,7 +1,8 @@
root_extra_deps = [ "//electron/spec-chromium:spec" ]
root_extra_deps = [ "//electron/spec" ]
dcheck_always_on = true
is_debug = false
is_component_build = false
is_component_ffmpeg = false
symbol_level = 1
use_jumbo_build = true

View File

@@ -6,6 +6,8 @@ is_official_build = false
dcheck_always_on = true
symbol_level = 1
strip_absolute_paths_from_debug_symbols = false
# This may be guarded behind is_chrome_branded alongside
# proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
# explicitly override here to build OpenH264 encoder/FFmpeg decoder.

View File

@@ -1,22 +1,33 @@
template("node_action") {
assert(defined(invoker.script), "Need script path to run")
assert(defined(invoker.args), "Need script arguments")
import("node.gni")
# TODO(MarshallOfSound): Move to electron/node, this is the only place it is used now
# Run an action with a given working directory. Behaves identically to the
# action() target type, with the exception that it changes directory before
# running the script.
#
# Parameters:
# cwd [required]: Directory to change to before running the script.
template("chdir_action") {
action(target_name) {
forward_variables_from(invoker,
"*",
[
"deps",
"public_deps",
"sources",
"inputs",
"outputs",
"script",
"args",
])
if (!defined(inputs)) {
inputs = []
assert(defined(cwd), "Need cwd in $target_name")
script = "//electron/build/run-in-dir.py"
if (defined(sources)) {
sources += [ invoker.script ]
} else {
assert(defined(inputs))
inputs += [ invoker.script ]
}
inputs += [ invoker.script ]
script = "//electron/build/run-node.py"
args = [ rebase_path(invoker.script) ] + invoker.args
args = [
rebase_path(cwd),
rebase_path(invoker.script),
]
args += invoker.args
}
}
@@ -46,42 +57,4 @@ template("asar") {
rebase_path(outputs[0]),
]
}
node_action(target_name + "_header_hash") {
invoker_out = invoker.outputs
deps = [ ":" + invoker.target_name ]
sources = invoker.outputs
script = "//electron/script/gn-asar-hash.js"
outputs = [ "$target_gen_dir/asar_hashes/$target_name.hash" ]
args = [
rebase_path(invoker_out[0]),
rebase_path(outputs[0]),
]
}
}
template("asar_hashed_info_plist") {
node_action(target_name) {
assert(defined(invoker.plist_file),
"Need plist_file to add hashed assets to")
assert(defined(invoker.keys), "Need keys to replace with asset hash")
assert(defined(invoker.hash_targets), "Need hash_targets to read hash from")
deps = invoker.hash_targets
script = "//electron/script/gn-plist-but-with-hashes.js"
inputs = [ invoker.plist_file ]
outputs = [ "$target_gen_dir/hashed_plists/$target_name.plist" ]
hash_files = []
foreach(hash_target, invoker.hash_targets) {
hash_files += get_target_outputs(hash_target)
}
args = [
rebase_path(invoker.plist_file),
rebase_path(outputs[0]),
] + invoker.keys + rebase_path(hash_files)
}
}

View File

@@ -1,8 +1,26 @@
config("build_time_executable") {
configs = []
if (is_electron_build && !is_component_build) {
# The executables which have this config applied are dependent on ffmpeg,
# which is always a shared library in an Electron build. However, in the
# non-component build, executables don't have rpath set to search for
# libraries in the executable's directory, so ffmpeg cannot be found. So
# let's make sure rpath is set here.
# See '//build/config/gcc/BUILD.gn' for details on the rpath setting.
if (is_linux) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_mac) {
ldflags = [ "-Wl,-rpath,@loader_path/." ]
}
}
}
# For MAS build, we force defining "MAS_BUILD".
config("mas_build") {
if (is_mas_build) {
defines = [ "IS_MAS_BUILD()=1" ]
} else {
defines = [ "IS_MAS_BUILD()=0" ]
defines = [ "MAS_BUILD" ]
}
}

View File

@@ -39,7 +39,7 @@ def main(dump_syms, binary, out_dir, stamp_file, dsym_file=None):
args += ["-g", dsym_file]
args += [binary]
symbol_data = subprocess.check_output(args).decode(sys.stdout.encoding)
symbol_data = subprocess.check_output(args)
symbol_path = os.path.join(out_dir, get_symbol_path(symbol_data))
mkdir_p(os.path.dirname(symbol_path))

View File

@@ -24,11 +24,7 @@ template("extract_symbols") {
assert(defined(invoker.binary), "Need binary to dump")
assert(defined(invoker.symbol_dir), "Need directory for symbol output")
if (host_os == "win" && target_cpu == "x86") {
dump_syms_label = "//third_party/breakpad:dump_syms(//build/toolchain/win:win_clang_x64)"
} else {
dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
}
dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") +
"/dump_syms$_host_executable_suffix"
@@ -38,7 +34,9 @@ template("extract_symbols") {
dump_syms_binary,
]
stamp_file = "${target_gen_dir}/${target_name}.stamp"
outputs = [ stamp_file ]
outputs = [
stamp_file,
]
args = [
"./" + rebase_path(dump_syms_binary, root_build_dir),
rebase_path(invoker.binary, root_build_dir),

View File

@@ -1,94 +0,0 @@
#!/usr/bin/env python3
from collections import OrderedDict
import json
import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
SENTINEL = "dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX"
TEMPLATE_H = """
#ifndef ELECTRON_FUSES_H_
#define ELECTRON_FUSES_H_
#if defined(WIN32)
#define FUSE_EXPORT __declspec(dllexport)
#else
#define FUSE_EXPORT __attribute__((visibility("default")))
#endif
namespace electron::fuses {
extern const volatile char kFuseWire[];
{getters}
} // namespace electron::fuses
#endif // ELECTRON_FUSES_H_
"""
TEMPLATE_CC = """
#include "electron/fuses.h"
namespace electron::fuses {
const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version */ {fuse_version}, /* fuse_wire_length */ {fuse_wire_length}, /* fuse_wire */ {initial_config}};
{getters}
} // namespace electron:fuses
"""
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"), object_pairs_hook=OrderedDict)
fuse_version = fuse_defaults['_version']
del fuse_defaults['_version']
del fuse_defaults['_schema']
del fuse_defaults['_comment']
if fuse_version >= pow(2, 8):
raise Exception("Fuse version can not exceed one byte in size")
fuses = fuse_defaults.keys()
initial_config = ""
getters_h = ""
getters_cc = ""
index = len(SENTINEL) + 1
for fuse in fuses:
index += 1
initial_config += fuse_defaults[fuse]
name = ''.join(word.title() for word in fuse.split('_'))
getters_h += "FUSE_EXPORT bool Is{name}Enabled();\n".replace("{name}", name)
getters_cc += """
bool Is{name}Enabled() {
return kFuseWire[{index}] == '1';
}
""".replace("{name}", name).replace("{index}", str(index))
def c_hex(n):
s = hex(n)[2:]
return "0x" + s.rjust(2, '0')
def hex_arr(s):
arr = []
for char in s:
arr.append(c_hex(ord(char)))
return ",".join(arr)
header = TEMPLATE_H.replace("{getters}", getters_h.strip())
impl = TEMPLATE_CC.replace("{sentinel}", hex_arr(SENTINEL))
impl = impl.replace("{fuse_version}", c_hex(fuse_version))
impl = impl.replace("{fuse_wire_length}", c_hex(len(fuses)))
impl = impl.replace("{initial_config}", hex_arr(initial_config))
impl = impl.replace("{getters}", getters_cc.strip())
with open(sys.argv[1], 'w') as f:
f.write(header)
with open(sys.argv[2], 'w') as f:
f.write(impl)

View File

@@ -1,12 +0,0 @@
{
"_comment": "Modifying the fuse schema in any breaking way should result in the _version prop being incremented. NEVER remove a fuse or change its meaning, instead mark it as removed with 'r'",
"_schema": "0 == off, 1 == on, r == removed fuse",
"_version": 1,
"run_as_node": "1",
"cookie_encryption": "0",
"node_options": "1",
"node_cli_inspect": "1",
"embedded_asar_integrity_validation": "0",
"only_load_app_from_asar": "0",
"load_browser_process_specific_v8_snapshot": "0"
}

View File

@@ -1,34 +0,0 @@
import os
import re
import sys
DEFINE_EXTRACT_REGEX = re.compile('^ *# *define (\w*)', re.MULTILINE)
def main(out_dir, headers):
defines = []
for filename in headers:
with open(filename, 'r') as f:
content = f.read()
defines += read_defines(content)
push_and_undef = ''
for define in defines:
push_and_undef += '#pragma push_macro("%s")\n' % define
push_and_undef += '#undef %s\n' % define
with open(os.path.join(out_dir, 'push_and_undef_node_defines.h'), 'w') as o:
o.write(push_and_undef)
pop = ''
for define in defines:
pop += '#pragma pop_macro("%s")\n' % define
with open(os.path.join(out_dir, 'pop_node_defines.h'), 'w') as o:
o.write(pop)
def read_defines(content):
defines = []
for match in DEFINE_EXTRACT_REGEX.finditer(content):
defines.append(match.group(1))
return defines
if __name__ == '__main__':
main(sys.argv[1], sys.argv[2:])

653
build/install-build-deps.sh Executable file
View File

@@ -0,0 +1,653 @@
#!/bin/bash -e
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install everything needed to build chromium (well, ideally, anyway)
# See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md
usage() {
echo "Usage: $0 [--options]"
echo "Options:"
echo "--[no-]syms: enable or disable installation of debugging symbols"
echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
echo "--[no-]arm: enable or disable installation of arm cross toolchain"
echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
"fonts"
echo "--[no-]nacl: enable or disable installation of prerequisites for"\
"building standalone NaCl and all its toolchains"
echo "--[no-]backwards-compatible: enable or disable installation of packages
that are no longer currently needed and have been removed from this
script. Useful for bisection."
echo "--no-prompt: silently select standard options/defaults"
echo "--quick-check: quickly try to determine if dependencies are installed"
echo " (this avoids interactive prompts and sudo commands,"
echo " so might not be 100% accurate)"
echo "--unsupported: attempt installation even on unsupported systems"
echo "Script will prompt interactively if options not given."
exit 1
}
# Checks whether a particular package is available in the repos.
# USAGE: $ package_exists <package name>
package_exists() {
# 'apt-cache search' takes a regex string, so eg. the +'s in packages like
# "libstdc++" need to be escaped.
local escaped="$(echo $1 | sed 's/[\~\+\.\:-]/\\&/g')"
[ ! -z "$(apt-cache search --names-only "${escaped}" | \
awk '$1 == "'$1'" { print $1; }')" ]
}
# These default to on because (some) bots need them and it keeps things
# simple for the bot setup if all bots just run the script in its default
# mode. Developers who don't want stuff they don't need installed on their
# own workstations can pass --no-arm --no-nacl when running the script.
do_inst_arm=1
do_inst_nacl=1
while [ "$1" != "" ]
do
case "$1" in
--syms) do_inst_syms=1;;
--no-syms) do_inst_syms=0;;
--lib32) do_inst_lib32=1;;
--arm) do_inst_arm=1;;
--no-arm) do_inst_arm=0;;
--chromeos-fonts) do_inst_chromeos_fonts=1;;
--no-chromeos-fonts) do_inst_chromeos_fonts=0;;
--nacl) do_inst_nacl=1;;
--no-nacl) do_inst_nacl=0;;
--backwards-compatible) do_inst_backwards_compatible=1;;
--no-backwards-compatible) do_inst_backwards_compatible=0;;
--add-cross-tool-repo) add_cross_tool_repo=1;;
--no-prompt) do_default=1
do_quietly="-qq --assume-yes"
;;
--quick-check) do_quick_check=1;;
--unsupported) do_unsupported=1;;
*) usage;;
esac
shift
done
if [ "$do_inst_arm" = "1" ]; then
do_inst_lib32=1
fi
# Check for lsb_release command in $PATH
if ! which lsb_release > /dev/null; then
echo "ERROR: lsb_release not found in \$PATH" >&2
exit 1;
fi
distro_codename=$(lsb_release --codename --short)
distro_id=$(lsb_release --id --short)
supported_codenames="(trusty|xenial|artful|bionic)"
supported_ids="(Debian)"
if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
if [[ ! $distro_codename =~ $supported_codenames &&
! $distro_id =~ $supported_ids ]]; then
echo -e "ERROR: The only supported distros are\n" \
"\tUbuntu 14.04 LTS (trusty)\n" \
"\tUbuntu 16.04 LTS (xenial)\n" \
"\tUbuntu 17.10 (artful)\n" \
"\tUbuntu 18.04 LTS (bionic)\n" \
"\tDebian 8 (jessie) or later" >&2
exit 1
fi
if ! uname -m | egrep -q "i686|x86_64"; then
echo "Only x86 architectures are currently supported" >&2
exit
fi
fi
if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then
echo "Running as non-root user."
echo "You might have to enter your password one or more times for 'sudo'."
echo
fi
# Packages needed for chromeos only
chromeos_dev_list="libbluetooth-dev libxkbcommon-dev"
if package_exists realpath; then
chromeos_dev_list="${chromeos_dev_list} realpath"
fi
# Packages needed for development
dev_list="\
binutils
bison
bzip2
cdbs
curl
dbus-x11
dpkg-dev
elfutils
devscripts
fakeroot
flex
g++
git-core
git-svn
gperf
libappindicator3-dev
libasound2-dev
libatspi2.0-dev
libbrlapi-dev
libbz2-dev
libcairo2-dev
libcap-dev
libcups2-dev
libcurl4-gnutls-dev
libdrm-dev
libelf-dev
libffi-dev
libgbm-dev
libglib2.0-dev
libglu1-mesa-dev
libgnome-keyring-dev
libgtk-3-dev
libkrb5-dev
libnspr4-dev
libnss3-dev
libpam0g-dev
libpci-dev
libpulse-dev
libsctp-dev
libspeechd-dev
libsqlite3-dev
libssl-dev
libudev-dev
libwww-perl
libxslt1-dev
libxss-dev
libxt-dev
libxtst-dev
locales
openbox
p7zip
patch
perl
pkg-config
python
python-cherrypy3
python-crypto
python-dev
python-numpy
python-opencv
python-openssl
python-psutil
python-yaml
rpm
ruby
subversion
uuid-dev
wdiff
x11-utils
xcompmgr
xz-utils
zip
$chromeos_dev_list
"
# 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
# NaCl binaries.
if file -L /sbin/init | grep -q 'ELF 64-bit'; then
dev_list="${dev_list} libc6-i386 lib32gcc1 lib32stdc++6"
fi
# Run-time libraries required by chromeos only
chromeos_lib_list="libpulse0 libbz2-1.0"
# List of required run-time libraries
common_lib_list="\
libappindicator3-1
libasound2
libatk1.0-0
libatspi2.0-0
libc6
libcairo2
libcap2
libcups2
libexpat1
libffi6
libfontconfig1
libfreetype6
libglib2.0-0
libgnome-keyring0
libgtk-3-0
libpam0g
libpango1.0-0
libpci3
libpcre3
libpixman-1-0
libspeechd2
libstdc++6
libsqlite3-0
libuuid1
libwayland-egl1-mesa
libx11-6
libx11-xcb1
libxau6
libxcb1
libxcomposite1
libxcursor1
libxdamage1
libxdmcp6
libxext6
libxfixes3
libxi6
libxinerama1
libxrandr2
libxrender1
libxtst6
zlib1g
"
# Full list of required run-time libraries
lib_list="\
$common_lib_list
$chromeos_lib_list
"
# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf
lib32_list="linux-libc-dev:i386 libpci3:i386"
# 32-bit libraries needed for a 32-bit build
lib32_list="$lib32_list libx11-xcb1:i386"
# Packages that have been removed from this script. Regardless of configuration
# or options passed to this script, whenever a package is removed, it should be
# added here.
backwards_compatible_list="\
7za
fonts-indic
fonts-ipafont
fonts-stix
fonts-thai-tlwg
fonts-tlwg-garuda
language-pack-da
language-pack-fr
language-pack-he
language-pack-zh-hant
libappindicator-dev
libappindicator1
libappindicator3-1:i386
libexif-dev
libexif12
libexif12:i386
libgbm-dev
libgl1-mesa-dev
libgl1-mesa-glx:i386
libgles2-mesa-dev
libgtk2.0-0
libgtk2.0-0:i386
libgtk2.0-dev
mesa-common-dev
msttcorefonts
ttf-dejavu-core
ttf-indic-fonts
ttf-kochi-gothic
ttf-kochi-mincho
ttf-mscorefonts-installer
xfonts-mathml
"
case $distro_codename in
trusty)
backwards_compatible_list+=" \
libgbm-dev-lts-trusty
libgl1-mesa-dev-lts-trusty
libgl1-mesa-glx-lts-trusty:i386
libgles2-mesa-dev-lts-trusty
mesa-common-dev-lts-trusty"
;;
xenial)
backwards_compatible_list+=" \
libgbm-dev-lts-xenial
libgl1-mesa-dev-lts-xenial
libgl1-mesa-glx-lts-xenial:i386
libgles2-mesa-dev-lts-xenial
mesa-common-dev-lts-xenial"
;;
esac
# arm cross toolchain packages needed to build chrome on armhf
EM_REPO="deb http://emdebian.org/tools/debian/ jessie main"
EM_SOURCE=$(cat <<EOF
# Repo added by Chromium $0
${EM_REPO}
# deb-src http://emdebian.org/tools/debian/ jessie main
EOF
)
EM_ARCHIVE_KEY_FINGER="084C6C6F39159EDB67969AA87DE089671804772E"
GPP_ARM_PACKAGE="g++-arm-linux-gnueabihf"
case $distro_codename in
jessie)
eval $(apt-config shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d')
CROSSTOOLS_LIST="${APT_SOURCESDIR}/crosstools.list"
arm_list="libc6-dev:armhf
linux-libc-dev:armhf"
if [ "$do_inst_arm" = "1" ]; then
if $(dpkg-query -W ${GPP_ARM_PACKAGE} &>/dev/null); then
arm_list+=" ${GPP_ARM_PACKAGE}"
else
if [ "${add_cross_tool_repo}" = "1" ]; then
gpg --keyserver pgp.mit.edu --recv-keys ${EM_ARCHIVE_KEY_FINGER}
gpg -a --export ${EM_ARCHIVE_KEY_FINGER} | sudo apt-key add -
if ! grep "^${EM_REPO}" "${CROSSTOOLS_LIST}" &>/dev/null; then
echo "${EM_SOURCE}" | sudo tee -a "${CROSSTOOLS_LIST}" >/dev/null
fi
arm_list+=" ${GPP_ARM_PACKAGE}"
else
echo "The Debian Cross-toolchains repository is necessary to"
echo "cross-compile Chromium for arm."
echo "Rerun with --add-deb-cross-tool-repo to have it added for you."
fi
fi
fi
;;
# All necessary ARM packages are available on the default repos on
# Debian 9 and later.
*)
arm_list="libc6-dev-armhf-cross
linux-libc-dev-armhf-cross
${GPP_ARM_PACKAGE}"
;;
esac
# Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056
case $distro_codename in
trusty)
arm_list+=" g++-4.8-multilib-arm-linux-gnueabihf
gcc-4.8-multilib-arm-linux-gnueabihf"
;;
xenial|artful|bionic)
arm_list+=" g++-5-multilib-arm-linux-gnueabihf
gcc-5-multilib-arm-linux-gnueabihf
gcc-arm-linux-gnueabihf"
;;
esac
# Packages to build NaCl, its toolchains, and its ports.
naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc"
nacl_list="\
g++-mingw-w64-i686
lib32z1-dev
libasound2:i386
libcap2:i386
libelf-dev:i386
libfontconfig1:i386
libglib2.0-0:i386
libgpm2:i386
libgtk-3-0:i386
libncurses5:i386
lib32ncurses5-dev
libnss3:i386
libpango1.0-0:i386
libssl-dev:i386
libtinfo-dev
libtinfo-dev:i386
libtool
libuuid1:i386
libxcomposite1:i386
libxcursor1:i386
libxdamage1:i386
libxi6:i386
libxrandr2:i386
libxss1:i386
libxtst6:i386
texinfo
xvfb
${naclports_list}
"
if package_exists libssl1.1; then
nacl_list="${nacl_list} libssl1.1:i386"
elif package_exists libssl1.0.2; then
nacl_list="${nacl_list} libssl1.0.2:i386"
else
nacl_list="${nacl_list} libssl1.0.0:i386"
fi
# Some package names have changed over time
if package_exists libpng16-16; then
lib_list="${lib_list} libpng16-16"
else
lib_list="${lib_list} libpng12-0"
fi
if package_exists libnspr4; then
lib_list="${lib_list} libnspr4 libnss3"
else
lib_list="${lib_list} libnspr4-0d libnss3-1d"
fi
if package_exists libjpeg-dev; then
dev_list="${dev_list} libjpeg-dev"
else
dev_list="${dev_list} libjpeg62-dev"
fi
if package_exists libudev1; then
dev_list="${dev_list} libudev1"
nacl_list="${nacl_list} libudev1:i386"
else
dev_list="${dev_list} libudev0"
nacl_list="${nacl_list} libudev0:i386"
fi
if package_exists libbrlapi0.6; then
dev_list="${dev_list} libbrlapi0.6"
else
dev_list="${dev_list} libbrlapi0.5"
fi
if package_exists apache2.2-bin; then
dev_list="${dev_list} apache2.2-bin"
else
dev_list="${dev_list} apache2-bin"
fi
if package_exists libav-tools; then
dev_list="${dev_list} libav-tools"
fi
if package_exists php7.2-cgi; then
dev_list="${dev_list} php7.2-cgi libapache2-mod-php7.2"
elif package_exists php7.1-cgi; then
dev_list="${dev_list} php7.1-cgi libapache2-mod-php7.1"
elif package_exists php7.0-cgi; then
dev_list="${dev_list} php7.0-cgi libapache2-mod-php7.0"
else
dev_list="${dev_list} php5-cgi libapache2-mod-php5"
fi
# Some packages are only needed if the distribution actually supports
# installing them.
if package_exists appmenu-gtk; then
lib_list="$lib_list appmenu-gtk"
fi
# Cross-toolchain strip is needed for building the sysroots.
if package_exists binutils-arm-linux-gnueabihf; then
dev_list="${dev_list} binutils-arm-linux-gnueabihf"
fi
if package_exists binutils-aarch64-linux-gnu; then
dev_list="${dev_list} binutils-aarch64-linux-gnu"
fi
if package_exists binutils-mipsel-linux-gnu; then
dev_list="${dev_list} binutils-mipsel-linux-gnu"
fi
if package_exists binutils-mips64el-linux-gnuabi64; then
dev_list="${dev_list} binutils-mips64el-linux-gnuabi64"
fi
# When cross building for arm/Android on 64-bit systems the host binaries
# that are part of v8 need to be compiled with -m32 which means
# that basic multilib support is needed.
if file -L /sbin/init | grep -q 'ELF 64-bit'; then
# gcc-multilib conflicts with the arm cross compiler (at least in trusty) but
# g++-X.Y-multilib gives us the 32-bit support that we need. Find out the
# appropriate value of X and Y by seeing what version the current
# distribution's g++-multilib package depends on.
multilib_package=$(apt-cache depends g++-multilib --important | \
grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b')
lib32_list="$lib32_list $multilib_package"
fi
if [ "$do_inst_syms" = "1" ]; then
echo "Including debugging symbols."
# Debian is in the process of transitioning to automatic debug packages, which
# have the -dbgsym suffix (https://wiki.debian.org/AutomaticDebugPackages).
# Untransitioned packages have the -dbg suffix. And on some systems, neither
# will be available, so exclude the ones that are missing.
dbg_package_name() {
if package_exists "$1-dbgsym"; then
echo "$1-dbgsym"
elif package_exists "$1-dbg"; then
echo "$1-dbg"
fi
}
for package in "${common_lib_list}"; do
dbg_list="$dbg_list $(dbg_package_name ${package})"
done
# Debugging symbols packages not following common naming scheme
if [ "$(dbg_package_name libstdc++6)" == "" ]; then
if package_exists libstdc++6-8-dbg; then
dbg_list="${dbg_list} libstdc++6-8-dbg"
elif package_exists libstdc++6-7-dbg; then
dbg_list="${dbg_list} libstdc++6-7-dbg"
elif package_exists libstdc++6-6-dbg; then
dbg_list="${dbg_list} libstdc++6-6-dbg"
elif package_exists libstdc++6-5-dbg; then
dbg_list="${dbg_list} libstdc++6-5-dbg"
elif package_exists libstdc++6-4.9-dbg; then
dbg_list="${dbg_list} libstdc++6-4.9-dbg"
elif package_exists libstdc++6-4.8-dbg; then
dbg_list="${dbg_list} libstdc++6-4.8-dbg"
elif package_exists libstdc++6-4.7-dbg; then
dbg_list="${dbg_list} libstdc++6-4.7-dbg"
elif package_exists libstdc++6-4.6-dbg; then
dbg_list="${dbg_list} libstdc++6-4.6-dbg"
fi
fi
if [ "$(dbg_package_name libatk1.0-0)" == "" ]; then
dbg_list="$dbg_list $(dbg_package_name libatk1.0)"
fi
if [ "$(dbg_package_name libpango1.0-0)" == "" ]; then
dbg_list="$dbg_list $(dbg_package_name libpango1.0-dev)"
fi
else
echo "Skipping debugging symbols."
dbg_list=
fi
if [ "$do_inst_lib32" = "1" ]; then
echo "Including 32-bit libraries."
else
echo "Skipping 32-bit libraries."
lib32_list=
fi
if [ "$do_inst_arm" = "1" ]; then
echo "Including ARM cross toolchain."
else
echo "Skipping ARM cross toolchain."
arm_list=
fi
if [ "$do_inst_nacl" = "1" ]; then
echo "Including NaCl, NaCl toolchain, NaCl ports dependencies."
else
echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies."
nacl_list=
fi
filtered_backwards_compatible_list=
if [ "$do_inst_backwards_compatible" = "1" ]; then
echo "Including backwards compatible packages."
for package in ${backwards_compatible_list}; do
if package_exists ${package}; then
filtered_backwards_compatible_list+=" ${package}"
fi
done
fi
# The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid
# confusing dpkg-query (crbug.com/446172).
packages="$(
echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}" \
"${nacl_list}" ${filtered_backwards_compatible_list} | tr " " "\n" | \
sort -u | sort -r -s -t: -k2 | tr "\n" " "
)"
if [ 1 -eq "${do_quick_check-0}" ] ; then
if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then
# Distinguish between packages that actually aren't available to the
# system (i.e. not in any repo) and packages that just aren't known to
# dpkg (i.e. managed by apt).
missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')"
not_installed=""
unknown=""
for p in ${missing_packages}; do
if apt-cache show ${p} > /dev/null 2>&1; then
not_installed="${p}\n${not_installed}"
else
unknown="${p}\n${unknown}"
fi
done
if [ -n "${not_installed}" ]; then
echo "WARNING: The following packages are not installed:"
echo -e "${not_installed}" | sed -e "s/^/ /"
fi
if [ -n "${unknown}" ]; then
echo "WARNING: The following packages are unknown to your system"
echo "(maybe missing a repo or need to 'sudo apt-get update'):"
echo -e "${unknown}" | sed -e "s/^/ /"
fi
exit 1
fi
exit 0
fi
if [ "$do_inst_lib32" = "1" ] || [ "$do_inst_nacl" = "1" ]; then
sudo dpkg --add-architecture i386
fi
sudo apt-get update
# We initially run "apt-get" with the --reinstall option and parse its output.
# This way, we can find all the packages that need to be newly installed
# without accidentally promoting any packages from "auto" to "manual".
# We then re-run "apt-get" with just the list of missing packages.
echo "Finding missing packages..."
# Intentionally leaving $packages unquoted so it's more readable.
echo "Packages required: " $packages
echo
new_list_cmd="sudo apt-get install --reinstall $(echo $packages)"
if new_list="$(yes n | LANGUAGE=en LANG=C $new_list_cmd)"; then
# We probably never hit this following line.
echo "No missing packages, and the packages are up to date."
elif [ $? -eq 1 ]; then
# We expect apt-get to have exit status of 1.
# This indicates that we cancelled the install with "yes n|".
new_list=$(echo "$new_list" |
sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d')
new_list=$(echo "$new_list" | sed 's/ *$//')
if [ -z "$new_list" ] ; then
echo "No missing packages, and the packages are up to date."
else
echo "Installing missing packages: $new_list."
sudo apt-get install ${do_quietly-} ${new_list}
fi
echo
else
# An apt-get exit status of 100 indicates that a real error has occurred.
# I am intentionally leaving out the '"'s around new_list_cmd,
# as this makes it easier to cut and paste the output
echo "The following command failed: " ${new_list_cmd}
echo
echo "It produces the following output:"
yes n | $new_list_cmd || true
echo
echo "You will have to install the above packages yourself."
echo
exit 100
fi
# Install the Chrome OS default fonts. This must go after running
# apt-get, since install-chromeos-fonts depends on curl.
if [ "$do_inst_chromeos_fonts" != "0" ]; then
echo
echo "Installing Chrome OS fonts."
dir=`echo $0 | sed -r -e 's/\/[^/]+$//'`
if ! sudo $dir/linux/install-chromeos-fonts.py; then
echo "ERROR: The installation of the Chrome OS default fonts failed."
if [ `stat -f -c %T $dir` == "nfs" ]; then
echo "The reason is that your repo is installed on a remote file system."
else
echo "This is expected if your repo is installed on a remote file system."
fi
echo "It is recommended to install your repo on a local file system."
echo "You can skip the installation of the Chrome OS default founts with"
echo "the command line option: --no-chromeos-fonts."
exit 1
fi
else
echo "Skipping installation of Chrome OS fonts."
fi
echo "Installing locales."
CHROMIUM_LOCALES="da_DK.UTF-8 fr_FR.UTF-8 he_IL.UTF-8 zh_TW.UTF-8"
LOCALE_GEN=/etc/locale.gen
if [ -e ${LOCALE_GEN} ]; then
OLD_LOCALE_GEN="$(cat /etc/locale.gen)"
for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do
sudo sed -i "s/^# ${CHROMIUM_LOCALE}/${CHROMIUM_LOCALE}/" ${LOCALE_GEN}
done
# Regenerating locales can take a while, so only do it if we need to.
if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then
echo "Locales already up-to-date."
else
sudo locale-gen
fi
else
for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do
sudo locale-gen ${CHROMIUM_LOCALE}
done
fi

View File

@@ -4,11 +4,10 @@
# Cocoa .app bundle. The presence of these empty directories is sufficient to
# convince Cocoa that the application supports the named localization, even if
# an InfoPlist.strings file is not provided. Chrome uses these empty locale
# directories for its helper executable bundles, which do not otherwise
# directoires for its helper executable bundles, which do not otherwise
# require any direct Cocoa locale support.
import os
import errno
import sys
@@ -17,7 +16,7 @@ def main(args):
try:
os.makedirs(dirname)
except OSError as e:
if e.errno == errno.EEXIST:
if e.errno == os.errno.EEXIST:
# It's OK if it already exists
pass
else:

21
build/node.gni Normal file
View File

@@ -0,0 +1,21 @@
template("node_action") {
assert(defined(invoker.script), "Need script path to run")
assert(defined(invoker.args), "Need script argumets")
action(target_name) {
forward_variables_from(invoker,
[
"deps",
"public_deps",
"sources",
"inputs",
"outputs",
])
if (!defined(inputs)) {
inputs = []
}
inputs += [ invoker.script ]
script = "//electron/build/run-node.py"
args = [ rebase_path(invoker.script) ] + invoker.args
}
}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
@@ -15,6 +15,5 @@ args = [cmd, "run",
try:
subprocess.check_output(args, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
error_msg = "NPM script '{}' failed with code '{}':\n".format(sys.argv[2], e.returncode)
print(error_msg + e.output.decode('utf8'))
print("NPM script '" + sys.argv[2] + "' failed with code '" + str(e.returncode) + "':\n" + e.output)
sys.exit(e.returncode)

View File

@@ -1,16 +1,18 @@
template("npm_action") {
assert(defined(invoker.script),
"Need script name to run (must be defined in package.json)")
assert(defined(invoker.args), "Need script arguments")
assert(defined(invoker.args), "Need script argumets")
action("npm_pre_flight_" + target_name) {
inputs = [
"//electron/package.json",
"//electron/yarn.lock",
"package.json",
"yarn.lock",
]
script = "//electron/build/npm-run.py"
outputs = [ "$target_gen_dir/npm_pre_stamps/" + target_name + ".stamp" ]
outputs = [
"$target_gen_dir/npm_pre_stamps/" + target_name + ".stamp",
]
args = [
"--silent",

View File

@@ -1,78 +0,0 @@
from __future__ import unicode_literals
import contextlib
import sys
import os
import optparse
import json
sys.path.append("%s/../../build" % os.path.dirname(os.path.realpath(__file__)))
import find_depot_tools
from vs_toolchain import \
SetEnvironmentAndGetRuntimeDllDirs, \
SetEnvironmentAndGetSDKDir, \
NormalizePath
sys.path.append("%s/win_toolchain" % find_depot_tools.add_depot_tools_to_path())
from get_toolchain_if_necessary import CalculateHash
@contextlib.contextmanager
def cwd(directory):
curdir = os.getcwd()
try:
os.chdir(directory)
yield
finally:
os.chdir(curdir)
def calculate_hash(root):
with cwd(root):
return CalculateHash('.', None)
def windows_installed_software():
# file_path = os.path.join(os.getcwd(), 'installed_software.json')
# return json.loads(open('installed_software.json').read().decode('utf-8'))
f = open('installed_software.json', encoding='utf-8-sig')
return json.load(f)
def windows_profile():
runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()
win_sdk_dir = SetEnvironmentAndGetSDKDir()
path = NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH'])
# since current windows executable are symbols path dependant,
# profile the current directory too
return {
'pwd': os.getcwd(),
'installed_software': windows_installed_software(),
'sdks': [
{'name': 'vs', 'path': path, 'hash': calculate_hash(path)},
{
'name': 'wsdk',
'path': win_sdk_dir,
'hash': calculate_hash(win_sdk_dir),
},
],
'runtime_lib_dirs': runtime_dll_dirs,
}
def main(options):
if sys.platform == 'win32':
with open(options.output_json, 'w') as f:
json.dump(windows_profile(), f)
else:
raise OSError("Unsupported OS")
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option('--output-json', metavar='FILE', default='profile.json',
help='write information about toolchain to FILE')
opts, args = parser.parse_args()
sys.exit(main(opts))

View File

@@ -1,57 +1,16 @@
import("//build/config/mac/mac_sdk.gni")
# Template to compile .xib and .storyboard files.
# (copied from src/build/config/ios/rules.gni)
#
# Arguments
#
# sources:
# list of string, sources to compile
#
# ibtool_flags:
# (optional) list of string, additional flags to pass to the ibtool
template("compile_ib_files") {
action_foreach(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
assert(defined(invoker.sources),
"sources must be specified for $target_name")
assert(defined(invoker.output_extension),
"output_extension must be specified for $target_name")
ibtool_flags = []
if (defined(invoker.ibtool_flags)) {
ibtool_flags = invoker.ibtool_flags
}
_output_extension = invoker.output_extension
script = "//build/config/ios/compile_ib_files.py"
sources = invoker.sources
outputs = [
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
]
args = [
"--input",
"{{source}}",
"--output",
rebase_path(
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
root_build_dir),
]
args += ibtool_flags
}
}
# This is imported from /ios becuase this functionality was moved
# after Chromium stopped using xib files for macOS menu functionality
# See https://chromium-review.googlesource.com/c/chromium/src/+/1648695
import("//build/config/ios/rules.gni")
# Template is copied here from Chromium but was removed in
# https://chromium-review.googlesource.com/c/chromium/src/+/1637981
# Template to compile and package Mac XIB files as bundle data.
# Arguments
# sources:
# list of string, sources to compile
# list of string, sources to comiple
# output_path:
# (optional) string, the path to use for the outputs list in the
# bundle_data step. If unspecified, defaults to bundle_resources_dir.
@@ -81,7 +40,9 @@ template("mac_xib_bundle_data") {
"visibility",
])
public_deps = [ ":$_compile_target_name" ]
public_deps = [
":$_compile_target_name",
]
sources = get_target_outputs(":$_compile_target_name")
_output_path = "{{bundle_resources_dir}}"
@@ -89,6 +50,8 @@ template("mac_xib_bundle_data") {
_output_path = invoker.output_path
}
outputs = [ "$_output_path/{{source_file_part}}" ]
outputs = [
"$_output_path/{{source_file_part}}",
]
}
}

View File

@@ -1,5 +1,6 @@
import sys
import os
import subprocess
def main(argv):
cwd = argv[1]

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env python3
import os
import subprocess
import sys
source = sys.argv[1]
dest = sys.argv[2]
# Ensure any existing framework is removed
subprocess.check_output(["rm", "-rf", dest])
subprocess.check_output(["cp", "-a", source, dest])
# Strip headers, we do not need to ship them
subprocess.check_output(["rm", "-r", os.path.join(dest, "Headers")])
subprocess.check_output(
["rm", "-r", os.path.join(dest, "Versions", "Current", "Headers")]
)

View File

@@ -15,8 +15,12 @@ template("templated_file") {
"inputs",
"outputs",
])
inputs = [ invoker.template ]
outputs = [ invoker.output ]
inputs = [
invoker.template,
]
outputs = [
invoker.output,
]
script = "//electron/build/generate-template.py"
args = [
rebase_path(invoker.template),

View File

@@ -1,107 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION $major,$minor,$patch,$prerelease_number
PRODUCTVERSION $major,$minor,$patch,$prerelease_number
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "$major.$minor.$patch"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "$major.$minor.$patch"
VALUE "SquirrelAwareVersion", "1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
IDR_MAINFRAME ICON "electron.ico"
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1 +0,0 @@
$full_version

View File

@@ -26,12 +26,19 @@ template("typescript_build") {
"//electron/typings/internal-electron.d.ts",
]
type_roots = "node_modules/@types,typings"
if (defined(invoker.type_root)) {
type_roots += "," + invoker.type_root
}
base_out_path = invoker.output_gen_dir + "/electron/"
args = [
"-p",
rebase_path(invoker.tsconfig),
"--outDir",
rebase_path("$base_out_path" + invoker.output_dir_name),
"--typeRoots",
type_roots,
]
outputs = []

View File

@@ -0,0 +1,2 @@
process.env.PRINT_WEBPACK_GRAPH = true
require('./run-compiler')

View File

@@ -0,0 +1,22 @@
const path = require('path')
const webpack = require('webpack')
const configPath = process.argv[2]
const outPath = path.resolve(process.argv[3])
const config = require(configPath)
config.output = {
path: path.dirname(outPath),
filename: path.basename(outPath)
}
webpack(config, (err, stats) => {
if (err) {
console.error(err)
process.exit(1)
} else if (stats.hasErrors()) {
console.error(stats.toString('normal'))
process.exit(1)
} else {
process.exit(0)
}
})

View File

@@ -1,5 +0,0 @@
module.exports = require('./webpack.config.base')({
target: 'asar',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
});

View File

@@ -1,19 +1,22 @@
const fs = require('node:fs');
const path = require('node:path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const WrapperPlugin = require('wrapper-webpack-plugin');
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const electronRoot = path.resolve(__dirname, '../..');
const electronRoot = path.resolve(__dirname, '../..')
const onlyPrintingGraph = !!process.env.PRINT_WEBPACK_GRAPH
class AccessDependenciesPlugin {
apply (compiler) {
apply(compiler) {
// Only hook into webpack when we are printing the dependency graph
if (!onlyPrintingGraph) return
compiler.hooks.compilation.tap('AccessDependenciesPlugin', compilation => {
compilation.hooks.finishModules.tap('AccessDependenciesPlugin', modules => {
const filePaths = modules.map(m => m.resource).filter(p => p).map(p => path.relative(electronRoot, p));
console.info(JSON.stringify(filePaths));
});
});
const filePaths = modules.map(m => m.resource).filter(p => p).map(p => path.relative(electronRoot, p))
console.info(JSON.stringify(filePaths))
})
})
}
}
@@ -21,154 +24,60 @@ module.exports = ({
alwaysHasNode,
loadElectronFromAlternateTarget,
targetDeletesNodeGlobals,
target,
wrapInitWithProfilingTimeout,
wrapInitWithTryCatch
target
}) => {
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts');
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
if (!fs.existsSync(entry)) {
entry = path.resolve(electronRoot, 'lib', target, 'init.js');
entry = path.resolve(electronRoot, 'lib', target, 'init.js')
}
const electronAPIFile = path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts');
return (env = {}, argv = {}) => {
const onlyPrintingGraph = !!env.PRINT_WEBPACK_GRAPH;
const outputFilename = argv['output-filename'] || `${target}.bundle.js`;
const defines = {
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
};
if (env.buildflags) {
const flagFile = fs.readFileSync(env.buildflags, 'utf8');
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/);
if (flagMatch) {
const [, flagName, flagValue] = flagMatch;
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
return ({
mode: 'development',
devtool: 'inline-source-map',
entry,
target: alwaysHasNode ? 'node' : 'web',
output: {
filename: `${target}.bundle.js`
},
resolve: {
alias: {
'@electron/internal': path.resolve(electronRoot, 'lib'),
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.js'),
// Force timers to resolve to our dependency that doens't use window.postMessage
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [6059]
}
}
}
const ignoredModules = [];
if (defines.ENABLE_VIEWS_API === 'false') {
ignoredModules.push(
'@electron/internal/browser/api/views/image-view.js'
);
}
const plugins = [];
if (onlyPrintingGraph) {
plugins.push(new AccessDependenciesPlugin());
}
if (targetDeletesNodeGlobals) {
plugins.push(new webpack.ProvidePlugin({
Buffer: ['@electron/internal/common/webpack-provider', 'Buffer'],
global: ['@electron/internal/common/webpack-provider', '_global'],
process: ['@electron/internal/common/webpack-provider', 'process']
}));
}
// Webpack 5 no longer polyfills process or Buffer.
if (!alwaysHasNode) {
plugins.push(new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser'
}));
}
plugins.push(new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise']
}));
plugins.push(new webpack.DefinePlugin(defines));
if (wrapInitWithProfilingTimeout) {
plugins.push(new WrapperPlugin({
header: 'function ___electron_webpack_init__() {',
footer: `
};
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
setTimeout(___electron_webpack_init__, 0);
} else {
___electron_webpack_init__();
}`
}));
}
if (wrapInitWithTryCatch) {
plugins.push(new WrapperPlugin({
header: 'try {',
footer: `
} catch (err) {
console.error('Electron ${outputFilename} script failed to run');
console.error(err);
}`
}));
}
return {
mode: 'development',
devtool: false,
entry,
target: alwaysHasNode ? 'node' : 'web',
output: {
filename: outputFilename
},
resolve: {
alias: {
'@electron/internal': path.resolve(electronRoot, 'lib'),
electron$: electronAPIFile,
'electron/main$': electronAPIFile,
'electron/renderer$': electronAPIFile,
'electron/common$': electronAPIFile,
// Force timers to resolve to our dependency that doesn't use window.postMessage
timers: path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js'],
fallback: {
// We provide our own "timers" import above, any usage of setImmediate inside
// one of our renderer bundles should import it from the 'timers' package
setImmediate: false
}
},
module: {
rules: [{
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
loader: 'null-loader'
}, {
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [
// File '{0}' is not under 'rootDir' '{1}'.
6059
]
}
}]
},
node: {
__dirname: false,
__filename: false
},
optimization: {
minimize: env.mode === 'production',
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true
}
})
]
},
plugins
};
};
};
}]
},
node: {
__dirname: false,
__filename: false,
// We provide our own "timers" import above, any usage of setImmediate inside
// one of our renderer bundles should import it from the 'timers' package
setImmediate: false,
},
plugins: [
new AccessDependenciesPlugin(),
...(targetDeletesNodeGlobals ? [
new webpack.ProvidePlugin({
process: ['@electron/internal/renderer/webpack-provider', 'process'],
global: ['@electron/internal/renderer/webpack-provider', '_global'],
Buffer: ['@electron/internal/renderer/webpack-provider', 'Buffer'],
})
] : []),
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
}),
]
})
}

View File

@@ -1,4 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'browser',
alwaysHasNode: true
});
})

View File

@@ -0,0 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'content_script',
alwaysHasNode: false
})

View File

@@ -1,5 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'isolated_renderer',
alwaysHasNode: false,
wrapInitWithTryCatch: true
});
alwaysHasNode: false
})

View File

@@ -1,7 +1,5 @@
module.exports = require('./webpack.config.base')({
target: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true,
wrapInitWithProfilingTimeout: true,
wrapInitWithTryCatch: true
});
targetDeletesNodeGlobals: true
})

View File

@@ -1,6 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'sandboxed_renderer',
alwaysHasNode: false,
wrapInitWithProfilingTimeout: true,
wrapInitWithTryCatch: true
});
alwaysHasNode: false
})

View File

@@ -1,4 +0,0 @@
module.exports = require('./webpack.config.base')({
target: 'utility',
alwaysHasNode: true
});

View File

@@ -2,6 +2,5 @@ module.exports = require('./webpack.config.base')({
target: 'worker',
loadElectronFromAlternateTarget: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true,
wrapInitWithTryCatch: true
});
targetDeletesNodeGlobals: true
})

View File

@@ -22,25 +22,13 @@ template("webpack_build") {
"//electron/typings/internal-electron.d.ts",
] + invoker.inputs
mode = "development"
if (is_official_build) {
mode = "production"
}
args = [
"--config",
rebase_path(invoker.config_file),
"--output-filename",
get_path_info(invoker.out_file, "file"),
"--output-path",
rebase_path(get_path_info(invoker.out_file, "dir")),
"--env",
"buildflags=" + rebase_path("$target_gen_dir/buildflags/buildflags.h"),
"--env",
"mode=" + mode,
rebase_path(invoker.out_file),
]
deps += [ "//electron/buildflags" ]
outputs = [ invoker.out_file ]
outputs = [
invoker.out_file,
]
}
}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
@@ -9,38 +9,21 @@ EXTENSIONS_TO_SKIP = [
'.pdb',
'.mojom.js',
'.mojom-lite.js',
'.info',
'.m.js',
# These are only needed for Chromium tests we don't run. Listed in
# 'extensions' because the mksnapshot zip has these under a subdirectory, and
# the PATHS_TO_SKIP is checked with |startswith|.
'dbgcore.dll',
'dbghelp.dll',
]
PATHS_TO_SKIP = [
# Skip because it is an output of //ui/gl that we don't need.
'angledata',
# Skip because these are outputs that we don't need.
'./libVkICD_mock_',
# Skip because these are outputs that we don't need.
'./VkICD_mock_',
# Skip because its an output of create_bundle from
# //build/config/mac/rules.gni that we don't need
'angledata', #Skipping because it is an output of //ui/gl that we don't need
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
'./VkICD_mock_', #Skipping because these are outputs that we don't need
# Skipping because its an output of create_bundle from //build/config/mac/rules.gni
# that we don't need
'Electron.dSYM',
# Refs https://chromium-review.googlesource.com/c/angle/angle/+/2425197.
# Remove this when Angle themselves remove the file:
# https://issuetracker.google.com/issues/168736059
'gen/angle/angle_commit.h',
# //chrome/browser:resources depends on this via
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
# ship it.
'pyproto',
# Skip because these are outputs that we don't need.
'resources/inspector',
'gen/third_party/devtools-frontend/src',
'gen/ui/webui',
]
def skip_path(dep, dist_zip, target_cpu):
@@ -53,12 +36,7 @@ def skip_path(dep, dist_zip, target_cpu):
should_skip = (
any(dep.startswith(path) for path in PATHS_TO_SKIP) or
any(dep.endswith(ext) for ext in EXTENSIONS_TO_SKIP) or
(
"arm" in target_cpu
and dist_zip == "mksnapshot.zip"
and dep == "snapshot_blob.bin"
)
)
('arm' in target_cpu and dist_zip == 'mksnapshot.zip' and dep == 'snapshot_blob.bin'))
if should_skip:
print("Skipping {}".format(dep))
return should_skip
@@ -72,46 +50,27 @@ def execute(argv):
raise e
def main(argv):
dist_zip, runtime_deps, target_cpu, _, flatten_val, flatten_relative_to = argv
should_flatten = flatten_val == "true"
dist_zip, runtime_deps, target_cpu, target_os = argv
dist_files = set()
with open(runtime_deps) as f:
for dep in f.readlines():
dep = dep.strip()
if not skip_path(dep, dist_zip, target_cpu):
dist_files.add(dep)
if sys.platform == 'darwin' and not should_flatten:
if sys.platform == 'darwin':
execute(['zip', '-r', '-y', dist_zip] + list(dist_files))
else:
with zipfile.ZipFile(
dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True
) as z:
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as z:
for dep in dist_files:
if os.path.isdir(dep):
for root, _, files in os.walk(dep):
for filename in files:
z.write(os.path.join(root, filename))
for root, dirs, files in os.walk(dep):
for file in files:
z.write(os.path.join(root, file))
else:
basename = os.path.basename(dep)
dirname = os.path.dirname(dep)
arcname = (
os.path.join(dirname, 'chrome-sandbox')
if basename == 'chrome_sandbox'
else dep
)
name_to_write = arcname
if should_flatten:
if flatten_relative_to:
if name_to_write.startswith(flatten_relative_to):
name_to_write = name_to_write[len(flatten_relative_to):]
else:
name_to_write = os.path.basename(arcname)
else:
name_to_write = os.path.basename(arcname)
z.write(
dep,
name_to_write,
)
arcname = os.path.join(dirname, 'chrome-sandbox') if basename == 'chrome_sandbox' else dep
z.write(dep, arcname)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

Some files were not shown because too many files have changed in this diff Show More