* [PR PATCH] [really wip] system wide electron package
@ 2020-05-08 19:40 Johnnynator
2020-05-08 20:04 ` [PR PATCH] [Updated] " Johnnynator
` (20 more replies)
0 siblings, 21 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-08 19:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 585 bytes --]
There is a new pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 133940 bytes --]
From 9fd9f013a8f783b6f5fbe06fb0a65ccda8e867e0 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 16:09:48 +0200
Subject: [PATCH 1/3] xbps-src: allow loading xbp-src.conf from XDG compliant
dirs
---
README.md | 2 +-
xbps-src | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 752fb3d4fdc..3dffd2b4511 100644
--- a/README.md
+++ b/README.md
@@ -165,7 +165,7 @@ If you don't want to waste your time building everything from scratch probably i
The `etc/defaults.conf` file contains the possible settings that can be overridden
through the `etc/conf` configuration file for the `xbps-src` utility; if that file
-does not exist, will try to read configuration settings from `~/.xbps-src.conf`.
+does not exist, will try to read configuration settings from `$XDG_CONFIG_HOME/xbps-src.conf`, `~/.config/xbps-src.conf`, `~/.xbps-src.conf`.
If you want to customize default `CFLAGS`, `CXXFLAGS` and `LDFLAGS`, don't override
those defined in `etc/defaults.conf`, set them on `etc/conf` instead i.e:
diff --git a/xbps-src b/xbps-src
index 68765b6c248..888bc3c474a 100755
--- a/xbps-src
+++ b/xbps-src
@@ -428,6 +428,8 @@ else
elif [ -s $XBPS_DISTDIR/etc/conf ]; then
# ... otherwise read generic user configuration...
readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf
+ elif [ -s ${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf ]; then
+ readonly XBPS_CONFIG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf
elif [ -s $HOME/.xbps-src.conf ]; then
# ... fallback to ~/.xbps-src.conf otherwise.
readonly XBPS_CONFIG_FILE=$HOME/.xbps-src.conf
From 59be2653c31ae81a27463cb5fccd088d19c88484 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 2/3] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 264 +++++++
35 files changed, 2716 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..f20401fed51
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,264 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+revision=1
+archs="x86_64*"
+build_wrksrc="src"
+create_wrksrc=yes
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+depends=""
+short_desc="Cross platform application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+_gn_flags() {
+ echo $*
+}
+
+do_configure() {
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ msg_normal "Bootstrapping GN\n"
+ local _c=$(_gn_flags is_clang=true \
+ use_sysroot=false \
+ treat_warnings_as_errors=false \
+ fatal_linker_warnings=false \
+ binutils_path=\"/usr/bin\" \
+ use_custom_libcxx=false \
+ use_gold=false \
+ use_allocator=\"none\" \
+ use_allocator_shim=false \
+ use_vaapi=true \
+ )
+
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$_c"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ msg_normal "Configuring build\n"
+ _c=$(_gn_flags \
+ blink_symbol_level=0 \
+ clang_use_chrome_plugins=false \
+ closure_compile=true \
+ custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ enable_hangout_services_extension=true \
+ enable_nacl_nonsfi=false \
+ enable_nacl=false \
+ enable_precompiled_headers=false \
+ fatal_linker_warnings=false \
+ ffmpeg_branding=\"Chrome\" \
+ fieldtrial_testing_like_official_build=true \
+ gold_path=\"/usr/bin/ld.gold\" \
+ google_api_key=\"AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738\" \
+ google_default_client_id=\"126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com\" \
+ google_default_client_secret=\"_ozIx2D-DKm_se_2NPwV4l5b\" \
+ host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ icu_use_data_file=true \
+ is_clang=true \
+ is_component_build=false \
+ is_debug=$_is_debug \
+ is_desktop_linux=true \
+ linux_use_bundled_binutils=false \
+ proprietary_codecs=true \
+ symbol_level=0 \
+ treat_warnings_as_errors=false \
+ use_allocator_shim=false \
+ use_allocator=\"none\" \
+ use_cups=true \
+ use_custom_libcxx=false \
+ use_gnome_keyring=false \
+ use_gold=false \
+ use_lld=false \
+ use_pulseaudio=false \
+ use_sysroot=false \
+ use_system_harfbuzz=true \
+ import\(\"//electron/build/args/release.gn\"\) \
+ )
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="$_c"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja -C out/Release third_party/electron_node:headers
+
+ # final link needs lots of file descriptors
+ ulimit -n 2048
+
+ ninja -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From fe1d5a17a51d77a982a1566cbd175f43a6d7f6db Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 3/3] vscode: built against system electron
---
.../vscode/patches/dont-download-ffmpeg.patch | 14 ++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 26 +++++++++++++++----
3 files changed, 38 insertions(+), 8 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..7a0e6091a4c 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/bin/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..e27e1c1f8d8 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,29 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|VSCODE_PATH=/usr/share/vscode|VSCODE_PATH=/usr/lib/vscode|g" \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
@ 2020-05-08 20:04 ` Johnnynator
2020-05-08 20:30 ` Anachron
` (19 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-08 20:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 134062 bytes --]
From ca2c66b1df855e9d839c00cfb3c1f61dea118f5e Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 16:09:48 +0200
Subject: [PATCH 1/3] xbps-src: allow loading xbp-src.conf from XDG compliant
dirs
---
README.md | 2 +-
xbps-src | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 752fb3d4fdc..3dffd2b4511 100644
--- a/README.md
+++ b/README.md
@@ -165,7 +165,7 @@ If you don't want to waste your time building everything from scratch probably i
The `etc/defaults.conf` file contains the possible settings that can be overridden
through the `etc/conf` configuration file for the `xbps-src` utility; if that file
-does not exist, will try to read configuration settings from `~/.xbps-src.conf`.
+does not exist, will try to read configuration settings from `$XDG_CONFIG_HOME/xbps-src.conf`, `~/.config/xbps-src.conf`, `~/.xbps-src.conf`.
If you want to customize default `CFLAGS`, `CXXFLAGS` and `LDFLAGS`, don't override
those defined in `etc/defaults.conf`, set them on `etc/conf` instead i.e:
diff --git a/xbps-src b/xbps-src
index 68765b6c248..888bc3c474a 100755
--- a/xbps-src
+++ b/xbps-src
@@ -428,6 +428,8 @@ else
elif [ -s $XBPS_DISTDIR/etc/conf ]; then
# ... otherwise read generic user configuration...
readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf
+ elif [ -s ${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf ]; then
+ readonly XBPS_CONFIG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf
elif [ -s $HOME/.xbps-src.conf ]; then
# ... fallback to ~/.xbps-src.conf otherwise.
readonly XBPS_CONFIG_FILE=$HOME/.xbps-src.conf
From 5194d1b68bcbefb80b305592938cf5a0983badab Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 2/3] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 268 +++++++
35 files changed, 2720 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..2617998399e
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,268 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+revision=1
+archs="x86_64*"
+build_wrksrc="src"
+create_wrksrc=yes
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+depends=""
+short_desc="Cross platform application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+_gn_flags() {
+ echo $*
+}
+
+do_configure() {
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ msg_normal "Bootstrapping GN\n"
+ local _c=$(_gn_flags is_clang=true \
+ use_sysroot=false \
+ treat_warnings_as_errors=false \
+ fatal_linker_warnings=false \
+ binutils_path=\"/usr/bin\" \
+ use_custom_libcxx=false \
+ use_gold=false \
+ use_allocator=\"none\" \
+ use_allocator_shim=false \
+ use_vaapi=true \
+ )
+
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$_c"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ msg_normal "Configuring build\n"
+ _c=$(_gn_flags \
+ blink_symbol_level=0 \
+ clang_use_chrome_plugins=false \
+ closure_compile=true \
+ custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ enable_hangout_services_extension=true \
+ enable_nacl_nonsfi=false \
+ enable_nacl=false \
+ enable_precompiled_headers=false \
+ fatal_linker_warnings=false \
+ ffmpeg_branding=\"Chrome\" \
+ fieldtrial_testing_like_official_build=true \
+ gold_path=\"/usr/bin/ld.gold\" \
+ google_api_key=\"AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738\" \
+ google_default_client_id=\"126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com\" \
+ google_default_client_secret=\"_ozIx2D-DKm_se_2NPwV4l5b\" \
+ host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ icu_use_data_file=true \
+ is_clang=true \
+ is_component_build=false \
+ is_debug=$_is_debug \
+ is_desktop_linux=true \
+ linux_use_bundled_binutils=false \
+ proprietary_codecs=true \
+ symbol_level=0 \
+ treat_warnings_as_errors=false \
+ use_allocator_shim=false \
+ use_allocator=\"none\" \
+ use_cups=true \
+ use_custom_libcxx=false \
+ use_gnome_keyring=false \
+ use_gold=false \
+ use_lld=false \
+ use_pulseaudio=false \
+ use_sysroot=false \
+ use_system_harfbuzz=true \
+ import\(\"//electron/build/args/release.gn\"\) \
+ )
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="$_c"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja -C out/Release third_party/electron_node:headers
+
+ # final link needs lots of file descriptors
+ ulimit -n 2048
+
+ ninja -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From d848c4dbe31ec450dd64ec25b3f641fe822c6731 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 3/3] vscode: built against system electron
[ci skip]
---
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
3 files changed, 37 insertions(+), 8 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
2020-05-08 20:04 ` [PR PATCH] [Updated] " Johnnynator
@ 2020-05-08 20:30 ` Anachron
2020-05-08 21:15 ` ericonr
` (18 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Anachron @ 2020-05-08 20:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
New comment by Anachron on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-626007098
Comment:
Pretty impressive. I wonder if we can find something better than `_electronver=7.2.3`.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
2020-05-08 20:04 ` [PR PATCH] [Updated] " Johnnynator
2020-05-08 20:30 ` Anachron
@ 2020-05-08 21:15 ` ericonr
2020-05-08 22:16 ` [PR PATCH] [Updated] " Johnnynator
` (17 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: ericonr @ 2020-05-08 21:15 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-626023950
Comment:
Should the xbps-src config commit be here?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (2 preceding siblings ...)
2020-05-08 21:15 ` ericonr
@ 2020-05-08 22:16 ` Johnnynator
2020-05-09 16:37 ` Johnnynator
` (16 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-08 22:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 663 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 138778 bytes --]
From 418a3a8609a70a0e2561b73a0b515ef8ad7bcb3e Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 23:04:55 +0200
Subject: [PATCH 1/4] telegram-desktop: update to 2.1.3.
---
srcpkgs/telegram-desktop/template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index 68b2f8289ee..58dc0825961 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,6 +1,6 @@
# Template file for 'telegram-desktop'
pkgname=telegram-desktop
-version=2.1.2
+version=2.1.3
revision=1
wrksrc="tdesktop-${version}-full"
build_style=cmake
@@ -28,7 +28,7 @@ license="GPL-3.0-or-later WITH OpenSSL"
homepage="https://desktop.telegram.org/"
changelog="https://github.com/telegramdesktop/tdesktop/blob/v${version}/changelog.txt"
distfiles="https://github.com/telegramdesktop/tdesktop/releases/download/v${version}/tdesktop-${version}-full.tar.gz"
-checksum=444455aa166448c43b46abad604e59f630225962b3fbebb32caccea2993e6858
+checksum=4967929d7ea26d5f18d8e4983a005959dfa9803f4cc5646aaffa7a9445905b45
build_options="spellcheck"
build_options_default="spellcheck"
From 9dc85cb1adf9dd51d2d909ac31a084287592ef55 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 2/4] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 268 +++++++
35 files changed, 2720 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..2617998399e
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,268 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+revision=1
+archs="x86_64*"
+build_wrksrc="src"
+create_wrksrc=yes
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+depends=""
+short_desc="Cross platform application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+_gn_flags() {
+ echo $*
+}
+
+do_configure() {
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ msg_normal "Bootstrapping GN\n"
+ local _c=$(_gn_flags is_clang=true \
+ use_sysroot=false \
+ treat_warnings_as_errors=false \
+ fatal_linker_warnings=false \
+ binutils_path=\"/usr/bin\" \
+ use_custom_libcxx=false \
+ use_gold=false \
+ use_allocator=\"none\" \
+ use_allocator_shim=false \
+ use_vaapi=true \
+ )
+
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$_c"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ msg_normal "Configuring build\n"
+ _c=$(_gn_flags \
+ blink_symbol_level=0 \
+ clang_use_chrome_plugins=false \
+ closure_compile=true \
+ custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ enable_hangout_services_extension=true \
+ enable_nacl_nonsfi=false \
+ enable_nacl=false \
+ enable_precompiled_headers=false \
+ fatal_linker_warnings=false \
+ ffmpeg_branding=\"Chrome\" \
+ fieldtrial_testing_like_official_build=true \
+ gold_path=\"/usr/bin/ld.gold\" \
+ google_api_key=\"AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738\" \
+ google_default_client_id=\"126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com\" \
+ google_default_client_secret=\"_ozIx2D-DKm_se_2NPwV4l5b\" \
+ host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
+ icu_use_data_file=true \
+ is_clang=true \
+ is_component_build=false \
+ is_debug=$_is_debug \
+ is_desktop_linux=true \
+ linux_use_bundled_binutils=false \
+ proprietary_codecs=true \
+ symbol_level=0 \
+ treat_warnings_as_errors=false \
+ use_allocator_shim=false \
+ use_allocator=\"none\" \
+ use_cups=true \
+ use_custom_libcxx=false \
+ use_gnome_keyring=false \
+ use_gold=false \
+ use_lld=false \
+ use_pulseaudio=false \
+ use_sysroot=false \
+ use_system_harfbuzz=true \
+ import\(\"//electron/build/args/release.gn\"\) \
+ )
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="$_c"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja -C out/Release third_party/electron_node:headers
+
+ # final link needs lots of file descriptors
+ ulimit -n 2048
+
+ ninja -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From 3830d26911c39280095d2276cb3f65e1ec2dfd15 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sat, 9 May 2020 00:14:51 +0200
Subject: [PATCH 3/4] fixup! New package: electron7-7.2.3
---
srcpkgs/electron7/template | 117 ++++++++++++++++++-------------------
1 file changed, 58 insertions(+), 59 deletions(-)
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
index 2617998399e..18ba7015172 100644
--- a/srcpkgs/electron7/template
+++ b/srcpkgs/electron7/template
@@ -152,11 +152,8 @@ pre_configure() {
third_party/libaddressinput/chromium/tools/update-strings.py
}
-_gn_flags() {
- echo $*
-}
-
do_configure() {
+ local conf=()
cd third_party/electron_node
./configure --prefix=/usr \
@@ -175,79 +172,81 @@ do_configure() {
cd "$wrksrc/$build_wrksrc"
msg_normal "Bootstrapping GN\n"
- local _c=$(_gn_flags is_clang=true \
- use_sysroot=false \
- treat_warnings_as_errors=false \
- fatal_linker_warnings=false \
- binutils_path=\"/usr/bin\" \
- use_custom_libcxx=false \
- use_gold=false \
- use_allocator=\"none\" \
- use_allocator_shim=false \
- use_vaapi=true \
+ conf+=(
+ 'is_clang=true'
+ 'use_sysroot=false'
+ 'treat_warnings_as_errors=false'
+ 'fatal_linker_warnings=false'
+ 'binutils_path="/usr/bin"'
+ 'use_custom_libcxx=false'
+ 'use_gold=false'
+ 'use_allocator="none"'
+ 'use_allocator_shim=false'
+ 'use_vaapi=true'
)
# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
- python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "$_c"
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+ msg_normal "Configuring build\n"
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Void Linux use ONLY.
- msg_normal "Configuring build\n"
- _c=$(_gn_flags \
- blink_symbol_level=0 \
- clang_use_chrome_plugins=false \
- closure_compile=true \
- custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
- enable_hangout_services_extension=true \
- enable_nacl_nonsfi=false \
- enable_nacl=false \
- enable_precompiled_headers=false \
- fatal_linker_warnings=false \
- ffmpeg_branding=\"Chrome\" \
- fieldtrial_testing_like_official_build=true \
- gold_path=\"/usr/bin/ld.gold\" \
- google_api_key=\"AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738\" \
- google_default_client_id=\"126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com\" \
- google_default_client_secret=\"_ozIx2D-DKm_se_2NPwV4l5b\" \
- host_toolchain=\"//build/toolchain/linux/unbundle:default\" \
- icu_use_data_file=true \
- is_clang=true \
- is_component_build=false \
- is_debug=$_is_debug \
- is_desktop_linux=true \
- linux_use_bundled_binutils=false \
- proprietary_codecs=true \
- symbol_level=0 \
- treat_warnings_as_errors=false \
- use_allocator_shim=false \
- use_allocator=\"none\" \
- use_cups=true \
- use_custom_libcxx=false \
- use_gnome_keyring=false \
- use_gold=false \
- use_lld=false \
- use_pulseaudio=false \
- use_sysroot=false \
- use_system_harfbuzz=true \
- import\(\"//electron/build/args/release.gn\"\) \
+ conf=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ 'use_pulseaudio=false'
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
)
AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
- out/Release/gn gen out/$_buildtype --args="$_c"
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
}
do_build() {
msg_normal "Ninja turtles GO!\n"
- ninja -C out/Release third_party/electron_node:headers
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
- # final link needs lots of file descriptors
- ulimit -n 2048
- ninja -C out/$_buildtype electron
+ ninja ${makejobs} -C out/$_buildtype electron
# finish rest of the build
strip -s out/$_buildtype/electron
- ninja -C out/$_buildtype electron_dist_zip
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
}
do_install() {
From e51b6a1fe705d1986448bc6d735bfe00b09550d5 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 4/4] vscode: built against system electron
[ci skip]
---
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
3 files changed, 37 insertions(+), 8 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (3 preceding siblings ...)
2020-05-08 22:16 ` [PR PATCH] [Updated] " Johnnynator
@ 2020-05-09 16:37 ` Johnnynator
2020-05-09 16:52 ` Johnnynator
` (15 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-09 16:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 132148 bytes --]
From 4138b9dd1b48a1d75f219a9a358b1ec3261bfe95 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/2] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 257 ++++++
35 files changed, 2709 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..c150707523b
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,257 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio"
+build_options_default=""
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local conf=()
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+
+ msg_normal "Configuring build\n"
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
+
+ ninja ${makejobs} -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From a51c38e6668557ce8c3b136cbe6ea427f469d32b Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/2] vscode: built against system electron
[ci skip]
---
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
3 files changed, 37 insertions(+), 8 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (4 preceding siblings ...)
2020-05-09 16:37 ` Johnnynator
@ 2020-05-09 16:52 ` Johnnynator
2020-05-09 17:04 ` Johnnynator
` (14 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-09 16:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 133199 bytes --]
From 4138b9dd1b48a1d75f219a9a358b1ec3261bfe95 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/3] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 257 ++++++
35 files changed, 2709 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..c150707523b
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,257 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio"
+build_options_default=""
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local conf=()
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+
+ msg_normal "Configuring build\n"
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
+
+ ninja ${makejobs} -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From a51c38e6668557ce8c3b136cbe6ea427f469d32b Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/3] vscode: built against system electron
[ci skip]
---
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
3 files changed, 37 insertions(+), 8 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
From d75189de11d1eecbe7df80ff91ce7616b9e4d252 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sat, 9 May 2020 18:44:22 +0200
Subject: [PATCH 3/3] vscode: override CLR_OPENSSL_VERSION_OVERRIDE for
libressl
resolves #11926
[ci skip]
---
srcpkgs/vscode/patches/openssl-version-override.patch | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 srcpkgs/vscode/patches/openssl-version-override.patch
diff --git a/srcpkgs/vscode/patches/openssl-version-override.patch b/srcpkgs/vscode/patches/openssl-version-override.patch
new file mode 100644
index 00000000000..7f29bd34672
--- /dev/null
+++ b/srcpkgs/vscode/patches/openssl-version-override.patch
@@ -0,0 +1,9 @@
+--- resources/linux/bin/code.sh 2020-04-16 17:59:11.000000000 +0200
++++ - 2020-05-09 18:43:29.924841808 +0200
+@@ -41,5 +41,5 @@
+
+ ELECTRON="$VSCODE_PATH/@@NAME@@"
+ CLI="$VSCODE_PATH/resources/app/out/cli.js"
+-ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
++CLR_OPENSSL_VERSION_OVERRIDE=47 ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
+ exit $?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (5 preceding siblings ...)
2020-05-09 16:52 ` Johnnynator
@ 2020-05-09 17:04 ` Johnnynator
2020-05-09 17:12 ` Johnnynator
` (13 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-09 17:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 133678 bytes --]
From 4138b9dd1b48a1d75f219a9a358b1ec3261bfe95 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/3] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 257 ++++++
35 files changed, 2709 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..c150707523b
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,257 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio"
+build_options_default=""
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local conf=()
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+
+ msg_normal "Configuring build\n"
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
+
+ ninja ${makejobs} -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin
+}
From b67fcd3460249ba255ab7bfe390b374ecb62dac8 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/3] vscode: built against system electron
[ci skip]
---
common/shlibs | 1 -
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
4 files changed, 37 insertions(+), 9 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/common/shlibs b/common/shlibs
index 8342e117092..8f1e022207f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -129,7 +129,6 @@ libGLESv2.so discord-0.0.7_1
libGLESv2.so keybase-desktop-3.1.2_1
libGLESv2.so riot-desktop-0.17.9_2
libGLESv2.so wire-desktop-3.6.2885_1
-libGLESv2.so vscode-1.36.1_1
libGLESv2.so Signal-Desktop-1.23.2_1
libGLESv2.so slack-desktop-3.4.2_1
libbrcmEGL.so rpi-userland-20180103_2
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
From a60e6973387a3f4e1aeddd44979fdcb24d6a3eda Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sat, 9 May 2020 18:44:22 +0200
Subject: [PATCH 3/3] vscode: override CLR_OPENSSL_VERSION_OVERRIDE for
libressl
resolves #11926
[ci skip]
---
srcpkgs/vscode/patches/openssl-version-override.patch | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 srcpkgs/vscode/patches/openssl-version-override.patch
diff --git a/srcpkgs/vscode/patches/openssl-version-override.patch b/srcpkgs/vscode/patches/openssl-version-override.patch
new file mode 100644
index 00000000000..7f29bd34672
--- /dev/null
+++ b/srcpkgs/vscode/patches/openssl-version-override.patch
@@ -0,0 +1,9 @@
+--- resources/linux/bin/code.sh 2020-04-16 17:59:11.000000000 +0200
++++ - 2020-05-09 18:43:29.924841808 +0200
+@@ -41,5 +41,5 @@
+
+ ELECTRON="$VSCODE_PATH/@@NAME@@"
+ CLI="$VSCODE_PATH/resources/app/out/cli.js"
+-ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
++CLR_OPENSSL_VERSION_OVERRIDE=47 ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
+ exit $?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (6 preceding siblings ...)
2020-05-09 17:04 ` Johnnynator
@ 2020-05-09 17:12 ` Johnnynator
2020-05-09 17:40 ` [PR PATCH] [Updated] " Johnnynator
` (12 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-09 17:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
New comment by Johnnynator on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-626207501
Comment:
> Pretty impressive. I wonder if we can find something better than _electronver=7.2.3.
I could workaround by using
```bash
_electronver=$(xbps-uhelper version electron7)
_electronver=${_electronver%_*}
```
on top of every function
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (7 preceding siblings ...)
2020-05-09 17:12 ` Johnnynator
@ 2020-05-09 17:40 ` Johnnynator
2020-07-17 10:26 ` Johnnynator
` (11 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-05-09 17:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 133687 bytes --]
From 61c676e15c289d5053e8adc66a99836f5c8a4cbb Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/3] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 257 ++++++
35 files changed, 2709 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..30c134637be
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,257 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.2.3
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="e3fc2e15c60551512e26f1e96e02e33954057818ceb8cd8ab6d199cbb8751ee3
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio"
+build_options_default=""
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local conf=()
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+
+ msg_normal "Configuring build\n"
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
+
+ ninja ${makejobs} -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin/$pkgname
+}
From a28ad7c2c41f00c7c0f1511459a8add9d2dc3772 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/3] vscode: built against system electron
[ci skip]
---
common/shlibs | 1 -
.../vscode/patches/dont-download-ffmpeg.patch | 14 +++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 25 +++++++++++++++----
4 files changed, 37 insertions(+), 9 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/common/shlibs b/common/shlibs
index 8342e117092..8f1e022207f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -129,7 +129,6 @@ libGLESv2.so discord-0.0.7_1
libGLESv2.so keybase-desktop-3.1.2_1
libGLESv2.so riot-desktop-0.17.9_2
libGLESv2.so wire-desktop-3.6.2885_1
-libGLESv2.so vscode-1.36.1_1
libGLESv2.so Signal-Desktop-1.23.2_1
libGLESv2.so slack-desktop-3.4.2_1
libbrcmEGL.so rpi-userland-20180103_2
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index 799f7ec9159..ce020c7edf9 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index fae96b1e332..7f3cd18675f 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -2,9 +2,11 @@
pkgname=vscode
version=1.44.2
revision=1
+_electronver=7.2.3
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=98d4d48f0fd287c84aa40cf7c80c6dc682220cef7e97257a8a5c9dc74d05fa97
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
From a9d9bceaf3393847db3b559c04d395ff241f6183 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sat, 9 May 2020 18:44:22 +0200
Subject: [PATCH 3/3] vscode: override CLR_OPENSSL_VERSION_OVERRIDE for
libressl
resolves #11926
[ci skip]
---
srcpkgs/vscode/patches/openssl-version-override.patch | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 srcpkgs/vscode/patches/openssl-version-override.patch
diff --git a/srcpkgs/vscode/patches/openssl-version-override.patch b/srcpkgs/vscode/patches/openssl-version-override.patch
new file mode 100644
index 00000000000..7f29bd34672
--- /dev/null
+++ b/srcpkgs/vscode/patches/openssl-version-override.patch
@@ -0,0 +1,9 @@
+--- resources/linux/bin/code.sh 2020-04-16 17:59:11.000000000 +0200
++++ - 2020-05-09 18:43:29.924841808 +0200
+@@ -41,5 +41,5 @@
+
+ ELECTRON="$VSCODE_PATH/@@NAME@@"
+ CLI="$VSCODE_PATH/resources/app/out/cli.js"
+-ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
++CLR_OPENSSL_VERSION_OVERRIDE=47 ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
+ exit $?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] [really wip] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (8 preceding siblings ...)
2020-05-09 17:40 ` [PR PATCH] [Updated] " Johnnynator
@ 2020-07-17 10:26 ` Johnnynator
2020-07-18 14:12 ` Johnnynator
` (10 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-07-17 10:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
[really wip] system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 135163 bytes --]
From 1f347179ece02b0c790b64d624d91b78b8fe7421 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/2] New package: electron7-7.2.3
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 +++++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 ++
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 ++
.../chromium-musl_exeinfo.patch.patch | 96 +++
.../chromium-musl_fpstate_t.patch.patch | 48 ++
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 ++
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 ++
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 ++
..._logs_from_test_cild_processes.patch.patch | 342 ++++++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++++++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++++
...-005-upstream-chromium_version.patch.patch | 26 +
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../chromium-fix-commandline-include.patch | 44 ++
.../chromium-fix-sucess-definition.patch | 15 +
.../files/patches/chromium-gcc.patch | 43 ++
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../patches/chromium-icu_u16_next.patch.patch | 13 +
.../files/patches/chromium-libc_malloc.patch | 26 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 ++
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 ++
srcpkgs/electron7/template | 257 ++++++
srcpkgs/electron7/update | 2 +
37 files changed, 2754 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gcc.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
create mode 100644 srcpkgs/electron7/update
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gcc.patch b/srcpkgs/electron7/files/patches/chromium-gcc.patch
new file mode 100644
index 00000000000..74de22e2c10
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gcc.patch
@@ -0,0 +1,43 @@
+Fix GCC build error
+
+Fixes this error:
+[ 375s] In file included from ../../base/task/common/intrusive_heap.h:8,
+[ 375s] from ../../base/task/thread_pool/task_source.h:17,
+[ 375s] from ../../base/task/thread_pool/task_tracker.h:27,
+[ 375s] from ./../../base/task/thread_pool/service_thread.cc:14,
+[ 375s] from gen/base/base_jumbo_28.cc:5:
+[ 375s] ../../base/containers/intrusive_heap.h:152:36: error: enumerator value
+ '-1' is outside the range of underlying type 'size_t' {aka 'long unsigned int'}
+[ 375s] 152 | enum : size_t { kInvalidIndex = -1 };
+[ 375s] |
+
+Change-Id: I6044fb704931b2f8416f6b19a247ae297cd7b0d6
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792763
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Commit-Queue: Lei Zhang <thestig@chromium.org>
+Reviewed-by: Lei Zhang <thestig@chromium.org>
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#694853}
+
+diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h
+index 53d3909..d7626bb 100644
+--- a/base/containers/intrusive_heap.h
++++ b/base/containers/intrusive_heap.h
+
+@@ -131,6 +131,7 @@
+
+ #include <algorithm>
+ #include <functional>
++#include <limits>
+ #include <type_traits>
+ #include <utility>
+ #include <vector>
+@@ -149,7 +150,7 @@
+ // in place.
+ class BASE_EXPORT HeapHandle {
+ public:
+- enum : size_t { kInvalidIndex = -1 };
++ enum : size_t { kInvalidIndex = std::numeric_limits<size_t>::max() };
+
+ constexpr HeapHandle() = default;
+ constexpr HeapHandle(const HeapHandle& other) = default;
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
new file mode 100644
index 00000000000..4ed4c038de7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-icu_u16_next.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 44d5a49..c2a7a2f 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6216,7 +6216,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..dbd8c76bcde
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,257 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.3.2
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="clang yasm python pkgconf perl gperf bison ninja nodejs hwids
+ which git libatomic-devel libevent-devel libglib-devel yarn openjdk"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel pulseaudio-devel libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="4ede501f0d5ee3068474c9e2ac154cd23fdb3580c0cff5230d4ddcffe542e6ba
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio"
+build_options_default=""
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ ;;
+ electron*.patch)
+ cd src/electron
+ echo Patching $x
+ patch -p1 -i "$x"
+ cd "$wrksrc"
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd $wrksrc
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ cd "$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local conf=()
+ cd third_party/electron_node
+
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ echo $wrksrc/$build_wrksrc
+ cd "$wrksrc/$build_wrksrc"
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ 'is_clang=true'
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+# AR="ar" CC="${CC:-gcc}" CXX="${CXX:-g++}" LD="${CXX:-g++}" \
+ CC="${CC:-clang}" CXX="${CXX:-clang++}" LD="${CXX:-clang++}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --gn-gen-args "${conf[*]}"
+
+ msg_normal "Configuring build\n"
+
+ AR="ar" CC="clang" CXX="clang++" LD="clang++" NM=/usr/bin/nm \
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/Release third_party/electron_node:headers
+
+ ninja ${makejobs} -C out/$_buildtype electron
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin/$pkgname
+}
diff --git a/srcpkgs/electron7/update b/srcpkgs/electron7/update
new file mode 100644
index 00000000000..3af8e58b535
--- /dev/null
+++ b/srcpkgs/electron7/update
@@ -0,0 +1,2 @@
+site=https://www.electronjs.org/releases/stable?version=${version%%.*}
+pattern='tag/v\K[\d\.]+(?=")'
From 4a17f1ae33fcda95e0c281b57154b2b7680fb949 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/2] vscode: built against system electron
[ci skip]
---
common/shlibs | 1 -
.../vscode/patches/dont-download-ffmpeg.patch | 14 ++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++---
srcpkgs/vscode/template | 27 ++++++++++++++-----
4 files changed, 38 insertions(+), 10 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/common/shlibs b/common/shlibs
index 887f160d5fd..df5e52216ac 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -130,7 +130,6 @@ libGLESv2.so discord-0.0.7_1
libGLESv2.so keybase-desktop-3.1.2_1
libGLESv2.so riot-desktop-0.17.9_2
libGLESv2.so wire-desktop-3.6.2885_1
-libGLESv2.so vscode-1.36.1_1
libGLESv2.so Signal-Desktop-1.23.2_1
libGLESv2.so slack-desktop-3.4.2_1
libbrcmEGL.so rpi-userland-20180103_2
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index f4251e89bcb..8132ac7e28c 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index d870454e6f9..41156a0ec49 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -1,10 +1,12 @@
# Template file for 'vscode'
pkgname=vscode
version=1.46.0
-revision=1
+revision=2
+_electronver=7.3.2
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="ripgrep electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -14,7 +16,7 @@ checksum=5bf4d51773bb26a484e0063b668cba38b5f7451cb77be230fbf64fa44d498ad8
patch_args="-Np1"
# Due to electron
-archs="x86_64"
+archs="x86_64*"
nostrip_files="code-oss"
pre_build() {
@@ -26,6 +28,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +40,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (9 preceding siblings ...)
2020-07-17 10:26 ` Johnnynator
@ 2020-07-18 14:12 ` Johnnynator
2020-07-18 14:18 ` Duncaen
` (9 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-07-18 14:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
New comment by Johnnynator on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-660488867
Comment:
@void-linux/pkg-committers Any comments adding a few more chromium version to the repo?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (10 preceding siblings ...)
2020-07-18 14:12 ` Johnnynator
@ 2020-07-18 14:18 ` Duncaen
2020-07-18 14:21 ` Johnnynator
` (8 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Duncaen @ 2020-07-18 14:18 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-660489743
Comment:
imho better than adding binary packages.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (11 preceding siblings ...)
2020-07-18 14:18 ` Duncaen
@ 2020-07-18 14:21 ` Johnnynator
2020-07-18 14:21 ` Johnnynator
` (7 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-07-18 14:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 261 bytes --]
New comment by Johnnynator on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-660488867
Comment:
@void-linux/pkg-committers Any comments adding a few more chromium version to the repo? (a few more = up to 3 or so)
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (12 preceding siblings ...)
2020-07-18 14:21 ` Johnnynator
@ 2020-07-18 14:21 ` Johnnynator
2020-08-16 0:10 ` fosslinux
` (6 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-07-18 14:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 266 bytes --]
New comment by Johnnynator on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-660488867
Comment:
@void-linux/pkg-committers Any comments adding a few more chromium version to the repo? (a few more = up to 3 more or so)
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (13 preceding siblings ...)
2020-07-18 14:21 ` Johnnynator
@ 2020-08-16 0:10 ` fosslinux
2020-08-16 13:36 ` [PR PATCH] [Updated] " Johnnynator
` (5 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: fosslinux @ 2020-08-16 0:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
New comment by fosslinux on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-674460427
Comment:
Any way for me to help? I really would like this package
> a) Wasn't able to figure cross out yet (also counts for chromium) (Would give more justification for this)
Regarding cross, I think its OK for now for it to be `nocross` and come back to it when we figure out chromium cross, I don't think it needs to be a blocker.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (14 preceding siblings ...)
2020-08-16 0:10 ` fosslinux
@ 2020-08-16 13:36 ` Johnnynator
2020-08-16 15:45 ` Johnnynator
` (4 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-08-16 13:36 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 263991 bytes --]
From 64523c8d3ca2f3a7690b8c25e6e3990d3e641f13 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/2] New package: electron7-7.2.3
closes #21758
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 ++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 +
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 +
.../chromium-musl_exeinfo.patch.patch | 96 ++
.../chromium-musl_fpstate_t.patch.patch | 48 +
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 +
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 +
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 +
..._logs_from_test_cild_processes.patch.patch | 342 ++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++
...-005-upstream-chromium_version.patch.patch | 26 +
.../files/patches/chromium-77-clang.patch | 13 +
.../patches/chromium-77-pulseaudio-13.patch | 82 +
.../patches/chromium-77-system-icu.patch | 20 +
.../patches/chromium-78-gcc-alignas.patch | 102 ++
.../patches/chromium-78-gcc-enum-range.patch | 46 +
.../patches/chromium-78-gcc-noexcept.patch | 32 +
.../files/patches/chromium-78-icon.patch | 12 +
.../files/patches/chromium-78-include.patch | 40 +
.../files/patches/chromium-78-pm-crash.patch | 43 +
.../patches/chromium-78-protobuf-export.patch | 13 +
.../chromium-78-revert-noexcept-r1.patch | 1471 +++++++++++++++++
...romium-79-gcc-ambiguous-nodestructor.patch | 39 +
.../patches/chromium-79-gcc-includes.patch | 102 ++
.../patches/chromium-79-gcc-status-enum.patch | 31 +
.../files/patches/chromium-79-icu-65.patch | 13 +
.../files/patches/chromium-79-icu-67.patch | 167 ++
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../files/patches/chromium-compiler-r10.patch | 185 +++
.../patches/chromium-fix-char_traits.patch | 14 +
.../chromium-fix-commandline-include.patch | 44 +
.../chromium-fix-sucess-definition.patch | 15 +
.../files/patches/chromium-gcc-lto.patch | 131 ++
.../files/patches/chromium-gcc-shared.patch | 20 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../files/patches/chromium-libc_malloc.patch | 26 +
.../patches/chromium-toolchain-host.patch | 11 +
.../patches/chromium-unbundle-zlib-r1.patch | 13 +
...3-files-to-have-a-start-time-of-zero.patch | 38 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 +
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 +
srcpkgs/electron7/template | 341 ++++
srcpkgs/electron7/update | 2 +
58 files changed, 5420 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-clang.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-icon.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
create mode 100644 srcpkgs/electron7/update
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-77-clang.patch b/srcpkgs/electron7/files/patches/chromium-77-clang.patch
new file mode 100644
index 00000000000..a57b5a458a4
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-clang.patch
@@ -0,0 +1,13 @@
+diff --git a/base/location.h b/base/location.h
+index c07e747..924db1c 100644
+--- a/base/location.h
++++ b/base/location.h
+@@ -18,7 +18,7 @@
+
+ namespace base {
+
+-#if defined(__has_builtin)
++#if defined(__clang__)
+ // Clang allows detection of these builtins.
+ #define SUPPORTS_LOCATION_BUILTINS \
+ (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \
diff --git a/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch b/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
new file mode 100644
index 00000000000..892a3183c9d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
@@ -0,0 +1,82 @@
+From 7ac85fb4cc6f44a21761a591ac497ae3d6bf966d Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Date: Mon, 23 Sep 2019 13:49:53 +0200
+Subject: [PATCH] Fix building with pulseaudio 13
+
+The function signature changed though the ABI stayed the same.
+
+(Modified to apply on chromium sources too)
+
+Change-Id: I86ca361b5e4f0c523e1031910df438c23beee876
+Fixes: QTBUG-77037
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+
+diff --git a/media/audio/pulse/pulse.sigs b/media/audio/pulse/pulse.sigs
+index 8b58887..daaeb14 100644
+--- a/media/audio/pulse/pulse.sigs
++++ b/media/audio/pulse/pulse.sigs
+@@ -24,11 +24,11 @@
+ pa_operation* pa_context_get_source_info_by_name(pa_context* c, const char* name, pa_source_info_cb_t cb, void *userdata);
+ pa_operation* pa_context_get_source_info_list(pa_context* c, pa_source_info_cb_t cb, void* userdata);
+ pa_operation* pa_context_get_sink_info_list(pa_context* c, pa_sink_info_cb_t cb, void* userdata);
+-pa_context_state_t pa_context_get_state(pa_context* c);
++pa_context_state_t pa_context_get_state(const_pa_context_ptr c);
+ pa_context* pa_context_new(pa_mainloop_api* mainloop, const char* name);
+ pa_operation* pa_context_set_source_volume_by_index(pa_context* c, uint32_t idx, const pa_cvolume* volume, pa_context_success_cb_t cb, void* userdata);
+ void pa_context_set_state_callback(pa_context* c, pa_context_notify_cb_t cb, void* userdata);
+-pa_operation_state_t pa_operation_get_state(pa_operation* o);
++pa_operation_state_t pa_operation_get_state(const_pa_operation_ptr o);
+ void pa_context_unref(pa_context* c);
+ void pa_operation_unref(pa_operation* o);
+ int pa_stream_begin_write(pa_stream* p, void** data, size_t* nbytes);
+@@ -38,23 +38,23 @@
+ int pa_stream_disconnect(pa_stream* s);
+ int pa_stream_drop(pa_stream *p);
+ pa_operation* pa_stream_flush(pa_stream* s, pa_stream_success_cb_t cb, void* userdata);
+-uint32_t pa_stream_get_device_index(pa_stream* s);
++uint32_t pa_stream_get_device_index(const_pa_stream_ptr s);
+ int pa_stream_get_latency(pa_stream* s, pa_usec_t* r_usec, int* negative);
+-pa_stream_state_t pa_stream_get_state(pa_stream* p);
++pa_stream_state_t pa_stream_get_state(const_pa_stream_ptr p);
+ pa_stream* pa_stream_new(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map * map);
+ pa_stream* pa_stream_new_with_proplist(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map* map, pa_proplist* p);
+ pa_proplist* pa_proplist_new(void);
+-int pa_proplist_contains(pa_proplist* p, const char* key);
++int pa_proplist_contains(const_pa_proplist_ptr p, const char* key);
+ void pa_proplist_free(pa_proplist* p);
+-const char* pa_proplist_gets(pa_proplist* p, const char* key);
++const char* pa_proplist_gets(const_pa_proplist_ptr p, const char* key);
+ int pa_proplist_sets(pa_proplist* p, const char* key, const char* value);
+-size_t pa_stream_readable_size(pa_stream *p);
++size_t pa_stream_readable_size(const_pa_stream_ptr p);
+ int pa_stream_peek(pa_stream* p, const void** data, size_t* nbytes);
+ void pa_stream_set_read_callback(pa_stream* p, pa_stream_request_cb_t cb, void* userdata);
+ void pa_stream_set_state_callback(pa_stream* s, pa_stream_notify_cb_t cb, void* userdata);
+ int pa_stream_write(pa_stream* p, const void* data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
+ void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
+ void pa_stream_unref(pa_stream* s);
+-int pa_context_errno(pa_context *c);
++int pa_context_errno(const_pa_context_ptr c);
+ const char* pa_strerror(int error);
+ pa_cvolume* pa_cvolume_set(pa_cvolume* a, unsigned channels, pa_volume_t v);
+diff --git a/chromium/media/audio/pulse/pulse_stub_header.fragment b/chromium/media/audio/pulse/pulse_stub_header.fragment
+index 2a2d3e7..cdaa841 100644
+--- a/media/audio/pulse/pulse_stub_header.fragment
++++ b/media/audio/pulse/pulse_stub_header.fragment
+@@ -5,4 +5,15 @@
+
+ #include <pulse/pulseaudio.h>
+
++#if PA_MAJOR > 12
++typedef const pa_context* const_pa_context_ptr;
++typedef const pa_operation* const_pa_operation_ptr;
++typedef const pa_proplist* const_pa_proplist_ptr;
++typedef const pa_stream* const_pa_stream_ptr;
++#else
++typedef pa_context* const_pa_context_ptr;
++typedef pa_operation* const_pa_operation_ptr;
++typedef pa_proplist* const_pa_proplist_ptr;
++typedef pa_stream* const_pa_stream_ptr;
++#endif
+ }
diff --git a/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch b/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
new file mode 100644
index 00000000000..1f848d7ee2b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
@@ -0,0 +1,20 @@
+diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
+index 4450e40..9ca36dd 100644
+--- a/build/linux/unbundle/icu.gn
++++ b/build/linux/unbundle/icu.gn
+@@ -96,6 +96,7 @@ shim_headers("icui18n_shim") {
+ "unicode/fpositer.h",
+ "unicode/gender.h",
+ "unicode/gregocal.h",
++ "unicode/listformatter.h",
+ "unicode/measfmt.h",
+ "unicode/measunit.h",
+ "unicode/measure.h",
+@@ -178,7 +179,6 @@ shim_headers("icuuc_shim") {
+ "unicode/icudataver.h",
+ "unicode/icuplug.h",
+ "unicode/idna.h",
+- "unicode/listformatter.h",
+ "unicode/localpointer.h",
+ "unicode/locdspnm.h",
+ "unicode/locid.h",
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
new file mode 100644
index 00000000000..bce4118596b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
@@ -0,0 +1,102 @@
+From 6b633c4b14850df376d5cec571699018772f358e Mon Sep 17 00:00:00 2001
+From: Tomas Popela <tomas.popela@gmail.com>
+Date: Tue, 17 Sep 2019 19:48:48 +0000
+Subject: [PATCH] GCC: Can't use alignas() together with __attribute__()
+
+It's because GCC has problems when mixing the alignas() together with
+__attribute__() (that is used to export the symbols). The best
+solution is to use ALIGNAS() macro from //base/compiler_specific.h
+together with alignof() to have the equal functionality that compiles on
+GCC as well as on clang.
+
+Bug: 819294
+Change-Id: Ieb169592a2965f17a18bfc88d28418eb723a4e5a
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806735
+Auto-Submit: Tom Popela <tomas.popela@gmail.com>
+Commit-Queue: Alex Clarke <alexclarke@chromium.org>
+Reviewed-by: Alex Clarke <alexclarke@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#697330}
+---
+
+diff --git a/base/task/promise/dependent_list.h b/base/task/promise/dependent_list.h
+index 020bdbfc..3245c1c 100644
+--- a/base/task/promise/dependent_list.h
++++ b/base/task/promise/dependent_list.h
+@@ -59,7 +59,7 @@
+
+ // Align Node on an 8-byte boundary to ensure the first 3 bits are 0 and can
+ // be used to store additional state (see static_asserts below).
+- class BASE_EXPORT alignas(8) Node {
++ class BASE_EXPORT ALIGNAS(8) Node {
+ public:
+ Node();
+ explicit Node(Node&& other) noexcept;
+
+Re-use chromium alignas workaround in protobuf.
+---
+
+diff --git a/third_party/protobuf/src/google/protobuf/port_def.inc b/third_party/protobuf/src/google/protobuf/port_def.inc
+index f1bd85d..9c204a1 100644
+--- a/third_party/protobuf/src/google/protobuf/port_def.inc
++++ b/third_party/protobuf/src/google/protobuf/port_def.inc
+@@ -528,6 +528,35 @@ PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
+ #undef IN
+ #endif // _MSC_VER
+
++// Specify memory alignment for structs, classes, etc.
++// Use like:
++// class PROTOBUF_ALIGNAS(16) MyClass { ... }
++// PROTOBUF_ALIGNAS(16) int array[4];
++//
++// In most places you can use the C++11 keyword "alignas", which is preferred.
++//
++// But compilers have trouble mixing __attribute__((...)) syntax with
++// alignas(...) syntax.
++//
++// Doesn't work in clang or gcc:
++// struct alignas(16) __attribute__((packed)) S { char c; };
++// Works in clang but not gcc:
++// struct __attribute__((packed)) alignas(16) S2 { char c; };
++// Works in clang and gcc:
++// struct alignas(16) S3 { char c; } __attribute__((packed));
++//
++// There are also some attributes that must be specified *before* a class
++// definition: visibility (used for exporting functions/classes) is one of
++// these attributes. This means that it is not possible to use alignas() with a
++// class that is marked as exported.
++#if defined(_MSC_VER)
++#define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
++#elif defined(__GNUC__)
++#define PROTOBUF_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
++#else
++#define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
++#endif
++
+ #if defined(__clang__)
+ #pragma clang diagnostic push
+ // TODO(gerbens) ideally we cleanup the code. But a cursory try shows many
+diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h
+index dedc221..a8515ce 100644
+--- a/third_party/protobuf/src/google/protobuf/arena.h
++++ b/third_party/protobuf/src/google/protobuf/arena.h
+@@ -245,7 +245,7 @@ struct ArenaOptions {
+ // well as protobuf container types like RepeatedPtrField and Map. The protocol
+ // is internal to protobuf and is not guaranteed to be stable. Non-proto types
+ // should not rely on this protocol.
+-class PROTOBUF_EXPORT alignas(8) Arena final {
++class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
+ public:
+ // Arena constructor taking custom options. See ArenaOptions below for
+ // descriptions of the options available.
+diff --git a/third_party/protobuf/src/google/protobuf/port_undef.inc b/third_party/protobuf/src/google/protobuf/port_undef.inc
+index b7e67fe..ba1fffc 100644
+--- a/third_party/protobuf/src/google/protobuf/port_undef.inc
++++ b/third_party/protobuf/src/google/protobuf/port_undef.inc
+@@ -80,6 +80,7 @@
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
++#undef PROTOBUF_ALIGNAS
+
+
+
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
new file mode 100644
index 00000000000..9c15e954b4e
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
@@ -0,0 +1,46 @@
+From 9662ec844017690d5fd56bf0f05ef6a540dd29c1 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Mon, 09 Sep 2019 19:06:01 +0000
+Subject: [PATCH] Fix GCC build error
+
+Fixes this error:
+[ 375s] In file included from ../../base/task/common/intrusive_heap.h:8,
+[ 375s] from ../../base/task/thread_pool/task_source.h:17,
+[ 375s] from ../../base/task/thread_pool/task_tracker.h:27,
+[ 375s] from ./../../base/task/thread_pool/service_thread.cc:14,
+[ 375s] from gen/base/base_jumbo_28.cc:5:
+[ 375s] ../../base/containers/intrusive_heap.h:152:36: error: enumerator value
+ '-1' is outside the range of underlying type 'size_t' {aka 'long unsigned int'}
+[ 375s] 152 | enum : size_t { kInvalidIndex = -1 };
+[ 375s] |
+
+Change-Id: I6044fb704931b2f8416f6b19a247ae297cd7b0d6
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792763
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Commit-Queue: Lei Zhang <thestig@chromium.org>
+Reviewed-by: Lei Zhang <thestig@chromium.org>
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#694853}
+---
+
+diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h
+index 53d3909..d7626bb 100644
+--- a/base/containers/intrusive_heap.h
++++ b/base/containers/intrusive_heap.h
+@@ -131,6 +131,7 @@
+
+ #include <algorithm>
+ #include <functional>
++#include <limits>
+ #include <type_traits>
+ #include <utility>
+ #include <vector>
+@@ -149,7 +150,7 @@
+ // in place.
+ class BASE_EXPORT HeapHandle {
+ public:
+- enum : size_t { kInvalidIndex = -1 };
++ enum : size_t { kInvalidIndex = std::numeric_limits<size_t>::max() };
+
+ constexpr HeapHandle() = default;
+ constexpr HeapHandle(const HeapHandle& other) = default;
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
new file mode 100644
index 00000000000..8ddb53fe82d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
@@ -0,0 +1,32 @@
+From d16cda8fc3476cc534a756873cc8aa2692a57054 Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <jose.dapena@lge.com>
+Date: Thu, 22 Aug 2019 13:13:36 +0200
+Subject: [PATCH] GCC: declare noexcept move constructor/assign operators of V8StackTraceId
+
+blink::BlinkCloneableMessage declares default implementation of
+move operator/assign operator that requires v8_inspector::V8StackTraceId
+to declare its move constructor/assign operator too.
+
+Bug: chromium:819294
+Change-Id: Iaf626ee8245efcba372a17cdf2de448e691d41d6
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1796062
+Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
+Reviewed-by: Yang Guo <yangguo@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#63799}
+---
+
+diff --git a/v8/include/v8-inspector.h b/v8/include/v8-inspector.h
+index ce5b777..ed4cdec 100644
+--- a/v8/include/v8-inspector.h
++++ b/v8/include/v8-inspector.h
+@@ -231,7 +231,10 @@ struct V8_EXPORT V8StackTraceId {
+ std::pair<int64_t, int64_t> debugger_id;
+
+ V8StackTraceId();
++ V8StackTraceId(const V8StackTraceId&) = default;
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id);
++ V8StackTraceId& operator=(const V8StackTraceId&) = default;
++ V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default;
+ ~V8StackTraceId() = default;
+
+ bool IsInvalid() const;
diff --git a/srcpkgs/electron7/files/patches/chromium-78-icon.patch b/srcpkgs/electron7/files/patches/chromium-78-icon.patch
new file mode 100644
index 00000000000..2cca7f10d19
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-icon.patch
@@ -0,0 +1,12 @@
+diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc
+index 7a3a6eb..7c01534 100644
+--- a/ui/platform_window/x11/x11_window.cc
++++ b/ui/platform_window/x11/x11_window.cc
+@@ -67,6 +67,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig(
+ config.wm_role_name = properties.wm_role_name;
+ config.activatable = properties.activatable;
+ config.visual_id = properties.x_visual_id;
++ config.icon = properties.icon;
+ return config;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-78-include.patch b/srcpkgs/electron7/files/patches/chromium-78-include.patch
new file mode 100644
index 00000000000..3db38eac1c9
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-include.patch
@@ -0,0 +1,40 @@
+From bbfe2665923225b4a7c436ba2b6c7e5f695f2e52 Mon Sep 17 00:00:00 2001
+From: David Landell <landell@vewd.com>
+Date: Fri, 13 Sep 2019 12:24:13 +0000
+Subject: [PATCH] Add missing include for unique_ptr
+
+Change-Id: I614d2f42868d563eb6a92dfb2aae08286e20d687
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803137
+Reviewed-by: Henrik Boström <hbos@chromium.org>
+Commit-Queue: Henrik Boström <hbos@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#696355}
+---
+
+diff --git a/third_party/blink/public/platform/web_rtc_rtp_source.h b/third_party/blink/public/platform/web_rtc_rtp_source.h
+index 959440f..c3fd542 100644
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h
+@@ -5,6 +5,8 @@
+ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_RTP_SOURCE_H_
+ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_RTP_SOURCE_H_
+
++#include <memory>
++
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
+
+Missing include due to reverting ProfileManagerObserver
+---
+
+diff --git a/chrome/browser/web_applications/extensions/bookmark_app_util.cc b/chrome/browser/web_applications/extensions/bookmark_app_util.cc
+index ee4b70a..b31e5f5 100644
+--- a/chrome/browser/web_applications/extensions/bookmark_app_util.cc
++++ b/chrome/browser/web_applications/extensions/bookmark_app_util.cc
+@@ -7,6 +7,7 @@
+ #include "base/strings/string_piece.h"
+ #include "base/values.h"
+ #include "chrome/browser/extensions/extension_service.h"
++#include "chrome/browser/profiles/profile.h"
+ #include "chrome/browser/web_applications/components/app_registrar.h"
+ #include "chrome/browser/web_applications/components/web_app_provider_base.h"
+ #include "chrome/common/chrome_features.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch b/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
new file mode 100644
index 00000000000..ada266120dc
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
@@ -0,0 +1,43 @@
+From e73aed9a5ef15102f29ac31b70290faf5c90f9fe Mon Sep 17 00:00:00 2001
+From: Evan Stade <estade@chromium.org>
+Date: Wed, 16 Oct 2019 16:01:32 +0000
+Subject: [PATCH] Fix shutdown crash in ProfileManager.
+
+OnProfileMarkedForPermanentDeletion should move from
+ProfileManagerObserver to ProfileObserver, which would also
+fix this bug. However, changing the order of members is the
+quickest and most cherry-pick-able way to avoid the crash.
+
+Bug: 1005244
+Change-Id: If2db68c846dd418cd02864b57b9b543687fa1e03
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863518
+Auto-Submit: Evan Stade <estade@chromium.org>
+Reviewed-by: David Roger <droger@chromium.org>
+Commit-Queue: Evan Stade <estade@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#706467}
+---
+
+diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h
+index b60df76d..7d02af7 100644
+--- a/chrome/browser/profiles/profile_manager.h
++++ b/chrome/browser/profiles/profile_manager.h
+@@ -409,6 +409,10 @@ class ProfileManager : public content::NotificationObserver,
+ const base::FilePath& profile_dir);
+ #endif // !defined(OS_ANDROID)
+
++ // Destroy after |profile_info_cache_| since Profile destruction may trigger
++ // some observers to unregister themselves.
++ base::ObserverList<ProfileManagerObserver> observers_;
++
+ // Object to cache various information about profiles. Contains information
+ // about every profile which has been created for this instance of Chrome,
+ // if it has not been explicitly deleted. It must be destroyed after
+@@ -450,8 +454,6 @@ class ProfileManager : public content::NotificationObserver,
+ // Controls whether to initialize some services. Only disabled for testing.
+ bool do_final_services_init_ = true;
+
+- base::ObserverList<ProfileManagerObserver> observers_;
+-
+ // TODO(chrome/browser/profiles/OWNERS): Usage of this in profile_manager.cc
+ // should likely be turned into DCHECK_CURRENTLY_ON(BrowserThread::UI) for
+ // consistency with surrounding code in the same file but that wasn't trivial
diff --git a/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch b/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
new file mode 100644
index 00000000000..ddb9e80eefe
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/protobuf/src/google/protobuf/repeated_field.h b/third_party/protobuf/src/google/protobuf/repeated_field.h
+index b5b193c..4434854 100644
+--- a/third_party/protobuf/src/google/protobuf/repeated_field.h
++++ b/third_party/protobuf/src/google/protobuf/repeated_field.h
+@@ -804,7 +804,7 @@ class StringTypeHandler {
+ // RepeatedPtrField is like RepeatedField, but used for repeated strings or
+ // Messages.
+ template <typename Element>
+-class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
++class PROTOBUF_EXPORT RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
+ public:
+ RepeatedPtrField();
+ explicit RepeatedPtrField(Arena* arena);
diff --git a/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch b/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
new file mode 100644
index 00000000000..408d618b541
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
@@ -0,0 +1,1471 @@
+From 37a95dd93e553888c00cf9443a5ec738ce658e65 Mon Sep 17 00:00:00 2001
+From: Zinovy Nis <zynis@yandex-team.ru>
+Date: Mon, 16 Sep 2019 13:08:17 +0000
+Subject: [PATCH] Revert "[clang-tidy] add noexcept for move ctors and operator= in blink"
+
+This reverts commit 8f3eea10fe63a64ac67dc21542ebee6b896156a3.
+
+Reason for revert: code bloating
+
+Original change's description:
+> [clang-tidy] add noexcept for move ctors and operator= in blink
+>
+> Bug: 994915
+> Change-Id: I2e1bcf286a2d2fa6613e18b5268098a0d258fb2e
+> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759163
+> Commit-Queue: Zinovy Nis <zynis@yandex-team.ru>
+> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
+> Reviewed-by: Mike West <mkwst@chromium.org>
+> Cr-Commit-Position: refs/heads/master@{#688676}
+
+TBR=jbroman@chromium.org,foolip@chromium.org,mkwst@chromium.org,zynis@yandex-team.ru
+
+# Not skipping CQ checks because original CL landed > 1 day ago.
+
+Bug: 994915
+Change-Id: I12b3ecc1186e27809082dc399c6d6864109ce307
+---
+
+diff --git a/third_party/blink/common/indexeddb/indexeddb_key_path.cc b/third_party/blink/common/indexeddb/indexeddb_key_path.cc
+index ec2b618..552d541 100644
+--- a/third_party/blink/common/indexeddb/indexeddb_key_path.cc
++++ b/third_party/blink/common/indexeddb/indexeddb_key_path.cc
+@@ -18,12 +18,12 @@
+ : type_(mojom::IDBKeyPathType::Array), array_(array) {}
+
+ IndexedDBKeyPath::IndexedDBKeyPath(const IndexedDBKeyPath& other) = default;
+-IndexedDBKeyPath::IndexedDBKeyPath(IndexedDBKeyPath&& other) noexcept = default;
++IndexedDBKeyPath::IndexedDBKeyPath(IndexedDBKeyPath&& other) = default;
+ IndexedDBKeyPath::~IndexedDBKeyPath() = default;
+ IndexedDBKeyPath& IndexedDBKeyPath::operator=(const IndexedDBKeyPath& other) =
+ default;
+-IndexedDBKeyPath& IndexedDBKeyPath::operator=(
+- IndexedDBKeyPath&& other) noexcept = default;
++IndexedDBKeyPath& IndexedDBKeyPath::operator=(IndexedDBKeyPath&& other) =
++ default;
+
+ const std::vector<base::string16>& IndexedDBKeyPath::array() const {
+ DCHECK(type_ == blink::mojom::IDBKeyPathType::Array);
+diff --git a/third_party/blink/common/indexeddb/indexeddb_metadata.cc b/third_party/blink/common/indexeddb/indexeddb_metadata.cc
+index 50d5845..9349732 100644
+--- a/third_party/blink/common/indexeddb/indexeddb_metadata.cc
++++ b/third_party/blink/common/indexeddb/indexeddb_metadata.cc
+@@ -23,15 +23,15 @@
+
+ IndexedDBIndexMetadata::IndexedDBIndexMetadata(
+ const IndexedDBIndexMetadata& other) = default;
+-IndexedDBIndexMetadata::IndexedDBIndexMetadata(
+- IndexedDBIndexMetadata&& other) noexcept = default;
++IndexedDBIndexMetadata::IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other) =
++ default;
+
+ IndexedDBIndexMetadata::~IndexedDBIndexMetadata() = default;
+
+ IndexedDBIndexMetadata& IndexedDBIndexMetadata::operator=(
+ const IndexedDBIndexMetadata& other) = default;
+ IndexedDBIndexMetadata& IndexedDBIndexMetadata::operator=(
+- IndexedDBIndexMetadata&& other) noexcept = default;
++ IndexedDBIndexMetadata&& other) = default;
+
+ bool IndexedDBIndexMetadata::operator==(
+ const IndexedDBIndexMetadata& other) const {
+@@ -56,14 +56,14 @@
+ IndexedDBObjectStoreMetadata::IndexedDBObjectStoreMetadata(
+ const IndexedDBObjectStoreMetadata& other) = default;
+ IndexedDBObjectStoreMetadata::IndexedDBObjectStoreMetadata(
+- IndexedDBObjectStoreMetadata&& other) noexcept = default;
++ IndexedDBObjectStoreMetadata&& other) = default;
+
+ IndexedDBObjectStoreMetadata::~IndexedDBObjectStoreMetadata() = default;
+
+ IndexedDBObjectStoreMetadata& IndexedDBObjectStoreMetadata::operator=(
+ const IndexedDBObjectStoreMetadata& other) = default;
+ IndexedDBObjectStoreMetadata& IndexedDBObjectStoreMetadata::operator=(
+- IndexedDBObjectStoreMetadata&& other) noexcept = default;
++ IndexedDBObjectStoreMetadata&& other) = default;
+
+ bool IndexedDBObjectStoreMetadata::operator==(
+ const IndexedDBObjectStoreMetadata& other) const {
+@@ -87,14 +87,14 @@
+ IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata(
+ const IndexedDBDatabaseMetadata& other) = default;
+ IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata(
+- IndexedDBDatabaseMetadata&& other) noexcept = default;
++ IndexedDBDatabaseMetadata&& other) = default;
+
+ IndexedDBDatabaseMetadata::~IndexedDBDatabaseMetadata() = default;
+
+ IndexedDBDatabaseMetadata& IndexedDBDatabaseMetadata::operator=(
+ const IndexedDBDatabaseMetadata& other) = default;
+ IndexedDBDatabaseMetadata& IndexedDBDatabaseMetadata::operator=(
+- IndexedDBDatabaseMetadata&& other) noexcept = default;
++ IndexedDBDatabaseMetadata&& other) = default;
+
+ bool IndexedDBDatabaseMetadata::operator==(
+ const IndexedDBDatabaseMetadata& other) const {
+diff --git a/third_party/blink/common/mediastream/media_devices.cc b/third_party/blink/common/mediastream/media_devices.cc
+index 93df201..3661b4b 100644
+--- a/third_party/blink/common/mediastream/media_devices.cc
++++ b/third_party/blink/common/mediastream/media_devices.cc
+@@ -13,8 +13,7 @@
+ WebMediaDeviceInfo::WebMediaDeviceInfo(const WebMediaDeviceInfo& other) =
+ default;
+
+-WebMediaDeviceInfo::WebMediaDeviceInfo(WebMediaDeviceInfo&& other) noexcept =
+- default;
++WebMediaDeviceInfo::WebMediaDeviceInfo(WebMediaDeviceInfo&& other) = default;
+
+ WebMediaDeviceInfo::WebMediaDeviceInfo(const std::string& device_id,
+ const std::string& label,
+@@ -36,8 +35,8 @@
+ WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(
+ const WebMediaDeviceInfo& other) = default;
+
+-WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(
+- WebMediaDeviceInfo&& other) noexcept = default;
++WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(WebMediaDeviceInfo&& other) =
++ default;
+
+ bool operator==(const WebMediaDeviceInfo& first,
+ const WebMediaDeviceInfo& second) {
+diff --git a/third_party/blink/common/messaging/cloneable_message.cc b/third_party/blink/common/messaging/cloneable_message.cc
+index 2984fd1..5c3ee7e 100644
+--- a/third_party/blink/common/messaging/cloneable_message.cc
++++ b/third_party/blink/common/messaging/cloneable_message.cc
+@@ -12,9 +12,8 @@
+ namespace blink {
+
+ CloneableMessage::CloneableMessage() = default;
+-CloneableMessage::CloneableMessage(CloneableMessage&&) noexcept = default;
+-CloneableMessage& CloneableMessage::operator=(CloneableMessage&&) noexcept =
+- default;
++CloneableMessage::CloneableMessage(CloneableMessage&&) = default;
++CloneableMessage& CloneableMessage::operator=(CloneableMessage&&) = default;
+ CloneableMessage::~CloneableMessage() = default;
+
+ CloneableMessage CloneableMessage::ShallowClone() const {
+diff --git a/third_party/blink/common/messaging/transferable_message.cc b/third_party/blink/common/messaging/transferable_message.cc
+index 07ac9bb..4a69d0a 100644
+--- a/third_party/blink/common/messaging/transferable_message.cc
++++ b/third_party/blink/common/messaging/transferable_message.cc
+@@ -9,10 +9,9 @@
+ namespace blink {
+
+ TransferableMessage::TransferableMessage() = default;
+-TransferableMessage::TransferableMessage(TransferableMessage&&) noexcept =
++TransferableMessage::TransferableMessage(TransferableMessage&&) = default;
++TransferableMessage& TransferableMessage::operator=(TransferableMessage&&) =
+ default;
+-TransferableMessage& TransferableMessage::operator=(
+- TransferableMessage&&) noexcept = default;
+ TransferableMessage::~TransferableMessage() = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/public/common/indexeddb/indexeddb_key_path.h b/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
+index 8ebe10c..9f5422c 100644
+--- a/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
++++ b/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
+@@ -22,10 +22,10 @@
+ explicit IndexedDBKeyPath(const base::string16&);
+ explicit IndexedDBKeyPath(const std::vector<base::string16>&);
+ IndexedDBKeyPath(const IndexedDBKeyPath& other);
+- IndexedDBKeyPath(IndexedDBKeyPath&& other) noexcept;
++ IndexedDBKeyPath(IndexedDBKeyPath&& other);
+ ~IndexedDBKeyPath();
+ IndexedDBKeyPath& operator=(const IndexedDBKeyPath& other);
+- IndexedDBKeyPath& operator=(IndexedDBKeyPath&& other) noexcept;
++ IndexedDBKeyPath& operator=(IndexedDBKeyPath&& other);
+
+ bool IsNull() const { return type_ == blink::mojom::IDBKeyPathType::Null; }
+ bool operator==(const IndexedDBKeyPath& other) const;
+diff --git a/third_party/blink/public/common/indexeddb/indexeddb_metadata.h b/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
+index 15663f6..7bb37c9 100644
+--- a/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
++++ b/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
+@@ -26,10 +26,10 @@
+ bool unique,
+ bool multi_entry);
+ IndexedDBIndexMetadata(const IndexedDBIndexMetadata& other);
+- IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other) noexcept;
++ IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other);
+ ~IndexedDBIndexMetadata();
+ IndexedDBIndexMetadata& operator=(const IndexedDBIndexMetadata& other);
+- IndexedDBIndexMetadata& operator=(IndexedDBIndexMetadata&& other) noexcept;
++ IndexedDBIndexMetadata& operator=(IndexedDBIndexMetadata&& other);
+ bool operator==(const IndexedDBIndexMetadata& other) const;
+
+ base::string16 name;
+@@ -50,12 +50,11 @@
+ bool auto_increment,
+ int64_t max_index_id);
+ IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata& other);
+- IndexedDBObjectStoreMetadata(IndexedDBObjectStoreMetadata&& other) noexcept;
++ IndexedDBObjectStoreMetadata(IndexedDBObjectStoreMetadata&& other);
+ ~IndexedDBObjectStoreMetadata();
+ IndexedDBObjectStoreMetadata& operator=(
+ const IndexedDBObjectStoreMetadata& other);
+- IndexedDBObjectStoreMetadata& operator=(
+- IndexedDBObjectStoreMetadata&& other) noexcept;
++ IndexedDBObjectStoreMetadata& operator=(IndexedDBObjectStoreMetadata&& other);
+ bool operator==(const IndexedDBObjectStoreMetadata& other) const;
+
+ base::string16 name;
+@@ -77,11 +76,10 @@
+ int64_t version,
+ int64_t max_object_store_id);
+ IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata& other);
+- IndexedDBDatabaseMetadata(IndexedDBDatabaseMetadata&& other) noexcept;
++ IndexedDBDatabaseMetadata(IndexedDBDatabaseMetadata&& other);
+ ~IndexedDBDatabaseMetadata();
+ IndexedDBDatabaseMetadata& operator=(const IndexedDBDatabaseMetadata& other);
+- IndexedDBDatabaseMetadata& operator=(
+- IndexedDBDatabaseMetadata&& other) noexcept;
++ IndexedDBDatabaseMetadata& operator=(IndexedDBDatabaseMetadata&& other);
+ bool operator==(const IndexedDBDatabaseMetadata& other) const;
+
+ base::string16 name;
+diff --git a/third_party/blink/public/common/mediastream/media_devices.h b/third_party/blink/public/common/mediastream/media_devices.h
+index 0d63e575..d87affe 100644
+--- a/third_party/blink/public/common/mediastream/media_devices.h
++++ b/third_party/blink/public/common/mediastream/media_devices.h
+@@ -27,7 +27,7 @@
+ struct BLINK_COMMON_EXPORT WebMediaDeviceInfo {
+ WebMediaDeviceInfo();
+ WebMediaDeviceInfo(const WebMediaDeviceInfo& other);
+- WebMediaDeviceInfo(WebMediaDeviceInfo&& other) noexcept;
++ WebMediaDeviceInfo(WebMediaDeviceInfo&& other);
+ WebMediaDeviceInfo(
+ const std::string& device_id,
+ const std::string& label,
+@@ -37,7 +37,7 @@
+ const media::VideoCaptureDeviceDescriptor& descriptor);
+ ~WebMediaDeviceInfo();
+ WebMediaDeviceInfo& operator=(const WebMediaDeviceInfo& other);
+- WebMediaDeviceInfo& operator=(WebMediaDeviceInfo&& other) noexcept;
++ WebMediaDeviceInfo& operator=(WebMediaDeviceInfo&& other);
+
+ std::string device_id;
+ std::string label;
+diff --git a/third_party/blink/public/common/messaging/cloneable_message.h b/third_party/blink/public/common/messaging/cloneable_message.h
+index de9952d..8dbd910 100644
+--- a/third_party/blink/public/common/messaging/cloneable_message.h
++++ b/third_party/blink/public/common/messaging/cloneable_message.h
+@@ -21,8 +21,8 @@
+ // This type can be serialized as a blink::mojom::CloneableMessage struct.
+ struct BLINK_COMMON_EXPORT CloneableMessage {
+ CloneableMessage();
+- CloneableMessage(CloneableMessage&&) noexcept;
+- CloneableMessage& operator=(CloneableMessage&&) noexcept;
++ CloneableMessage(CloneableMessage&&);
++ CloneableMessage& operator=(CloneableMessage&&);
+ ~CloneableMessage();
+
+ // Returns a shallow clone of this message. |encoded_message| in the clone
+diff --git a/third_party/blink/public/common/messaging/transferable_message.h b/third_party/blink/public/common/messaging/transferable_message.h
+index 5eef63c..2d87363 100644
+--- a/third_party/blink/public/common/messaging/transferable_message.h
++++ b/third_party/blink/public/common/messaging/transferable_message.h
+@@ -22,8 +22,8 @@
+ // type can be serialized as a blink::mojom::TransferableMessage struct.
+ struct BLINK_COMMON_EXPORT TransferableMessage : public CloneableMessage {
+ TransferableMessage();
+- TransferableMessage(TransferableMessage&&) noexcept;
+- TransferableMessage& operator=(TransferableMessage&&) noexcept;
++ TransferableMessage(TransferableMessage&&);
++ TransferableMessage& operator=(TransferableMessage&&);
+ ~TransferableMessage();
+
+ // Any ports being transferred as part of this message.
+diff --git a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
+index 75f3ae16..81edd69 100644
+--- a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
++++ b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
+@@ -42,9 +42,8 @@
+ WebScopedVirtualTimePauser();
+ ~WebScopedVirtualTimePauser();
+
+- WebScopedVirtualTimePauser(WebScopedVirtualTimePauser&& other) noexcept;
+- WebScopedVirtualTimePauser& operator=(
+- WebScopedVirtualTimePauser&& other) noexcept;
++ WebScopedVirtualTimePauser(WebScopedVirtualTimePauser&& other);
++ WebScopedVirtualTimePauser& operator=(WebScopedVirtualTimePauser&& other);
+
+ WebScopedVirtualTimePauser(const WebScopedVirtualTimePauser&) = delete;
+ WebScopedVirtualTimePauser& operator=(const WebScopedVirtualTimePauser&) =
+diff --git a/third_party/blink/public/platform/web_string.h b/third_party/blink/public/platform/web_string.h
+index e4fda4f..ffd1da0 100644
+--- a/third_party/blink/public/platform/web_string.h
++++ b/third_party/blink/public/platform/web_string.h
+@@ -102,10 +102,10 @@
+ BLINK_PLATFORM_EXPORT WebString(const WebUChar* data, size_t len);
+
+ BLINK_PLATFORM_EXPORT WebString(const WebString&);
+- BLINK_PLATFORM_EXPORT WebString(WebString&&) noexcept;
++ BLINK_PLATFORM_EXPORT WebString(WebString&&);
+
+ BLINK_PLATFORM_EXPORT WebString& operator=(const WebString&);
+- BLINK_PLATFORM_EXPORT WebString& operator=(WebString&&) noexcept;
++ BLINK_PLATFORM_EXPORT WebString& operator=(WebString&&);
+
+ BLINK_PLATFORM_EXPORT void Reset();
+
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
+index 99f47f5..8451b86 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
+@@ -73,8 +73,8 @@
+
+ VideoCaptureSettings(const VideoCaptureSettings& other);
+ VideoCaptureSettings& operator=(const VideoCaptureSettings& other);
+- VideoCaptureSettings(VideoCaptureSettings&& other) noexcept;
+- VideoCaptureSettings& operator=(VideoCaptureSettings&& other) noexcept;
++ VideoCaptureSettings(VideoCaptureSettings&& other);
++ VideoCaptureSettings& operator=(VideoCaptureSettings&& other);
+ ~VideoCaptureSettings();
+
+ bool HasValue() const { return !failed_constraint_name_; }
+@@ -193,8 +193,8 @@
+ const AudioProcessingProperties& audio_processing_properties);
+ AudioCaptureSettings(const AudioCaptureSettings& other);
+ AudioCaptureSettings& operator=(const AudioCaptureSettings& other);
+- AudioCaptureSettings(AudioCaptureSettings&& other) noexcept;
+- AudioCaptureSettings& operator=(AudioCaptureSettings&& other) noexcept;
++ AudioCaptureSettings(AudioCaptureSettings&& other);
++ AudioCaptureSettings& operator=(AudioCaptureSettings&& other);
+
+ bool HasValue() const { return !failed_constraint_name_; }
+
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
+index 199bdeb..c89e6e9 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
+@@ -159,8 +159,8 @@
+
+ DiscreteSet(const DiscreteSet& other) = default;
+ DiscreteSet& operator=(const DiscreteSet& other) = default;
+- DiscreteSet(DiscreteSet&& other) noexcept = default;
+- DiscreteSet& operator=(DiscreteSet&& other) noexcept = default;
++ DiscreteSet(DiscreteSet&& other) = default;
++ DiscreteSet& operator=(DiscreteSet&& other) = default;
+ ~DiscreteSet() = default;
+
+ bool Contains(const T& value) const {
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
+index 5e50d1b..ed5967f 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
+@@ -285,8 +285,8 @@
+ const VideoTrackFormatCallback& format_callback,
+ std::unique_ptr<VideoTrackAdapterSettings> adapter_settings,
+ const ConstraintsCallback& callback);
+- PendingTrackInfo(PendingTrackInfo&& other) noexcept;
+- PendingTrackInfo& operator=(PendingTrackInfo&& other) noexcept;
++ PendingTrackInfo(PendingTrackInfo&& other);
++ PendingTrackInfo& operator=(PendingTrackInfo&& other);
+ ~PendingTrackInfo();
+
+ MediaStreamVideoTrack* track;
+diff --git a/third_party/blink/renderer/core/animation/interpolation_value.h b/third_party/blink/renderer/core/animation/interpolation_value.h
+index 75c5d35..17ccf02 100644
+--- a/third_party/blink/renderer/core/animation/interpolation_value.h
++++ b/third_party/blink/renderer/core/animation/interpolation_value.h
+@@ -27,11 +27,11 @@
+
+ InterpolationValue(std::nullptr_t) {}
+
+- InterpolationValue(InterpolationValue&& other) noexcept
++ InterpolationValue(InterpolationValue&& other)
+ : interpolable_value(std::move(other.interpolable_value)),
+ non_interpolable_value(std::move(other.non_interpolable_value)) {}
+
+- void operator=(InterpolationValue&& other) noexcept {
++ void operator=(InterpolationValue&& other) {
+ interpolable_value = std::move(other.interpolable_value);
+ non_interpolable_value = std::move(other.non_interpolable_value);
+ }
+diff --git a/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h b/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
+index 39e6c57..87bb431 100644
+--- a/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
++++ b/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
+@@ -28,7 +28,7 @@
+
+ PairwiseInterpolationValue(std::nullptr_t) {}
+
+- PairwiseInterpolationValue(PairwiseInterpolationValue&& other) noexcept
++ PairwiseInterpolationValue(PairwiseInterpolationValue&& other)
+ : start_interpolable_value(std::move(other.start_interpolable_value)),
+ end_interpolable_value(std::move(other.end_interpolable_value)),
+ non_interpolable_value(std::move(other.non_interpolable_value)) {}
+diff --git a/third_party/blink/renderer/core/css/css_selector_list.h b/third_party/blink/renderer/core/css/css_selector_list.h
+index 4d38b09..51f354b 100644
+--- a/third_party/blink/renderer/core/css/css_selector_list.h
++++ b/third_party/blink/renderer/core/css/css_selector_list.h
+@@ -67,8 +67,7 @@
+ public:
+ CSSSelectorList() : selector_array_(nullptr) {}
+
+- CSSSelectorList(CSSSelectorList&& o) noexcept
+- : selector_array_(o.selector_array_) {
++ CSSSelectorList(CSSSelectorList&& o) : selector_array_(o.selector_array_) {
+ o.selector_array_ = nullptr;
+ }
+
+@@ -82,7 +81,7 @@
+ bool HasPseudoWhere() const;
+ bool RequiresExpansion() const;
+
+- CSSSelectorList& operator=(CSSSelectorList&& o) noexcept {
++ CSSSelectorList& operator=(CSSSelectorList&& o) {
+ DCHECK(this != &o);
+ DeleteSelectorsIfNeeded();
+ selector_array_ = o.selector_array_;
+diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context.cc b/third_party/blink/renderer/core/display_lock/display_lock_context.cc
+index 0e6b6cb..79f281a 100644
+--- a/third_party/blink/renderer/core/display_lock/display_lock_context.cc
++++ b/third_party/blink/renderer/core/display_lock/display_lock_context.cc
+@@ -1033,7 +1033,7 @@
+ : context_(context) {}
+
+ DisplayLockContext::ScopedForcedUpdate::ScopedForcedUpdate(
+- ScopedForcedUpdate&& other) noexcept
++ ScopedForcedUpdate&& other)
+ : context_(other.context_) {
+ other.context_ = nullptr;
+ }
+diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context.h b/third_party/blink/renderer/core/display_lock/display_lock_context.h
+index 1a38b2af..f890b432 100644
+--- a/third_party/blink/renderer/core/display_lock/display_lock_context.h
++++ b/third_party/blink/renderer/core/display_lock/display_lock_context.h
+@@ -76,7 +76,7 @@
+ DISALLOW_NEW();
+
+ public:
+- ScopedForcedUpdate(ScopedForcedUpdate&&) noexcept;
++ ScopedForcedUpdate(ScopedForcedUpdate&&);
+ ~ScopedForcedUpdate();
+
+ private:
+diff --git a/third_party/blink/renderer/core/editing/layout_selection.cc b/third_party/blink/renderer/core/editing/layout_selection.cc
+index 00040d2..73cfe0f 100644
+--- a/third_party/blink/renderer/core/editing/layout_selection.cc
++++ b/third_party/blink/renderer/core/editing/layout_selection.cc
+@@ -178,7 +178,7 @@
+ public:
+ OldSelectedNodes()
+ : paint_range(MakeGarbageCollected<SelectionPaintRange>()) {}
+- OldSelectedNodes(OldSelectedNodes&& other) noexcept {
++ OldSelectedNodes(OldSelectedNodes&& other) {
+ paint_range = other.paint_range;
+ selected_map = std::move(other.selected_map);
+ }
+@@ -205,8 +205,7 @@
+ HeapHashSet<Member<const Node>>&& passed_selected_objects)
+ : paint_range(passed_paint_range),
+ selected_objects(std::move(passed_selected_objects)) {}
+- NewPaintRangeAndSelectedNodes(
+- NewPaintRangeAndSelectedNodes&& other) noexcept {
++ NewPaintRangeAndSelectedNodes(NewPaintRangeAndSelectedNodes&& other) {
+ paint_range = other.paint_range;
+ selected_objects = std::move(other.selected_objects);
+ }
+diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
+index f0ac3c4..81f47ab 100644
+--- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
++++ b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
+@@ -24,7 +24,7 @@
+ start_time_(clock_->NowTicks()) {}
+
+ LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer::ScopedUkmHierarchicalTimer(
+- ScopedUkmHierarchicalTimer&& other) noexcept
++ ScopedUkmHierarchicalTimer&& other)
+ : aggregator_(other.aggregator_),
+ metric_index_(other.metric_index_),
+ clock_(other.clock_),
+diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
+index 44c3f87..dc06091 100644
+--- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
++++ b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
+@@ -195,7 +195,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&) noexcept;
++ ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&);
+ ~ScopedUkmHierarchicalTimer();
+
+ private:
+diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
+index 2af19ca..498e42e 100644
+--- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
++++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
+@@ -181,7 +181,7 @@
+
+ public:
+ ChildList() = default;
+- void operator=(ChildList&& other) noexcept {
++ void operator=(ChildList&& other) {
+ children_ = std::move(other.children_);
+ }
+
+diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
+index 8f77b90..833b0d2 100644
+--- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
++++ b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
+@@ -86,7 +86,7 @@
+ else
+ bfc_offset_ = other.bfc_offset_;
+ }
+- NGConstraintSpace(NGConstraintSpace&& other) noexcept
++ NGConstraintSpace(NGConstraintSpace&& other)
+ : available_size_(other.available_size_),
+ exclusion_space_(std::move(other.exclusion_space_)),
+ bitfields_(other.bitfields_) {
+@@ -110,7 +110,7 @@
+ bitfields_ = other.bitfields_;
+ return *this;
+ }
+- NGConstraintSpace& operator=(NGConstraintSpace&& other) noexcept {
++ NGConstraintSpace& operator=(NGConstraintSpace&& other) {
+ available_size_ = other.available_size_;
+ if (HasRareData())
+ delete rare_data_;
+diff --git a/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc b/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
+index b6c8768..7423930 100644
+--- a/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
++++ b/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
+@@ -9,9 +9,8 @@
+ BlinkCloneableMessage::BlinkCloneableMessage() = default;
+ BlinkCloneableMessage::~BlinkCloneableMessage() = default;
+
+-BlinkCloneableMessage::BlinkCloneableMessage(BlinkCloneableMessage&&) noexcept =
+- default;
++BlinkCloneableMessage::BlinkCloneableMessage(BlinkCloneableMessage&&) = default;
+ BlinkCloneableMessage& BlinkCloneableMessage::operator=(
+- BlinkCloneableMessage&&) noexcept = default;
++ BlinkCloneableMessage&&) = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/renderer/core/messaging/blink_cloneable_message.h b/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
+index 337b0f8..a51e888 100644
+--- a/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
++++ b/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
+@@ -21,8 +21,8 @@
+ BlinkCloneableMessage();
+ ~BlinkCloneableMessage();
+
+- BlinkCloneableMessage(BlinkCloneableMessage&&) noexcept;
+- BlinkCloneableMessage& operator=(BlinkCloneableMessage&&) noexcept;
++ BlinkCloneableMessage(BlinkCloneableMessage&&);
++ BlinkCloneableMessage& operator=(BlinkCloneableMessage&&);
+
+ scoped_refptr<blink::SerializedScriptValue> message;
+ v8_inspector::V8StackTraceId sender_stack_trace_id;
+diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
+index 909ddb0..b5cdfda 100644
+--- a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
++++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
+@@ -16,10 +16,10 @@
+ BlinkTransferableMessage::BlinkTransferableMessage() = default;
+ BlinkTransferableMessage::~BlinkTransferableMessage() = default;
+
+-BlinkTransferableMessage::BlinkTransferableMessage(
+- BlinkTransferableMessage&&) noexcept = default;
++BlinkTransferableMessage::BlinkTransferableMessage(BlinkTransferableMessage&&) =
++ default;
+ BlinkTransferableMessage& BlinkTransferableMessage::operator=(
+- BlinkTransferableMessage&&) noexcept = default;
++ BlinkTransferableMessage&&) = default;
+
+ scoped_refptr<blink::StaticBitmapImage> ToStaticBitmapImage(
+ const SkBitmap& sk_bitmap) {
+diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.h b/third_party/blink/renderer/core/messaging/blink_transferable_message.h
+index edf4fab..3957bed 100644
+--- a/third_party/blink/renderer/core/messaging/blink_transferable_message.h
++++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.h
+@@ -24,8 +24,8 @@
+ BlinkTransferableMessage();
+ ~BlinkTransferableMessage();
+
+- BlinkTransferableMessage(BlinkTransferableMessage&&) noexcept;
+- BlinkTransferableMessage& operator=(BlinkTransferableMessage&&) noexcept;
++ BlinkTransferableMessage(BlinkTransferableMessage&&);
++ BlinkTransferableMessage& operator=(BlinkTransferableMessage&&);
+
+ Vector<MessagePortChannel> ports;
+
+diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
+index 85b46e1..f050a85 100644
+--- a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
++++ b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
+@@ -92,10 +92,10 @@
+ std::move(destruction_callback_).Run(std::move(callbacks_));
+ }
+
+- ScopedWebCallbacks(ScopedWebCallbacks&& other) noexcept = default;
++ ScopedWebCallbacks(ScopedWebCallbacks&& other) = default;
+ ScopedWebCallbacks(const ScopedWebCallbacks& other) = delete;
+
+- ScopedWebCallbacks& operator=(ScopedWebCallbacks&& other) noexcept = default;
++ ScopedWebCallbacks& operator=(ScopedWebCallbacks&& other) = default;
+ ScopedWebCallbacks& operator=(const ScopedWebCallbacks& other) = delete;
+
+ std::unique_ptr<CallbacksType> PassCallbacks() {
+diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request.h b/third_party/blink/renderer/modules/indexeddb/idb_request.h
+index f85b864..d3f1132 100644
+--- a/third_party/blink/renderer/modules/indexeddb/idb_request.h
++++ b/third_party/blink/renderer/modules/indexeddb/idb_request.h
+@@ -110,13 +110,13 @@
+ ~AsyncTraceState();
+
+ // Used to transfer the trace end event state to an IDBRequest.
+- AsyncTraceState(AsyncTraceState&& other) noexcept {
++ AsyncTraceState(AsyncTraceState&& other) {
+ DCHECK(IsEmpty());
+ this->trace_event_name_ = other.trace_event_name_;
+ this->id_ = other.id_;
+ other.trace_event_name_ = nullptr;
+ }
+- AsyncTraceState& operator=(AsyncTraceState&& rhs) noexcept {
++ AsyncTraceState& operator=(AsyncTraceState&& rhs) {
+ DCHECK(IsEmpty());
+ this->trace_event_name_ = rhs.trace_event_name_;
+ this->id_ = rhs.id_;
+diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
+index 84de726..2d3d4de5 100644
+--- a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
++++ b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
+@@ -434,10 +434,9 @@
+ class AsyncTraceStateForTesting : public IDBRequest::AsyncTraceState {
+ public:
+ AsyncTraceStateForTesting() : IDBRequest::AsyncTraceState() {}
+- AsyncTraceStateForTesting(AsyncTraceStateForTesting&& other) noexcept
++ AsyncTraceStateForTesting(AsyncTraceStateForTesting&& other)
+ : IDBRequest::AsyncTraceState(std::move(other)) {}
+- AsyncTraceStateForTesting& operator=(
+- AsyncTraceStateForTesting&& rhs) noexcept {
++ AsyncTraceStateForTesting& operator=(AsyncTraceStateForTesting&& rhs) {
+ AsyncTraceState::operator=(std::move(rhs));
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
+index 24499bd..3bf00e9 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
+@@ -134,13 +134,13 @@
+
+ VideoCaptureSettings::VideoCaptureSettings(const VideoCaptureSettings& other) =
+ default;
+-VideoCaptureSettings::VideoCaptureSettings(
+- VideoCaptureSettings&& other) noexcept = default;
++VideoCaptureSettings::VideoCaptureSettings(VideoCaptureSettings&& other) =
++ default;
+ VideoCaptureSettings::~VideoCaptureSettings() = default;
+ VideoCaptureSettings& VideoCaptureSettings::operator=(
+ const VideoCaptureSettings& other) = default;
+ VideoCaptureSettings& VideoCaptureSettings::operator=(
+- VideoCaptureSettings&& other) noexcept = default;
++ VideoCaptureSettings&& other) = default;
+
+ AudioCaptureSettings::AudioCaptureSettings() : AudioCaptureSettings("") {}
+
+@@ -166,10 +166,10 @@
+ default;
+ AudioCaptureSettings& AudioCaptureSettings::operator=(
+ const AudioCaptureSettings& other) = default;
+-AudioCaptureSettings::AudioCaptureSettings(
+- AudioCaptureSettings&& other) noexcept = default;
++AudioCaptureSettings::AudioCaptureSettings(AudioCaptureSettings&& other) =
++ default;
+ AudioCaptureSettings& AudioCaptureSettings::operator=(
+- AudioCaptureSettings&& other) noexcept = default;
++ AudioCaptureSettings&& other) = default;
+
+ bool GetConstraintValueAsBoolean(
+ const WebMediaConstraints& constraints,
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
+index 96992217..67c8bab 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
+@@ -529,9 +529,9 @@
+ facing_mode(facing_mode) {}
+
+ VideoInputDeviceCapabilities::VideoInputDeviceCapabilities(
+- VideoInputDeviceCapabilities&& other) noexcept = default;
++ VideoInputDeviceCapabilities&& other) = default;
+ VideoInputDeviceCapabilities& VideoInputDeviceCapabilities::operator=(
+- VideoInputDeviceCapabilities&& other) noexcept = default;
++ VideoInputDeviceCapabilities&& other) = default;
+
+ VideoInputDeviceCapabilities::~VideoInputDeviceCapabilities() = default;
+
+@@ -557,10 +557,10 @@
+
+ VideoDeviceCaptureCapabilities::VideoDeviceCaptureCapabilities() = default;
+ VideoDeviceCaptureCapabilities::VideoDeviceCaptureCapabilities(
+- VideoDeviceCaptureCapabilities&& other) noexcept = default;
++ VideoDeviceCaptureCapabilities&& other) = default;
+ VideoDeviceCaptureCapabilities::~VideoDeviceCaptureCapabilities() = default;
+ VideoDeviceCaptureCapabilities& VideoDeviceCaptureCapabilities::operator=(
+- VideoDeviceCaptureCapabilities&& other) noexcept = default;
++ VideoDeviceCaptureCapabilities&& other) = default;
+
+ VideoCaptureSettings SelectSettingsVideoDeviceCapture(
+ const VideoDeviceCaptureCapabilities& capabilities,
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
+index 66ae103..94d8ed9 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
+@@ -34,9 +34,8 @@
+ Vector<media::VideoCaptureFormat> formats,
+ media::VideoFacingMode facing_mode);
+ VideoInputDeviceCapabilities();
+- VideoInputDeviceCapabilities(VideoInputDeviceCapabilities&& other) noexcept;
+- VideoInputDeviceCapabilities& operator=(
+- VideoInputDeviceCapabilities&& other) noexcept;
++ VideoInputDeviceCapabilities(VideoInputDeviceCapabilities&& other);
++ VideoInputDeviceCapabilities& operator=(VideoInputDeviceCapabilities&& other);
+ ~VideoInputDeviceCapabilities();
+
+ String device_id;
+@@ -47,11 +46,10 @@
+
+ struct MODULES_EXPORT VideoDeviceCaptureCapabilities {
+ VideoDeviceCaptureCapabilities();
+- VideoDeviceCaptureCapabilities(
+- VideoDeviceCaptureCapabilities&& other) noexcept;
++ VideoDeviceCaptureCapabilities(VideoDeviceCaptureCapabilities&& other);
+ ~VideoDeviceCaptureCapabilities();
+ VideoDeviceCaptureCapabilities& operator=(
+- VideoDeviceCaptureCapabilities&& other) noexcept;
++ VideoDeviceCaptureCapabilities&& other);
+
+ // Each capabilities field is independent of each other.
+ // TODO(crbug.com/704136): Replace VideoInputDeviceCapabilities in the
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
+index 7651e47..99759c1 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
+@@ -461,10 +461,10 @@
+ callback(callback) {}
+
+ MediaStreamVideoSource::PendingTrackInfo::PendingTrackInfo(
+- PendingTrackInfo&& other) noexcept = default;
++ PendingTrackInfo&& other) = default;
+ MediaStreamVideoSource::PendingTrackInfo&
+ MediaStreamVideoSource::PendingTrackInfo::operator=(
+- MediaStreamVideoSource::PendingTrackInfo&& other) noexcept = default;
++ MediaStreamVideoSource::PendingTrackInfo&& other) = default;
+
+ MediaStreamVideoSource::PendingTrackInfo::~PendingTrackInfo() {}
+
+diff --git a/third_party/blink/renderer/platform/bindings/dom_data_store.h b/third_party/blink/renderer/platform/bindings/dom_data_store.h
+index d660b67..0660dd18 100644
+--- a/third_party/blink/renderer/platform/bindings/dom_data_store.h
++++ b/third_party/blink/renderer/platform/bindings/dom_data_store.h
+@@ -230,12 +230,11 @@
+ : TraceWrapperV8Reference(isolate, handle) {}
+
+ // Move support without write barrier.
+- DOMWorldWrapperReference(DOMWorldWrapperReference&& other) noexcept
++ DOMWorldWrapperReference(DOMWorldWrapperReference&& other)
+ : TraceWrapperV8Reference() {
+ handle_ = std::move(other.handle_);
+ }
+- DOMWorldWrapperReference& operator=(
+- DOMWorldWrapperReference&& rhs) noexcept {
++ DOMWorldWrapperReference& operator=(DOMWorldWrapperReference&& rhs) {
+ handle_ = std::move(rhs.handle_);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/exported/web_string.cc b/third_party/blink/renderer/platform/exported/web_string.cc
+index 71d4c07..fbe4828 100644
+--- a/third_party/blink/renderer/platform/exported/web_string.cc
++++ b/third_party/blink/renderer/platform/exported/web_string.cc
+@@ -51,9 +51,9 @@
+ WebString::~WebString() = default;
+ WebString::WebString() = default;
+ WebString::WebString(const WebString&) = default;
+-WebString::WebString(WebString&&) noexcept = default;
++WebString::WebString(WebString&&) = default;
+ WebString& WebString::operator=(const WebString&) = default;
+-WebString& WebString::operator=(WebString&&) noexcept = default;
++WebString& WebString::operator=(WebString&&) = default;
+
+ WebString::WebString(const WebUChar* data, size_t len)
+ : impl_(StringImpl::Create8BitIfPossible(data, len)) {}
+diff --git a/third_party/blink/renderer/platform/graphics/contiguous_container.cc b/third_party/blink/renderer/platform/graphics/contiguous_container.cc
+index fd01c00..19cb6f2 100644
+--- a/third_party/blink/renderer/platform/graphics/contiguous_container.cc
++++ b/third_party/blink/renderer/platform/graphics/contiguous_container.cc
+@@ -69,7 +69,7 @@
+ : end_index_(0), max_object_size_(max_object_size) {}
+
+ ContiguousContainerBase::ContiguousContainerBase(
+- ContiguousContainerBase&& source) noexcept
++ ContiguousContainerBase&& source)
+ : ContiguousContainerBase(source.max_object_size_) {
+ Swap(source);
+ }
+@@ -77,7 +77,7 @@
+ ContiguousContainerBase::~ContiguousContainerBase() = default;
+
+ ContiguousContainerBase& ContiguousContainerBase::operator=(
+- ContiguousContainerBase&& source) noexcept {
++ ContiguousContainerBase&& source) {
+ Swap(source);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/graphics/contiguous_container.h b/third_party/blink/renderer/platform/graphics/contiguous_container.h
+index 867e59c..3eee558 100644
+--- a/third_party/blink/renderer/platform/graphics/contiguous_container.h
++++ b/third_party/blink/renderer/platform/graphics/contiguous_container.h
+@@ -42,10 +42,10 @@
+
+ protected:
+ explicit ContiguousContainerBase(size_t max_object_size);
+- ContiguousContainerBase(ContiguousContainerBase&&) noexcept;
++ ContiguousContainerBase(ContiguousContainerBase&&);
+ ~ContiguousContainerBase();
+
+- ContiguousContainerBase& operator=(ContiguousContainerBase&&) noexcept;
++ ContiguousContainerBase& operator=(ContiguousContainerBase&&);
+
+ size_t size() const { return elements_.size(); }
+ bool IsEmpty() const { return !size(); }
+@@ -147,7 +147,7 @@
+ WTF_HEAP_PROFILER_TYPE_NAME(BaseElementType));
+ }
+
+- ContiguousContainer(ContiguousContainer&& source) noexcept
++ ContiguousContainer(ContiguousContainer&& source)
+ : ContiguousContainerBase(std::move(source)) {}
+
+ ~ContiguousContainer() {
+@@ -157,7 +157,7 @@
+ }
+ }
+
+- ContiguousContainer& operator=(ContiguousContainer&& source) noexcept {
++ ContiguousContainer& operator=(ContiguousContainer&& source) {
+ // Must clear in the derived class to ensure that element destructors
+ // care called.
+ Clear();
+diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+index ad10c54..4edbf7f 100644
+--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
++++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+@@ -247,9 +247,9 @@
+ }
+
+ ImageLayerBridge::RegisteredBitmap::RegisteredBitmap() = default;
+-ImageLayerBridge::RegisteredBitmap::RegisteredBitmap(
+- RegisteredBitmap&& other) noexcept = default;
++ImageLayerBridge::RegisteredBitmap::RegisteredBitmap(RegisteredBitmap&& other) =
++ default;
+ ImageLayerBridge::RegisteredBitmap& ImageLayerBridge::RegisteredBitmap::
+-operator=(RegisteredBitmap&& other) noexcept = default;
++operator=(RegisteredBitmap&& other) = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
+index bea81dfb..b6879f9 100644
+--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
++++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
+@@ -65,8 +65,8 @@
+ // only with software compositing.
+ struct RegisteredBitmap {
+ RegisteredBitmap();
+- RegisteredBitmap(RegisteredBitmap&& other) noexcept;
+- RegisteredBitmap& operator=(RegisteredBitmap&& other) noexcept;
++ RegisteredBitmap(RegisteredBitmap&& other);
++ RegisteredBitmap& operator=(RegisteredBitmap&& other);
+
+ scoped_refptr<cc::CrossThreadSharedBitmap> bitmap;
+ cc::SharedBitmapIdRegistration registration;
+diff --git a/third_party/blink/renderer/platform/graphics/paint/display_item_list.h b/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
+index cd3ed2f..9ee2571 100644
+--- a/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
++++ b/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
+@@ -28,10 +28,10 @@
+ public:
+ DisplayItemList(size_t initial_size_bytes)
+ : ContiguousContainer(kMaximumDisplayItemSize, initial_size_bytes) {}
+- DisplayItemList(DisplayItemList&& source) noexcept
++ DisplayItemList(DisplayItemList&& source)
+ : ContiguousContainer(std::move(source)) {}
+
+- DisplayItemList& operator=(DisplayItemList&& source) noexcept {
++ DisplayItemList& operator=(DisplayItemList&& source) {
+ ContiguousContainer::operator=(std::move(source));
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/heap/heap_test.cc b/third_party/blink/renderer/platform/heap/heap_test.cc
+index dad0ca0..e94cbc95 100644
+--- a/third_party/blink/renderer/platform/heap/heap_test.cc
++++ b/third_party/blink/renderer/platform/heap/heap_test.cc
+@@ -145,7 +145,7 @@
+ }
+ KeyWithCopyingMoveConstructor(const KeyWithCopyingMoveConstructor&) = default;
+ // The move constructor delegates to the copy constructor intentionally.
+- KeyWithCopyingMoveConstructor(KeyWithCopyingMoveConstructor&& x) noexcept
++ KeyWithCopyingMoveConstructor(KeyWithCopyingMoveConstructor&& x)
+ : KeyWithCopyingMoveConstructor(x) {}
+ KeyWithCopyingMoveConstructor& operator=(
+ const KeyWithCopyingMoveConstructor&) = default;
+diff --git a/third_party/blink/renderer/platform/image-decoders/segment_stream.cc b/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
+index 4024f9c..5a98701 100644
+--- a/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
++++ b/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
+@@ -10,10 +10,10 @@
+
+ SegmentStream::SegmentStream() = default;
+
+-SegmentStream::SegmentStream(SegmentStream&& rhs) noexcept
++SegmentStream::SegmentStream(SegmentStream&& rhs)
+ : reader_(std::move(rhs.reader_)), position_(rhs.position_) {}
+
+-SegmentStream& SegmentStream::operator=(SegmentStream&& rhs) noexcept {
++SegmentStream& SegmentStream::operator=(SegmentStream&& rhs) {
+ reader_ = std::move(rhs.reader_);
+ position_ = rhs.position_;
+
+diff --git a/third_party/blink/renderer/platform/image-decoders/segment_stream.h b/third_party/blink/renderer/platform/image-decoders/segment_stream.h
+index f49f551..fa1ccf2 100644
+--- a/third_party/blink/renderer/platform/image-decoders/segment_stream.h
++++ b/third_party/blink/renderer/platform/image-decoders/segment_stream.h
+@@ -19,8 +19,8 @@
+ SegmentStream();
+ SegmentStream(const SegmentStream&) = delete;
+ SegmentStream& operator=(const SegmentStream&) = delete;
+- SegmentStream(SegmentStream&&) noexcept;
+- SegmentStream& operator=(SegmentStream&&) noexcept;
++ SegmentStream(SegmentStream&&);
++ SegmentStream& operator=(SegmentStream&&);
+
+ ~SegmentStream() override;
+
+diff --git a/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h b/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
+index 555be28..34bad3f 100644
+--- a/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
++++ b/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
+@@ -41,7 +41,7 @@
+ RevocableInterfacePtr(std::nullptr_t) {}
+
+ // Takes over the binding of another RevocableInterfacePtr.
+- RevocableInterfacePtr(RevocableInterfacePtr&& other) noexcept {
++ RevocableInterfacePtr(RevocableInterfacePtr&& other) {
+ interface_ptr_ = std::move(other.interface_ptr_);
+ SetInvalidator(other.invalidator_.get());
+ // Reset the other interface ptr to remove it as an observer of the
+@@ -58,7 +58,7 @@
+
+ // Takes over the binding of another RevocableInterfacePtr, and closes any
+ // message pipe already bound to this pointer.
+- RevocableInterfacePtr& operator=(RevocableInterfacePtr&& other) noexcept {
++ RevocableInterfacePtr& operator=(RevocableInterfacePtr&& other) {
+ reset();
+ interface_ptr_ = std::move(other.interface_ptr_);
+ SetInvalidator(other.invalidator_.get());
+diff --git a/third_party/blink/renderer/platform/network/encoded_form_data.cc b/third_party/blink/renderer/platform/network/encoded_form_data.cc
+index bc4ec14..1b660e6 100644
+--- a/third_party/blink/renderer/platform/network/encoded_form_data.cc
++++ b/third_party/blink/renderer/platform/network/encoded_form_data.cc
+@@ -61,11 +61,10 @@
+ : type_(kDataPipe), data_pipe_getter_(std::move(data_pipe_getter)) {}
+
+ FormDataElement::FormDataElement(const FormDataElement&) = default;
+-FormDataElement::FormDataElement(FormDataElement&&) noexcept = default;
++FormDataElement::FormDataElement(FormDataElement&&) = default;
+ FormDataElement::~FormDataElement() = default;
+ FormDataElement& FormDataElement::operator=(const FormDataElement&) = default;
+-FormDataElement& FormDataElement::operator=(FormDataElement&&) noexcept =
+- default;
++FormDataElement& FormDataElement::operator=(FormDataElement&&) = default;
+
+ bool operator==(const FormDataElement& a, const FormDataElement& b) {
+ if (&a == &b)
+diff --git a/third_party/blink/renderer/platform/network/encoded_form_data.h b/third_party/blink/renderer/platform/network/encoded_form_data.h
+index 48f84c8..865f664 100644
+--- a/third_party/blink/renderer/platform/network/encoded_form_data.h
++++ b/third_party/blink/renderer/platform/network/encoded_form_data.h
+@@ -61,12 +61,12 @@
+ explicit FormDataElement(scoped_refptr<WrappedDataPipeGetter>);
+
+ FormDataElement(const FormDataElement&);
+- FormDataElement(FormDataElement&&) noexcept;
++ FormDataElement(FormDataElement&&);
+
+ ~FormDataElement();
+
+ FormDataElement& operator=(const FormDataElement&);
+- FormDataElement& operator=(FormDataElement&&) noexcept;
++ FormDataElement& operator=(FormDataElement&&);
+
+ bool IsSafeToSendToAnotherThread() const;
+
+diff --git a/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc b/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
+index ebe99ff..e971856 100644
+--- a/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
++++ b/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
+@@ -28,15 +28,14 @@
+ }
+
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::
+- SchedulingAffectingFeatureHandle(
+- SchedulingAffectingFeatureHandle&& other) noexcept
++ SchedulingAffectingFeatureHandle(SchedulingAffectingFeatureHandle&& other)
+ : feature_(other.feature_), scheduler_(std::move(other.scheduler_)) {
+ other.scheduler_ = nullptr;
+ }
+
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle&
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::operator=(
+- SchedulingAffectingFeatureHandle&& other) noexcept {
++ SchedulingAffectingFeatureHandle&& other) {
+ feature_ = other.feature_;
+ policy_ = std::move(other.policy_);
+ scheduler_ = std::move(other.scheduler_);
+diff --git a/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc b/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
+index 2c84d70..fad56ee1 100644
+--- a/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
++++ b/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
+@@ -103,9 +103,9 @@
+ Cancel();
+ }
+
+-TaskHandle::TaskHandle(TaskHandle&&) noexcept = default;
++TaskHandle::TaskHandle(TaskHandle&&) = default;
+
+-TaskHandle& TaskHandle::operator=(TaskHandle&& other) noexcept {
++TaskHandle& TaskHandle::operator=(TaskHandle&& other) {
+ TaskHandle tmp(std::move(other));
+ runner_.swap(tmp.runner_);
+ return *this;
+diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc b/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
+index f55730a..b64ec9d 100644
+--- a/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
++++ b/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
+@@ -28,7 +28,7 @@
+ }
+
+ WebScopedVirtualTimePauser::WebScopedVirtualTimePauser(
+- WebScopedVirtualTimePauser&& other) noexcept {
++ WebScopedVirtualTimePauser&& other) {
+ virtual_time_when_paused_ = other.virtual_time_when_paused_;
+ paused_ = other.paused_;
+ duration_ = other.duration_;
+@@ -39,7 +39,7 @@
+ }
+
+ WebScopedVirtualTimePauser& WebScopedVirtualTimePauser::operator=(
+- WebScopedVirtualTimePauser&& other) noexcept {
++ WebScopedVirtualTimePauser&& other) {
+ if (scheduler_ && paused_)
+ DecrementVirtualTimePauseCount();
+ virtual_time_when_paused_ = other.virtual_time_when_paused_;
+diff --git a/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h b/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
+index 56915ee..3fdb8cf 100644
+--- a/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
++++ b/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
+@@ -57,12 +57,11 @@
+
+ public:
+ SchedulingAffectingFeatureHandle() = default;
+- SchedulingAffectingFeatureHandle(
+- SchedulingAffectingFeatureHandle&&) noexcept;
++ SchedulingAffectingFeatureHandle(SchedulingAffectingFeatureHandle&&);
+ inline ~SchedulingAffectingFeatureHandle() { reset(); }
+
+ SchedulingAffectingFeatureHandle& operator=(
+- SchedulingAffectingFeatureHandle&&) noexcept;
++ SchedulingAffectingFeatureHandle&&);
+
+ inline void reset() {
+ if (scheduler_)
+diff --git a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
+index 38cbf63..ae66c73 100644
+--- a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
++++ b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
+@@ -28,8 +28,8 @@
+ TaskHandle();
+ ~TaskHandle();
+
+- TaskHandle(TaskHandle&&) noexcept;
+- TaskHandle& operator=(TaskHandle&&) noexcept;
++ TaskHandle(TaskHandle&&);
++ TaskHandle& operator=(TaskHandle&&);
+
+ // Returns true if the task will run later. Returns false if the task is
+ // cancelled or the task is run already.
+diff --git a/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc b/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
+index 2e9a9d1..c9d777e7 100644
+--- a/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
++++ b/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
+@@ -59,8 +59,7 @@
+ network::mojom::CorsPortMatchMode::kAllowOnlySpecifiedPort,
+ priority) {}
+
+-OriginAccessEntry::OriginAccessEntry(OriginAccessEntry&& from) noexcept =
+- default;
++OriginAccessEntry::OriginAccessEntry(OriginAccessEntry&& from) = default;
+
+ network::cors::OriginAccessEntry::MatchResult OriginAccessEntry::MatchesOrigin(
+ const SecurityOrigin& origin) const {
+diff --git a/third_party/blink/renderer/platform/weborigin/origin_access_entry.h b/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
+index b3e5674..5113a40 100644
+--- a/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
++++ b/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
+@@ -58,7 +58,7 @@
+ network::mojom::CorsDomainMatchMode,
+ network::mojom::CorsOriginAccessMatchPriority priority =
+ network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+- OriginAccessEntry(OriginAccessEntry&& from) noexcept;
++ OriginAccessEntry(OriginAccessEntry&& from);
+
+ network::cors::OriginAccessEntry::MatchResult MatchesOrigin(
+ const SecurityOrigin&) const;
+diff --git a/third_party/blink/renderer/platform/wtf/deque.h b/third_party/blink/renderer/platform/wtf/deque.h
+index c6fe1b9..4a98ffb 100644
+--- a/third_party/blink/renderer/platform/wtf/deque.h
++++ b/third_party/blink/renderer/platform/wtf/deque.h
+@@ -64,8 +64,8 @@ class Deque {
+ Deque();
+ Deque(const Deque&);
+ Deque& operator=(const Deque&);
+- Deque(Deque&&) noexcept;
+- Deque& operator=(Deque&&) noexcept;
++ Deque(Deque&&);
++ Deque& operator=(Deque&&);
+ ~Deque();
+
+ void FinalizeGarbageCollectedObject() { NOTREACHED(); }
+@@ -343,14 +343,14 @@
+ }
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+-inline Deque<T, inlineCapacity, Allocator>::Deque(Deque&& other) noexcept
++inline Deque<T, inlineCapacity, Allocator>::Deque(Deque&& other)
+ : start_(0), end_(0) {
+ Swap(other);
+ }
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ inline Deque<T, inlineCapacity, Allocator>&
+-Deque<T, inlineCapacity, Allocator>::operator=(Deque&& other) noexcept {
++Deque<T, inlineCapacity, Allocator>::operator=(Deque&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/functional.h b/third_party/blink/renderer/platform/wtf/functional.h
+index 2c5aeea..5e4b373 100644
+--- a/third_party/blink/renderer/platform/wtf/functional.h
++++ b/third_party/blink/renderer/platform/wtf/functional.h
+@@ -117,8 +117,7 @@
+ class PassedWrapper final {
+ public:
+ explicit PassedWrapper(T&& scoper) : scoper_(std::move(scoper)) {}
+- PassedWrapper(PassedWrapper&& other) noexcept
+- : scoper_(std::move(other.scoper_)) {}
++ PassedWrapper(PassedWrapper&& other) : scoper_(std::move(other.scoper_)) {}
+ T MoveOut() const { return std::move(scoper_); }
+
+ private:
+@@ -319,9 +318,8 @@
+ CrossThreadFunction(const CrossThreadFunction&) = delete;
+ CrossThreadFunction& operator=(const CrossThreadFunction&) = delete;
+
+- CrossThreadFunction(CrossThreadFunction&& other) noexcept = default;
+- CrossThreadFunction& operator=(CrossThreadFunction&& other) noexcept =
+- default;
++ CrossThreadFunction(CrossThreadFunction&& other) = default;
++ CrossThreadFunction& operator=(CrossThreadFunction&& other) = default;
+
+ R Run(Args... args) const & {
+ return callback_.Run(std::forward<Args>(args)...);
+@@ -356,9 +354,8 @@
+ CrossThreadOnceFunction(const CrossThreadOnceFunction&) = delete;
+ CrossThreadOnceFunction& operator=(const CrossThreadOnceFunction&) = delete;
+
+- CrossThreadOnceFunction(CrossThreadOnceFunction&& other) noexcept = default;
+- CrossThreadOnceFunction& operator=(CrossThreadOnceFunction&& other) noexcept =
+- default;
++ CrossThreadOnceFunction(CrossThreadOnceFunction&& other) = default;
++ CrossThreadOnceFunction& operator=(CrossThreadOnceFunction&& other) = default;
+
+ R Run(Args... args) && {
+ return std::move(callback_).Run(std::forward<Args>(args)...);
+diff --git a/third_party/blink/renderer/platform/wtf/hash_map.h b/third_party/blink/renderer/platform/wtf/hash_map.h
+index 8a002a8..46b39e0 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_map.h
++++ b/third_party/blink/renderer/platform/wtf/hash_map.h
+@@ -106,8 +106,8 @@
+ #endif
+ HashMap(const HashMap&) = default;
+ HashMap& operator=(const HashMap&) = default;
+- HashMap(HashMap&&) noexcept = default;
+- HashMap& operator=(HashMap&&) noexcept = default;
++ HashMap(HashMap&&) = default;
++ HashMap& operator=(HashMap&&) = default;
+
+ // For example, HashMap<int, int>({{1, 11}, {2, 22}, {3, 33}}) will give you
+ // a HashMap containing a mapping {1 -> 11, 2 -> 22, 3 -> 33}.
+diff --git a/third_party/blink/renderer/platform/wtf/hash_set.h b/third_party/blink/renderer/platform/wtf/hash_set.h
+index c79e45f1..d7cdeed 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/hash_set.h
+@@ -74,8 +74,8 @@
+ }
+ HashSet(const HashSet&) = default;
+ HashSet& operator=(const HashSet&) = default;
+- HashSet(HashSet&&) noexcept = default;
+- HashSet& operator=(HashSet&&) noexcept = default;
++ HashSet(HashSet&&) = default;
++ HashSet& operator=(HashSet&&) = default;
+
+ HashSet(std::initializer_list<ValueType> elements);
+ HashSet& operator=(std::initializer_list<ValueType> elements);
+diff --git a/third_party/blink/renderer/platform/wtf/hash_table.h b/third_party/blink/renderer/platform/wtf/hash_table.h
+index 373280f..52483ec5 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_table.h
++++ b/third_party/blink/renderer/platform/wtf/hash_table.h
+@@ -747,10 +747,10 @@
+ }
+
+ HashTable(const HashTable&);
+- HashTable(HashTable&&) noexcept;
++ HashTable(HashTable&&);
+ void swap(HashTable&);
+ HashTable& operator=(const HashTable&);
+- HashTable& operator=(HashTable&&) noexcept;
++ HashTable& operator=(HashTable&&);
+
+ // When the hash table is empty, just return the same iterator for end as
+ // for begin. This is more efficient because we don't have to skip all the
+@@ -1929,7 +1929,7 @@
+ typename KeyTraits,
+ typename Allocator>
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
+- HashTable(HashTable&& other) noexcept
++ HashTable(HashTable&& other)
+ : table_(nullptr),
+ table_size_(0),
+ key_count_(0),
+@@ -2008,7 +2008,7 @@
+ typename Allocator>
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>&
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
+-operator=(HashTable&& other) noexcept {
++operator=(HashTable&& other) {
+ swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/linked_hash_set.h b/third_party/blink/renderer/platform/wtf/linked_hash_set.h
+index 79c3d76d..71ef37a 100644
+--- a/third_party/blink/renderer/platform/wtf/linked_hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/linked_hash_set.h
+@@ -121,7 +121,7 @@
+ LinkedHashSetNodeBase(const LinkedHashSetNodeBase& other)
+ : prev_(nullptr), next_(nullptr) {}
+
+- LinkedHashSetNodeBase(LinkedHashSetNodeBase&& other) noexcept
++ LinkedHashSetNodeBase(LinkedHashSetNodeBase&& other)
+ : prev_(other.prev_), next_(other.next_) {
+ other.prev_ = nullptr;
+ other.next_ = nullptr;
+@@ -151,7 +151,7 @@
+ LinkedHashSetNodeBase* next)
+ : LinkedHashSetNodeBase(prev, next), value_(std::move(value)) {}
+
+- LinkedHashSetNode(LinkedHashSetNode&& other) noexcept
++ LinkedHashSetNode(LinkedHashSetNode&& other)
+ : LinkedHashSetNodeBase(std::move(other)),
+ value_(std::move(other.value_)) {}
+
+@@ -214,9 +214,9 @@
+
+ LinkedHashSet();
+ LinkedHashSet(const LinkedHashSet&);
+- LinkedHashSet(LinkedHashSet&&) noexcept;
++ LinkedHashSet(LinkedHashSet&&);
+ LinkedHashSet& operator=(const LinkedHashSet&);
+- LinkedHashSet& operator=(LinkedHashSet&&) noexcept;
++ LinkedHashSet& operator=(LinkedHashSet&&);
+
+ // Needs finalization. The anchor needs to unlink itself from the chain.
+ ~LinkedHashSet();
+@@ -748,7 +748,7 @@
+ }
+
+ template <typename T, typename U, typename V, typename W>
+-inline LinkedHashSet<T, U, V, W>::LinkedHashSet(LinkedHashSet&& other) noexcept
++inline LinkedHashSet<T, U, V, W>::LinkedHashSet(LinkedHashSet&& other)
+ : anchor_() {
+ Swap(other);
+ }
+@@ -763,7 +763,7 @@
+
+ template <typename T, typename U, typename V, typename W>
+ inline LinkedHashSet<T, U, V, W>& LinkedHashSet<T, U, V, W>::operator=(
+- LinkedHashSet&& other) noexcept {
++ LinkedHashSet&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set.h b/third_party/blink/renderer/platform/wtf/list_hash_set.h
+index ead6a87..78bd279 100644
+--- a/third_party/blink/renderer/platform/wtf/list_hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/list_hash_set.h
+@@ -145,9 +145,9 @@ class ListHashSet {
+
+ ListHashSet();
+ ListHashSet(const ListHashSet&);
+- ListHashSet(ListHashSet&&) noexcept;
++ ListHashSet(ListHashSet&&);
+ ListHashSet& operator=(const ListHashSet&);
+- ListHashSet& operator=(ListHashSet&&) noexcept;
++ ListHashSet& operator=(ListHashSet&&);
+ ~ListHashSet();
+
+ void Swap(ListHashSet&);
+@@ -780,8 +780,7 @@
+ }
+
+ template <typename T, size_t inlineCapacity, typename U, typename V>
+-inline ListHashSet<T, inlineCapacity, U, V>::ListHashSet(
+- ListHashSet&& other) noexcept
++inline ListHashSet<T, inlineCapacity, U, V>::ListHashSet(ListHashSet&& other)
+ : head_(nullptr), tail_(nullptr) {
+ Swap(other);
+ }
+@@ -796,7 +795,7 @@
+
+ template <typename T, size_t inlineCapacity, typename U, typename V>
+ inline ListHashSet<T, inlineCapacity, U, V>&
+-ListHashSet<T, inlineCapacity, U, V>::operator=(ListHashSet&& other) noexcept {
++ListHashSet<T, inlineCapacity, U, V>::operator=(ListHashSet&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/type_traits_test.cc b/third_party/blink/renderer/platform/wtf/type_traits_test.cc
+index 0930b73..1b45d55 100644
+--- a/third_party/blink/renderer/platform/wtf/type_traits_test.cc
++++ b/third_party/blink/renderer/platform/wtf/type_traits_test.cc
+@@ -158,7 +158,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentDeleted& operator=(CopyAssignmentDeleted&&) noexcept;
++ CopyAssignmentDeleted& operator=(CopyAssignmentDeleted&&);
+
+ private:
+ CopyAssignmentDeleted& operator=(const CopyAssignmentDeleted&) = delete;
+@@ -173,7 +173,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentPrivate& operator=(CopyAssignmentPrivate&&) noexcept;
++ CopyAssignmentPrivate& operator=(CopyAssignmentPrivate&&);
+
+ private:
+ CopyAssignmentPrivate& operator=(const CopyAssignmentPrivate&);
+@@ -188,7 +188,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentUndeclared& operator=(CopyAssignmentUndeclared&&) noexcept;
++ CopyAssignmentUndeclared& operator=(CopyAssignmentUndeclared&&);
+ };
+
+ static_assert(!std::is_copy_assignable<CopyAssignmentUndeclared>::value,
+diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+index 3f44cd2..ee7c89a 100644
+--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
++++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+@@ -68,7 +68,7 @@
+ deleter_(deleter),
+ deleter_info_(deleter_info) {}
+ // Move constructor
+- DataHandle(DataHandle&& other) noexcept { *this = std::move(other); }
++ DataHandle(DataHandle&& other) { *this = std::move(other); }
+ ~DataHandle() {
+ if (!data_)
+ return;
+diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
+index 2783c2b..43a27f7 100644
+--- a/third_party/blink/renderer/platform/wtf/vector.h
++++ b/third_party/blink/renderer/platform/wtf/vector.h
+@@ -1018,8 +1018,8 @@
+ Vector& operator=(const Vector<T, otherCapacity, Allocator>&);
+
+ // Moving.
+- Vector(Vector&&) noexcept;
+- Vector& operator=(Vector&&) noexcept;
++ Vector(Vector&&);
++ Vector& operator=(Vector&&);
+
+ // Construct with an initializer list. You can do e.g.
+ // Vector<int> v({1, 2, 3});
+@@ -1459,7 +1459,7 @@
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ Vector<T, inlineCapacity, Allocator>::Vector(
+- Vector<T, inlineCapacity, Allocator>&& other) noexcept {
++ Vector<T, inlineCapacity, Allocator>&& other) {
+ size_ = 0;
+ // It's a little weird to implement a move constructor using swap but this
+ // way we don't have to add a move constructor to VectorBuffer.
+@@ -1468,7 +1468,7 @@
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ Vector<T, inlineCapacity, Allocator>& Vector<T, inlineCapacity, Allocator>::
+-operator=(Vector<T, inlineCapacity, Allocator>&& other) noexcept {
++operator=(Vector<T, inlineCapacity, Allocator>&& other) {
+ swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/vector_test.cc b/third_party/blink/renderer/platform/wtf/vector_test.cc
+index aa8a138..788cc2bb 100644
+--- a/third_party/blink/renderer/platform/wtf/vector_test.cc
++++ b/third_party/blink/renderer/platform/wtf/vector_test.cc
+@@ -420,8 +420,8 @@
+ class MojoMoveOnlyType final {
+ public:
+ MojoMoveOnlyType();
+- MojoMoveOnlyType(MojoMoveOnlyType&&) noexcept;
+- MojoMoveOnlyType& operator=(MojoMoveOnlyType&&) noexcept;
++ MojoMoveOnlyType(MojoMoveOnlyType&&);
++ MojoMoveOnlyType& operator=(MojoMoveOnlyType&&);
+ ~MojoMoveOnlyType();
+
+ private:
+diff --git a/third_party/blink/renderer/platform/wtf/wtf_test_helper.h b/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
+index e797445..8f31365 100644
+--- a/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
++++ b/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
+@@ -36,9 +36,9 @@
+ public:
+ explicit MoveOnly(int i = 0) : i_(i) {}
+
+- MoveOnly(MoveOnly&& other) noexcept : i_(other.i_) { other.i_ = 0; }
++ MoveOnly(MoveOnly&& other) : i_(other.i_) { other.i_ = 0; }
+
+- MoveOnly& operator=(MoveOnly&& other) noexcept {
++ MoveOnly& operator=(MoveOnly&& other) {
+ if (this != &other) {
+ i_ = other.i_;
+ other.i_ = 0;
+@@ -62,12 +62,12 @@
+
+ explicit MoveOnlyHashValue(int value = kEmpty, int id = 0)
+ : value_(value), id_(id) {}
+- MoveOnlyHashValue(MoveOnlyHashValue&& other) noexcept
++ MoveOnlyHashValue(MoveOnlyHashValue&& other)
+ : value_(other.value_), id_(other.id_) {
+ other.value_ = kMovedOut;
+ other.id_ = 0;
+ }
+- MoveOnlyHashValue& operator=(MoveOnlyHashValue&& other) noexcept {
++ MoveOnlyHashValue& operator=(MoveOnlyHashValue&& other) {
+ value_ = other.value_;
+ id_ = other.id_;
+ other.value_ = kMovedOut;
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
new file mode 100644
index 00000000000..d43a091b971
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
@@ -0,0 +1,39 @@
+From af77dc4014ead3d898fdc8a7a70fe5063ac9b102 Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <jose.dapena@lge.com>
+Date: Fri, 25 Oct 2019 19:01:29 +0000
+Subject: [PATCH] GCC: use brace-initializer for DohUpgrade vector
+
+Constructing NoDestructor with parenthesis constructor is ambiguous
+in GCC. Use brace-initializer to avoid that problem. This fixes this
+build error:
+
+Bug: 819294
+Change-Id: I00dda42daa1794d11e022f26ac07f92e599d106d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879910
+Reviewed-by: Eric Orth <ericorth@chromium.org>
+Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
+Cr-Commit-Position: refs/heads/master@{#709569}
+---
+
+diff --git a/net/dns/dns_util.cc b/net/dns/dns_util.cc
+index 14997c4..637b6f2 100644
+--- a/net/dns/dns_util.cc
++++ b/net/dns/dns_util.cc
+@@ -144,7 +144,7 @@
+ // DohProviderId histogram suffix list in
+ // tools/metrics/histograms/histograms.xml.
+ static const base::NoDestructor<std::vector<DohUpgradeEntry>>
+- upgradable_servers({
++ upgradable_servers{{
+ DohUpgradeEntry(
+ "CleanBrowsingAdult",
+ {"185.228.168.10", "185.228.169.11", "2a0d:2a00:1::1",
+@@ -215,7 +215,7 @@
+ {"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"},
+ {"dns.quad9.net", "dns9.quad9.net"} /* DoT hostname */,
+ {"https://dns.quad9.net/dns-query", true /* use_post */}),
+- });
++ }};
+ return *upgradable_servers;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
new file mode 100644
index 00000000000..05cb1e9b634
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
@@ -0,0 +1,102 @@
+From cf2022b11cd3e28f1f3777b060fd509f665ff8e1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 6 Jul 2020 10:21:27 -0700
+Subject: [PATCH] GCC 10 Fixes
+
+---
+ base/trace_event/trace_event_memory_overhead.h | 1 +
+ third_party/angle/include/platform/Platform.h | 1 +
+ third_party/perfetto/include/perfetto/base/task_runner.h | 2 ++
+ third_party/webrtc/call/rtx_receive_stream.h | 1 +
+ 4 files changed, 5 insertions(+)
+
+diff --git a/base/trace_event/trace_event_memory_overhead.h b/base/trace_event/trace_event_memory_overhead.h
+index 69468d4..e10a3ec 100644
+--- a/base/trace_event/trace_event_memory_overhead.h
++++ b/base/trace_event/trace_event_memory_overhead.h
+@@ -8,6 +8,7 @@
+ #include <stddef.h>
+ #include <stdint.h>
+
++#include <string>
+ #include <unordered_map>
+
+ #include "base/base_export.h"
+diff --git a/third_party/angle/include/platform/Platform.h b/third_party/angle/include/platform/Platform.h
+index cea6070..0fbd64f 100644
+--- a/third_party/angle/include/platform/Platform.h
++++ b/third_party/angle/include/platform/Platform.h
+@@ -9,6 +9,7 @@
+ #ifndef ANGLE_PLATFORM_H
+ #define ANGLE_PLATFORM_H
+
++#include <stddef.h>
+ #include <stdint.h>
+ #include <array>
+
+diff --git a/third_party/perfetto/include/perfetto/base/task_runner.h b/third_party/perfetto/include/perfetto/base/task_runner.h
+index cf60401..040aab2 100644
+--- a/third_party/perfetto/include/perfetto/base/task_runner.h
++++ b/third_party/perfetto/include/perfetto/base/task_runner.h
+@@ -17,6 +17,8 @@
+ #ifndef INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+ #define INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+
++#include <stdint.h>
++
+ #include <functional>
+
+ #include "perfetto/base/export.h"
+diff --git a/third_party/webrtc/call/rtx_receive_stream.h b/third_party/webrtc/call/rtx_receive_stream.h
+index 8ffa440..fb2f9f4 100644
+--- a/third_party/webrtc/call/rtx_receive_stream.h
++++ b/third_party/webrtc/call/rtx_receive_stream.h
+@@ -11,6 +11,8 @@
+ #ifndef CALL_RTX_RECEIVE_STREAM_H_
+ #define CALL_RTX_RECEIVE_STREAM_H_
+
++#include <stdint.h>
++
+ #include <map>
+
+ #include "call/rtp_packet_sink_interface.h"
+diff --git a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
+index 22528c9..2ba90bb 100644
+--- a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
++++ b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
+@@ -11,6 +11,8 @@
+ #ifndef MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_
+ #define MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_
+
++#include <stddef.h>
++
+ #include <array>
+
+ namespace webrtc {
+diff --git a/media/cdm/supported_cdm_versions.h b/media/cdm/supported_cdm_versions.h
+index 3f220da..c54e3bb 100644
+--- a/media/cdm/supported_cdm_versions.h
++++ b/media/cdm/supported_cdm_versions.h
+@@ -6,6 +6,7 @@
+ #define MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_
+
+ #include <array>
++#include <cstddef>
+
+ #include "media/base/media_export.h"
+ #include "media/cdm/api/content_decryption_module.h"
+diff --git a/third_party/webrtc/modules/video_coding/decoding_state.h b/third_party/webrtc/modules/video_coding/decoding_state.h
+index b87fb2d..ec97294 100644
+--- a/third_party/webrtc/modules/video_coding/decoding_state.h
++++ b/third_party/webrtc/modules/video_coding/decoding_state.h
+@@ -11,6 +11,7 @@
+ #ifndef MODULES_VIDEO_CODING_DECODING_STATE_H_
+ #define MODULES_VIDEO_CODING_DECODING_STATE_H_
+
++#include <cstdint>
+ #include <map>
+ #include <set>
+ #include <vector>
+--
+2.26.2
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
new file mode 100644
index 00000000000..ef57ce774a9
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
@@ -0,0 +1,31 @@
+From d48486507d6b4ed130696721a758e2a231066cf7 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 6 Jul 2020 16:33:14 -0700
+Subject: [PATCH] GCC-X11-Success-enum
+
+---
+ components/viz/host/host_display_client.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
+index 72a807e..257bc86 100644
+--- a/components/viz/host/host_display_client.h
++++ b/components/viz/host/host_display_client.h
+@@ -13,7 +13,14 @@
+ #include "build/build_config.h"
+ #include "components/viz/host/viz_host_export.h"
+ #include "mojo/public/cpp/bindings/binding.h"
++#ifdef Success
++#undef Success
++#define __X11_SUCCESS
++#endif
+ #include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
++#ifdef __X11_SUCCESS
++#define Success 0
++#endif
+ #include "ui/gfx/native_widget_types.h"
+
+ namespace viz {
+--
+2.26.2
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch b/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
new file mode 100644
index 00000000000..e0732b6ace2
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 5a62770..1fae2aa 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6192,7 +6192,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch b/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
new file mode 100644
index 00000000000..c18b3ed5c51
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
@@ -0,0 +1,167 @@
+From 64b8ee6fc65bcce07bcaa4bba5f61f29c5495253 Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Fri, 3 Apr 2020 23:13:54 -0700
+Subject: [PATCH] [intl] Remove soon-to-be removed getAllFieldPositions
+
+Needed to land ICU67.1 soon.
+
+Bug: v8:10393
+Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489
+Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
+Commit-Queue: Frank Tang <ftang@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#67027}
+---
+ v8/src/objects/js-number-format.cc | 76 +++++++++++++++++----------------
+ 1 file changed, 40 insertions(+), 36 deletions(-)
+
+diff --git a/v8/src/objects/js-number-format.cc b/v8/src/objects/js-number-format.cc
+index ff564975d6..ad8e173b59 100644
+--- a/v8/src/objects/js-number-format.cc
++++ b/v8/src/objects/js-number-format.cc
+@@ -1257,42 +1257,33 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate,
+ }
+
+ namespace {
+-Maybe<icu::UnicodeString> IcuFormatNumber(
++Maybe<bool> IcuFormatNumber(
+ Isolate* isolate,
+ const icu::number::LocalizedNumberFormatter& number_format,
+- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) {
++ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) {
+ // If it is BigInt, handle it differently.
+ UErrorCode status = U_ZERO_ERROR;
+- icu::number::FormattedNumber formatted;
+ if (numeric_obj->IsBigInt()) {
+ Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj);
+ Handle<String> big_int_string;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
+ BigInt::ToString(isolate, big_int),
+- Nothing<icu::UnicodeString>());
+- formatted = number_format.formatDecimal(
++ Nothing<bool>());
++ *formatted = number_format.formatDecimal(
+ {big_int_string->ToCString().get(), big_int_string->length()}, status);
+ } else {
+- double number = numeric_obj->Number();
+- formatted = number_format.formatDouble(number, status);
++ double number = numeric_obj->IsNaN()
++ ? std::numeric_limits<double>::quiet_NaN()
++ : numeric_obj->Number();
++ *formatted = number_format.formatDouble(number, status);
+ }
+ if (U_FAILURE(status)) {
+ // This happen because of icu data trimming trim out "unit".
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=8641
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- if (fp_iter) {
+- formatted.getAllFieldPositions(*fp_iter, status);
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
+ }
+- icu::UnicodeString result = formatted.toString(status);
+- if (U_FAILURE(status)) {
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- return Just(result);
++ return Just(true);
+ }
+
+ } // namespace
+@@ -1303,10 +1294,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric(
+ Handle<Object> numeric_obj) {
+ DCHECK(numeric_obj->IsNumeric());
+
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<String>());
+- return Intl::ToString(isolate, maybe_format.FromJust());
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString result = formatted.toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
++ }
++ return Intl::ToString(isolate, result);
+ }
+
+ namespace {
+@@ -1419,12 +1416,18 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts(
+ }
+
+ namespace {
+-Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+- icu::FieldPositionIterator* fp_iter,
++Maybe<int> ConstructParts(Isolate* isolate,
++ icu::number::FormattedNumber* formatted,
+ Handle<JSArray> result, int start_index,
+ Handle<Object> numeric_obj, bool style_is_unit) {
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString formatted_text = formatted->toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
++ }
+ DCHECK(numeric_obj->IsNumeric());
+- int32_t length = formatted.length();
++ int32_t length = formatted_text.length();
+ int index = start_index;
+ if (length == 0) return Just(index);
+
+@@ -1433,13 +1436,14 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ // other region covers some part of the formatted string. It's possible
+ // there's another field with exactly the same begin and end as this backdrop,
+ // in which case the backdrop's field_id of -1 will give it lower priority.
+- regions.push_back(NumberFormatSpan(-1, 0, formatted.length()));
++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length()));
+
+ {
+- icu::FieldPosition fp;
+- while (fp_iter->next(fp)) {
+- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(),
+- fp.getEndIndex()));
++ icu::ConstrainedFieldPosition cfp;
++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER);
++ while (formatted->nextPosition(cfp, status)) {
++ regions.push_back(
++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit()));
+ }
+ }
+
+@@ -1461,7 +1465,7 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ Handle<String> substring;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, substring,
+- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos),
++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
+ Nothing<int>());
+ Intl::AddElement(isolate, result, index, field_type_string, substring);
+ ++index;
+@@ -1481,14 +1485,14 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts(
+ number_format->icu_number_formatter().raw();
+ CHECK_NOT_NULL(fmt);
+
+- icu::FieldPositionIterator fp_iter;
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<JSArray>());
+
+ Handle<JSArray> result = factory->NewJSArray(0);
+ Maybe<int> maybe_format_to_parts = ConstructParts(
+- isolate, maybe_format.FromJust(), &fp_iter, result, 0, numeric_obj,
++ isolate, &formatted, result, 0, numeric_obj,
+ number_format->style() == JSNumberFormat::Style::UNIT);
+ MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>());
+
+--
+2.26.2
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch b/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
new file mode 100644
index 00000000000..f2ecdc3f32b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
@@ -0,0 +1,185 @@
+From a1207cc75454e653030716948d27ec27412f6fe8 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sat, 16 Jun 2019 15:43:27 +0100
+Subject: [PATCH] Disable various compiler configs
+
+---
+ build/config/compiler/BUILD.gn | 64 +++++++++++++---------------------
+ 1 file changed, 25 insertions(+), 39 deletions(-)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index a3f21b7..0a7bec6 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -230,8 +230,6 @@ config("compiler") {
+
+ configs += [
+ # See the definitions below.
+- ":clang_revision",
+- ":compiler_cpu_abi",
+ ":compiler_codegen",
+ ":compiler_deterministic",
+ ]
+@@ -471,20 +469,6 @@ config("compiler") {
+ }
+ }
+
+- if (is_clang && !is_nacl && !use_xcode_clang) {
+- cflags += [ "-fcrash-diagnostics-dir=" +
+- rebase_path("//tools/clang/crashreports", root_build_dir) ]
+-
+- cflags += [
+- # TODO(hans): Remove this once Clang generates better optimized debug info
+- # by default. https://crbug.com/765793
+- "-Xclang",
+- "-mllvm",
+- "-Xclang",
+- "-instcombine-lower-dbg-declare=0",
+- ]
+- }
+-
+ # C11/C++11 compiler flags setup.
+ # ---------------------------
+ if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") {
+@@ -1431,6 +1415,12 @@ config("default_warnings") {
+ "-Wno-narrowing",
+ ]
+
++ # -Wno-class-memaccess warns about hash table and vector in blink.
++ # But the violation is intentional.
++ if (!is_nacl) {
++ cflags_cc += [ "-Wno-class-memaccess" ]
++ }
++
+ # -Wunused-local-typedefs is broken in gcc,
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872
+ cflags += [ "-Wno-unused-local-typedefs" ]
+@@ -1525,7 +1515,7 @@ config("chromium_code") {
+ defines = [ "_HAS_NODISCARD" ]
+ }
+ } else {
+- cflags = [ "-Wall" ]
++ cflags = []
+ if (treat_warnings_as_errors) {
+ cflags += [ "-Werror" ]
+
+@@ -1534,10 +1524,6 @@ config("chromium_code") {
+ # well.
+ ldflags = [ "-Werror" ]
+ }
+- if (is_clang) {
+- # Enable extra warnings for chromium_code when we control the compiler.
+- cflags += [ "-Wextra" ]
+- }
+
+ # In Chromium code, we define __STDC_foo_MACROS in order to get the
+ # C99 macros on Mac and Linux.
+@@ -1546,15 +1532,6 @@ config("chromium_code") {
+ "__STDC_FORMAT_MACROS",
+ ]
+
+- if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
+- current_cpu != "s390" && current_cpu != "ppc64" &&
+- current_cpu != "mips" && current_cpu != "mips64") {
+- # Non-chromium code is not guaranteed to compile cleanly with
+- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
+- # disabled, so only do that for Release build.
+- defines += [ "_FORTIFY_SOURCE=2" ]
+- }
+-
+ if (is_mac) {
+ cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
+ cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
+@@ -1943,7 +1920,8 @@ config("default_stack_frames") {
+ }
+
+ # Default "optimization on" config.
+-config("optimize") {
++config("optimize") { }
++config("xoptimize") {
+ if (is_win) {
+ # TODO(thakis): Remove is_clang here, https://crbug.com/598772
+ if (is_official_build && full_wpo_on_official && !is_clang) {
+@@ -1977,7 +1955,8 @@ config("optimize") {
+ }
+
+ # Same config as 'optimize' but without the WPO flag.
+-config("optimize_no_wpo") {
++config("optimize_no_wpo") { }
++config("xoptimize_no_wpo") {
+ if (is_win) {
+ # Favor size over speed, /O1 must be before the common flags. The GYP
+ # build also specifies /Os and /GF but these are implied by /O1.
+@@ -2000,7 +1979,8 @@ config("optimize_no_wpo") {
+ }
+
+ # Turn off optimizations.
+-config("no_optimize") {
++config("no_optimize") { }
++config("xno_optimize") {
+ if (is_win) {
+ cflags = [
+ "/Od", # Disable optimization.
+@@ -2028,7 +2008,8 @@ config("no_optimize") {
+ # Turns up the optimization level. On Windows, this implies whole program
+ # optimization and link-time code generation which is very expensive and should
+ # be used sparingly.
+-config("optimize_max") {
++config("optimize_max") { }
++config("xoptimize_max") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2075,7 +2056,8 @@ config("optimize_max") {
+ #
+ # TODO(crbug.com/621335) - rework how all of these configs are related
+ # so that we don't need this disclaimer.
+-config("optimize_speed") {
++config("optimize_speed") { }
++config("xoptimize_speed") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2113,7 +2095,8 @@ config("optimize_speed") {
+ }
+ }
+
+-config("optimize_fuzzing") {
++config("optimize_fuzzing") { }
++config("xoptimize_fuzzing") {
+ cflags = [ "-O1" ] + common_optimize_on_cflags
+ ldflags = common_optimize_on_ldflags
+ visibility = [ ":default_optimization" ]
+@@ -2215,7 +2198,8 @@ config("win_pdbaltpath") {
+ }
+
+ # Full symbols.
+-config("symbols") {
++config("symbols") { }
++config("xsymbols") {
+ if (is_win) {
+ if (use_goma || is_clang) {
+ # Note that with VC++ this requires is_win_fastlink, enforced elsewhere.
+@@ -2325,7 +2309,8 @@ config("symbols") {
+ # Minimal symbols.
+ # This config guarantees to hold symbol for stack trace which are shown to user
+ # when crash happens in unittests running on buildbot.
+-config("minimal_symbols") {
++config("minimal_symbols") { }
++config("xminimal_symbols") {
+ if (is_win) {
+ # Linker symbols for backtraces only.
+ cflags = []
+@@ -2382,7 +2367,8 @@ config("minimal_symbols") {
+ }
+
+ # No symbols.
+-config("no_symbols") {
++config("no_symbols") { }
++config("xno_symbols") {
+ if (!is_win) {
+ cflags = [ "-g0" ]
+ asmflags = cflags
+--
+2.21.0
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch b/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
new file mode 100644
index 00000000000..4cb9503a93f
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
@@ -0,0 +1,14 @@
+--- a/base/strings/char_traits.h
++++ b/base/strings/char_traits.h
+@@ -67,9 +67,9 @@
+ return __builtin_memcmp(s1, s2, n);
+ #else
+ for (; n; --n, ++s1, ++s2) {
+- if (*s1 < *s2)
++ if ((unsigned char)*s1 < (unsigned char)*s2)
+ return -1;
+- if (*s1 > *s2)
++ if ((unsigned char)*s1 > (unsigned char)*s2)
+ return 1;
+ }
+ return 0;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch b/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
new file mode 100644
index 00000000000..1e09cb8044c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
@@ -0,0 +1,131 @@
+From 15d9b2515631cedcbd427e4c6de2dd4e7a0bfa36 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Sat, 4 Jan 2020 16:03:03 -0500
+Subject: [PATCH] GCC LTO Support
+
+---
+ build/config/BUILD.gn | 6 +++++-
+ build/config/compiler/BUILD.gn | 30 ++++++++++++++++++++++--------
+ build/config/compiler/compiler.gni | 2 +-
+ sandbox/linux/BUILD.gn | 3 +++
+ 4 files changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
+index 514ab7b..f8d36fe 100644
+--- a/build/config/BUILD.gn
++++ b/build/config/BUILD.gn
+@@ -260,9 +260,13 @@ config("default_libs") {
+ } else if (is_linux) {
+ libs = [
+ "dl",
+- "pthread",
+ "rt",
+ ]
++ ldflags = [
++ "-Wl,--no-as-needed",
++ "-lpthread",
++ "-Wl,--as-needed"
++ ]
+ }
+ }
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index a3f21b7..48747f7 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -558,12 +558,13 @@ config("compiler") {
+ # TODO(pcc): Make this conditional on is_official_build rather than on gn
+ # flags for specific features.
+ if (!is_debug && use_thin_lto && is_a_target_toolchain) {
+- assert(use_lld || target_os == "chromeos",
+- "gold plugin only supported with ChromeOS")
+-
+- cflags += [ "-flto=thin" ]
++ if (is_clang) {
++ cflags += [ "-flto=thin" ]
++ } else {
++ cflags += [ "-flto=2", "-fno-fat-lto-objects", "-fuse-linker-plugin" ]
++ }
+
+- if (target_os != "chromeos") {
++ if (target_os != "chromeos" && is_clang) {
+ cflags += [ "-fsplit-lto-unit" ]
+ }
+
+@@ -586,7 +587,11 @@ config("compiler") {
+ "-mllvm:-import-instr-limit=10",
+ ]
+ } else {
+- ldflags += [ "-flto=thin" ]
++ if (is_clang) {
++ ldflags += [ "-flto=thin" ]
++ } else {
++ ldflags += [ "-flto=8", "-fno-fat-lto-objects", "-fuse-linker-plugin" ]
++ }
+
+ # Limit the parallelism to avoid too aggressive competition between
+ # linker jobs. This is still suboptimal to a potential dynamic
+@@ -607,7 +612,7 @@ config("compiler") {
+ "-Wl,--thinlto-cache-policy,$cache_policy",
+ ]
+ }
+- } else {
++ } else if (is_clang) {
+ ldflags += [ "-Wl,-plugin-opt,jobs=8" ]
+ }
+
+@@ -630,7 +635,7 @@ config("compiler") {
+
+ # TODO(pcc): Re-enable this flag on Android. This will require libc++ to be
+ # built with ThinLTO (see https://crbug.com/767901) as well as the GVR shim.
+- if (!is_android) {
++ if (!is_android && is_clang) {
+ cflags += [ "-fwhole-program-vtables" ]
+ if (!is_win) {
+ ldflags += [ "-fwhole-program-vtables" ]
+@@ -697,6 +702,15 @@ config("compiler") {
+ }
+ }
+
++config("compiler_no_lto") {
++ cflags = []
++ ldflags = []
++ if (!is_debug && use_thin_lto && is_a_target_toolchain) {
++ cflags += ["-fno-lto"]
++ ldflags += ["-fno-lto"]
++ }
++}
++
+ # This provides the basic options to select the target CPU and ABI.
+ # It is factored out of "compiler" so that special cases can use this
+ # without using everything that "compiler" brings in. Options that
+diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
+index c351d6b..e567372 100644
+--- a/build/config/compiler/compiler.gni
++++ b/build/config/compiler/compiler.gni
+@@ -57,7 +57,7 @@ declare_args() {
+
+ # Enables support for ThinLTO, which links 3x-10x faster than full LTO. See
+ # also http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
+- use_thin_lto = is_cfi || (is_android && is_official_build)
++ use_thin_lto = false
+
+ # Tell VS to create a PDB that references information in .obj files rather
+ # than copying it all. This should improve linker performance. mspdbcmf.exe
+diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn
+index b00a88c..e4615c0 100644
+--- a/sandbox/linux/BUILD.gn
++++ b/sandbox/linux/BUILD.gn
+@@ -256,6 +256,9 @@ component("seccomp_bpf") {
+ "//base",
+ "//base/third_party/dynamic_annotations",
+ ]
++ configs += [
++ "//build/config/compiler:compiler_no_lto"
++ ]
+
+ if (is_nacl_nonsfi) {
+ cflags = [ "-fgnu-inline-asm" ]
+--
+2.24.1
+
diff --git a/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch b/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
new file mode 100644
index 00000000000..098b6832242
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
@@ -0,0 +1,20 @@
+--- a/build/toolchain/gcc_toolchain.gni 2019-11-19 02:27:43.000000000 +0100
++++ - 2020-07-21 00:59:09.201421469 +0200
+@@ -371,7 +371,7 @@
+ # .TOC file, overwrite it, otherwise, don't change it.
+ tocfile = sofile + ".TOC"
+
+- link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
++ link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -shared @\"$rspfile\""
+
+ # Generate a map file to be used for binary size analysis.
+ # Map file adds ~10% to the link time on a z620.
+@@ -450,7 +450,7 @@
+ unstripped_sofile = sofile
+ }
+
+- command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" @\"$rspfile\""
++ command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" -shared @\"$rspfile\""
+
+ if (defined(invoker.strip)) {
+ strip_command = "${invoker.strip} -o \"$sofile\" \"$unstripped_sofile\""
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch b/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
new file mode 100644
index 00000000000..0dace261a08
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
@@ -0,0 +1,11 @@
+--- src/build/toolchain/linux/unbundle/BUILD.gn 2020-07-21 17:36:34.064748261 +0200
++++ - 2020-07-21 17:39:03.115740522 +0200
+@@ -35,7 +35,7 @@
+ extra_ldflags = getenv("BUILD_LDFLAGS")
+
+ toolchain_args = {
+- current_cpu = current_cpu
++ current_cpu = host_cpu
+ current_os = current_os
+ }
+ }
diff --git a/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch b/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
new file mode 100644
index 00000000000..951a2adb196
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn
+index 3bc618a..e0ddf6d 100644
+--- a/third_party/perfetto/gn/BUILD.gn
++++ b/third_party/perfetto/gn/BUILD.gn
+@@ -244,7 +244,7 @@ if (enable_perfetto_trace_processor || perfetto_build_standalone ||
+ "//buildtools:zlib",
+ ]
+ } else {
+- public_configs = [ "//third_party/zlib:zlib_config" ]
++ public_configs = [ "//third_party/zlib:system_zlib" ]
+ public_deps = [
+ "//third_party/zlib",
+ ]
diff --git a/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch b/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
new file mode 100644
index 00000000000..d018a87094d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
@@ -0,0 +1,38 @@
+From 192fc3899f76e9487d77895f31df8d2d13bf9619 Mon Sep 17 00:00:00 2001
+From: Dale Curtis <dalecurtis@chromium.org>
+Date: Fri, 26 Jun 2020 01:10:55 +0000
+Subject: [PATCH] Force mp3 files to have a start time of zero.
+
+This will allow us to remove our custom patch which breaks upstream
+ffmpeg functionality for unknown reasons.
+
+R=sandersd
+
+Fixed: 1062037
+Change-Id: I253011843dee4dd6a8c958b14990ad836a9f1dca
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2268221
+Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
+Reviewed-by: Dan Sanders <sandersd@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#782792}
+---
+ media/filters/ffmpeg_demuxer.cc | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index 01266e1a072..a7ed542b5fc 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -1522,6 +1522,12 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
+ if (glue_->container() == container_names::CONTAINER_AVI)
+ format_context->flags |= AVFMT_FLAG_GENPTS;
+
++ // FFmpeg will incorrectly adjust the start time of MP3 files into the future
++ // based on discard samples. We were unable to fix this upstream without
++ // breaking ffmpeg functionality. https://crbug.com/1062037
++ if (glue_->container() == container_names::CONTAINER_MP3)
++ start_time_ = base::TimeDelta();
++
+ // For testing purposes, don't overwrite the timeline offset if set already.
+ if (timeline_offset_.is_null()) {
+ timeline_offset_ =
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..3d871a738ac
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,341 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.3.2
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64* aarch64*"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="$(vopt_if clang clang) yasm python pkgconf perl gperf bison ninja nodejs hwids
+ libwebp-devel freetype-devel harfbuzz-devel libpng-devel nss-devel which git libevent-devel
+ pciutils-devel libatomic-devel ffmpeg-devel libxml2-devel libglib-devel yarn openjdk libxslt-devel
+ opus-devel libXcursor-devel libXcomposite-devel libXtst-devel libXrandr-devel libXScrnSaver-devel
+ alsa-lib-devel re2-devel snappy-devel mit-krb5-devel"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel $(vopt_if pulseaudio pulseaudio-devel) libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel libatomic-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="4ede501f0d5ee3068474c9e2ac154cd23fdb3580c0cff5230d4ddcffe542e6ba
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+no_generic_pkgconfig_link=yes
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio clang"
+build_options_default="pulseaudio"
+
+if [ -z "$CROSS_BUILD" ]; then
+ build_options_default+=" clang"
+fi
+
+if [ "$build_option_clang" ]; then
+ nocross="No proper setup for using clang as cross compiler in void yet"
+elif [ "$CROSS_BUILD" ] && [ "${XBPS_TARGET_MACHINE%%-musl}" = "aarch64" ]; then
+ broken="{standard input}: Error: unaligned opcodes detected in executable segment"
+ # This might also happen with non-cross gcc?
+fi
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+_apply_patch() {
+ local args="$1" pname="$(basename $2)"
+
+ if [ ! -f ".${pname}_done" ]; then
+ msg_normal "$pkgver: patching: ${pname}.\n"
+ patch -N $args -i $2
+ touch .${pname}_done
+ fi
+}
+
+_get_chromium_arch() {
+ case "$1" in
+ x86_64*) echo x64 ;;
+ i686*) echo x86 ;;
+ arm*) echo arm ;;
+ aarch64*) echo arm64 ;;
+ ppc64*) echo ppc64 ;;
+ ppc*) echo ppc ;;
+ mipsel*) echo mipsel ;;
+ mips*) echo mips ;;
+ *) msg_error "$pkgver: cannot be compiled for ${XBPS_TARGET_MACHINE}.\n" ;;
+ esac
+}
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ electron*.patch)
+ cd src/electron
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+ cd $wrksrc
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ electron*.patch)
+ cd src/electron
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd "$wrksrc/$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ zlib
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local target_arch="$(_get_chromium_arch ${XBPS_TARGET_MACHINE})"
+ local host_arch="$(_get_chromium_arch ${XBPS_MACHINE})"
+ # the build system will set march for use, adding it to cflags will break builds
+ export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} )
+ export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} )
+ local conf=()
+ cd third_party/electron_node
+ if [ "$CROSS_BUILD" ]; then
+ conf_args=" --dest-cpu=${target_arch} --cross-compiling"
+ fi
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8 \
+ ${conf_args}
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ cd "$wrksrc/$build_wrksrc"
+
+ if [ "$build_option_clang" ]; then
+ export CC=clang
+ export CXX=clang++
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ else
+ export CXXFLAGS="$CXXFLAGS -fpermissive"
+ export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive"
+ export BUILD_AR="$AR_host"
+ export BUILD_NM="$NM_host"
+ fi
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ )
+ if [ "$CROSS_BUILD" ]; then
+ conf+=(
+ 'host_toolchain="//build/toolchain/linux/unbundle:host"'
+ 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
+ "host_pkg_config=\"$PKG_CONFIG_FOR_BUILD\""
+ "pkg_config=\"$PKG_CONFIG\""
+ )
+ else
+ conf+=(
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'
+ )
+ fi
+ conf+=(
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ "is_clang=$(vopt_if clang true false)"
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ "target_cpu=\"$target_arch\""
+ "host_cpu=\"$host_arch\""
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+ CC="${CC_FOR_BUILD:-$CC}" CXX="${CXX_FOR_BUILD:-$CXX}" LD="${LD_FOR_BUILD:-$LD}" \
+ CFLAGS="${CFLAGS_FOR_BUILD:-$CFLAGS}" CXXFLAGS="${CXXFLAGS_FOR_BUILD:-$CXXFLAGS}" \
+ LDFLAGS="${XBPS_LDFLAGS}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --skip-generate-buildfiles
+
+ msg_normal "Configuring build\n"
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} )
+ export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} )
+ if [ "$build_option_clang" ]; then
+ export CC=clang
+ export CXX=clang++
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ else
+ export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive"
+ export CXXFLAGS="$CXXFLAGS -fpermissive"
+ export BUILD_AR="$AR_host"
+ export BUILD_NM="$NM_host"
+ fi
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/$_buildtype electron third_party/electron_node:headers
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin/$pkgname
+}
diff --git a/srcpkgs/electron7/update b/srcpkgs/electron7/update
new file mode 100644
index 00000000000..3af8e58b535
--- /dev/null
+++ b/srcpkgs/electron7/update
@@ -0,0 +1,2 @@
+site=https://www.electronjs.org/releases/stable?version=${version%%.*}
+pattern='tag/v\K[\d\.]+(?=")'
From 87fe6cca380591a4c2609f5af180af78573cfdc8 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/2] vscode: built against system electron
[ci skip]
---
common/shlibs | 1 -
.../vscode/patches/dont-download-ffmpeg.patch | 14 ++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++--
srcpkgs/vscode/template | 28 +++++++++++++------
4 files changed, 36 insertions(+), 13 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/common/shlibs b/common/shlibs
index 4d3dfa3c7fe..993b3d4c18b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -125,7 +125,6 @@ libGLESv2.so discord-0.0.7_1
libGLESv2.so keybase-desktop-3.1.2_1
libGLESv2.so riot-desktop-0.17.9_2
libGLESv2.so wire-desktop-3.6.2885_1
-libGLESv2.so vscode-1.36.1_1
libGLESv2.so Signal-Desktop-1.23.2_1
libGLESv2.so slack-desktop-3.4.2_1
libbrcmEGL.so rpi-userland-20180103_2
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index f4251e89bcb..8132ac7e28c 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index 9624022dcd0..79266fd5288 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -1,10 +1,11 @@
# Template file for 'vscode'
pkgname=vscode
version=1.47.3
-revision=1
+revision=2
+_electronver=7.3.2
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils ripgrep electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -13,10 +14,6 @@ distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz"
checksum=463c8d5c3e02035ada5c0b9dcbb8718841fa27f6258838bfa4bab3a916ca16f3
patch_args="-Np1"
-# Due to electron
-archs="x86_64"
-nostrip_files="code-oss"
-
pre_build() {
# Use yarn to install dependencies
echo "" > build/npm/preinstall.js
@@ -26,6 +23,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +35,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Updated] system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (15 preceding siblings ...)
2020-08-16 13:36 ` [PR PATCH] [Updated] " Johnnynator
@ 2020-08-16 15:45 ` Johnnynator
2020-08-16 21:11 ` [PR PATCH] [Closed]: " Johnnynator
` (3 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-08-16 15:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
There is an updated pull request by Johnnynator against master on the void-packages repository
https://github.com/Johnnynator/void-packages electron
https://github.com/void-linux/void-packages/pull/21758
system wide electron package
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
A patch file from https://github.com/void-linux/void-packages/pull/21758.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-electron-21758.patch --]
[-- Type: text/x-diff, Size: 263996 bytes --]
From 7826d971626e191ef9eb0bc8c930fb50023140ac Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:16:39 +0200
Subject: [PATCH 1/2] New package: electron7-7.2.3
closes #21758
---
...musl-default-pthread-stacksize.patch.patch | 31 +
.../chromium-musl-sandbox.patch.patch | 176 ++
...um-musl_canonicalize_file_name.patch.patch | 13 +
.../chromium-musl_cdefs.patch.patch | 45 +
...musl_define_temp_failure_retry.patch.patch | 18 +
.../chromium-musl_dns.patch.patch | 61 +
.../chromium-musl_exeinfo.patch.patch | 96 ++
.../chromium-musl_fpstate_t.patch.patch | 48 +
.../chromium-musl_getcontext.patch.patch | 25 +
.../chromium-musl_mallinfo.patch.patch | 61 +
.../chromium-musl_pread_pwrite64.patch.patch | 18 +
.../chromium-musl_push_back.patch.patch | 13 +
.../chromium-musl_si_fields.patch.patch | 13 +
.../chromium-musl_stack_size.patch.patch | 41 +
.../chromium-musl_stack_trace.patch.patch | 44 +
.../chromium-musl_tcp_listen.patch.patch | 14 +
.../chromium-musl_wordsize.patch.patch | 24 +
...um-001-upstream_chrome_cleaner.patch.patch | 73 +
..._logs_from_test_cild_processes.patch.patch | 342 ++++
...pstream_move_child_process_log.patch.patch | 730 ++++++++
...pstream_use_childprocesslogger.patch.patch | 186 +++
...-005-upstream-chromium_version.patch.patch | 26 +
.../files/patches/chromium-77-clang.patch | 13 +
.../patches/chromium-77-pulseaudio-13.patch | 82 +
.../patches/chromium-77-system-icu.patch | 20 +
.../patches/chromium-78-gcc-alignas.patch | 102 ++
.../patches/chromium-78-gcc-enum-range.patch | 46 +
.../patches/chromium-78-gcc-noexcept.patch | 32 +
.../files/patches/chromium-78-icon.patch | 12 +
.../files/patches/chromium-78-include.patch | 40 +
.../files/patches/chromium-78-pm-crash.patch | 43 +
.../patches/chromium-78-protobuf-export.patch | 13 +
.../chromium-78-revert-noexcept-r1.patch | 1471 +++++++++++++++++
...romium-79-gcc-ambiguous-nodestructor.patch | 39 +
.../patches/chromium-79-gcc-includes.patch | 102 ++
.../patches/chromium-79-gcc-status-enum.patch | 31 +
.../files/patches/chromium-79-icu-65.patch | 13 +
.../files/patches/chromium-79-icu-67.patch | 167 ++
...chromium-chromium_atk_optional.patch.patch | 17 +
.../chromium-clang10_glslang.patch.patch | 25 +
.../files/patches/chromium-compiler-r10.patch | 185 +++
.../patches/chromium-fix-char_traits.patch | 14 +
.../chromium-fix-commandline-include.patch | 44 +
.../chromium-fix-sucess-definition.patch | 15 +
.../files/patches/chromium-gcc-lto.patch | 131 ++
.../files/patches/chromium-gcc-shared.patch | 20 +
.../patches/chromium-gn_bootstrap_ninja.patch | 32 +
.../files/patches/chromium-libc_malloc.patch | 26 +
.../patches/chromium-toolchain-host.patch | 11 +
.../patches/chromium-unbundle-zlib-r1.patch | 13 +
...3-files-to-have-a-start-time-of-zero.patch | 38 +
...a-script-to-list-patch-targets.patch.patch | 42 +
.../patches/electron-Build-fixes.patch.patch | 57 +
...ectron-dont-assume-python-is-python2.patch | 17 +
.../files/patches/electron-fix-includes.patch | 19 +
.../electron-mjsunit-not-exsit.patch.patch | 47 +
srcpkgs/electron7/template | 341 ++++
srcpkgs/electron7/update | 2 +
58 files changed, 5420 insertions(+)
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
create mode 100644 srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-clang.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-icon.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
create mode 100644 srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-fix-includes.patch
create mode 100644 srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
create mode 100644 srcpkgs/electron7/template
create mode 100644 srcpkgs/electron7/update
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
new file mode 100644
index 00000000000..d0c1361b8ed
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-default-pthread-stacksize.patch.patch
@@ -0,0 +1,31 @@
+diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
+index 095c49b..5044bb8 100644
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -186,7 +186,7 @@ void TerminateOnThread() {}
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ return (1 << 23);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
+index 621d441..be21106 100644
+--- a/chrome/app/shutdown_signal_handlers_posix.cc
++++ b/chrome/app/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,11 @@ void InstallShutdownSignalHandlers(
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 *8;
+ #else
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+- const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 *8;
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
new file mode 100644
index 00000000000..f485f6cc75a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl-sandbox.patch.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index 348ab6e..4550f9e 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 7dbcc87..589262f 100644
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..612fcfa 100644
+--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..1742acd 100644
+--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux + 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
+index a6afc62..7ed0a3b 100644
+--- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index 349504a..ea3c7c9 100644
+--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index 017f13c..50aeec3 100644
+--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ case __NR_sched_setscheduler:
+ return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
new file mode 100644
index 00000000000..05614daa757
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_canonicalize_file_name.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
+index 7eb7c20..882b736 100644
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++/* #undef HAVE_CANONICALIZE_FILE_NAME */
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
new file mode 100644
index 00000000000..fc7dc06ff21
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_cdefs.patch.patch
@@ -0,0 +1,45 @@
+diff --git a/base/allocator/allocator_shim_internals.h b/base/allocator/allocator_shim_internal
+s.h
+index 0196f89..bb42b5d 100644
+--- a/base/allocator/allocator_shim_internals.h
++++ b/base/allocator/allocator_shim_internals.h
+@@ -7,7 +7,9 @@
+
+ #if defined(__GNUC__)
+
++#if defined(__GLIBC__)
+ #include <sys/cdefs.h> // for __THROW
++#endif
+
+ #ifndef __THROW // Not a glibc system
+ #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead
+diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
+index 50ed0ac..7552a49 100644
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+
+ #include <linux/types.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
+
+ struct sync_legacy_merge_data {
+ int32_t fd2;
+@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
+ struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
+
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
new file mode 100644
index 00000000000..61db658f849
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_define_temp_failure_retry.patch.patch
@@ -0,0 +1,18 @@
+--- a/sandbox/linux/suid/sandbox.c 2019-11-19 09:28:05.000000000 +0800
++++ b/sandbox/linux/suid/sandbox.c 2020-04-24 11:50:12.719880728 +0800
+@@ -42,6 +42,15 @@
+ #define CLONE_NEWNET 0x40000000
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ static bool DropRoot();
+
+ #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
new file mode 100644
index 00000000000..f49d8bd0afa
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_dns.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
+index 2f94832..2dd1a98 100644
+--- a/net/dns/dns_config_service_posix.cc
++++ b/net/dns/dns_config_service_posix.cc
+@@ -150,7 +150,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #if !defined(OS_ANDROID)
+ ConfigParsePosixResult result;
+ // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
+-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+@@ -173,7 +173,7 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
+ #else
+ res_nclose(&res);
+ #endif // defined(OS_MACOSX) || defined(OS_FREEBSD)
+-#endif // defined(OS_OPENBSD)
++#endif // defined(OS_OPENBSD) || defined(OS_FUCHSIA) || (defined(OS_LINUX) && !defined(__GLIBC__))
+
+ #if defined(OS_MACOSX) && !defined(OS_IOS)
+ ConfigParsePosixResult error = DnsConfigWatcher::CheckDnsConfig();
+diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
+index 952cff4..4b366f4 100644
+--- a/net/dns/dns_reloader.cc
++++ b/net/dns/dns_reloader.cc
+@@ -4,7 +4,7 @@
+
+ #include "net/dns/dns_reloader.h"
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+
+ #include <resolv.h>
+diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
+index e8dea46..c86a830 100644
+--- a/net/dns/host_resolver_manager.cc
++++ b/net/dns/host_resolver_manager.cc
+@@ -2386,7 +2386,7 @@ HostResolverManager::HostResolverManager(
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID)
+ EnsureDnsReloaderInit();
+ #endif
+diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
+index 0824540..3384978 100644
+--- a/net/dns/host_resolver_proc.cc
++++ b/net/dns/host_resolver_proc.cc
+@@ -197,7 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
++#if defined(OS_POSIX) && defined(__GLIBC__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+ !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
+ DnsReloaderMaybeReload();
+ #endif
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
new file mode 100644
index 00000000000..f1afc7c1b17
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_exeinfo.patch.patch
@@ -0,0 +1,96 @@
+diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
+index de2f356..f697c66 100644
+--- a/base/debug/stack_trace_posix.cc
++++ b/base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -86,7 +86,7 @@ void DemangleSymbols(std::string* text) {
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@ void DemangleSymbols(std::string* text) {
+ search_from = mangled_start + 2;
+ }
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ }
+ #endif // !defined(USE_SYMBOLIZE)
+
+@@ -133,7 +133,7 @@ class BacktraceOutputHandler {
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@ void ProcessBacktrace(void* const* trace,
+ }
+ #endif // defined(USE_SYMBOLIZE)
+ }
+-#endif // !defined(__UCLIBC__) && !defined(_AIX)
++#endif // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+
+ void PrintToStderr(const char* output) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -828,7 +828,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -841,13 +841,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index 798f150..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -14,7 +14,7 @@
+ #define ENABLE_CRASH_OVERRIDES 1
+
+ /* Define to 1 if you have the `backtrace' function. */
+-#define HAVE_BACKTRACE 1
++/* #undef HAVE_BACKTRACE */
+
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -55,7 +55,7 @@
+ #define HAVE_ERRNO_H 1
+
+ /* Define to 1 if you have the <execinfo.h> header file. */
+-#define HAVE_EXECINFO_H 1
++/* #undef HAVE_EXECINFO_H */
+
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
new file mode 100644
index 00000000000..d8c41ccd9a0
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_fpstate_t.patch.patch
@@ -0,0 +1,48 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+index 6ee6cc1..a8f9ccc 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+index f830618..f3dde1f 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@ struct UContextReader {
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+index d1dc331..d1cc562 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@ class ExceptionHandler;
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
new file mode 100644
index 00000000000..7697243a910
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_getcontext.patch.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+index b895f6d..4f13352 100644
+--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,8 +677,10 @@ bool ExceptionHandler::WriteMinidump() {
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
++#endif
+ return false;
+
+ #if defined(__i386__)
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
new file mode 100644
index 00000000000..941313e4939
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_mallinfo.patch.patch
@@ -0,0 +1,61 @@
+diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
+index 044bd8d..0521321 100644
+--- a/base/process/process_metrics_posix.cc
++++ b/base/process/process_metrics_posix.cc
+@@ -110,14 +110,14 @@ size_t ProcessMetrics::GetMallocUsage() {
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+ struct mallinfo minfo = mallinfo();
+ #if BUILDFLAG(USE_TCMALLOC)
+ return minfo.uordblks;
+ #else
+ return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
+index e89597c..eca258c 100644
+--- a/base/trace_event/malloc_dump_provider.cc
++++ b/base/trace_event/malloc_dump_provider.cc
+@@ -132,7 +132,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
+ }
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(OS_LINUX) && defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+index aa98242..97acc7c 100644
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -130,7 +130,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+index 6e17020..d4a9ed0 100644
+--- a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+@@ -122,7 +122,7 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
+-#define HAVE_MALLINFO 1
++/* #undef HAVE_MALLINFO */
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
new file mode 100644
index 00000000000..2aeaaeb7593
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_pread_pwrite64.patch.patch
@@ -0,0 +1,18 @@
+diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
+index 5d9c2e8..2682349 100644
+--- a/third_party/lss/linux_syscall_support.h
++++ b/third_party/lss/linux_syscall_support.h
+@@ -166,6 +166,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
new file mode 100644
index 00000000000..cff340287da
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_push_back.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc
+index 08bf79c..3ee5353 100644
+--- a/net/socket/udp_socket_posix.cc
++++ b/net/socket/udp_socket_posix.cc
+@@ -1194,7 +1194,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, nullptr, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
new file mode 100644
index 00000000000..fdbefd27e2b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_si_fields.patch.patch
@@ -0,0 +1,13 @@
+diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
+index 003708d..b21414f 100644
+--- a/sandbox/linux/seccomp-bpf/trap.cc
++++ b/sandbox/linux/seccomp-bpf/trap.cc
+@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
new file mode 100644
index 00000000000..a4df7a3729b
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_size.patch.patch
@@ -0,0 +1,41 @@
+diff --git a/third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
+index b242164..1a0b519 100644
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -55,6 +55,9 @@ size_t GetUnderestimatedStackSize() {
+ pthread_attr_destroy(&attr);
+ #endif
+
++#if defined(OS_LINUX) && !defined(__GLIBC__)
++ return 0;
++#else
+ // Return a 512k stack size, (conservatively) assuming the following:
+ // - that size is much lower than the pthreads default (x86 pthreads has a 2M
+ // default.)
+@@ -62,6 +65,8 @@ size_t GetUnderestimatedStackSize() {
+ // low as 512k.
+ //
+ return 512 * 1024;
++#endif
++
+ #elif defined(OS_MACOSX)
+ // pthread_get_stacksize_np() returns too low a value for the main thread on
+ // OSX 10.9,
+@@ -97,7 +102,7 @@ return Threading::ThreadStackSize();
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+ defined(OS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
new file mode 100644
index 00000000000..9a1f2b04458
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_stack_trace.patch.patch
@@ -0,0 +1,44 @@
+diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
+index d8ca822..ffe1f08 100644
+--- a/base/debug/stack_trace.cc
++++ b/base/debug/stack_trace.cc
+@@ -225,7 +225,9 @@ void StackTrace::Print() const {
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -233,14 +233,14 @@ std::string StackTrace::ToString() const {
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+ }
+
+ std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
+-#if !defined(__UCLIBC__) & !defined(_AIX)
++#if defined(__GLIBC__) && !defined(__UCLIBC__) & !defined(_AIX)
+ s.OutputToStream(&os);
+ #else
+ os << "StackTrace::OutputToStream not implemented.";
+diff --git a/base/logging.cc b/base/logging.cc
+index 36b8bfc..dd830fe 100644
+--- a/base/logging.cc
++++ b/base/logging.cc
+@@ -607,7 +607,7 @@ LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+ #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+- !defined(OS_AIX)
++ !defined(OS_AIX) && defined(__GLIBC__)
+ if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
new file mode 100644
index 00000000000..fa62317b11a
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_tcp_listen.patch.patch
@@ -0,0 +1,14 @@
+diff --git a/content/public/common/socket_permission_request.h b/content/public/common/socket_permission_request.h
+index 7316621..6171219 100644
+--- a/content/public/common/socket_permission_request.h
++++ b/content/public/common/socket_permission_request.h
+@@ -9,6 +9,9 @@
+
+ #include <string>
+
++#ifdef TCP_LISTEN
++#undef TCP_LISTEN
++#endif
+
+ namespace content {
+
diff --git a/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
new file mode 100644
index 00000000000..6208cffafbe
--- /dev/null
+++ b/srcpkgs/electron7/files/musl-patches/chromium-musl_wordsize.patch.patch
@@ -0,0 +1,24 @@
+diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+index d03c7a8..78ca9dd 100644
+--- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@ class ElfCoreDump {
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
diff --git a/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
new file mode 100644
index 00000000000..57e94180c59
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-001-upstream_chrome_cleaner.patch.patch
@@ -0,0 +1,73 @@
+From c755ec847459d9d3807c22c2d4d6aa6f9c86dc7c Mon Sep 17 00:00:00 2001
+From: John Budorick <jbudorick@chromium.org>
+Date: Tue, 19 Nov 2019 22:24:20 +0000
+Subject: [PATCH] 3904: chrome_cleaner: ensure internal targets are reachable
+ from :gn_all.
+
+(cherry picked from commit eee513dfc780ad4bcaa74b67f2e0eaebf57b5c93)
+
+Bug: 984162, 1004848
+Change-Id: Ibb7c47f0188de8e077cd30aa8d68ca61133d2037
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904549
+Commit-Queue: John Budorick <jbudorick@chromium.org>
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#713683}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922299
+Cr-Commit-Position: refs/branch-heads/3904@{#895}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ BUILD.gn | 2 +-
+ chrome/chrome_cleaner/BUILD.gn | 23 ++++++++++++++++++++---
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/BUILD.gn b/BUILD.gn
+index 5e2f6b9b0f41c..ac0297608594f 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -604,7 +604,7 @@ group("gn_all") {
+ if (is_win) {
+ deps += [
+ "//base:pe_image_test",
+- "//chrome/chrome_cleaner:chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner",
+ "//chrome/chrome_elf:chrome_elf_unittests",
+ "//chrome/chrome_elf:dll_hash_main",
+ "//chrome/elevation_service:elevation_service_unittests",
+diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn
+index fbd2d8d5307aa..1671a3f7d097c 100644
+--- a/chrome/chrome_cleaner/BUILD.gn
++++ b/chrome/chrome_cleaner/BUILD.gn
+@@ -64,9 +64,6 @@ static_library("other_executable_definitions") {
+ }
+
+ test("chrome_cleaner_unittests") {
+- # Make this target findable from the "all" target used by the builders.
+- visibility += [ "//.:gn_all" ]
+-
+ sources = [
+ "//chrome/chrome_cleaner/test/test_main.cc",
+ ]
+@@ -126,3 +123,23 @@ test("chrome_cleaner_unittests") {
+ ]
+ }
+ }
++
++group("chrome_cleaner") {
++ testonly = true
++
++ # Make this target findable from the "all" target used by the builders.
++ visibility += [ "//.:gn_all" ]
++
++ deps = [
++ ":chrome_cleaner_unittests",
++ "//chrome/chrome_cleaner/executables:chrome_cleanup_tool",
++ "//chrome/chrome_cleaner/executables:software_reporter_tool",
++ ]
++
++ if (is_internal_chrome_cleaner_build) {
++ deps += [
++ "${chrome_cleaner_internal_root}:build_targets",
++ "${chrome_cleaner_internal_root}:test_targets",
++ ]
++ }
++}
diff --git a/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
new file mode 100644
index 00000000000..74b9fec59a7
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-002-upstream_save_logs_from_test_cild_processes.patch.patch
@@ -0,0 +1,342 @@
+From daec661f27bdfab79132d7d2c4637cc17fd4aa35 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:04:21 +0000
+Subject: [PATCH] Save logs from test child processes by redirecting stdout and
+ stderr.
+
+The previous solution can only capture logs after the child process
+creates a ScopedLogging object. We see flaky crashes in sandbox creation
+that happen before that so this will let us see the child process stack
+traces.
+
+Also moves some functions that were exported from ipc_test_util.h to be
+private to proto_chrome_prompt_ipc_unittest.cc, which is the only test
+that still uses them.
+
+(cherry picked from commit e7a755421136d7fc9b3a73a5e5464368f3efa7f9)
+
+Bug: 1030333
+Change-Id: Ie30eed3b16631721e81a420b3b70f1ec5f0d9a0c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948483
+Reviewed-by: proberge <proberge@chromium.org>
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721071}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951089
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#913}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 92 ++++++++++++-------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 13 ++-
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 17 ++--
+ chrome/chrome_cleaner/ipc/sandbox.cc | 5 +-
+ 4 files changed, 77 insertions(+), 50 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 05fc0d027ec43..0d03a6870fb07 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -13,6 +13,7 @@
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+ #include "base/files/file_util.h"
++#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+@@ -23,7 +24,6 @@
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/sandbox.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+
+ namespace chrome_cleaner {
+@@ -32,12 +32,13 @@ namespace {
+
+ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+-constexpr wchar_t kIPCTestUtilLogSuffix[] = L"ipc-test-util";
+-
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
+- : parent_process_(parent_process) {}
++ explicit MojoSandboxSetupHooks(
++ SandboxedParentProcess* parent_process,
++ base::win::ScopedHandle child_stdout_write_handle)
++ : parent_process_(parent_process),
++ child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -49,6 +50,8 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
++ policy->SetStdoutHandle(child_stdout_write_handle_.Get());
++ policy->SetStderrHandle(child_stdout_write_handle_.Get());
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -61,33 +64,14 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ private:
+ SandboxedParentProcess* parent_process_;
++ base::win::ScopedHandle child_stdout_write_handle_;
+ };
+
+ } // namespace
+
+ namespace internal {
+
+-base::FilePath::StringPieceType GetLogPathSuffix() {
+- return kIPCTestUtilLogSuffix;
+-}
+-
+-base::FilePath GetLogPath() {
+- return ScopedLogging::GetLogFilePath(kIPCTestUtilLogSuffix);
+-}
+-
+-bool DeleteChildProcessLogs() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = GetLogPath();
+- if (!base::DeleteFile(log_path, false)) {
+- LOG(ERROR) << "Can't delete log file from previous run: "
+- << log_path.value();
+- return false;
+- }
+- return true;
+-}
+-
+-void PrintChildProcessLogs() {
+- const base::FilePath log_path = GetLogPath();
++void PrintChildProcessLogs(const base::FilePath& log_path) {
+ if (log_path.empty()) {
+ LOG(ERROR) << "Child process log path is empty";
+ return;
+@@ -174,11 +158,38 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- if (!internal::DeleteChildProcessLogs())
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ base::ScopedTempDir temp_dir;
++ if (!temp_dir.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ base::FilePath temp_file_name;
++ if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ base::win::ScopedHandle child_stdout_write_handle(
++ ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_write_handle.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
+ return false;
++ }
+
+- if (!PrepareAndLaunchTestChildProcess(child_main_function))
++ if (!PrepareAndLaunchTestChildProcess(child_main_function,
++ std::move(child_stdout_write_handle))) {
++ internal::PrintChildProcessLogs(temp_file_name);
+ return false;
++ }
+
+ CreateImplOnIPCThread(std::move(mojo_pipe_));
+ const bool success = base::WaitForMultiprocessTestChildExit(
+@@ -189,21 +200,32 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ }
+ DestroyImplOnIPCThread();
+
+- if (!success || *exit_code != 0)
+- internal::PrintChildProcessLogs();
++ if (!success || *exit_code != 0) {
++ internal::PrintChildProcessLogs(temp_file_name);
++ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
++ launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
++ launch_options.stdin_handle = INVALID_HANDLE_VALUE;
++ launch_options.stdout_handle = child_stdout_write_handle.Get();
++ launch_options.stderr_handle = child_stdout_write_handle.Get();
++
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
++ // Now that it's been passed to the child process,
++ // |child_stdout_write_handle| can be closed in this process as it goes out
++ // of scope.
++
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -235,8 +257,9 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) {
+- MojoSandboxSetupHooks hooks(this);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) {
++ MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+@@ -258,8 +281,7 @@ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+
+ ChildProcess::ChildProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : mojo_task_runner_(mojo_task_runner),
+- command_line_(base::CommandLine::ForCurrentProcess()),
+- scopped_logging_(new ScopedLogging(kIPCTestUtilLogSuffix)) {
++ command_line_(base::CommandLine::ForCurrentProcess()) {
+ sandbox::TargetServices* target_services =
+ sandbox::SandboxFactory::GetTargetServices();
+ if (!target_services)
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 97f2072a09165..1b2e5598ed52a 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
++#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -70,7 +70,8 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function);
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+@@ -95,7 +96,8 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function) override;
++ const std::string& child_main_function,
++ base::win::ScopedHandle child_stdout_write_handle) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -120,7 +122,6 @@ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+
+ private:
+ base::CommandLine* command_line_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ // This will be true iff the process is running in a sandbox and
+ // TargetServices was initialized successfully.
+@@ -143,9 +144,7 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ };
+
+ namespace internal {
+-base::FilePath::StringPieceType GetLogPathSuffix();
+-bool DeleteChildProcessLogs();
+-void PrintChildProcessLogs();
++void PrintChildProcessLogs(const base::FilePath& log_file);
+ } // namespace internal
+
+ } // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index 1c7b4c575eb3d..f867df58f96ea 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,6 +5,7 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
++#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -41,8 +42,9 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-const base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+- 0xDFFF, 0xDBFF, 0};
++constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
++constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
++ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+ const base::FilePath kNonASCIIFilePath(L"ééààçç");
+ const base::string16 kInvalidRegistryKey(kInvalidUTF16String);
+@@ -420,8 +422,7 @@ class MockChrome {
+ class ChildProcess {
+ public:
+ ChildProcess()
+- : scopped_logging_(
+- std::make_unique<ScopedLogging>(internal::GetLogPathSuffix())) {
++ : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -630,7 +631,10 @@ class ParentProcess {
+ }
+
+ void Run() {
+- ASSERT_TRUE(internal::DeleteChildProcessLogs());
++ // Delete the child process log file if existing.
++ const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
++ ASSERT_TRUE(base::DeleteFile(log_path, false))
++ << "Can't delete log file from previous run: " << log_path.value();
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+@@ -702,7 +706,8 @@ class ParentProcess {
+ EXPECT_EQ(expected_exit_code, rv);
+
+ if (!success || rv != 0) {
+- internal::PrintChildProcessLogs();
++ internal::PrintChildProcessLogs(
++ ScopedLogging::GetLogFilePath(kLogSuffix));
+ }
+ }
+
+diff --git a/chrome/chrome_cleaner/ipc/sandbox.cc b/chrome/chrome_cleaner/ipc/sandbox.cc
+index 154bd05c51066..fafad4f0c6188 100644
+--- a/chrome/chrome_cleaner/ipc/sandbox.cc
++++ b/chrome/chrome_cleaner/ipc/sandbox.cc
+@@ -280,8 +280,9 @@ ResultCode StartSandboxTarget(const base::CommandLine& sandbox_command_line,
+ &last_win_error, &temp_process_info);
+ if (sandbox_result != sandbox::SBOX_ALL_OK) {
+ LOG(DFATAL) << "Failed to spawn sandbox target: " << sandbox_result
+- << " , last sandbox warning : " << last_sbox_warning
+- << " , last windows error: " << last_win_error;
++ << ", last sandbox warning: " << last_sbox_warning
++ << ", last windows error: "
++ << logging::SystemErrorCodeToString(last_win_error);
+ return RESULT_CODE_FAILED_TO_START_SANDBOX_PROCESS;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
new file mode 100644
index 00000000000..518b955a0b0
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-003-upstream_move_child_process_log.patch.patch
@@ -0,0 +1,730 @@
+From 726cbfcfaa521e9e5098829195a7d9a9c19ca391 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:15:36 +0000
+Subject: [PATCH] Move child process log capture to a ChildProcessLogger class.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update comments to clarify how the child process log interacts with
+ScopedLogging.
+
+Use the new class to capture logs in cleaner_test.cc,
+secure_dll_loading_test.cc and proto_chrome_prompt_ipc_unittest.cc.
+
+R=proberge
+
+(cherry picked from commit 063600229fb7dc472ff66839ba2657bf99b98850)
+
+Bug: 1030333
+Change-Id: I88f538ff360bb8ed9da6743dc5d6c4b263af992c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947986
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721184}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949631
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#914}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/chrome_cleaner/ipc/BUILD.gn | 1 +
+ chrome/chrome_cleaner/ipc/ipc_test_util.cc | 98 +++----------------
+ chrome/chrome_cleaner/ipc/ipc_test_util.h | 17 ++--
+ .../ipc/proto_chrome_prompt_ipc_unittest.cc | 26 +++--
+ chrome/chrome_cleaner/test/BUILD.gn | 3 +
+ .../test/child_process_logger.cc | 90 +++++++++++++++++
+ .../test/child_process_logger.h | 62 ++++++++++++
+ chrome/chrome_cleaner/test/cleaner_test.cc | 14 ++-
+ .../test/secure_dll_loading_test.cc | 57 ++---------
+ 9 files changed, 207 insertions(+), 161 deletions(-)
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.cc
+ create mode 100644 chrome/chrome_cleaner/test/child_process_logger.h
+
+diff --git a/chrome/chrome_cleaner/ipc/BUILD.gn b/chrome/chrome_cleaner/ipc/BUILD.gn
+index 03fddfd8736e1..4d81803a24df6 100644
+--- a/chrome/chrome_cleaner/ipc/BUILD.gn
++++ b/chrome/chrome_cleaner/ipc/BUILD.gn
+@@ -77,6 +77,7 @@ source_set("ipc_test_util") {
+ "//base/test:test_support",
+ "//chrome/chrome_cleaner/ipc:sandbox",
+ "//chrome/chrome_cleaner/logging:common",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/system",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+index 0d03a6870fb07..ea2bb2145bfdd 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
+@@ -12,14 +12,10 @@
+ #include "base/bind_helpers.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/process/launch.h"
+ #include "base/rand_util.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/test/multiprocess_test.h"
+ #include "base/test/test_timeouts.h"
+ #include "base/win/win_util.h"
+@@ -34,11 +30,8 @@ constexpr char kMojoPipeTokenSwitch[] = "mojo-pipe-token";
+
+ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ public:
+- explicit MojoSandboxSetupHooks(
+- SandboxedParentProcess* parent_process,
+- base::win::ScopedHandle child_stdout_write_handle)
+- : parent_process_(parent_process),
+- child_stdout_write_handle_(std::move(child_stdout_write_handle)) {}
++ explicit MojoSandboxSetupHooks(SandboxedParentProcess* parent_process)
++ : parent_process_(parent_process) {}
+ ~MojoSandboxSetupHooks() override = default;
+
+ // SandboxSetupHooks
+@@ -50,8 +43,7 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+ parent_process_->CreateMojoPipe(command_line, &handles_to_inherit);
+ for (HANDLE handle : handles_to_inherit)
+ policy->AddHandleToShare(handle);
+- policy->SetStdoutHandle(child_stdout_write_handle_.Get());
+- policy->SetStderrHandle(child_stdout_write_handle_.Get());
++ parent_process_->child_process_logger().UpdateSandboxPolicy(policy);
+ return RESULT_CODE_SUCCESS;
+ }
+
+@@ -69,38 +61,6 @@ class MojoSandboxSetupHooks : public SandboxSetupHooks {
+
+ } // namespace
+
+-namespace internal {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_path) {
+- if (log_path.empty()) {
+- LOG(ERROR) << "Child process log path is empty";
+- return;
+- }
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace internal
+-
+ ParentProcess::ParentProcess(scoped_refptr<MojoTaskRunner> mojo_task_runner)
+ : command_line_(base::GetMultiProcessTestChildBaseCommandLine()),
+ mojo_task_runner_(mojo_task_runner) {}
+@@ -158,36 +118,10 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ const std::string& child_main_function,
+ base::TimeDelta timeout,
+ int32_t* exit_code) {
+- // Adapted from
+- // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
+- base::ScopedTempDir temp_dir;
+- if (!temp_dir.CreateUniqueTempDir()) {
+- PLOG(ERROR) << "Could not create temp dir for child stdout";
++ if (!child_process_logger_.Initialize())
+ return false;
+- }
+-
+- base::FilePath temp_file_name;
+- if (!CreateTemporaryFileInDir(temp_dir.GetPath(), &temp_file_name)) {
+- PLOG(ERROR) << "Could not create temp file for child stdout";
+- return false;
+- }
+-
+- SECURITY_ATTRIBUTES attrs = {};
+- attrs.nLength = sizeof(attrs);
+- attrs.bInheritHandle = true;
+-
+- base::win::ScopedHandle child_stdout_write_handle(
+- ::CreateFile(temp_file_name.value().c_str(), GENERIC_WRITE,
+- FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
+- &attrs, OPEN_EXISTING, 0, nullptr));
+- if (!child_stdout_write_handle.IsValid()) {
+- PLOG(ERROR) << "Could not open child stdout file";
+- return false;
+- }
+-
+- if (!PrepareAndLaunchTestChildProcess(child_main_function,
+- std::move(child_stdout_write_handle))) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ if (!PrepareAndLaunchTestChildProcess(child_main_function)) {
++ child_process_logger_.DumpLogs();
+ return false;
+ }
+
+@@ -201,31 +135,22 @@ bool ParentProcess::LaunchConnectedChildProcess(
+ DestroyImplOnIPCThread();
+
+ if (!success || *exit_code != 0) {
+- internal::PrintChildProcessLogs(temp_file_name);
++ child_process_logger_.DumpLogs();
+ }
+
+ return success;
+ }
+
+ bool ParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
++ const std::string& child_main_function) {
+ base::LaunchOptions launch_options;
+ launch_options.handles_to_inherit = extra_handles_to_inherit_;
+- launch_options.handles_to_inherit.push_back(child_stdout_write_handle.Get());
+- launch_options.stdin_handle = INVALID_HANDLE_VALUE;
+- launch_options.stdout_handle = child_stdout_write_handle.Get();
+- launch_options.stderr_handle = child_stdout_write_handle.Get();
+-
++ child_process_logger_.UpdateLaunchOptions(&launch_options);
+ CreateMojoPipe(&command_line_, &launch_options.handles_to_inherit);
+
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ child_main_function, command_line_, launch_options);
+
+- // Now that it's been passed to the child process,
+- // |child_stdout_write_handle| can be closed in this process as it goes out
+- // of scope.
+-
+ ConnectMojoPipe(std::move(child_process));
+ return true;
+ }
+@@ -257,9 +182,8 @@ SandboxedParentProcess::SandboxedParentProcess(
+ SandboxedParentProcess::~SandboxedParentProcess() {}
+
+ bool SandboxedParentProcess::PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) {
+- MojoSandboxSetupHooks hooks(this, std::move(child_stdout_write_handle));
++ const std::string& child_main_function) {
++ MojoSandboxSetupHooks hooks(this);
+
+ // This switch usage is copied from SpawnMultiProcessTestChild.
+ //
+diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+index 1b2e5598ed52a..1526a42701353 100644
+--- a/chrome/chrome_cleaner/ipc/ipc_test_util.h
++++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
+@@ -14,9 +14,9 @@
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/time/time.h"
+-#include "base/win/scoped_handle.h"
+ #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h"
+ #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/platform/platform_channel.h"
+ #include "mojo/public/cpp/system/invitation.h"
+ #include "mojo/public/cpp/system/message_pipe.h"
+@@ -58,6 +58,10 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ return extra_handles_to_inherit_;
+ }
+
++ const ChildProcessLogger& child_process_logger() const {
++ return child_process_logger_;
++ }
++
+ protected:
+ friend base::RefCountedThreadSafe<ParentProcess>;
+ virtual ~ParentProcess();
+@@ -70,13 +74,13 @@ class ParentProcess : public base::RefCountedThreadSafe<ParentProcess> {
+ // as in the sandbox. Subclasses should call CreateMojoPipe before the
+ // subprocess is spawned and ConnectMojoPipe afterward.
+ virtual bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle);
++ const std::string& child_main_function);
+
+ scoped_refptr<MojoTaskRunner> mojo_task_runner();
+
+ base::CommandLine command_line_;
+ base::HandlesToInheritVector extra_handles_to_inherit_;
++ ChildProcessLogger child_process_logger_;
+
+ private:
+ scoped_refptr<MojoTaskRunner> mojo_task_runner_;
+@@ -96,8 +100,7 @@ class SandboxedParentProcess : public ParentProcess {
+ ~SandboxedParentProcess() override;
+
+ bool PrepareAndLaunchTestChildProcess(
+- const std::string& child_main_function,
+- base::win::ScopedHandle child_stdout_write_handle) override;
++ const std::string& child_main_function) override;
+ };
+
+ class ChildProcess : public base::RefCountedThreadSafe<ChildProcess> {
+@@ -143,10 +146,6 @@ class ChromePromptIPCTestErrorHandler : public ChromePromptIPC::ErrorHandler {
+ base::OnceClosure on_closed_after_done_;
+ };
+
+-namespace internal {
+-void PrintChildProcessLogs(const base::FilePath& log_file);
+-} // namespace internal
+-
+ } // namespace chrome_cleaner
+
+ #endif // CHROME_CHROME_CLEANER_IPC_IPC_TEST_UTIL_H_
+diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+index f867df58f96ea..e3ce2ab6c27fe 100644
+--- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
++++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
+@@ -5,7 +5,6 @@
+ #include <windows.h>
+
+ #include "base/command_line.h"
+-#include "base/files/file_util.h"
+ #include "base/process/process.h"
+ #include "base/strings/strcat.h"
+ #include "base/strings/string_number_conversions.h"
+@@ -19,7 +18,7 @@
+ #include "base/win/win_util.h"
+ #include "chrome/chrome_cleaner/ipc/ipc_test_util.h"
+ #include "chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h"
+-#include "chrome/chrome_cleaner/logging/scoped_logging.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h"
+ #include "components/chrome_cleaner/public/proto/chrome_prompt_for_tests.pb.h"
+@@ -42,7 +41,6 @@ constexpr char kExpectedPromptResultSwitch[] = "expected-prompt-result";
+ constexpr char kExpectedChromeDisconnectPointSwitch[] =
+ "expected-parent-disconnected";
+
+-constexpr base::char16 kLogSuffix[] = L"prompt-ipc-test";
+ constexpr base::char16 kInvalidUTF16String[] = {0xDC00, 0xD800, 0xD800, 0xDFFF,
+ 0xDFFF, 0xDBFF, 0};
+ const base::FilePath kInvalidFilePath(kInvalidUTF16String);
+@@ -421,8 +419,7 @@ class MockChrome {
+ // Gtest to log.
+ class ChildProcess {
+ public:
+- ChildProcess()
+- : scopped_logging_(std::make_unique<ScopedLogging>(kLogSuffix)) {
++ ChildProcess() {
+ mock_chrome_ = std::make_unique<MockChrome>(
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeReadHandleSwitch),
+ ExtractHandleFromCommandLine(chrome_cleaner::kChromeWriteHandleSwitch));
+@@ -571,7 +568,6 @@ class ChildProcess {
+
+ private:
+ std::unique_ptr<MockChrome> mock_chrome_;
+- std::unique_ptr<ScopedLogging> scopped_logging_;
+
+ ChromeDisconnectPoint expected_disconnect_point_ =
+ ChromeDisconnectPoint::kUnspecified;
+@@ -603,6 +599,9 @@ class ProtoChromePromptIPCTest
+ class ParentProcess {
+ public:
+ bool Initialize() {
++ if (!child_process_logger_.Initialize())
++ return false;
++
+ // Inject the flags related to the the config in the command line.
+ test_config_.EnhanceCommandLine(&command_line_);
+
+@@ -631,14 +630,13 @@ class ParentProcess {
+ }
+
+ void Run() {
+- // Delete the child process log file if existing.
+- const base::FilePath log_path = ScopedLogging::GetLogFilePath(kLogSuffix);
+- ASSERT_TRUE(base::DeleteFile(log_path, false))
+- << "Can't delete log file from previous run: " << log_path.value();
++ child_process_logger_.UpdateLaunchOptions(&launch_options_);
+
+ // Pass the command to the child process and launch the child process.
+ base::Process child_process = base::SpawnMultiProcessTestChild(
+ "ProtoChromePromptIPCClientMain", command_line_, launch_options_);
++ if (!child_process.IsRunning())
++ child_process_logger_.DumpLogs();
+ ASSERT_TRUE(child_process.IsRunning());
+
+ // Close our references to the handles as they are now handled by the child
+@@ -705,10 +703,8 @@ class ParentProcess {
+
+ EXPECT_EQ(expected_exit_code, rv);
+
+- if (!success || rv != 0) {
+- internal::PrintChildProcessLogs(
+- ScopedLogging::GetLogFilePath(kLogSuffix));
+- }
++ if (!success || rv != 0)
++ child_process_logger_.DumpLogs();
+ }
+
+ TestConfig& GetTestConfig() { return test_config_; }
+@@ -732,6 +728,8 @@ class ParentProcess {
+ // Blocks until we receive the response from Chrome or an error occurs.
+ base::RunLoop main_runloop_;
+ bool error_occurred_ = false;
++
++ ChildProcessLogger child_process_logger_;
+ };
+
+ // This contains calls to the chrome_cleaner_ipc implementation.
+diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn
+index 118454c2bdcd2..4b053fdcaf182 100644
+--- a/chrome/chrome_cleaner/test/BUILD.gn
++++ b/chrome/chrome_cleaner/test/BUILD.gn
+@@ -148,6 +148,8 @@ source_set("test_util") {
+ testonly = true
+
+ sources = [
++ "child_process_logger.cc",
++ "child_process_logger.h",
+ "file_remover_test_util.cc",
+ "file_remover_test_util.h",
+ "reboot_deletion_helper.cc",
+@@ -228,6 +230,7 @@ source_set("integration_test_sources") {
+ "//chrome/chrome_cleaner/os:common_os",
+ "//chrome/chrome_cleaner/pup_data:pup_data_base",
+ "//chrome/chrome_cleaner/pup_data:test_uws",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//chrome/chrome_cleaner/zip_archiver:common",
+ "//components/chrome_cleaner/public/constants",
+ "//components/chrome_cleaner/test:test_name_helper",
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.cc b/chrome/chrome_cleaner/test/child_process_logger.cc
+new file mode 100644
+index 0000000000000..9f4836267aea6
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.cc
+@@ -0,0 +1,90 @@
++// Copyright 2019 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.
++
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
++
++#include <vector>
++
++#include "base/files/file_util.h"
++#include "base/logging.h"
++#include "base/strings/string_piece.h"
++#include "base/strings/string_split.h"
++
++namespace chrome_cleaner {
++
++ChildProcessLogger::ChildProcessLogger() = default;
++
++ChildProcessLogger::~ChildProcessLogger() = default;
++
++bool ChildProcessLogger::Initialize() {
++ // Adapted from
++ // https://cs.chromium.org/chromium/src/sandbox/win/src/handle_inheritance_test.cc
++ if (!temp_dir_.CreateUniqueTempDir()) {
++ PLOG(ERROR) << "Could not create temp dir for child stdout";
++ return false;
++ }
++
++ if (!CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_file_name_)) {
++ PLOG(ERROR) << "Could not create temp file for child stdout";
++ return false;
++ }
++
++ SECURITY_ATTRIBUTES attrs = {};
++ attrs.nLength = sizeof(attrs);
++ attrs.bInheritHandle = true;
++
++ child_stdout_handle_.Set(
++ ::CreateFile(temp_file_name_.value().c_str(), GENERIC_WRITE,
++ FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
++ &attrs, OPEN_EXISTING, 0, nullptr));
++ if (!child_stdout_handle_.IsValid()) {
++ PLOG(ERROR) << "Could not open child stdout file";
++ return false;
++ }
++
++ return true;
++}
++
++void ChildProcessLogger::UpdateLaunchOptions(
++ base::LaunchOptions* options) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ options->handles_to_inherit.push_back(child_stdout_handle_.Get());
++ options->stdin_handle = INVALID_HANDLE_VALUE;
++ options->stdout_handle = child_stdout_handle_.Get();
++ options->stderr_handle = child_stdout_handle_.Get();
++}
++
++void ChildProcessLogger::UpdateSandboxPolicy(
++ sandbox::TargetPolicy* policy) const {
++ DCHECK(child_stdout_handle_.IsValid());
++ policy->SetStdoutHandle(child_stdout_handle_.Get());
++ policy->SetStderrHandle(child_stdout_handle_.Get());
++}
++
++void ChildProcessLogger::DumpLogs() const {
++ DCHECK(!temp_file_name_.empty());
++
++ if (!base::PathExists(temp_file_name_)) {
++ LOG(ERROR) << "Child process log file doesn't exist";
++ return;
++ }
++
++ // Collect the child process log file, and dump the contents, to help
++ // debugging failures.
++ std::string log_file_contents;
++ if (!base::ReadFileToString(temp_file_name_, &log_file_contents)) {
++ LOG(ERROR) << "Failed to read child process log file";
++ return;
++ }
++
++ std::vector<base::StringPiece> lines =
++ base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
++ base::SPLIT_WANT_NONEMPTY);
++ LOG(ERROR) << "Dumping child process logs";
++ for (const auto& line : lines) {
++ LOG(ERROR) << "Child process: " << line;
++ }
++}
++
++} // namespace chrome_cleaner
+diff --git a/chrome/chrome_cleaner/test/child_process_logger.h b/chrome/chrome_cleaner/test/child_process_logger.h
+new file mode 100644
+index 0000000000000..215fa911d7899
+--- /dev/null
++++ b/chrome/chrome_cleaner/test/child_process_logger.h
+@@ -0,0 +1,62 @@
++// Copyright 2019 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.
++
++#ifndef CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++#define CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
++
++#include "base/files/scoped_temp_dir.h"
++#include "base/process/launch.h"
++#include "base/win/scoped_handle.h"
++#include "sandbox/win/src/sandbox_policy.h"
++
++namespace chrome_cleaner {
++
++// Redirects stdin and stdout of a child process to a temp file. Tests that
++// spawn children can add the contents of the temp file to the test output.
++//
++// Note that if the child process sets up ScopedLogging, ERROR and FATAL level
++// logs will still be captured by this, but other logs will start going to the
++// ScopedLogging log file. test_main.cc sets up ScopedLogging so usually this
++// class will capture:
++//
++// 1. All log lines from before the ScopedLogging constructor.
++// 2. ERROR and FATAL log lines from after that.
++// 3. stdout and stderr output that doesn't go through the logging system.
++// 4. Stack traces from any crashes.
++//
++// This should be all that's needed to diagnose errors in tests.
++class ChildProcessLogger {
++ public:
++ ChildProcessLogger();
++ ~ChildProcessLogger();
++
++ // Creates a temp file for child processes to log to. Logs an error and
++ // returns false on failure.
++ bool Initialize();
++
++ // Updates |options| to direct the child stdout and stderr to the temp file.
++ // For use with base::LaunchProcess and base::SpawnMultiProcessTestChild.
++ void UpdateLaunchOptions(base::LaunchOptions* options) const;
++
++ // Updates |policy| to direct the child stdout and stderr to the temp file.
++ // For use with sandbox::BrokerServices::SpawnTarget.
++ void UpdateSandboxPolicy(sandbox::TargetPolicy* policy) const;
++
++ // Writes every line in the temp file using LOG(ERROR) so that all lines are
++ // captured in the test suite output. The class-level comment above describes
++ // which log lines from the child will be captured.
++ void DumpLogs() const;
++
++ private:
++ ChildProcessLogger(const ChildProcessLogger& other) = delete;
++ ChildProcessLogger& operator=(const ChildProcessLogger& other) = delete;
++
++ base::ScopedTempDir temp_dir_;
++ base::FilePath temp_file_name_;
++ base::win::ScopedHandle child_stdout_handle_;
++};
++
++} // namespace chrome_cleaner
++
++#endif // CHROME_CHROME_CLEANER_TEST_CHILD_PROCESS_LOGGER_H_
+diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc
+index d6df17e3516f1..f778103bfdad3 100644
+--- a/chrome/chrome_cleaner/test/cleaner_test.cc
++++ b/chrome/chrome_cleaner/test/cleaner_test.cc
+@@ -24,6 +24,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/pup_data/pup_data.h"
+ #include "chrome/chrome_cleaner/pup_data/test_uws.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+@@ -311,8 +312,14 @@ class CleanerTest
+
+ void ExpectExitCode(const base::CommandLine& command_line,
+ int expected_exit_code) {
+- base::Process process(
+- base::LaunchProcess(command_line, base::LaunchOptions()));
++ chrome_cleaner::ChildProcessLogger logger;
++ ASSERT_TRUE(logger.Initialize());
++
++ base::LaunchOptions options;
++ logger.UpdateLaunchOptions(&options);
++ base::Process process(base::LaunchProcess(command_line, options));
++ if (!process.IsValid())
++ logger.DumpLogs();
+ ASSERT_TRUE(process.IsValid());
+
+ int exit_code = -1;
+@@ -320,7 +327,8 @@ class CleanerTest
+ base::TimeDelta::FromMinutes(10), &exit_code);
+ EXPECT_TRUE(exited_within_timeout);
+ EXPECT_EQ(expected_exit_code, exit_code);
+-
++ if (!exited_within_timeout || expected_exit_code != exit_code)
++ logger.DumpLogs();
+ if (!exited_within_timeout)
+ process.Terminate(/*exit_code=*/-1, /*wait=*/false);
+ }
+diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+index fe10c44346b5e..92e2db19fde6c 100644
+--- a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
++++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
+@@ -8,22 +8,17 @@
+
+ #include <memory>
+ #include <set>
+-#include <string>
+ #include <vector>
+
+ #include "base/base_paths.h"
+ #include "base/command_line.h"
+ #include "base/files/file_path.h"
+-#include "base/files/file_util.h"
+-#include "base/files/scoped_temp_dir.h"
+ #include "base/logging.h"
+ #include "base/path_service.h"
+ #include "base/process/launch.h"
+ #include "base/process/process.h"
+ #include "base/strings/string16.h"
+ #include "base/strings/string_number_conversions.h"
+-#include "base/strings/string_piece.h"
+-#include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/synchronization/waitable_event.h"
+ #include "base/test/test_timeouts.h"
+@@ -32,54 +27,16 @@
+ #include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h"
+ #include "chrome/chrome_cleaner/os/inheritable_event.h"
+ #include "chrome/chrome_cleaner/os/process.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/test_util.h"
+ #include "components/chrome_cleaner/public/constants/constants.h"
+ #include "components/chrome_cleaner/test/test_name_helper.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+
+-namespace {
+-
+-void PrintChildProcessLogs(const base::FilePath& log_dir,
+- base::StringPiece16 file_name) {
+- base::string16 base_name;
+- if (file_name == L"software_reporter_tool") {
+- base_name = L"software_reporter_tool";
+- } else if (file_name == L"chrome_cleanup_tool") {
+- base_name = L"chrome_cleanup";
+- } else {
+- LOG(ERROR) << "Unknown file name " << file_name.data();
+- return;
+- }
+-
+- base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log");
+-
+- if (!base::PathExists(log_path)) {
+- LOG(ERROR) << "Child process log file doesn't exist";
+- return;
+- }
+-
+- // Collect the child process log file, and dump the contents, to help
+- // debugging failures.
+- std::string log_file_contents;
+- if (!base::ReadFileToString(log_path, &log_file_contents)) {
+- LOG(ERROR) << "Failed to read child process log file";
+- return;
+- }
+-
+- std::vector<base::StringPiece> lines =
+- base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE,
+- base::SPLIT_WANT_NONEMPTY);
+- LOG(ERROR) << "Dumping child process logs";
+- for (const auto& line : lines) {
+- LOG(ERROR) << "Child process: " << line;
+- }
+-}
+-
+-} // namespace
+-
+ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ protected:
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
+ base::FilePath out_dir;
+ ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir));
+ exe_path_ = out_dir.Append(GetParam() + L".exe");
+@@ -104,8 +61,6 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ base::NumberToString16(
+ base::win::HandleToUint32(init_done_notifier->handle())));
+ command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch);
+- command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch,
+- log_dir.GetPath());
+
+ #if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD)
+ if (disable_secure_dll_loading)
+@@ -121,7 +76,12 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+
+ base::LaunchOptions options;
+ options.handles_to_inherit.push_back(init_done_notifier->handle());
++ child_process_logger_.UpdateLaunchOptions(&options);
+ base::Process process = base::LaunchProcess(command_line, options);
++ if (!process.IsValid()) {
++ child_process_logger_.DumpLogs();
++ return process;
++ }
+
+ // Make sure the process has finished its initialization (including loading
+ // DLLs). Also check the process handle in case it exits with an error.
+@@ -136,7 +96,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code));
+ ADD_FAILURE() << "Process exited with " << exit_code
+ << " before signalling init_done_notifier";
+- PrintChildProcessLogs(log_dir.GetPath(), GetParam());
++ child_process_logger_.DumpLogs();
+ } else {
+ EXPECT_EQ(wait_result, WAIT_OBJECT_0);
+ }
+@@ -157,6 +117,7 @@ class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> {
+ }
+
+ private:
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ base::FilePath exe_path_;
+ base::FilePath empty_dll_path_;
+ };
diff --git a/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
new file mode 100644
index 00000000000..6a2a4893d44
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-004-upstream_use_childprocesslogger.patch.patch
@@ -0,0 +1,186 @@
+From 890956be1496b625967df0bbf620e8fc4aefb390 Mon Sep 17 00:00:00 2001
+From: Joe Mason <joenotcharles@google.com>
+Date: Wed, 4 Dec 2019 18:22:34 +0000
+Subject: [PATCH] Use ChildProcessLogger in FileRemoverQuarantineTest and
+ SandboxedShortcutParserTest
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+R=proberge
+
+(cherry picked from commit 814583834ebf35ede5dad0ba3574343851b1a8bd)
+
+Bug: 1030333
+Change-Id: I66b9b3dc73980e8ed03ee37d89eb172b5330c913
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948235
+Commit-Queue: Joe Mason <joenotcharles@chromium.org>
+Reviewed-by: proberge <proberge@chromium.org>
+Cr-Original-Commit-Position: refs/heads/master@{#721193}
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948102
+Reviewed-by: Joe Mason <joenotcharles@chromium.org>
+Cr-Commit-Position: refs/branch-heads/3904@{#915}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ .../os/file_remover_unittest.cc | 39 ++++++++++++++++---
+ .../parsers/shortcut_parser/broker/BUILD.gn | 1 +
+ .../sandboxed_shortcut_parser_unittest.cc | 35 +++++++++++++++--
+ 3 files changed, 67 insertions(+), 8 deletions(-)
+
+diff --git a/chrome/chrome_cleaner/os/file_remover_unittest.cc b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+index 52c9b4f1c5089..c57983e83c6b9 100644
+--- a/chrome/chrome_cleaner/os/file_remover_unittest.cc
++++ b/chrome/chrome_cleaner/os/file_remover_unittest.cc
+@@ -30,6 +30,7 @@
+ #include "chrome/chrome_cleaner/os/pre_fetched_paths.h"
+ #include "chrome/chrome_cleaner/os/system_util.h"
+ #include "chrome/chrome_cleaner/os/whitelisted_directory.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "chrome/chrome_cleaner/test/file_remover_test_util.h"
+ #include "chrome/chrome_cleaner/test/reboot_deletion_helper.h"
+ #include "chrome/chrome_cleaner/test/resources/grit/test_resources.h"
+@@ -398,20 +399,47 @@ constexpr wchar_t kTestExpectArchiveName[] =
+ L"temp_file.exe_"
+ L"A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E.zip";
+
++class LoggedZipArchiverSandboxSetupHooks : public ZipArchiverSandboxSetupHooks {
++ public:
++ explicit LoggedZipArchiverSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ZipArchiverSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ZipArchiverSandboxSetupHooks::UpdateSandboxPolicy(policy,
++ command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ void SetUp() override {
+ use_reboot_removal_ = GetParam();
+
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ scoped_refptr<MojoTaskRunner> mojo_task_runner = MojoTaskRunner::Create();
+- ZipArchiverSandboxSetupHooks setup_hooks(
++ LoggedZipArchiverSandboxSetupHooks setup_hooks(
+ mojo_task_runner.get(), base::BindOnce([] {
+ FAIL() << "ZipArchiver sandbox connection error";
+- }));
+- ASSERT_EQ(RESULT_CODE_SUCCESS,
+- StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ }),
++ &child_process_logger_);
++ ResultCode result_code =
++ StartSandboxTarget(MakeCmdLine("FileRemoverQuarantineTargetMain"),
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
+
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+
+@@ -447,6 +475,7 @@ class FileRemoverQuarantineTest : public base::MultiProcessTest,
+ base::test::SingleThreadTaskEnvironment task_environment_;
+ base::ScopedTempDir temp_dir_;
+ std::unique_ptr<FileRemover> file_remover_;
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ } // namespace
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+index bc7ba8188c83b..09ed07b761a4e 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/BUILD.gn
+@@ -67,6 +67,7 @@ source_set("unittest_sources") {
+ "//chrome/chrome_cleaner/parsers/shortcut_parser:sandboxed_lnk_parser_test_util",
+ "//chrome/chrome_cleaner/parsers/shortcut_parser/target:lnk_parser",
+ "//chrome/chrome_cleaner/parsers/target:parser_sandbox_target",
++ "//chrome/chrome_cleaner/test:test_util",
+ "//mojo/public/cpp/bindings:bindings",
+ "//sandbox/win:sandbox",
+ "//testing/gtest",
+diff --git a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+index 64ac91ed92016..4c033f21c77c3 100644
+--- a/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
++++ b/chrome/chrome_cleaner/parsers/shortcut_parser/broker/sandboxed_shortcut_parser_unittest.cc
+@@ -18,6 +18,7 @@
+ #include "chrome/chrome_cleaner/parsers/broker/sandbox_setup_hooks.h"
+ #include "chrome/chrome_cleaner/parsers/shortcut_parser/sandboxed_lnk_parser_test_util.h"
+ #include "chrome/chrome_cleaner/parsers/target/sandbox_setup.h"
++#include "chrome/chrome_cleaner/test/child_process_logger.h"
+ #include "mojo/public/cpp/bindings/interface_request.h"
+ #include "mojo/public/cpp/system/platform_handle.h"
+ #include "sandbox/win/src/sandbox_factory.h"
+@@ -31,6 +32,26 @@ constexpr unsigned int kDirQuantity = 5;
+
+ const base::string16 kLnkArguments = L"-a -b -c -d GenericExample";
+
++class LoggedParserSandboxSetupHooks : public ParserSandboxSetupHooks {
++ public:
++ explicit LoggedParserSandboxSetupHooks(
++ scoped_refptr<MojoTaskRunner> mojo_task_runner,
++ base::OnceClosure connection_error_handler,
++ chrome_cleaner::ChildProcessLogger* child_process_logger)
++ : ParserSandboxSetupHooks(std::move(mojo_task_runner),
++ std::move(connection_error_handler)),
++ child_process_logger_(child_process_logger) {}
++
++ ResultCode UpdateSandboxPolicy(sandbox::TargetPolicy* policy,
++ base::CommandLine* command_line) override {
++ child_process_logger_->UpdateSandboxPolicy(policy);
++ return ParserSandboxSetupHooks::UpdateSandboxPolicy(policy, command_line);
++ }
++
++ private:
++ chrome_cleaner::ChildProcessLogger* child_process_logger_;
++};
++
+ } // namespace
+
+ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+@@ -40,14 +61,20 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ temp_dirs_with_chrome_lnk_(kDirQuantity) {}
+
+ void SetUp() override {
++ ASSERT_TRUE(child_process_logger_.Initialize());
++
+ mojo_task_runner_ = MojoTaskRunner::Create();
+ ParserSandboxSetupHooks setup_hooks(
+ mojo_task_runner_.get(),
+ base::BindOnce([] { FAIL() << "Parser sandbox connection error"; }));
+- ASSERT_EQ(
+- RESULT_CODE_SUCCESS,
++
++ ResultCode result_code =
+ StartSandboxTarget(MakeCmdLine("SandboxedShortcutParserTargetMain"),
+- &setup_hooks, SandboxType::kTest));
++ &setup_hooks, SandboxType::kTest);
++ if (result_code != RESULT_CODE_SUCCESS)
++ child_process_logger_.DumpLogs();
++ ASSERT_EQ(RESULT_CODE_SUCCESS, result_code);
++
+ parser_ptr_ = setup_hooks.TakeParserPtr();
+ shortcut_parser_ = std::make_unique<SandboxedShortcutParser>(
+ mojo_task_runner_.get(), parser_ptr_.get());
+@@ -98,6 +125,8 @@ class SandboxedShortcutParserTest : public base::MultiProcessTest {
+ base::FilePath not_lnk_file_path_;
+
+ base::test::TaskEnvironment task_environment_;
++
++ chrome_cleaner::ChildProcessLogger child_process_logger_;
+ };
+
+ MULTIPROCESS_TEST_MAIN(SandboxedShortcutParserTargetMain) {
diff --git a/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
new file mode 100644
index 00000000000..65b8ef4df0a
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-005-upstream-chromium_version.patch.patch
@@ -0,0 +1,26 @@
+From c1109b707b1eda5d98eb2ed6bd74083bc352f482 Mon Sep 17 00:00:00 2001
+From: chrome-release-bot <chrome-release-bot@chromium.org>
+Date: Fri, 6 Dec 2019 01:09:50 +0000
+Subject: [PATCH] Incrementing VERSION to 78.0.3904.130
+
+TBR=govind@chromium.org
+
+Change-Id: Ib675653e2605cf2c15ebdbd1320465b08a49994d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954709
+Reviewed-by: Chrome Release Bot (LUCI) <chrome-official-brancher@chops-service-accounts.iam.gserviceaccount.com>
+Cr-Commit-Position: refs/branch-heads/3904@{#917}
+Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
+---
+ chrome/VERSION | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/VERSION b/chrome/VERSION
+index 7a4383a1ccb7f..50f887f746227 100644
+--- a/chrome/VERSION
++++ b/chrome/VERSION
+@@ -1,4 +1,4 @@
+ MAJOR=78
+ MINOR=0
+ BUILD=3904
+-PATCH=108
++PATCH=130
diff --git a/srcpkgs/electron7/files/patches/chromium-77-clang.patch b/srcpkgs/electron7/files/patches/chromium-77-clang.patch
new file mode 100644
index 00000000000..a57b5a458a4
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-clang.patch
@@ -0,0 +1,13 @@
+diff --git a/base/location.h b/base/location.h
+index c07e747..924db1c 100644
+--- a/base/location.h
++++ b/base/location.h
+@@ -18,7 +18,7 @@
+
+ namespace base {
+
+-#if defined(__has_builtin)
++#if defined(__clang__)
+ // Clang allows detection of these builtins.
+ #define SUPPORTS_LOCATION_BUILTINS \
+ (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \
diff --git a/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch b/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
new file mode 100644
index 00000000000..892a3183c9d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-pulseaudio-13.patch
@@ -0,0 +1,82 @@
+From 7ac85fb4cc6f44a21761a591ac497ae3d6bf966d Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Date: Mon, 23 Sep 2019 13:49:53 +0200
+Subject: [PATCH] Fix building with pulseaudio 13
+
+The function signature changed though the ABI stayed the same.
+
+(Modified to apply on chromium sources too)
+
+Change-Id: I86ca361b5e4f0c523e1031910df438c23beee876
+Fixes: QTBUG-77037
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+
+diff --git a/media/audio/pulse/pulse.sigs b/media/audio/pulse/pulse.sigs
+index 8b58887..daaeb14 100644
+--- a/media/audio/pulse/pulse.sigs
++++ b/media/audio/pulse/pulse.sigs
+@@ -24,11 +24,11 @@
+ pa_operation* pa_context_get_source_info_by_name(pa_context* c, const char* name, pa_source_info_cb_t cb, void *userdata);
+ pa_operation* pa_context_get_source_info_list(pa_context* c, pa_source_info_cb_t cb, void* userdata);
+ pa_operation* pa_context_get_sink_info_list(pa_context* c, pa_sink_info_cb_t cb, void* userdata);
+-pa_context_state_t pa_context_get_state(pa_context* c);
++pa_context_state_t pa_context_get_state(const_pa_context_ptr c);
+ pa_context* pa_context_new(pa_mainloop_api* mainloop, const char* name);
+ pa_operation* pa_context_set_source_volume_by_index(pa_context* c, uint32_t idx, const pa_cvolume* volume, pa_context_success_cb_t cb, void* userdata);
+ void pa_context_set_state_callback(pa_context* c, pa_context_notify_cb_t cb, void* userdata);
+-pa_operation_state_t pa_operation_get_state(pa_operation* o);
++pa_operation_state_t pa_operation_get_state(const_pa_operation_ptr o);
+ void pa_context_unref(pa_context* c);
+ void pa_operation_unref(pa_operation* o);
+ int pa_stream_begin_write(pa_stream* p, void** data, size_t* nbytes);
+@@ -38,23 +38,23 @@
+ int pa_stream_disconnect(pa_stream* s);
+ int pa_stream_drop(pa_stream *p);
+ pa_operation* pa_stream_flush(pa_stream* s, pa_stream_success_cb_t cb, void* userdata);
+-uint32_t pa_stream_get_device_index(pa_stream* s);
++uint32_t pa_stream_get_device_index(const_pa_stream_ptr s);
+ int pa_stream_get_latency(pa_stream* s, pa_usec_t* r_usec, int* negative);
+-pa_stream_state_t pa_stream_get_state(pa_stream* p);
++pa_stream_state_t pa_stream_get_state(const_pa_stream_ptr p);
+ pa_stream* pa_stream_new(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map * map);
+ pa_stream* pa_stream_new_with_proplist(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map* map, pa_proplist* p);
+ pa_proplist* pa_proplist_new(void);
+-int pa_proplist_contains(pa_proplist* p, const char* key);
++int pa_proplist_contains(const_pa_proplist_ptr p, const char* key);
+ void pa_proplist_free(pa_proplist* p);
+-const char* pa_proplist_gets(pa_proplist* p, const char* key);
++const char* pa_proplist_gets(const_pa_proplist_ptr p, const char* key);
+ int pa_proplist_sets(pa_proplist* p, const char* key, const char* value);
+-size_t pa_stream_readable_size(pa_stream *p);
++size_t pa_stream_readable_size(const_pa_stream_ptr p);
+ int pa_stream_peek(pa_stream* p, const void** data, size_t* nbytes);
+ void pa_stream_set_read_callback(pa_stream* p, pa_stream_request_cb_t cb, void* userdata);
+ void pa_stream_set_state_callback(pa_stream* s, pa_stream_notify_cb_t cb, void* userdata);
+ int pa_stream_write(pa_stream* p, const void* data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
+ void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
+ void pa_stream_unref(pa_stream* s);
+-int pa_context_errno(pa_context *c);
++int pa_context_errno(const_pa_context_ptr c);
+ const char* pa_strerror(int error);
+ pa_cvolume* pa_cvolume_set(pa_cvolume* a, unsigned channels, pa_volume_t v);
+diff --git a/chromium/media/audio/pulse/pulse_stub_header.fragment b/chromium/media/audio/pulse/pulse_stub_header.fragment
+index 2a2d3e7..cdaa841 100644
+--- a/media/audio/pulse/pulse_stub_header.fragment
++++ b/media/audio/pulse/pulse_stub_header.fragment
+@@ -5,4 +5,15 @@
+
+ #include <pulse/pulseaudio.h>
+
++#if PA_MAJOR > 12
++typedef const pa_context* const_pa_context_ptr;
++typedef const pa_operation* const_pa_operation_ptr;
++typedef const pa_proplist* const_pa_proplist_ptr;
++typedef const pa_stream* const_pa_stream_ptr;
++#else
++typedef pa_context* const_pa_context_ptr;
++typedef pa_operation* const_pa_operation_ptr;
++typedef pa_proplist* const_pa_proplist_ptr;
++typedef pa_stream* const_pa_stream_ptr;
++#endif
+ }
diff --git a/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch b/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
new file mode 100644
index 00000000000..1f848d7ee2b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-77-system-icu.patch
@@ -0,0 +1,20 @@
+diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
+index 4450e40..9ca36dd 100644
+--- a/build/linux/unbundle/icu.gn
++++ b/build/linux/unbundle/icu.gn
+@@ -96,6 +96,7 @@ shim_headers("icui18n_shim") {
+ "unicode/fpositer.h",
+ "unicode/gender.h",
+ "unicode/gregocal.h",
++ "unicode/listformatter.h",
+ "unicode/measfmt.h",
+ "unicode/measunit.h",
+ "unicode/measure.h",
+@@ -178,7 +179,6 @@ shim_headers("icuuc_shim") {
+ "unicode/icudataver.h",
+ "unicode/icuplug.h",
+ "unicode/idna.h",
+- "unicode/listformatter.h",
+ "unicode/localpointer.h",
+ "unicode/locdspnm.h",
+ "unicode/locid.h",
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
new file mode 100644
index 00000000000..bce4118596b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-alignas.patch
@@ -0,0 +1,102 @@
+From 6b633c4b14850df376d5cec571699018772f358e Mon Sep 17 00:00:00 2001
+From: Tomas Popela <tomas.popela@gmail.com>
+Date: Tue, 17 Sep 2019 19:48:48 +0000
+Subject: [PATCH] GCC: Can't use alignas() together with __attribute__()
+
+It's because GCC has problems when mixing the alignas() together with
+__attribute__() (that is used to export the symbols). The best
+solution is to use ALIGNAS() macro from //base/compiler_specific.h
+together with alignof() to have the equal functionality that compiles on
+GCC as well as on clang.
+
+Bug: 819294
+Change-Id: Ieb169592a2965f17a18bfc88d28418eb723a4e5a
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806735
+Auto-Submit: Tom Popela <tomas.popela@gmail.com>
+Commit-Queue: Alex Clarke <alexclarke@chromium.org>
+Reviewed-by: Alex Clarke <alexclarke@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#697330}
+---
+
+diff --git a/base/task/promise/dependent_list.h b/base/task/promise/dependent_list.h
+index 020bdbfc..3245c1c 100644
+--- a/base/task/promise/dependent_list.h
++++ b/base/task/promise/dependent_list.h
+@@ -59,7 +59,7 @@
+
+ // Align Node on an 8-byte boundary to ensure the first 3 bits are 0 and can
+ // be used to store additional state (see static_asserts below).
+- class BASE_EXPORT alignas(8) Node {
++ class BASE_EXPORT ALIGNAS(8) Node {
+ public:
+ Node();
+ explicit Node(Node&& other) noexcept;
+
+Re-use chromium alignas workaround in protobuf.
+---
+
+diff --git a/third_party/protobuf/src/google/protobuf/port_def.inc b/third_party/protobuf/src/google/protobuf/port_def.inc
+index f1bd85d..9c204a1 100644
+--- a/third_party/protobuf/src/google/protobuf/port_def.inc
++++ b/third_party/protobuf/src/google/protobuf/port_def.inc
+@@ -528,6 +528,35 @@ PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
+ #undef IN
+ #endif // _MSC_VER
+
++// Specify memory alignment for structs, classes, etc.
++// Use like:
++// class PROTOBUF_ALIGNAS(16) MyClass { ... }
++// PROTOBUF_ALIGNAS(16) int array[4];
++//
++// In most places you can use the C++11 keyword "alignas", which is preferred.
++//
++// But compilers have trouble mixing __attribute__((...)) syntax with
++// alignas(...) syntax.
++//
++// Doesn't work in clang or gcc:
++// struct alignas(16) __attribute__((packed)) S { char c; };
++// Works in clang but not gcc:
++// struct __attribute__((packed)) alignas(16) S2 { char c; };
++// Works in clang and gcc:
++// struct alignas(16) S3 { char c; } __attribute__((packed));
++//
++// There are also some attributes that must be specified *before* a class
++// definition: visibility (used for exporting functions/classes) is one of
++// these attributes. This means that it is not possible to use alignas() with a
++// class that is marked as exported.
++#if defined(_MSC_VER)
++#define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
++#elif defined(__GNUC__)
++#define PROTOBUF_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
++#else
++#define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
++#endif
++
+ #if defined(__clang__)
+ #pragma clang diagnostic push
+ // TODO(gerbens) ideally we cleanup the code. But a cursory try shows many
+diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h
+index dedc221..a8515ce 100644
+--- a/third_party/protobuf/src/google/protobuf/arena.h
++++ b/third_party/protobuf/src/google/protobuf/arena.h
+@@ -245,7 +245,7 @@ struct ArenaOptions {
+ // well as protobuf container types like RepeatedPtrField and Map. The protocol
+ // is internal to protobuf and is not guaranteed to be stable. Non-proto types
+ // should not rely on this protocol.
+-class PROTOBUF_EXPORT alignas(8) Arena final {
++class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
+ public:
+ // Arena constructor taking custom options. See ArenaOptions below for
+ // descriptions of the options available.
+diff --git a/third_party/protobuf/src/google/protobuf/port_undef.inc b/third_party/protobuf/src/google/protobuf/port_undef.inc
+index b7e67fe..ba1fffc 100644
+--- a/third_party/protobuf/src/google/protobuf/port_undef.inc
++++ b/third_party/protobuf/src/google/protobuf/port_undef.inc
+@@ -80,6 +80,7 @@
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport
+ #undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
++#undef PROTOBUF_ALIGNAS
+
+
+
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
new file mode 100644
index 00000000000..9c15e954b4e
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-enum-range.patch
@@ -0,0 +1,46 @@
+From 9662ec844017690d5fd56bf0f05ef6a540dd29c1 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Mon, 09 Sep 2019 19:06:01 +0000
+Subject: [PATCH] Fix GCC build error
+
+Fixes this error:
+[ 375s] In file included from ../../base/task/common/intrusive_heap.h:8,
+[ 375s] from ../../base/task/thread_pool/task_source.h:17,
+[ 375s] from ../../base/task/thread_pool/task_tracker.h:27,
+[ 375s] from ./../../base/task/thread_pool/service_thread.cc:14,
+[ 375s] from gen/base/base_jumbo_28.cc:5:
+[ 375s] ../../base/containers/intrusive_heap.h:152:36: error: enumerator value
+ '-1' is outside the range of underlying type 'size_t' {aka 'long unsigned int'}
+[ 375s] 152 | enum : size_t { kInvalidIndex = -1 };
+[ 375s] |
+
+Change-Id: I6044fb704931b2f8416f6b19a247ae297cd7b0d6
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792763
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Commit-Queue: Lei Zhang <thestig@chromium.org>
+Reviewed-by: Lei Zhang <thestig@chromium.org>
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#694853}
+---
+
+diff --git a/base/containers/intrusive_heap.h b/base/containers/intrusive_heap.h
+index 53d3909..d7626bb 100644
+--- a/base/containers/intrusive_heap.h
++++ b/base/containers/intrusive_heap.h
+@@ -131,6 +131,7 @@
+
+ #include <algorithm>
+ #include <functional>
++#include <limits>
+ #include <type_traits>
+ #include <utility>
+ #include <vector>
+@@ -149,7 +150,7 @@
+ // in place.
+ class BASE_EXPORT HeapHandle {
+ public:
+- enum : size_t { kInvalidIndex = -1 };
++ enum : size_t { kInvalidIndex = std::numeric_limits<size_t>::max() };
+
+ constexpr HeapHandle() = default;
+ constexpr HeapHandle(const HeapHandle& other) = default;
diff --git a/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch b/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
new file mode 100644
index 00000000000..8ddb53fe82d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-gcc-noexcept.patch
@@ -0,0 +1,32 @@
+From d16cda8fc3476cc534a756873cc8aa2692a57054 Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <jose.dapena@lge.com>
+Date: Thu, 22 Aug 2019 13:13:36 +0200
+Subject: [PATCH] GCC: declare noexcept move constructor/assign operators of V8StackTraceId
+
+blink::BlinkCloneableMessage declares default implementation of
+move operator/assign operator that requires v8_inspector::V8StackTraceId
+to declare its move constructor/assign operator too.
+
+Bug: chromium:819294
+Change-Id: Iaf626ee8245efcba372a17cdf2de448e691d41d6
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1796062
+Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
+Reviewed-by: Yang Guo <yangguo@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#63799}
+---
+
+diff --git a/v8/include/v8-inspector.h b/v8/include/v8-inspector.h
+index ce5b777..ed4cdec 100644
+--- a/v8/include/v8-inspector.h
++++ b/v8/include/v8-inspector.h
+@@ -231,7 +231,10 @@ struct V8_EXPORT V8StackTraceId {
+ std::pair<int64_t, int64_t> debugger_id;
+
+ V8StackTraceId();
++ V8StackTraceId(const V8StackTraceId&) = default;
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id);
++ V8StackTraceId& operator=(const V8StackTraceId&) = default;
++ V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default;
+ ~V8StackTraceId() = default;
+
+ bool IsInvalid() const;
diff --git a/srcpkgs/electron7/files/patches/chromium-78-icon.patch b/srcpkgs/electron7/files/patches/chromium-78-icon.patch
new file mode 100644
index 00000000000..2cca7f10d19
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-icon.patch
@@ -0,0 +1,12 @@
+diff --git a/ui/platform_window/x11/x11_window.cc b/ui/platform_window/x11/x11_window.cc
+index 7a3a6eb..7c01534 100644
+--- a/ui/platform_window/x11/x11_window.cc
++++ b/ui/platform_window/x11/x11_window.cc
+@@ -67,6 +67,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig(
+ config.wm_role_name = properties.wm_role_name;
+ config.activatable = properties.activatable;
+ config.visual_id = properties.x_visual_id;
++ config.icon = properties.icon;
+ return config;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-78-include.patch b/srcpkgs/electron7/files/patches/chromium-78-include.patch
new file mode 100644
index 00000000000..3db38eac1c9
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-include.patch
@@ -0,0 +1,40 @@
+From bbfe2665923225b4a7c436ba2b6c7e5f695f2e52 Mon Sep 17 00:00:00 2001
+From: David Landell <landell@vewd.com>
+Date: Fri, 13 Sep 2019 12:24:13 +0000
+Subject: [PATCH] Add missing include for unique_ptr
+
+Change-Id: I614d2f42868d563eb6a92dfb2aae08286e20d687
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803137
+Reviewed-by: Henrik Boström <hbos@chromium.org>
+Commit-Queue: Henrik Boström <hbos@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#696355}
+---
+
+diff --git a/third_party/blink/public/platform/web_rtc_rtp_source.h b/third_party/blink/public/platform/web_rtc_rtp_source.h
+index 959440f..c3fd542 100644
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h
+@@ -5,6 +5,8 @@
+ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_RTP_SOURCE_H_
+ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_RTP_SOURCE_H_
+
++#include <memory>
++
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
+
+Missing include due to reverting ProfileManagerObserver
+---
+
+diff --git a/chrome/browser/web_applications/extensions/bookmark_app_util.cc b/chrome/browser/web_applications/extensions/bookmark_app_util.cc
+index ee4b70a..b31e5f5 100644
+--- a/chrome/browser/web_applications/extensions/bookmark_app_util.cc
++++ b/chrome/browser/web_applications/extensions/bookmark_app_util.cc
+@@ -7,6 +7,7 @@
+ #include "base/strings/string_piece.h"
+ #include "base/values.h"
+ #include "chrome/browser/extensions/extension_service.h"
++#include "chrome/browser/profiles/profile.h"
+ #include "chrome/browser/web_applications/components/app_registrar.h"
+ #include "chrome/browser/web_applications/components/web_app_provider_base.h"
+ #include "chrome/common/chrome_features.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch b/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
new file mode 100644
index 00000000000..ada266120dc
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-pm-crash.patch
@@ -0,0 +1,43 @@
+From e73aed9a5ef15102f29ac31b70290faf5c90f9fe Mon Sep 17 00:00:00 2001
+From: Evan Stade <estade@chromium.org>
+Date: Wed, 16 Oct 2019 16:01:32 +0000
+Subject: [PATCH] Fix shutdown crash in ProfileManager.
+
+OnProfileMarkedForPermanentDeletion should move from
+ProfileManagerObserver to ProfileObserver, which would also
+fix this bug. However, changing the order of members is the
+quickest and most cherry-pick-able way to avoid the crash.
+
+Bug: 1005244
+Change-Id: If2db68c846dd418cd02864b57b9b543687fa1e03
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863518
+Auto-Submit: Evan Stade <estade@chromium.org>
+Reviewed-by: David Roger <droger@chromium.org>
+Commit-Queue: Evan Stade <estade@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#706467}
+---
+
+diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h
+index b60df76d..7d02af7 100644
+--- a/chrome/browser/profiles/profile_manager.h
++++ b/chrome/browser/profiles/profile_manager.h
+@@ -409,6 +409,10 @@ class ProfileManager : public content::NotificationObserver,
+ const base::FilePath& profile_dir);
+ #endif // !defined(OS_ANDROID)
+
++ // Destroy after |profile_info_cache_| since Profile destruction may trigger
++ // some observers to unregister themselves.
++ base::ObserverList<ProfileManagerObserver> observers_;
++
+ // Object to cache various information about profiles. Contains information
+ // about every profile which has been created for this instance of Chrome,
+ // if it has not been explicitly deleted. It must be destroyed after
+@@ -450,8 +454,6 @@ class ProfileManager : public content::NotificationObserver,
+ // Controls whether to initialize some services. Only disabled for testing.
+ bool do_final_services_init_ = true;
+
+- base::ObserverList<ProfileManagerObserver> observers_;
+-
+ // TODO(chrome/browser/profiles/OWNERS): Usage of this in profile_manager.cc
+ // should likely be turned into DCHECK_CURRENTLY_ON(BrowserThread::UI) for
+ // consistency with surrounding code in the same file but that wasn't trivial
diff --git a/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch b/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
new file mode 100644
index 00000000000..ddb9e80eefe
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-protobuf-export.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/protobuf/src/google/protobuf/repeated_field.h b/third_party/protobuf/src/google/protobuf/repeated_field.h
+index b5b193c..4434854 100644
+--- a/third_party/protobuf/src/google/protobuf/repeated_field.h
++++ b/third_party/protobuf/src/google/protobuf/repeated_field.h
+@@ -804,7 +804,7 @@ class StringTypeHandler {
+ // RepeatedPtrField is like RepeatedField, but used for repeated strings or
+ // Messages.
+ template <typename Element>
+-class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
++class PROTOBUF_EXPORT RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
+ public:
+ RepeatedPtrField();
+ explicit RepeatedPtrField(Arena* arena);
diff --git a/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch b/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
new file mode 100644
index 00000000000..408d618b541
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-78-revert-noexcept-r1.patch
@@ -0,0 +1,1471 @@
+From 37a95dd93e553888c00cf9443a5ec738ce658e65 Mon Sep 17 00:00:00 2001
+From: Zinovy Nis <zynis@yandex-team.ru>
+Date: Mon, 16 Sep 2019 13:08:17 +0000
+Subject: [PATCH] Revert "[clang-tidy] add noexcept for move ctors and operator= in blink"
+
+This reverts commit 8f3eea10fe63a64ac67dc21542ebee6b896156a3.
+
+Reason for revert: code bloating
+
+Original change's description:
+> [clang-tidy] add noexcept for move ctors and operator= in blink
+>
+> Bug: 994915
+> Change-Id: I2e1bcf286a2d2fa6613e18b5268098a0d258fb2e
+> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759163
+> Commit-Queue: Zinovy Nis <zynis@yandex-team.ru>
+> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
+> Reviewed-by: Mike West <mkwst@chromium.org>
+> Cr-Commit-Position: refs/heads/master@{#688676}
+
+TBR=jbroman@chromium.org,foolip@chromium.org,mkwst@chromium.org,zynis@yandex-team.ru
+
+# Not skipping CQ checks because original CL landed > 1 day ago.
+
+Bug: 994915
+Change-Id: I12b3ecc1186e27809082dc399c6d6864109ce307
+---
+
+diff --git a/third_party/blink/common/indexeddb/indexeddb_key_path.cc b/third_party/blink/common/indexeddb/indexeddb_key_path.cc
+index ec2b618..552d541 100644
+--- a/third_party/blink/common/indexeddb/indexeddb_key_path.cc
++++ b/third_party/blink/common/indexeddb/indexeddb_key_path.cc
+@@ -18,12 +18,12 @@
+ : type_(mojom::IDBKeyPathType::Array), array_(array) {}
+
+ IndexedDBKeyPath::IndexedDBKeyPath(const IndexedDBKeyPath& other) = default;
+-IndexedDBKeyPath::IndexedDBKeyPath(IndexedDBKeyPath&& other) noexcept = default;
++IndexedDBKeyPath::IndexedDBKeyPath(IndexedDBKeyPath&& other) = default;
+ IndexedDBKeyPath::~IndexedDBKeyPath() = default;
+ IndexedDBKeyPath& IndexedDBKeyPath::operator=(const IndexedDBKeyPath& other) =
+ default;
+-IndexedDBKeyPath& IndexedDBKeyPath::operator=(
+- IndexedDBKeyPath&& other) noexcept = default;
++IndexedDBKeyPath& IndexedDBKeyPath::operator=(IndexedDBKeyPath&& other) =
++ default;
+
+ const std::vector<base::string16>& IndexedDBKeyPath::array() const {
+ DCHECK(type_ == blink::mojom::IDBKeyPathType::Array);
+diff --git a/third_party/blink/common/indexeddb/indexeddb_metadata.cc b/third_party/blink/common/indexeddb/indexeddb_metadata.cc
+index 50d5845..9349732 100644
+--- a/third_party/blink/common/indexeddb/indexeddb_metadata.cc
++++ b/third_party/blink/common/indexeddb/indexeddb_metadata.cc
+@@ -23,15 +23,15 @@
+
+ IndexedDBIndexMetadata::IndexedDBIndexMetadata(
+ const IndexedDBIndexMetadata& other) = default;
+-IndexedDBIndexMetadata::IndexedDBIndexMetadata(
+- IndexedDBIndexMetadata&& other) noexcept = default;
++IndexedDBIndexMetadata::IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other) =
++ default;
+
+ IndexedDBIndexMetadata::~IndexedDBIndexMetadata() = default;
+
+ IndexedDBIndexMetadata& IndexedDBIndexMetadata::operator=(
+ const IndexedDBIndexMetadata& other) = default;
+ IndexedDBIndexMetadata& IndexedDBIndexMetadata::operator=(
+- IndexedDBIndexMetadata&& other) noexcept = default;
++ IndexedDBIndexMetadata&& other) = default;
+
+ bool IndexedDBIndexMetadata::operator==(
+ const IndexedDBIndexMetadata& other) const {
+@@ -56,14 +56,14 @@
+ IndexedDBObjectStoreMetadata::IndexedDBObjectStoreMetadata(
+ const IndexedDBObjectStoreMetadata& other) = default;
+ IndexedDBObjectStoreMetadata::IndexedDBObjectStoreMetadata(
+- IndexedDBObjectStoreMetadata&& other) noexcept = default;
++ IndexedDBObjectStoreMetadata&& other) = default;
+
+ IndexedDBObjectStoreMetadata::~IndexedDBObjectStoreMetadata() = default;
+
+ IndexedDBObjectStoreMetadata& IndexedDBObjectStoreMetadata::operator=(
+ const IndexedDBObjectStoreMetadata& other) = default;
+ IndexedDBObjectStoreMetadata& IndexedDBObjectStoreMetadata::operator=(
+- IndexedDBObjectStoreMetadata&& other) noexcept = default;
++ IndexedDBObjectStoreMetadata&& other) = default;
+
+ bool IndexedDBObjectStoreMetadata::operator==(
+ const IndexedDBObjectStoreMetadata& other) const {
+@@ -87,14 +87,14 @@
+ IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata(
+ const IndexedDBDatabaseMetadata& other) = default;
+ IndexedDBDatabaseMetadata::IndexedDBDatabaseMetadata(
+- IndexedDBDatabaseMetadata&& other) noexcept = default;
++ IndexedDBDatabaseMetadata&& other) = default;
+
+ IndexedDBDatabaseMetadata::~IndexedDBDatabaseMetadata() = default;
+
+ IndexedDBDatabaseMetadata& IndexedDBDatabaseMetadata::operator=(
+ const IndexedDBDatabaseMetadata& other) = default;
+ IndexedDBDatabaseMetadata& IndexedDBDatabaseMetadata::operator=(
+- IndexedDBDatabaseMetadata&& other) noexcept = default;
++ IndexedDBDatabaseMetadata&& other) = default;
+
+ bool IndexedDBDatabaseMetadata::operator==(
+ const IndexedDBDatabaseMetadata& other) const {
+diff --git a/third_party/blink/common/mediastream/media_devices.cc b/third_party/blink/common/mediastream/media_devices.cc
+index 93df201..3661b4b 100644
+--- a/third_party/blink/common/mediastream/media_devices.cc
++++ b/third_party/blink/common/mediastream/media_devices.cc
+@@ -13,8 +13,7 @@
+ WebMediaDeviceInfo::WebMediaDeviceInfo(const WebMediaDeviceInfo& other) =
+ default;
+
+-WebMediaDeviceInfo::WebMediaDeviceInfo(WebMediaDeviceInfo&& other) noexcept =
+- default;
++WebMediaDeviceInfo::WebMediaDeviceInfo(WebMediaDeviceInfo&& other) = default;
+
+ WebMediaDeviceInfo::WebMediaDeviceInfo(const std::string& device_id,
+ const std::string& label,
+@@ -36,8 +35,8 @@
+ WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(
+ const WebMediaDeviceInfo& other) = default;
+
+-WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(
+- WebMediaDeviceInfo&& other) noexcept = default;
++WebMediaDeviceInfo& WebMediaDeviceInfo::operator=(WebMediaDeviceInfo&& other) =
++ default;
+
+ bool operator==(const WebMediaDeviceInfo& first,
+ const WebMediaDeviceInfo& second) {
+diff --git a/third_party/blink/common/messaging/cloneable_message.cc b/third_party/blink/common/messaging/cloneable_message.cc
+index 2984fd1..5c3ee7e 100644
+--- a/third_party/blink/common/messaging/cloneable_message.cc
++++ b/third_party/blink/common/messaging/cloneable_message.cc
+@@ -12,9 +12,8 @@
+ namespace blink {
+
+ CloneableMessage::CloneableMessage() = default;
+-CloneableMessage::CloneableMessage(CloneableMessage&&) noexcept = default;
+-CloneableMessage& CloneableMessage::operator=(CloneableMessage&&) noexcept =
+- default;
++CloneableMessage::CloneableMessage(CloneableMessage&&) = default;
++CloneableMessage& CloneableMessage::operator=(CloneableMessage&&) = default;
+ CloneableMessage::~CloneableMessage() = default;
+
+ CloneableMessage CloneableMessage::ShallowClone() const {
+diff --git a/third_party/blink/common/messaging/transferable_message.cc b/third_party/blink/common/messaging/transferable_message.cc
+index 07ac9bb..4a69d0a 100644
+--- a/third_party/blink/common/messaging/transferable_message.cc
++++ b/third_party/blink/common/messaging/transferable_message.cc
+@@ -9,10 +9,9 @@
+ namespace blink {
+
+ TransferableMessage::TransferableMessage() = default;
+-TransferableMessage::TransferableMessage(TransferableMessage&&) noexcept =
++TransferableMessage::TransferableMessage(TransferableMessage&&) = default;
++TransferableMessage& TransferableMessage::operator=(TransferableMessage&&) =
+ default;
+-TransferableMessage& TransferableMessage::operator=(
+- TransferableMessage&&) noexcept = default;
+ TransferableMessage::~TransferableMessage() = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/public/common/indexeddb/indexeddb_key_path.h b/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
+index 8ebe10c..9f5422c 100644
+--- a/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
++++ b/third_party/blink/public/common/indexeddb/indexeddb_key_path.h
+@@ -22,10 +22,10 @@
+ explicit IndexedDBKeyPath(const base::string16&);
+ explicit IndexedDBKeyPath(const std::vector<base::string16>&);
+ IndexedDBKeyPath(const IndexedDBKeyPath& other);
+- IndexedDBKeyPath(IndexedDBKeyPath&& other) noexcept;
++ IndexedDBKeyPath(IndexedDBKeyPath&& other);
+ ~IndexedDBKeyPath();
+ IndexedDBKeyPath& operator=(const IndexedDBKeyPath& other);
+- IndexedDBKeyPath& operator=(IndexedDBKeyPath&& other) noexcept;
++ IndexedDBKeyPath& operator=(IndexedDBKeyPath&& other);
+
+ bool IsNull() const { return type_ == blink::mojom::IDBKeyPathType::Null; }
+ bool operator==(const IndexedDBKeyPath& other) const;
+diff --git a/third_party/blink/public/common/indexeddb/indexeddb_metadata.h b/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
+index 15663f6..7bb37c9 100644
+--- a/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
++++ b/third_party/blink/public/common/indexeddb/indexeddb_metadata.h
+@@ -26,10 +26,10 @@
+ bool unique,
+ bool multi_entry);
+ IndexedDBIndexMetadata(const IndexedDBIndexMetadata& other);
+- IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other) noexcept;
++ IndexedDBIndexMetadata(IndexedDBIndexMetadata&& other);
+ ~IndexedDBIndexMetadata();
+ IndexedDBIndexMetadata& operator=(const IndexedDBIndexMetadata& other);
+- IndexedDBIndexMetadata& operator=(IndexedDBIndexMetadata&& other) noexcept;
++ IndexedDBIndexMetadata& operator=(IndexedDBIndexMetadata&& other);
+ bool operator==(const IndexedDBIndexMetadata& other) const;
+
+ base::string16 name;
+@@ -50,12 +50,11 @@
+ bool auto_increment,
+ int64_t max_index_id);
+ IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata& other);
+- IndexedDBObjectStoreMetadata(IndexedDBObjectStoreMetadata&& other) noexcept;
++ IndexedDBObjectStoreMetadata(IndexedDBObjectStoreMetadata&& other);
+ ~IndexedDBObjectStoreMetadata();
+ IndexedDBObjectStoreMetadata& operator=(
+ const IndexedDBObjectStoreMetadata& other);
+- IndexedDBObjectStoreMetadata& operator=(
+- IndexedDBObjectStoreMetadata&& other) noexcept;
++ IndexedDBObjectStoreMetadata& operator=(IndexedDBObjectStoreMetadata&& other);
+ bool operator==(const IndexedDBObjectStoreMetadata& other) const;
+
+ base::string16 name;
+@@ -77,11 +76,10 @@
+ int64_t version,
+ int64_t max_object_store_id);
+ IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata& other);
+- IndexedDBDatabaseMetadata(IndexedDBDatabaseMetadata&& other) noexcept;
++ IndexedDBDatabaseMetadata(IndexedDBDatabaseMetadata&& other);
+ ~IndexedDBDatabaseMetadata();
+ IndexedDBDatabaseMetadata& operator=(const IndexedDBDatabaseMetadata& other);
+- IndexedDBDatabaseMetadata& operator=(
+- IndexedDBDatabaseMetadata&& other) noexcept;
++ IndexedDBDatabaseMetadata& operator=(IndexedDBDatabaseMetadata&& other);
+ bool operator==(const IndexedDBDatabaseMetadata& other) const;
+
+ base::string16 name;
+diff --git a/third_party/blink/public/common/mediastream/media_devices.h b/third_party/blink/public/common/mediastream/media_devices.h
+index 0d63e575..d87affe 100644
+--- a/third_party/blink/public/common/mediastream/media_devices.h
++++ b/third_party/blink/public/common/mediastream/media_devices.h
+@@ -27,7 +27,7 @@
+ struct BLINK_COMMON_EXPORT WebMediaDeviceInfo {
+ WebMediaDeviceInfo();
+ WebMediaDeviceInfo(const WebMediaDeviceInfo& other);
+- WebMediaDeviceInfo(WebMediaDeviceInfo&& other) noexcept;
++ WebMediaDeviceInfo(WebMediaDeviceInfo&& other);
+ WebMediaDeviceInfo(
+ const std::string& device_id,
+ const std::string& label,
+@@ -37,7 +37,7 @@
+ const media::VideoCaptureDeviceDescriptor& descriptor);
+ ~WebMediaDeviceInfo();
+ WebMediaDeviceInfo& operator=(const WebMediaDeviceInfo& other);
+- WebMediaDeviceInfo& operator=(WebMediaDeviceInfo&& other) noexcept;
++ WebMediaDeviceInfo& operator=(WebMediaDeviceInfo&& other);
+
+ std::string device_id;
+ std::string label;
+diff --git a/third_party/blink/public/common/messaging/cloneable_message.h b/third_party/blink/public/common/messaging/cloneable_message.h
+index de9952d..8dbd910 100644
+--- a/third_party/blink/public/common/messaging/cloneable_message.h
++++ b/third_party/blink/public/common/messaging/cloneable_message.h
+@@ -21,8 +21,8 @@
+ // This type can be serialized as a blink::mojom::CloneableMessage struct.
+ struct BLINK_COMMON_EXPORT CloneableMessage {
+ CloneableMessage();
+- CloneableMessage(CloneableMessage&&) noexcept;
+- CloneableMessage& operator=(CloneableMessage&&) noexcept;
++ CloneableMessage(CloneableMessage&&);
++ CloneableMessage& operator=(CloneableMessage&&);
+ ~CloneableMessage();
+
+ // Returns a shallow clone of this message. |encoded_message| in the clone
+diff --git a/third_party/blink/public/common/messaging/transferable_message.h b/third_party/blink/public/common/messaging/transferable_message.h
+index 5eef63c..2d87363 100644
+--- a/third_party/blink/public/common/messaging/transferable_message.h
++++ b/third_party/blink/public/common/messaging/transferable_message.h
+@@ -22,8 +22,8 @@
+ // type can be serialized as a blink::mojom::TransferableMessage struct.
+ struct BLINK_COMMON_EXPORT TransferableMessage : public CloneableMessage {
+ TransferableMessage();
+- TransferableMessage(TransferableMessage&&) noexcept;
+- TransferableMessage& operator=(TransferableMessage&&) noexcept;
++ TransferableMessage(TransferableMessage&&);
++ TransferableMessage& operator=(TransferableMessage&&);
+ ~TransferableMessage();
+
+ // Any ports being transferred as part of this message.
+diff --git a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
+index 75f3ae16..81edd69 100644
+--- a/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
++++ b/third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h
+@@ -42,9 +42,8 @@
+ WebScopedVirtualTimePauser();
+ ~WebScopedVirtualTimePauser();
+
+- WebScopedVirtualTimePauser(WebScopedVirtualTimePauser&& other) noexcept;
+- WebScopedVirtualTimePauser& operator=(
+- WebScopedVirtualTimePauser&& other) noexcept;
++ WebScopedVirtualTimePauser(WebScopedVirtualTimePauser&& other);
++ WebScopedVirtualTimePauser& operator=(WebScopedVirtualTimePauser&& other);
+
+ WebScopedVirtualTimePauser(const WebScopedVirtualTimePauser&) = delete;
+ WebScopedVirtualTimePauser& operator=(const WebScopedVirtualTimePauser&) =
+diff --git a/third_party/blink/public/platform/web_string.h b/third_party/blink/public/platform/web_string.h
+index e4fda4f..ffd1da0 100644
+--- a/third_party/blink/public/platform/web_string.h
++++ b/third_party/blink/public/platform/web_string.h
+@@ -102,10 +102,10 @@
+ BLINK_PLATFORM_EXPORT WebString(const WebUChar* data, size_t len);
+
+ BLINK_PLATFORM_EXPORT WebString(const WebString&);
+- BLINK_PLATFORM_EXPORT WebString(WebString&&) noexcept;
++ BLINK_PLATFORM_EXPORT WebString(WebString&&);
+
+ BLINK_PLATFORM_EXPORT WebString& operator=(const WebString&);
+- BLINK_PLATFORM_EXPORT WebString& operator=(WebString&&) noexcept;
++ BLINK_PLATFORM_EXPORT WebString& operator=(WebString&&);
+
+ BLINK_PLATFORM_EXPORT void Reset();
+
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
+index 99f47f5..8451b86 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h
+@@ -73,8 +73,8 @@
+
+ VideoCaptureSettings(const VideoCaptureSettings& other);
+ VideoCaptureSettings& operator=(const VideoCaptureSettings& other);
+- VideoCaptureSettings(VideoCaptureSettings&& other) noexcept;
+- VideoCaptureSettings& operator=(VideoCaptureSettings&& other) noexcept;
++ VideoCaptureSettings(VideoCaptureSettings&& other);
++ VideoCaptureSettings& operator=(VideoCaptureSettings&& other);
+ ~VideoCaptureSettings();
+
+ bool HasValue() const { return !failed_constraint_name_; }
+@@ -193,8 +193,8 @@
+ const AudioProcessingProperties& audio_processing_properties);
+ AudioCaptureSettings(const AudioCaptureSettings& other);
+ AudioCaptureSettings& operator=(const AudioCaptureSettings& other);
+- AudioCaptureSettings(AudioCaptureSettings&& other) noexcept;
+- AudioCaptureSettings& operator=(AudioCaptureSettings&& other) noexcept;
++ AudioCaptureSettings(AudioCaptureSettings&& other);
++ AudioCaptureSettings& operator=(AudioCaptureSettings&& other);
+
+ bool HasValue() const { return !failed_constraint_name_; }
+
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
+index 199bdeb..c89e6e9 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_constraints_util_sets.h
+@@ -159,8 +159,8 @@
+
+ DiscreteSet(const DiscreteSet& other) = default;
+ DiscreteSet& operator=(const DiscreteSet& other) = default;
+- DiscreteSet(DiscreteSet&& other) noexcept = default;
+- DiscreteSet& operator=(DiscreteSet&& other) noexcept = default;
++ DiscreteSet(DiscreteSet&& other) = default;
++ DiscreteSet& operator=(DiscreteSet&& other) = default;
+ ~DiscreteSet() = default;
+
+ bool Contains(const T& value) const {
+diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
+index 5e50d1b..ed5967f 100644
+--- a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
++++ b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
+@@ -285,8 +285,8 @@
+ const VideoTrackFormatCallback& format_callback,
+ std::unique_ptr<VideoTrackAdapterSettings> adapter_settings,
+ const ConstraintsCallback& callback);
+- PendingTrackInfo(PendingTrackInfo&& other) noexcept;
+- PendingTrackInfo& operator=(PendingTrackInfo&& other) noexcept;
++ PendingTrackInfo(PendingTrackInfo&& other);
++ PendingTrackInfo& operator=(PendingTrackInfo&& other);
+ ~PendingTrackInfo();
+
+ MediaStreamVideoTrack* track;
+diff --git a/third_party/blink/renderer/core/animation/interpolation_value.h b/third_party/blink/renderer/core/animation/interpolation_value.h
+index 75c5d35..17ccf02 100644
+--- a/third_party/blink/renderer/core/animation/interpolation_value.h
++++ b/third_party/blink/renderer/core/animation/interpolation_value.h
+@@ -27,11 +27,11 @@
+
+ InterpolationValue(std::nullptr_t) {}
+
+- InterpolationValue(InterpolationValue&& other) noexcept
++ InterpolationValue(InterpolationValue&& other)
+ : interpolable_value(std::move(other.interpolable_value)),
+ non_interpolable_value(std::move(other.non_interpolable_value)) {}
+
+- void operator=(InterpolationValue&& other) noexcept {
++ void operator=(InterpolationValue&& other) {
+ interpolable_value = std::move(other.interpolable_value);
+ non_interpolable_value = std::move(other.non_interpolable_value);
+ }
+diff --git a/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h b/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
+index 39e6c57..87bb431 100644
+--- a/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
++++ b/third_party/blink/renderer/core/animation/pairwise_interpolation_value.h
+@@ -28,7 +28,7 @@
+
+ PairwiseInterpolationValue(std::nullptr_t) {}
+
+- PairwiseInterpolationValue(PairwiseInterpolationValue&& other) noexcept
++ PairwiseInterpolationValue(PairwiseInterpolationValue&& other)
+ : start_interpolable_value(std::move(other.start_interpolable_value)),
+ end_interpolable_value(std::move(other.end_interpolable_value)),
+ non_interpolable_value(std::move(other.non_interpolable_value)) {}
+diff --git a/third_party/blink/renderer/core/css/css_selector_list.h b/third_party/blink/renderer/core/css/css_selector_list.h
+index 4d38b09..51f354b 100644
+--- a/third_party/blink/renderer/core/css/css_selector_list.h
++++ b/third_party/blink/renderer/core/css/css_selector_list.h
+@@ -67,8 +67,7 @@
+ public:
+ CSSSelectorList() : selector_array_(nullptr) {}
+
+- CSSSelectorList(CSSSelectorList&& o) noexcept
+- : selector_array_(o.selector_array_) {
++ CSSSelectorList(CSSSelectorList&& o) : selector_array_(o.selector_array_) {
+ o.selector_array_ = nullptr;
+ }
+
+@@ -82,7 +81,7 @@
+ bool HasPseudoWhere() const;
+ bool RequiresExpansion() const;
+
+- CSSSelectorList& operator=(CSSSelectorList&& o) noexcept {
++ CSSSelectorList& operator=(CSSSelectorList&& o) {
+ DCHECK(this != &o);
+ DeleteSelectorsIfNeeded();
+ selector_array_ = o.selector_array_;
+diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context.cc b/third_party/blink/renderer/core/display_lock/display_lock_context.cc
+index 0e6b6cb..79f281a 100644
+--- a/third_party/blink/renderer/core/display_lock/display_lock_context.cc
++++ b/third_party/blink/renderer/core/display_lock/display_lock_context.cc
+@@ -1033,7 +1033,7 @@
+ : context_(context) {}
+
+ DisplayLockContext::ScopedForcedUpdate::ScopedForcedUpdate(
+- ScopedForcedUpdate&& other) noexcept
++ ScopedForcedUpdate&& other)
+ : context_(other.context_) {
+ other.context_ = nullptr;
+ }
+diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context.h b/third_party/blink/renderer/core/display_lock/display_lock_context.h
+index 1a38b2af..f890b432 100644
+--- a/third_party/blink/renderer/core/display_lock/display_lock_context.h
++++ b/third_party/blink/renderer/core/display_lock/display_lock_context.h
+@@ -76,7 +76,7 @@
+ DISALLOW_NEW();
+
+ public:
+- ScopedForcedUpdate(ScopedForcedUpdate&&) noexcept;
++ ScopedForcedUpdate(ScopedForcedUpdate&&);
+ ~ScopedForcedUpdate();
+
+ private:
+diff --git a/third_party/blink/renderer/core/editing/layout_selection.cc b/third_party/blink/renderer/core/editing/layout_selection.cc
+index 00040d2..73cfe0f 100644
+--- a/third_party/blink/renderer/core/editing/layout_selection.cc
++++ b/third_party/blink/renderer/core/editing/layout_selection.cc
+@@ -178,7 +178,7 @@
+ public:
+ OldSelectedNodes()
+ : paint_range(MakeGarbageCollected<SelectionPaintRange>()) {}
+- OldSelectedNodes(OldSelectedNodes&& other) noexcept {
++ OldSelectedNodes(OldSelectedNodes&& other) {
+ paint_range = other.paint_range;
+ selected_map = std::move(other.selected_map);
+ }
+@@ -205,8 +205,7 @@
+ HeapHashSet<Member<const Node>>&& passed_selected_objects)
+ : paint_range(passed_paint_range),
+ selected_objects(std::move(passed_selected_objects)) {}
+- NewPaintRangeAndSelectedNodes(
+- NewPaintRangeAndSelectedNodes&& other) noexcept {
++ NewPaintRangeAndSelectedNodes(NewPaintRangeAndSelectedNodes&& other) {
+ paint_range = other.paint_range;
+ selected_objects = std::move(other.selected_objects);
+ }
+diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
+index f0ac3c4..81f47ab 100644
+--- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
++++ b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc
+@@ -24,7 +24,7 @@
+ start_time_(clock_->NowTicks()) {}
+
+ LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer::ScopedUkmHierarchicalTimer(
+- ScopedUkmHierarchicalTimer&& other) noexcept
++ ScopedUkmHierarchicalTimer&& other)
+ : aggregator_(other.aggregator_),
+ metric_index_(other.metric_index_),
+ clock_(other.clock_),
+diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
+index 44c3f87..dc06091 100644
+--- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
++++ b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h
+@@ -195,7 +195,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&) noexcept;
++ ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&);
+ ~ScopedUkmHierarchicalTimer();
+
+ private:
+diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
+index 2af19ca..498e42e 100644
+--- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
++++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
+@@ -181,7 +181,7 @@
+
+ public:
+ ChildList() = default;
+- void operator=(ChildList&& other) noexcept {
++ void operator=(ChildList&& other) {
+ children_ = std::move(other.children_);
+ }
+
+diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
+index 8f77b90..833b0d2 100644
+--- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
++++ b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
+@@ -86,7 +86,7 @@
+ else
+ bfc_offset_ = other.bfc_offset_;
+ }
+- NGConstraintSpace(NGConstraintSpace&& other) noexcept
++ NGConstraintSpace(NGConstraintSpace&& other)
+ : available_size_(other.available_size_),
+ exclusion_space_(std::move(other.exclusion_space_)),
+ bitfields_(other.bitfields_) {
+@@ -110,7 +110,7 @@
+ bitfields_ = other.bitfields_;
+ return *this;
+ }
+- NGConstraintSpace& operator=(NGConstraintSpace&& other) noexcept {
++ NGConstraintSpace& operator=(NGConstraintSpace&& other) {
+ available_size_ = other.available_size_;
+ if (HasRareData())
+ delete rare_data_;
+diff --git a/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc b/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
+index b6c8768..7423930 100644
+--- a/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
++++ b/third_party/blink/renderer/core/messaging/blink_cloneable_message.cc
+@@ -9,9 +9,8 @@
+ BlinkCloneableMessage::BlinkCloneableMessage() = default;
+ BlinkCloneableMessage::~BlinkCloneableMessage() = default;
+
+-BlinkCloneableMessage::BlinkCloneableMessage(BlinkCloneableMessage&&) noexcept =
+- default;
++BlinkCloneableMessage::BlinkCloneableMessage(BlinkCloneableMessage&&) = default;
+ BlinkCloneableMessage& BlinkCloneableMessage::operator=(
+- BlinkCloneableMessage&&) noexcept = default;
++ BlinkCloneableMessage&&) = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/renderer/core/messaging/blink_cloneable_message.h b/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
+index 337b0f8..a51e888 100644
+--- a/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
++++ b/third_party/blink/renderer/core/messaging/blink_cloneable_message.h
+@@ -21,8 +21,8 @@
+ BlinkCloneableMessage();
+ ~BlinkCloneableMessage();
+
+- BlinkCloneableMessage(BlinkCloneableMessage&&) noexcept;
+- BlinkCloneableMessage& operator=(BlinkCloneableMessage&&) noexcept;
++ BlinkCloneableMessage(BlinkCloneableMessage&&);
++ BlinkCloneableMessage& operator=(BlinkCloneableMessage&&);
+
+ scoped_refptr<blink::SerializedScriptValue> message;
+ v8_inspector::V8StackTraceId sender_stack_trace_id;
+diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
+index 909ddb0..b5cdfda 100644
+--- a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
++++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
+@@ -16,10 +16,10 @@
+ BlinkTransferableMessage::BlinkTransferableMessage() = default;
+ BlinkTransferableMessage::~BlinkTransferableMessage() = default;
+
+-BlinkTransferableMessage::BlinkTransferableMessage(
+- BlinkTransferableMessage&&) noexcept = default;
++BlinkTransferableMessage::BlinkTransferableMessage(BlinkTransferableMessage&&) =
++ default;
+ BlinkTransferableMessage& BlinkTransferableMessage::operator=(
+- BlinkTransferableMessage&&) noexcept = default;
++ BlinkTransferableMessage&&) = default;
+
+ scoped_refptr<blink::StaticBitmapImage> ToStaticBitmapImage(
+ const SkBitmap& sk_bitmap) {
+diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.h b/third_party/blink/renderer/core/messaging/blink_transferable_message.h
+index edf4fab..3957bed 100644
+--- a/third_party/blink/renderer/core/messaging/blink_transferable_message.h
++++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.h
+@@ -24,8 +24,8 @@
+ BlinkTransferableMessage();
+ ~BlinkTransferableMessage();
+
+- BlinkTransferableMessage(BlinkTransferableMessage&&) noexcept;
+- BlinkTransferableMessage& operator=(BlinkTransferableMessage&&) noexcept;
++ BlinkTransferableMessage(BlinkTransferableMessage&&);
++ BlinkTransferableMessage& operator=(BlinkTransferableMessage&&);
+
+ Vector<MessagePortChannel> ports;
+
+diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
+index 85b46e1..f050a85 100644
+--- a/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
++++ b/third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h
+@@ -92,10 +92,10 @@
+ std::move(destruction_callback_).Run(std::move(callbacks_));
+ }
+
+- ScopedWebCallbacks(ScopedWebCallbacks&& other) noexcept = default;
++ ScopedWebCallbacks(ScopedWebCallbacks&& other) = default;
+ ScopedWebCallbacks(const ScopedWebCallbacks& other) = delete;
+
+- ScopedWebCallbacks& operator=(ScopedWebCallbacks&& other) noexcept = default;
++ ScopedWebCallbacks& operator=(ScopedWebCallbacks&& other) = default;
+ ScopedWebCallbacks& operator=(const ScopedWebCallbacks& other) = delete;
+
+ std::unique_ptr<CallbacksType> PassCallbacks() {
+diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request.h b/third_party/blink/renderer/modules/indexeddb/idb_request.h
+index f85b864..d3f1132 100644
+--- a/third_party/blink/renderer/modules/indexeddb/idb_request.h
++++ b/third_party/blink/renderer/modules/indexeddb/idb_request.h
+@@ -110,13 +110,13 @@
+ ~AsyncTraceState();
+
+ // Used to transfer the trace end event state to an IDBRequest.
+- AsyncTraceState(AsyncTraceState&& other) noexcept {
++ AsyncTraceState(AsyncTraceState&& other) {
+ DCHECK(IsEmpty());
+ this->trace_event_name_ = other.trace_event_name_;
+ this->id_ = other.id_;
+ other.trace_event_name_ = nullptr;
+ }
+- AsyncTraceState& operator=(AsyncTraceState&& rhs) noexcept {
++ AsyncTraceState& operator=(AsyncTraceState&& rhs) {
+ DCHECK(IsEmpty());
+ this->trace_event_name_ = rhs.trace_event_name_;
+ this->id_ = rhs.id_;
+diff --git a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
+index 84de726..2d3d4de5 100644
+--- a/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
++++ b/third_party/blink/renderer/modules/indexeddb/idb_request_test.cc
+@@ -434,10 +434,9 @@
+ class AsyncTraceStateForTesting : public IDBRequest::AsyncTraceState {
+ public:
+ AsyncTraceStateForTesting() : IDBRequest::AsyncTraceState() {}
+- AsyncTraceStateForTesting(AsyncTraceStateForTesting&& other) noexcept
++ AsyncTraceStateForTesting(AsyncTraceStateForTesting&& other)
+ : IDBRequest::AsyncTraceState(std::move(other)) {}
+- AsyncTraceStateForTesting& operator=(
+- AsyncTraceStateForTesting&& rhs) noexcept {
++ AsyncTraceStateForTesting& operator=(AsyncTraceStateForTesting&& rhs) {
+ AsyncTraceState::operator=(std::move(rhs));
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
+index 24499bd..3bf00e9 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
+@@ -134,13 +134,13 @@
+
+ VideoCaptureSettings::VideoCaptureSettings(const VideoCaptureSettings& other) =
+ default;
+-VideoCaptureSettings::VideoCaptureSettings(
+- VideoCaptureSettings&& other) noexcept = default;
++VideoCaptureSettings::VideoCaptureSettings(VideoCaptureSettings&& other) =
++ default;
+ VideoCaptureSettings::~VideoCaptureSettings() = default;
+ VideoCaptureSettings& VideoCaptureSettings::operator=(
+ const VideoCaptureSettings& other) = default;
+ VideoCaptureSettings& VideoCaptureSettings::operator=(
+- VideoCaptureSettings&& other) noexcept = default;
++ VideoCaptureSettings&& other) = default;
+
+ AudioCaptureSettings::AudioCaptureSettings() : AudioCaptureSettings("") {}
+
+@@ -166,10 +166,10 @@
+ default;
+ AudioCaptureSettings& AudioCaptureSettings::operator=(
+ const AudioCaptureSettings& other) = default;
+-AudioCaptureSettings::AudioCaptureSettings(
+- AudioCaptureSettings&& other) noexcept = default;
++AudioCaptureSettings::AudioCaptureSettings(AudioCaptureSettings&& other) =
++ default;
+ AudioCaptureSettings& AudioCaptureSettings::operator=(
+- AudioCaptureSettings&& other) noexcept = default;
++ AudioCaptureSettings&& other) = default;
+
+ bool GetConstraintValueAsBoolean(
+ const WebMediaConstraints& constraints,
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
+index 96992217..67c8bab 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.cc
+@@ -529,9 +529,9 @@
+ facing_mode(facing_mode) {}
+
+ VideoInputDeviceCapabilities::VideoInputDeviceCapabilities(
+- VideoInputDeviceCapabilities&& other) noexcept = default;
++ VideoInputDeviceCapabilities&& other) = default;
+ VideoInputDeviceCapabilities& VideoInputDeviceCapabilities::operator=(
+- VideoInputDeviceCapabilities&& other) noexcept = default;
++ VideoInputDeviceCapabilities&& other) = default;
+
+ VideoInputDeviceCapabilities::~VideoInputDeviceCapabilities() = default;
+
+@@ -557,10 +557,10 @@
+
+ VideoDeviceCaptureCapabilities::VideoDeviceCaptureCapabilities() = default;
+ VideoDeviceCaptureCapabilities::VideoDeviceCaptureCapabilities(
+- VideoDeviceCaptureCapabilities&& other) noexcept = default;
++ VideoDeviceCaptureCapabilities&& other) = default;
+ VideoDeviceCaptureCapabilities::~VideoDeviceCaptureCapabilities() = default;
+ VideoDeviceCaptureCapabilities& VideoDeviceCaptureCapabilities::operator=(
+- VideoDeviceCaptureCapabilities&& other) noexcept = default;
++ VideoDeviceCaptureCapabilities&& other) = default;
+
+ VideoCaptureSettings SelectSettingsVideoDeviceCapture(
+ const VideoDeviceCaptureCapabilities& capabilities,
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
+index 66ae103..94d8ed9 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h
+@@ -34,9 +34,8 @@
+ Vector<media::VideoCaptureFormat> formats,
+ media::VideoFacingMode facing_mode);
+ VideoInputDeviceCapabilities();
+- VideoInputDeviceCapabilities(VideoInputDeviceCapabilities&& other) noexcept;
+- VideoInputDeviceCapabilities& operator=(
+- VideoInputDeviceCapabilities&& other) noexcept;
++ VideoInputDeviceCapabilities(VideoInputDeviceCapabilities&& other);
++ VideoInputDeviceCapabilities& operator=(VideoInputDeviceCapabilities&& other);
+ ~VideoInputDeviceCapabilities();
+
+ String device_id;
+@@ -47,11 +46,10 @@
+
+ struct MODULES_EXPORT VideoDeviceCaptureCapabilities {
+ VideoDeviceCaptureCapabilities();
+- VideoDeviceCaptureCapabilities(
+- VideoDeviceCaptureCapabilities&& other) noexcept;
++ VideoDeviceCaptureCapabilities(VideoDeviceCaptureCapabilities&& other);
+ ~VideoDeviceCaptureCapabilities();
+ VideoDeviceCaptureCapabilities& operator=(
+- VideoDeviceCaptureCapabilities&& other) noexcept;
++ VideoDeviceCaptureCapabilities&& other);
+
+ // Each capabilities field is independent of each other.
+ // TODO(crbug.com/704136): Replace VideoInputDeviceCapabilities in the
+diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
+index 7651e47..99759c1 100644
+--- a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
++++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
+@@ -461,10 +461,10 @@
+ callback(callback) {}
+
+ MediaStreamVideoSource::PendingTrackInfo::PendingTrackInfo(
+- PendingTrackInfo&& other) noexcept = default;
++ PendingTrackInfo&& other) = default;
+ MediaStreamVideoSource::PendingTrackInfo&
+ MediaStreamVideoSource::PendingTrackInfo::operator=(
+- MediaStreamVideoSource::PendingTrackInfo&& other) noexcept = default;
++ MediaStreamVideoSource::PendingTrackInfo&& other) = default;
+
+ MediaStreamVideoSource::PendingTrackInfo::~PendingTrackInfo() {}
+
+diff --git a/third_party/blink/renderer/platform/bindings/dom_data_store.h b/third_party/blink/renderer/platform/bindings/dom_data_store.h
+index d660b67..0660dd18 100644
+--- a/third_party/blink/renderer/platform/bindings/dom_data_store.h
++++ b/third_party/blink/renderer/platform/bindings/dom_data_store.h
+@@ -230,12 +230,11 @@
+ : TraceWrapperV8Reference(isolate, handle) {}
+
+ // Move support without write barrier.
+- DOMWorldWrapperReference(DOMWorldWrapperReference&& other) noexcept
++ DOMWorldWrapperReference(DOMWorldWrapperReference&& other)
+ : TraceWrapperV8Reference() {
+ handle_ = std::move(other.handle_);
+ }
+- DOMWorldWrapperReference& operator=(
+- DOMWorldWrapperReference&& rhs) noexcept {
++ DOMWorldWrapperReference& operator=(DOMWorldWrapperReference&& rhs) {
+ handle_ = std::move(rhs.handle_);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/exported/web_string.cc b/third_party/blink/renderer/platform/exported/web_string.cc
+index 71d4c07..fbe4828 100644
+--- a/third_party/blink/renderer/platform/exported/web_string.cc
++++ b/third_party/blink/renderer/platform/exported/web_string.cc
+@@ -51,9 +51,9 @@
+ WebString::~WebString() = default;
+ WebString::WebString() = default;
+ WebString::WebString(const WebString&) = default;
+-WebString::WebString(WebString&&) noexcept = default;
++WebString::WebString(WebString&&) = default;
+ WebString& WebString::operator=(const WebString&) = default;
+-WebString& WebString::operator=(WebString&&) noexcept = default;
++WebString& WebString::operator=(WebString&&) = default;
+
+ WebString::WebString(const WebUChar* data, size_t len)
+ : impl_(StringImpl::Create8BitIfPossible(data, len)) {}
+diff --git a/third_party/blink/renderer/platform/graphics/contiguous_container.cc b/third_party/blink/renderer/platform/graphics/contiguous_container.cc
+index fd01c00..19cb6f2 100644
+--- a/third_party/blink/renderer/platform/graphics/contiguous_container.cc
++++ b/third_party/blink/renderer/platform/graphics/contiguous_container.cc
+@@ -69,7 +69,7 @@
+ : end_index_(0), max_object_size_(max_object_size) {}
+
+ ContiguousContainerBase::ContiguousContainerBase(
+- ContiguousContainerBase&& source) noexcept
++ ContiguousContainerBase&& source)
+ : ContiguousContainerBase(source.max_object_size_) {
+ Swap(source);
+ }
+@@ -77,7 +77,7 @@
+ ContiguousContainerBase::~ContiguousContainerBase() = default;
+
+ ContiguousContainerBase& ContiguousContainerBase::operator=(
+- ContiguousContainerBase&& source) noexcept {
++ ContiguousContainerBase&& source) {
+ Swap(source);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/graphics/contiguous_container.h b/third_party/blink/renderer/platform/graphics/contiguous_container.h
+index 867e59c..3eee558 100644
+--- a/third_party/blink/renderer/platform/graphics/contiguous_container.h
++++ b/third_party/blink/renderer/platform/graphics/contiguous_container.h
+@@ -42,10 +42,10 @@
+
+ protected:
+ explicit ContiguousContainerBase(size_t max_object_size);
+- ContiguousContainerBase(ContiguousContainerBase&&) noexcept;
++ ContiguousContainerBase(ContiguousContainerBase&&);
+ ~ContiguousContainerBase();
+
+- ContiguousContainerBase& operator=(ContiguousContainerBase&&) noexcept;
++ ContiguousContainerBase& operator=(ContiguousContainerBase&&);
+
+ size_t size() const { return elements_.size(); }
+ bool IsEmpty() const { return !size(); }
+@@ -147,7 +147,7 @@
+ WTF_HEAP_PROFILER_TYPE_NAME(BaseElementType));
+ }
+
+- ContiguousContainer(ContiguousContainer&& source) noexcept
++ ContiguousContainer(ContiguousContainer&& source)
+ : ContiguousContainerBase(std::move(source)) {}
+
+ ~ContiguousContainer() {
+@@ -157,7 +157,7 @@
+ }
+ }
+
+- ContiguousContainer& operator=(ContiguousContainer&& source) noexcept {
++ ContiguousContainer& operator=(ContiguousContainer&& source) {
+ // Must clear in the derived class to ensure that element destructors
+ // care called.
+ Clear();
+diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+index ad10c54..4edbf7f 100644
+--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
++++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+@@ -247,9 +247,9 @@
+ }
+
+ ImageLayerBridge::RegisteredBitmap::RegisteredBitmap() = default;
+-ImageLayerBridge::RegisteredBitmap::RegisteredBitmap(
+- RegisteredBitmap&& other) noexcept = default;
++ImageLayerBridge::RegisteredBitmap::RegisteredBitmap(RegisteredBitmap&& other) =
++ default;
+ ImageLayerBridge::RegisteredBitmap& ImageLayerBridge::RegisteredBitmap::
+-operator=(RegisteredBitmap&& other) noexcept = default;
++operator=(RegisteredBitmap&& other) = default;
+
+ } // namespace blink
+diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
+index bea81dfb..b6879f9 100644
+--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
++++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
+@@ -65,8 +65,8 @@
+ // only with software compositing.
+ struct RegisteredBitmap {
+ RegisteredBitmap();
+- RegisteredBitmap(RegisteredBitmap&& other) noexcept;
+- RegisteredBitmap& operator=(RegisteredBitmap&& other) noexcept;
++ RegisteredBitmap(RegisteredBitmap&& other);
++ RegisteredBitmap& operator=(RegisteredBitmap&& other);
+
+ scoped_refptr<cc::CrossThreadSharedBitmap> bitmap;
+ cc::SharedBitmapIdRegistration registration;
+diff --git a/third_party/blink/renderer/platform/graphics/paint/display_item_list.h b/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
+index cd3ed2f..9ee2571 100644
+--- a/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
++++ b/third_party/blink/renderer/platform/graphics/paint/display_item_list.h
+@@ -28,10 +28,10 @@
+ public:
+ DisplayItemList(size_t initial_size_bytes)
+ : ContiguousContainer(kMaximumDisplayItemSize, initial_size_bytes) {}
+- DisplayItemList(DisplayItemList&& source) noexcept
++ DisplayItemList(DisplayItemList&& source)
+ : ContiguousContainer(std::move(source)) {}
+
+- DisplayItemList& operator=(DisplayItemList&& source) noexcept {
++ DisplayItemList& operator=(DisplayItemList&& source) {
+ ContiguousContainer::operator=(std::move(source));
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/heap/heap_test.cc b/third_party/blink/renderer/platform/heap/heap_test.cc
+index dad0ca0..e94cbc95 100644
+--- a/third_party/blink/renderer/platform/heap/heap_test.cc
++++ b/third_party/blink/renderer/platform/heap/heap_test.cc
+@@ -145,7 +145,7 @@
+ }
+ KeyWithCopyingMoveConstructor(const KeyWithCopyingMoveConstructor&) = default;
+ // The move constructor delegates to the copy constructor intentionally.
+- KeyWithCopyingMoveConstructor(KeyWithCopyingMoveConstructor&& x) noexcept
++ KeyWithCopyingMoveConstructor(KeyWithCopyingMoveConstructor&& x)
+ : KeyWithCopyingMoveConstructor(x) {}
+ KeyWithCopyingMoveConstructor& operator=(
+ const KeyWithCopyingMoveConstructor&) = default;
+diff --git a/third_party/blink/renderer/platform/image-decoders/segment_stream.cc b/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
+index 4024f9c..5a98701 100644
+--- a/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
++++ b/third_party/blink/renderer/platform/image-decoders/segment_stream.cc
+@@ -10,10 +10,10 @@
+
+ SegmentStream::SegmentStream() = default;
+
+-SegmentStream::SegmentStream(SegmentStream&& rhs) noexcept
++SegmentStream::SegmentStream(SegmentStream&& rhs)
+ : reader_(std::move(rhs.reader_)), position_(rhs.position_) {}
+
+-SegmentStream& SegmentStream::operator=(SegmentStream&& rhs) noexcept {
++SegmentStream& SegmentStream::operator=(SegmentStream&& rhs) {
+ reader_ = std::move(rhs.reader_);
+ position_ = rhs.position_;
+
+diff --git a/third_party/blink/renderer/platform/image-decoders/segment_stream.h b/third_party/blink/renderer/platform/image-decoders/segment_stream.h
+index f49f551..fa1ccf2 100644
+--- a/third_party/blink/renderer/platform/image-decoders/segment_stream.h
++++ b/third_party/blink/renderer/platform/image-decoders/segment_stream.h
+@@ -19,8 +19,8 @@
+ SegmentStream();
+ SegmentStream(const SegmentStream&) = delete;
+ SegmentStream& operator=(const SegmentStream&) = delete;
+- SegmentStream(SegmentStream&&) noexcept;
+- SegmentStream& operator=(SegmentStream&&) noexcept;
++ SegmentStream(SegmentStream&&);
++ SegmentStream& operator=(SegmentStream&&);
+
+ ~SegmentStream() override;
+
+diff --git a/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h b/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
+index 555be28..34bad3f 100644
+--- a/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
++++ b/third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h
+@@ -41,7 +41,7 @@
+ RevocableInterfacePtr(std::nullptr_t) {}
+
+ // Takes over the binding of another RevocableInterfacePtr.
+- RevocableInterfacePtr(RevocableInterfacePtr&& other) noexcept {
++ RevocableInterfacePtr(RevocableInterfacePtr&& other) {
+ interface_ptr_ = std::move(other.interface_ptr_);
+ SetInvalidator(other.invalidator_.get());
+ // Reset the other interface ptr to remove it as an observer of the
+@@ -58,7 +58,7 @@
+
+ // Takes over the binding of another RevocableInterfacePtr, and closes any
+ // message pipe already bound to this pointer.
+- RevocableInterfacePtr& operator=(RevocableInterfacePtr&& other) noexcept {
++ RevocableInterfacePtr& operator=(RevocableInterfacePtr&& other) {
+ reset();
+ interface_ptr_ = std::move(other.interface_ptr_);
+ SetInvalidator(other.invalidator_.get());
+diff --git a/third_party/blink/renderer/platform/network/encoded_form_data.cc b/third_party/blink/renderer/platform/network/encoded_form_data.cc
+index bc4ec14..1b660e6 100644
+--- a/third_party/blink/renderer/platform/network/encoded_form_data.cc
++++ b/third_party/blink/renderer/platform/network/encoded_form_data.cc
+@@ -61,11 +61,10 @@
+ : type_(kDataPipe), data_pipe_getter_(std::move(data_pipe_getter)) {}
+
+ FormDataElement::FormDataElement(const FormDataElement&) = default;
+-FormDataElement::FormDataElement(FormDataElement&&) noexcept = default;
++FormDataElement::FormDataElement(FormDataElement&&) = default;
+ FormDataElement::~FormDataElement() = default;
+ FormDataElement& FormDataElement::operator=(const FormDataElement&) = default;
+-FormDataElement& FormDataElement::operator=(FormDataElement&&) noexcept =
+- default;
++FormDataElement& FormDataElement::operator=(FormDataElement&&) = default;
+
+ bool operator==(const FormDataElement& a, const FormDataElement& b) {
+ if (&a == &b)
+diff --git a/third_party/blink/renderer/platform/network/encoded_form_data.h b/third_party/blink/renderer/platform/network/encoded_form_data.h
+index 48f84c8..865f664 100644
+--- a/third_party/blink/renderer/platform/network/encoded_form_data.h
++++ b/third_party/blink/renderer/platform/network/encoded_form_data.h
+@@ -61,12 +61,12 @@
+ explicit FormDataElement(scoped_refptr<WrappedDataPipeGetter>);
+
+ FormDataElement(const FormDataElement&);
+- FormDataElement(FormDataElement&&) noexcept;
++ FormDataElement(FormDataElement&&);
+
+ ~FormDataElement();
+
+ FormDataElement& operator=(const FormDataElement&);
+- FormDataElement& operator=(FormDataElement&&) noexcept;
++ FormDataElement& operator=(FormDataElement&&);
+
+ bool IsSafeToSendToAnotherThread() const;
+
+diff --git a/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc b/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
+index ebe99ff..e971856 100644
+--- a/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
++++ b/third_party/blink/renderer/platform/scheduler/common/frame_or_worker_scheduler.cc
+@@ -28,15 +28,14 @@
+ }
+
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::
+- SchedulingAffectingFeatureHandle(
+- SchedulingAffectingFeatureHandle&& other) noexcept
++ SchedulingAffectingFeatureHandle(SchedulingAffectingFeatureHandle&& other)
+ : feature_(other.feature_), scheduler_(std::move(other.scheduler_)) {
+ other.scheduler_ = nullptr;
+ }
+
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle&
+ FrameOrWorkerScheduler::SchedulingAffectingFeatureHandle::operator=(
+- SchedulingAffectingFeatureHandle&& other) noexcept {
++ SchedulingAffectingFeatureHandle&& other) {
+ feature_ = other.feature_;
+ policy_ = std::move(other.policy_);
+ scheduler_ = std::move(other.scheduler_);
+diff --git a/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc b/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
+index 2c84d70..fad56ee1 100644
+--- a/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
++++ b/third_party/blink/renderer/platform/scheduler/common/post_cancellable_task.cc
+@@ -103,9 +103,9 @@
+ Cancel();
+ }
+
+-TaskHandle::TaskHandle(TaskHandle&&) noexcept = default;
++TaskHandle::TaskHandle(TaskHandle&&) = default;
+
+-TaskHandle& TaskHandle::operator=(TaskHandle&& other) noexcept {
++TaskHandle& TaskHandle::operator=(TaskHandle&& other) {
+ TaskHandle tmp(std::move(other));
+ runner_.swap(tmp.runner_);
+ return *this;
+diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc b/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
+index f55730a..b64ec9d 100644
+--- a/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
++++ b/third_party/blink/renderer/platform/scheduler/main_thread/web_scoped_virtual_time_pauser.cc
+@@ -28,7 +28,7 @@
+ }
+
+ WebScopedVirtualTimePauser::WebScopedVirtualTimePauser(
+- WebScopedVirtualTimePauser&& other) noexcept {
++ WebScopedVirtualTimePauser&& other) {
+ virtual_time_when_paused_ = other.virtual_time_when_paused_;
+ paused_ = other.paused_;
+ duration_ = other.duration_;
+@@ -39,7 +39,7 @@
+ }
+
+ WebScopedVirtualTimePauser& WebScopedVirtualTimePauser::operator=(
+- WebScopedVirtualTimePauser&& other) noexcept {
++ WebScopedVirtualTimePauser&& other) {
+ if (scheduler_ && paused_)
+ DecrementVirtualTimePauseCount();
+ virtual_time_when_paused_ = other.virtual_time_when_paused_;
+diff --git a/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h b/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
+index 56915ee..3fdb8cf 100644
+--- a/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
++++ b/third_party/blink/renderer/platform/scheduler/public/frame_or_worker_scheduler.h
+@@ -57,12 +57,11 @@
+
+ public:
+ SchedulingAffectingFeatureHandle() = default;
+- SchedulingAffectingFeatureHandle(
+- SchedulingAffectingFeatureHandle&&) noexcept;
++ SchedulingAffectingFeatureHandle(SchedulingAffectingFeatureHandle&&);
+ inline ~SchedulingAffectingFeatureHandle() { reset(); }
+
+ SchedulingAffectingFeatureHandle& operator=(
+- SchedulingAffectingFeatureHandle&&) noexcept;
++ SchedulingAffectingFeatureHandle&&);
+
+ inline void reset() {
+ if (scheduler_)
+diff --git a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
+index 38cbf63..ae66c73 100644
+--- a/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
++++ b/third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h
+@@ -28,8 +28,8 @@
+ TaskHandle();
+ ~TaskHandle();
+
+- TaskHandle(TaskHandle&&) noexcept;
+- TaskHandle& operator=(TaskHandle&&) noexcept;
++ TaskHandle(TaskHandle&&);
++ TaskHandle& operator=(TaskHandle&&);
+
+ // Returns true if the task will run later. Returns false if the task is
+ // cancelled or the task is run already.
+diff --git a/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc b/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
+index 2e9a9d1..c9d777e7 100644
+--- a/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
++++ b/third_party/blink/renderer/platform/weborigin/origin_access_entry.cc
+@@ -59,8 +59,7 @@
+ network::mojom::CorsPortMatchMode::kAllowOnlySpecifiedPort,
+ priority) {}
+
+-OriginAccessEntry::OriginAccessEntry(OriginAccessEntry&& from) noexcept =
+- default;
++OriginAccessEntry::OriginAccessEntry(OriginAccessEntry&& from) = default;
+
+ network::cors::OriginAccessEntry::MatchResult OriginAccessEntry::MatchesOrigin(
+ const SecurityOrigin& origin) const {
+diff --git a/third_party/blink/renderer/platform/weborigin/origin_access_entry.h b/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
+index b3e5674..5113a40 100644
+--- a/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
++++ b/third_party/blink/renderer/platform/weborigin/origin_access_entry.h
+@@ -58,7 +58,7 @@
+ network::mojom::CorsDomainMatchMode,
+ network::mojom::CorsOriginAccessMatchPriority priority =
+ network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+- OriginAccessEntry(OriginAccessEntry&& from) noexcept;
++ OriginAccessEntry(OriginAccessEntry&& from);
+
+ network::cors::OriginAccessEntry::MatchResult MatchesOrigin(
+ const SecurityOrigin&) const;
+diff --git a/third_party/blink/renderer/platform/wtf/deque.h b/third_party/blink/renderer/platform/wtf/deque.h
+index c6fe1b9..4a98ffb 100644
+--- a/third_party/blink/renderer/platform/wtf/deque.h
++++ b/third_party/blink/renderer/platform/wtf/deque.h
+@@ -64,8 +64,8 @@ class Deque {
+ Deque();
+ Deque(const Deque&);
+ Deque& operator=(const Deque&);
+- Deque(Deque&&) noexcept;
+- Deque& operator=(Deque&&) noexcept;
++ Deque(Deque&&);
++ Deque& operator=(Deque&&);
+ ~Deque();
+
+ void FinalizeGarbageCollectedObject() { NOTREACHED(); }
+@@ -343,14 +343,14 @@
+ }
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+-inline Deque<T, inlineCapacity, Allocator>::Deque(Deque&& other) noexcept
++inline Deque<T, inlineCapacity, Allocator>::Deque(Deque&& other)
+ : start_(0), end_(0) {
+ Swap(other);
+ }
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ inline Deque<T, inlineCapacity, Allocator>&
+-Deque<T, inlineCapacity, Allocator>::operator=(Deque&& other) noexcept {
++Deque<T, inlineCapacity, Allocator>::operator=(Deque&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/functional.h b/third_party/blink/renderer/platform/wtf/functional.h
+index 2c5aeea..5e4b373 100644
+--- a/third_party/blink/renderer/platform/wtf/functional.h
++++ b/third_party/blink/renderer/platform/wtf/functional.h
+@@ -117,8 +117,7 @@
+ class PassedWrapper final {
+ public:
+ explicit PassedWrapper(T&& scoper) : scoper_(std::move(scoper)) {}
+- PassedWrapper(PassedWrapper&& other) noexcept
+- : scoper_(std::move(other.scoper_)) {}
++ PassedWrapper(PassedWrapper&& other) : scoper_(std::move(other.scoper_)) {}
+ T MoveOut() const { return std::move(scoper_); }
+
+ private:
+@@ -319,9 +318,8 @@
+ CrossThreadFunction(const CrossThreadFunction&) = delete;
+ CrossThreadFunction& operator=(const CrossThreadFunction&) = delete;
+
+- CrossThreadFunction(CrossThreadFunction&& other) noexcept = default;
+- CrossThreadFunction& operator=(CrossThreadFunction&& other) noexcept =
+- default;
++ CrossThreadFunction(CrossThreadFunction&& other) = default;
++ CrossThreadFunction& operator=(CrossThreadFunction&& other) = default;
+
+ R Run(Args... args) const & {
+ return callback_.Run(std::forward<Args>(args)...);
+@@ -356,9 +354,8 @@
+ CrossThreadOnceFunction(const CrossThreadOnceFunction&) = delete;
+ CrossThreadOnceFunction& operator=(const CrossThreadOnceFunction&) = delete;
+
+- CrossThreadOnceFunction(CrossThreadOnceFunction&& other) noexcept = default;
+- CrossThreadOnceFunction& operator=(CrossThreadOnceFunction&& other) noexcept =
+- default;
++ CrossThreadOnceFunction(CrossThreadOnceFunction&& other) = default;
++ CrossThreadOnceFunction& operator=(CrossThreadOnceFunction&& other) = default;
+
+ R Run(Args... args) && {
+ return std::move(callback_).Run(std::forward<Args>(args)...);
+diff --git a/third_party/blink/renderer/platform/wtf/hash_map.h b/third_party/blink/renderer/platform/wtf/hash_map.h
+index 8a002a8..46b39e0 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_map.h
++++ b/third_party/blink/renderer/platform/wtf/hash_map.h
+@@ -106,8 +106,8 @@
+ #endif
+ HashMap(const HashMap&) = default;
+ HashMap& operator=(const HashMap&) = default;
+- HashMap(HashMap&&) noexcept = default;
+- HashMap& operator=(HashMap&&) noexcept = default;
++ HashMap(HashMap&&) = default;
++ HashMap& operator=(HashMap&&) = default;
+
+ // For example, HashMap<int, int>({{1, 11}, {2, 22}, {3, 33}}) will give you
+ // a HashMap containing a mapping {1 -> 11, 2 -> 22, 3 -> 33}.
+diff --git a/third_party/blink/renderer/platform/wtf/hash_set.h b/third_party/blink/renderer/platform/wtf/hash_set.h
+index c79e45f1..d7cdeed 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/hash_set.h
+@@ -74,8 +74,8 @@
+ }
+ HashSet(const HashSet&) = default;
+ HashSet& operator=(const HashSet&) = default;
+- HashSet(HashSet&&) noexcept = default;
+- HashSet& operator=(HashSet&&) noexcept = default;
++ HashSet(HashSet&&) = default;
++ HashSet& operator=(HashSet&&) = default;
+
+ HashSet(std::initializer_list<ValueType> elements);
+ HashSet& operator=(std::initializer_list<ValueType> elements);
+diff --git a/third_party/blink/renderer/platform/wtf/hash_table.h b/third_party/blink/renderer/platform/wtf/hash_table.h
+index 373280f..52483ec5 100644
+--- a/third_party/blink/renderer/platform/wtf/hash_table.h
++++ b/third_party/blink/renderer/platform/wtf/hash_table.h
+@@ -747,10 +747,10 @@
+ }
+
+ HashTable(const HashTable&);
+- HashTable(HashTable&&) noexcept;
++ HashTable(HashTable&&);
+ void swap(HashTable&);
+ HashTable& operator=(const HashTable&);
+- HashTable& operator=(HashTable&&) noexcept;
++ HashTable& operator=(HashTable&&);
+
+ // When the hash table is empty, just return the same iterator for end as
+ // for begin. This is more efficient because we don't have to skip all the
+@@ -1929,7 +1929,7 @@
+ typename KeyTraits,
+ typename Allocator>
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
+- HashTable(HashTable&& other) noexcept
++ HashTable(HashTable&& other)
+ : table_(nullptr),
+ table_size_(0),
+ key_count_(0),
+@@ -2008,7 +2008,7 @@
+ typename Allocator>
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>&
+ HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
+-operator=(HashTable&& other) noexcept {
++operator=(HashTable&& other) {
+ swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/linked_hash_set.h b/third_party/blink/renderer/platform/wtf/linked_hash_set.h
+index 79c3d76d..71ef37a 100644
+--- a/third_party/blink/renderer/platform/wtf/linked_hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/linked_hash_set.h
+@@ -121,7 +121,7 @@
+ LinkedHashSetNodeBase(const LinkedHashSetNodeBase& other)
+ : prev_(nullptr), next_(nullptr) {}
+
+- LinkedHashSetNodeBase(LinkedHashSetNodeBase&& other) noexcept
++ LinkedHashSetNodeBase(LinkedHashSetNodeBase&& other)
+ : prev_(other.prev_), next_(other.next_) {
+ other.prev_ = nullptr;
+ other.next_ = nullptr;
+@@ -151,7 +151,7 @@
+ LinkedHashSetNodeBase* next)
+ : LinkedHashSetNodeBase(prev, next), value_(std::move(value)) {}
+
+- LinkedHashSetNode(LinkedHashSetNode&& other) noexcept
++ LinkedHashSetNode(LinkedHashSetNode&& other)
+ : LinkedHashSetNodeBase(std::move(other)),
+ value_(std::move(other.value_)) {}
+
+@@ -214,9 +214,9 @@
+
+ LinkedHashSet();
+ LinkedHashSet(const LinkedHashSet&);
+- LinkedHashSet(LinkedHashSet&&) noexcept;
++ LinkedHashSet(LinkedHashSet&&);
+ LinkedHashSet& operator=(const LinkedHashSet&);
+- LinkedHashSet& operator=(LinkedHashSet&&) noexcept;
++ LinkedHashSet& operator=(LinkedHashSet&&);
+
+ // Needs finalization. The anchor needs to unlink itself from the chain.
+ ~LinkedHashSet();
+@@ -748,7 +748,7 @@
+ }
+
+ template <typename T, typename U, typename V, typename W>
+-inline LinkedHashSet<T, U, V, W>::LinkedHashSet(LinkedHashSet&& other) noexcept
++inline LinkedHashSet<T, U, V, W>::LinkedHashSet(LinkedHashSet&& other)
+ : anchor_() {
+ Swap(other);
+ }
+@@ -763,7 +763,7 @@
+
+ template <typename T, typename U, typename V, typename W>
+ inline LinkedHashSet<T, U, V, W>& LinkedHashSet<T, U, V, W>::operator=(
+- LinkedHashSet&& other) noexcept {
++ LinkedHashSet&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set.h b/third_party/blink/renderer/platform/wtf/list_hash_set.h
+index ead6a87..78bd279 100644
+--- a/third_party/blink/renderer/platform/wtf/list_hash_set.h
++++ b/third_party/blink/renderer/platform/wtf/list_hash_set.h
+@@ -145,9 +145,9 @@ class ListHashSet {
+
+ ListHashSet();
+ ListHashSet(const ListHashSet&);
+- ListHashSet(ListHashSet&&) noexcept;
++ ListHashSet(ListHashSet&&);
+ ListHashSet& operator=(const ListHashSet&);
+- ListHashSet& operator=(ListHashSet&&) noexcept;
++ ListHashSet& operator=(ListHashSet&&);
+ ~ListHashSet();
+
+ void Swap(ListHashSet&);
+@@ -780,8 +780,7 @@
+ }
+
+ template <typename T, size_t inlineCapacity, typename U, typename V>
+-inline ListHashSet<T, inlineCapacity, U, V>::ListHashSet(
+- ListHashSet&& other) noexcept
++inline ListHashSet<T, inlineCapacity, U, V>::ListHashSet(ListHashSet&& other)
+ : head_(nullptr), tail_(nullptr) {
+ Swap(other);
+ }
+@@ -796,7 +795,7 @@
+
+ template <typename T, size_t inlineCapacity, typename U, typename V>
+ inline ListHashSet<T, inlineCapacity, U, V>&
+-ListHashSet<T, inlineCapacity, U, V>::operator=(ListHashSet&& other) noexcept {
++ListHashSet<T, inlineCapacity, U, V>::operator=(ListHashSet&& other) {
+ Swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/type_traits_test.cc b/third_party/blink/renderer/platform/wtf/type_traits_test.cc
+index 0930b73..1b45d55 100644
+--- a/third_party/blink/renderer/platform/wtf/type_traits_test.cc
++++ b/third_party/blink/renderer/platform/wtf/type_traits_test.cc
+@@ -158,7 +158,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentDeleted& operator=(CopyAssignmentDeleted&&) noexcept;
++ CopyAssignmentDeleted& operator=(CopyAssignmentDeleted&&);
+
+ private:
+ CopyAssignmentDeleted& operator=(const CopyAssignmentDeleted&) = delete;
+@@ -173,7 +173,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentPrivate& operator=(CopyAssignmentPrivate&&) noexcept;
++ CopyAssignmentPrivate& operator=(CopyAssignmentPrivate&&);
+
+ private:
+ CopyAssignmentPrivate& operator=(const CopyAssignmentPrivate&);
+@@ -188,7 +188,7 @@
+ STACK_ALLOCATED();
+
+ public:
+- CopyAssignmentUndeclared& operator=(CopyAssignmentUndeclared&&) noexcept;
++ CopyAssignmentUndeclared& operator=(CopyAssignmentUndeclared&&);
+ };
+
+ static_assert(!std::is_copy_assignable<CopyAssignmentUndeclared>::value,
+diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+index 3f44cd2..ee7c89a 100644
+--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
++++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+@@ -68,7 +68,7 @@
+ deleter_(deleter),
+ deleter_info_(deleter_info) {}
+ // Move constructor
+- DataHandle(DataHandle&& other) noexcept { *this = std::move(other); }
++ DataHandle(DataHandle&& other) { *this = std::move(other); }
+ ~DataHandle() {
+ if (!data_)
+ return;
+diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
+index 2783c2b..43a27f7 100644
+--- a/third_party/blink/renderer/platform/wtf/vector.h
++++ b/third_party/blink/renderer/platform/wtf/vector.h
+@@ -1018,8 +1018,8 @@
+ Vector& operator=(const Vector<T, otherCapacity, Allocator>&);
+
+ // Moving.
+- Vector(Vector&&) noexcept;
+- Vector& operator=(Vector&&) noexcept;
++ Vector(Vector&&);
++ Vector& operator=(Vector&&);
+
+ // Construct with an initializer list. You can do e.g.
+ // Vector<int> v({1, 2, 3});
+@@ -1459,7 +1459,7 @@
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ Vector<T, inlineCapacity, Allocator>::Vector(
+- Vector<T, inlineCapacity, Allocator>&& other) noexcept {
++ Vector<T, inlineCapacity, Allocator>&& other) {
+ size_ = 0;
+ // It's a little weird to implement a move constructor using swap but this
+ // way we don't have to add a move constructor to VectorBuffer.
+@@ -1468,7 +1468,7 @@
+
+ template <typename T, wtf_size_t inlineCapacity, typename Allocator>
+ Vector<T, inlineCapacity, Allocator>& Vector<T, inlineCapacity, Allocator>::
+-operator=(Vector<T, inlineCapacity, Allocator>&& other) noexcept {
++operator=(Vector<T, inlineCapacity, Allocator>&& other) {
+ swap(other);
+ return *this;
+ }
+diff --git a/third_party/blink/renderer/platform/wtf/vector_test.cc b/third_party/blink/renderer/platform/wtf/vector_test.cc
+index aa8a138..788cc2bb 100644
+--- a/third_party/blink/renderer/platform/wtf/vector_test.cc
++++ b/third_party/blink/renderer/platform/wtf/vector_test.cc
+@@ -420,8 +420,8 @@
+ class MojoMoveOnlyType final {
+ public:
+ MojoMoveOnlyType();
+- MojoMoveOnlyType(MojoMoveOnlyType&&) noexcept;
+- MojoMoveOnlyType& operator=(MojoMoveOnlyType&&) noexcept;
++ MojoMoveOnlyType(MojoMoveOnlyType&&);
++ MojoMoveOnlyType& operator=(MojoMoveOnlyType&&);
+ ~MojoMoveOnlyType();
+
+ private:
+diff --git a/third_party/blink/renderer/platform/wtf/wtf_test_helper.h b/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
+index e797445..8f31365 100644
+--- a/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
++++ b/third_party/blink/renderer/platform/wtf/wtf_test_helper.h
+@@ -36,9 +36,9 @@
+ public:
+ explicit MoveOnly(int i = 0) : i_(i) {}
+
+- MoveOnly(MoveOnly&& other) noexcept : i_(other.i_) { other.i_ = 0; }
++ MoveOnly(MoveOnly&& other) : i_(other.i_) { other.i_ = 0; }
+
+- MoveOnly& operator=(MoveOnly&& other) noexcept {
++ MoveOnly& operator=(MoveOnly&& other) {
+ if (this != &other) {
+ i_ = other.i_;
+ other.i_ = 0;
+@@ -62,12 +62,12 @@
+
+ explicit MoveOnlyHashValue(int value = kEmpty, int id = 0)
+ : value_(value), id_(id) {}
+- MoveOnlyHashValue(MoveOnlyHashValue&& other) noexcept
++ MoveOnlyHashValue(MoveOnlyHashValue&& other)
+ : value_(other.value_), id_(other.id_) {
+ other.value_ = kMovedOut;
+ other.id_ = 0;
+ }
+- MoveOnlyHashValue& operator=(MoveOnlyHashValue&& other) noexcept {
++ MoveOnlyHashValue& operator=(MoveOnlyHashValue&& other) {
+ value_ = other.value_;
+ id_ = other.id_;
+ other.value_ = kMovedOut;
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
new file mode 100644
index 00000000000..d43a091b971
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-ambiguous-nodestructor.patch
@@ -0,0 +1,39 @@
+From af77dc4014ead3d898fdc8a7a70fe5063ac9b102 Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <jose.dapena@lge.com>
+Date: Fri, 25 Oct 2019 19:01:29 +0000
+Subject: [PATCH] GCC: use brace-initializer for DohUpgrade vector
+
+Constructing NoDestructor with parenthesis constructor is ambiguous
+in GCC. Use brace-initializer to avoid that problem. This fixes this
+build error:
+
+Bug: 819294
+Change-Id: I00dda42daa1794d11e022f26ac07f92e599d106d
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879910
+Reviewed-by: Eric Orth <ericorth@chromium.org>
+Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
+Cr-Commit-Position: refs/heads/master@{#709569}
+---
+
+diff --git a/net/dns/dns_util.cc b/net/dns/dns_util.cc
+index 14997c4..637b6f2 100644
+--- a/net/dns/dns_util.cc
++++ b/net/dns/dns_util.cc
+@@ -144,7 +144,7 @@
+ // DohProviderId histogram suffix list in
+ // tools/metrics/histograms/histograms.xml.
+ static const base::NoDestructor<std::vector<DohUpgradeEntry>>
+- upgradable_servers({
++ upgradable_servers{{
+ DohUpgradeEntry(
+ "CleanBrowsingAdult",
+ {"185.228.168.10", "185.228.169.11", "2a0d:2a00:1::1",
+@@ -215,7 +215,7 @@
+ {"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"},
+ {"dns.quad9.net", "dns9.quad9.net"} /* DoT hostname */,
+ {"https://dns.quad9.net/dns-query", true /* use_post */}),
+- });
++ }};
+ return *upgradable_servers;
+ }
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
new file mode 100644
index 00000000000..05cb1e9b634
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-includes.patch
@@ -0,0 +1,102 @@
+From cf2022b11cd3e28f1f3777b060fd509f665ff8e1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 6 Jul 2020 10:21:27 -0700
+Subject: [PATCH] GCC 10 Fixes
+
+---
+ base/trace_event/trace_event_memory_overhead.h | 1 +
+ third_party/angle/include/platform/Platform.h | 1 +
+ third_party/perfetto/include/perfetto/base/task_runner.h | 2 ++
+ third_party/webrtc/call/rtx_receive_stream.h | 1 +
+ 4 files changed, 5 insertions(+)
+
+diff --git a/base/trace_event/trace_event_memory_overhead.h b/base/trace_event/trace_event_memory_overhead.h
+index 69468d4..e10a3ec 100644
+--- a/base/trace_event/trace_event_memory_overhead.h
++++ b/base/trace_event/trace_event_memory_overhead.h
+@@ -8,6 +8,7 @@
+ #include <stddef.h>
+ #include <stdint.h>
+
++#include <string>
+ #include <unordered_map>
+
+ #include "base/base_export.h"
+diff --git a/third_party/angle/include/platform/Platform.h b/third_party/angle/include/platform/Platform.h
+index cea6070..0fbd64f 100644
+--- a/third_party/angle/include/platform/Platform.h
++++ b/third_party/angle/include/platform/Platform.h
+@@ -9,6 +9,7 @@
+ #ifndef ANGLE_PLATFORM_H
+ #define ANGLE_PLATFORM_H
+
++#include <stddef.h>
+ #include <stdint.h>
+ #include <array>
+
+diff --git a/third_party/perfetto/include/perfetto/base/task_runner.h b/third_party/perfetto/include/perfetto/base/task_runner.h
+index cf60401..040aab2 100644
+--- a/third_party/perfetto/include/perfetto/base/task_runner.h
++++ b/third_party/perfetto/include/perfetto/base/task_runner.h
+@@ -17,6 +17,8 @@
+ #ifndef INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+ #define INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_
+
++#include <stdint.h>
++
+ #include <functional>
+
+ #include "perfetto/base/export.h"
+diff --git a/third_party/webrtc/call/rtx_receive_stream.h b/third_party/webrtc/call/rtx_receive_stream.h
+index 8ffa440..fb2f9f4 100644
+--- a/third_party/webrtc/call/rtx_receive_stream.h
++++ b/third_party/webrtc/call/rtx_receive_stream.h
+@@ -11,6 +11,8 @@
+ #ifndef CALL_RTX_RECEIVE_STREAM_H_
+ #define CALL_RTX_RECEIVE_STREAM_H_
+
++#include <stdint.h>
++
+ #include <map>
+
+ #include "call/rtp_packet_sink_interface.h"
+diff --git a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
+index 22528c9..2ba90bb 100644
+--- a/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
++++ b/third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h
+@@ -11,6 +11,8 @@
+ #ifndef MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_
+ #define MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_
+
++#include <stddef.h>
++
+ #include <array>
+
+ namespace webrtc {
+diff --git a/media/cdm/supported_cdm_versions.h b/media/cdm/supported_cdm_versions.h
+index 3f220da..c54e3bb 100644
+--- a/media/cdm/supported_cdm_versions.h
++++ b/media/cdm/supported_cdm_versions.h
+@@ -6,6 +6,7 @@
+ #define MEDIA_CDM_SUPPORTED_CDM_VERSIONS_H_
+
+ #include <array>
++#include <cstddef>
+
+ #include "media/base/media_export.h"
+ #include "media/cdm/api/content_decryption_module.h"
+diff --git a/third_party/webrtc/modules/video_coding/decoding_state.h b/third_party/webrtc/modules/video_coding/decoding_state.h
+index b87fb2d..ec97294 100644
+--- a/third_party/webrtc/modules/video_coding/decoding_state.h
++++ b/third_party/webrtc/modules/video_coding/decoding_state.h
+@@ -11,6 +11,7 @@
+ #ifndef MODULES_VIDEO_CODING_DECODING_STATE_H_
+ #define MODULES_VIDEO_CODING_DECODING_STATE_H_
+
++#include <cstdint>
+ #include <map>
+ #include <set>
+ #include <vector>
+--
+2.26.2
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch b/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
new file mode 100644
index 00000000000..ef57ce774a9
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-gcc-status-enum.patch
@@ -0,0 +1,31 @@
+From d48486507d6b4ed130696721a758e2a231066cf7 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 6 Jul 2020 16:33:14 -0700
+Subject: [PATCH] GCC-X11-Success-enum
+
+---
+ components/viz/host/host_display_client.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
+index 72a807e..257bc86 100644
+--- a/components/viz/host/host_display_client.h
++++ b/components/viz/host/host_display_client.h
+@@ -13,7 +13,14 @@
+ #include "build/build_config.h"
+ #include "components/viz/host/viz_host_export.h"
+ #include "mojo/public/cpp/bindings/binding.h"
++#ifdef Success
++#undef Success
++#define __X11_SUCCESS
++#endif
+ #include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
++#ifdef __X11_SUCCESS
++#define Success 0
++#endif
+ #include "ui/gfx/native_widget_types.h"
+
+ namespace viz {
+--
+2.26.2
+
diff --git a/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch b/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
new file mode 100644
index 00000000000..e0732b6ace2
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-icu-65.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 5a62770..1fae2aa 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6192,7 +6192,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
diff --git a/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch b/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
new file mode 100644
index 00000000000..c18b3ed5c51
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-79-icu-67.patch
@@ -0,0 +1,167 @@
+From 64b8ee6fc65bcce07bcaa4bba5f61f29c5495253 Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Fri, 3 Apr 2020 23:13:54 -0700
+Subject: [PATCH] [intl] Remove soon-to-be removed getAllFieldPositions
+
+Needed to land ICU67.1 soon.
+
+Bug: v8:10393
+Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618
+Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489
+Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
+Commit-Queue: Frank Tang <ftang@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#67027}
+---
+ v8/src/objects/js-number-format.cc | 76 +++++++++++++++++----------------
+ 1 file changed, 40 insertions(+), 36 deletions(-)
+
+diff --git a/v8/src/objects/js-number-format.cc b/v8/src/objects/js-number-format.cc
+index ff564975d6..ad8e173b59 100644
+--- a/v8/src/objects/js-number-format.cc
++++ b/v8/src/objects/js-number-format.cc
+@@ -1257,42 +1257,33 @@ MaybeHandle<JSNumberFormat> JSNumberFormat::New(Isolate* isolate,
+ }
+
+ namespace {
+-Maybe<icu::UnicodeString> IcuFormatNumber(
++Maybe<bool> IcuFormatNumber(
+ Isolate* isolate,
+ const icu::number::LocalizedNumberFormatter& number_format,
+- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) {
++ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) {
+ // If it is BigInt, handle it differently.
+ UErrorCode status = U_ZERO_ERROR;
+- icu::number::FormattedNumber formatted;
+ if (numeric_obj->IsBigInt()) {
+ Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj);
+ Handle<String> big_int_string;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
+ BigInt::ToString(isolate, big_int),
+- Nothing<icu::UnicodeString>());
+- formatted = number_format.formatDecimal(
++ Nothing<bool>());
++ *formatted = number_format.formatDecimal(
+ {big_int_string->ToCString().get(), big_int_string->length()}, status);
+ } else {
+- double number = numeric_obj->Number();
+- formatted = number_format.formatDouble(number, status);
++ double number = numeric_obj->IsNaN()
++ ? std::numeric_limits<double>::quiet_NaN()
++ : numeric_obj->Number();
++ *formatted = number_format.formatDouble(number, status);
+ }
+ if (U_FAILURE(status)) {
+ // This happen because of icu data trimming trim out "unit".
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=8641
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- if (fp_iter) {
+- formatted.getAllFieldPositions(*fp_iter, status);
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
+ }
+- icu::UnicodeString result = formatted.toString(status);
+- if (U_FAILURE(status)) {
+- THROW_NEW_ERROR_RETURN_VALUE(isolate,
+- NewTypeError(MessageTemplate::kIcuError),
+- Nothing<icu::UnicodeString>());
+- }
+- return Just(result);
++ return Just(true);
+ }
+
+ } // namespace
+@@ -1303,10 +1294,16 @@ MaybeHandle<String> JSNumberFormat::FormatNumeric(
+ Handle<Object> numeric_obj) {
+ DCHECK(numeric_obj->IsNumeric());
+
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<String>());
+- return Intl::ToString(isolate, maybe_format.FromJust());
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString result = formatted.toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
++ }
++ return Intl::ToString(isolate, result);
+ }
+
+ namespace {
+@@ -1419,12 +1416,18 @@ std::vector<NumberFormatSpan> FlattenRegionsToParts(
+ }
+
+ namespace {
+-Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+- icu::FieldPositionIterator* fp_iter,
++Maybe<int> ConstructParts(Isolate* isolate,
++ icu::number::FormattedNumber* formatted,
+ Handle<JSArray> result, int start_index,
+ Handle<Object> numeric_obj, bool style_is_unit) {
++ UErrorCode status = U_ZERO_ERROR;
++ icu::UnicodeString formatted_text = formatted->toString(status);
++ if (U_FAILURE(status)) {
++ THROW_NEW_ERROR_RETURN_VALUE(
++ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
++ }
+ DCHECK(numeric_obj->IsNumeric());
+- int32_t length = formatted.length();
++ int32_t length = formatted_text.length();
+ int index = start_index;
+ if (length == 0) return Just(index);
+
+@@ -1433,13 +1436,14 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ // other region covers some part of the formatted string. It's possible
+ // there's another field with exactly the same begin and end as this backdrop,
+ // in which case the backdrop's field_id of -1 will give it lower priority.
+- regions.push_back(NumberFormatSpan(-1, 0, formatted.length()));
++ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length()));
+
+ {
+- icu::FieldPosition fp;
+- while (fp_iter->next(fp)) {
+- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(),
+- fp.getEndIndex()));
++ icu::ConstrainedFieldPosition cfp;
++ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER);
++ while (formatted->nextPosition(cfp, status)) {
++ regions.push_back(
++ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit()));
+ }
+ }
+
+@@ -1461,7 +1465,7 @@ Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
+ Handle<String> substring;
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(
+ isolate, substring,
+- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos),
++ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
+ Nothing<int>());
+ Intl::AddElement(isolate, result, index, field_type_string, substring);
+ ++index;
+@@ -1481,14 +1485,14 @@ MaybeHandle<JSArray> JSNumberFormat::FormatToParts(
+ number_format->icu_number_formatter().raw();
+ CHECK_NOT_NULL(fmt);
+
+- icu::FieldPositionIterator fp_iter;
+- Maybe<icu::UnicodeString> maybe_format =
+- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter);
++ icu::number::FormattedNumber formatted;
++ Maybe<bool> maybe_format =
++ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
+ MAYBE_RETURN(maybe_format, Handle<JSArray>());
+
+ Handle<JSArray> result = factory->NewJSArray(0);
+ Maybe<int> maybe_format_to_parts = ConstructParts(
+- isolate, maybe_format.FromJust(), &fp_iter, result, 0, numeric_obj,
++ isolate, &formatted, result, 0, numeric_obj,
+ number_format->style() == JSNumberFormat::Style::UNIT);
+ MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>());
+
+--
+2.26.2
diff --git a/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
new file mode 100644
index 00000000000..27b56251ec3
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-chromium_atk_optional.patch.patch
@@ -0,0 +1,17 @@
+diff --git a/build/config/ui.gni b/build/config/ui.gni
+index 547b42f..966b00c 100644
+--- a/build/config/ui.gni
++++ b/build/config/ui.gni
+@@ -51,8 +51,10 @@ if (use_ozone) {
+ use_glib = false
+ }
+
+-# Whether to use atk, the Accessibility ToolKit library
+-use_atk = is_desktop_linux && use_x11
++declare_args() {
++ # Whether to use atk, the Accessibility ToolKit library
++ use_atk = is_desktop_linux && use_x11
++}
+ # =============================================
+ # PLEASE DO NOT ADD MORE FLAGS TO THIS FILE
+ # =============================================
diff --git a/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
new file mode 100644
index 00000000000..91ef84ca7e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-clang10_glslang.patch.patch
@@ -0,0 +1,25 @@
+From 24b3e8384e93f3e73b6aa14ea00a30574112f9ba Mon Sep 17 00:00:00 2001
+From: Reid Kleckner <rnk@google.com>
+Date: Wed, 4 Dec 2019 14:09:03 -0800
+Subject: [PATCH] Remove glslang::pool_allocator::setAllocator
+
+TPoolAllocator is not copy assignable, so this setter could never have
+been used. After a recent change (878a24ee2), new versions of Clang
+reject this code outright.
+---
+ glslang/Include/PoolAlloc.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h
+index 0e237a6a2..b8eccb883 100644
+--- a/third_party/glslang/src/glslang/Include/PoolAlloc.h
++++ b/third_party/glslang/src/glslang/Include/PoolAlloc.h
+@@ -304,7 +304,6 @@ class pool_allocator {
+ size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
+ size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
+
+- void setAllocator(TPoolAllocator* a) { allocator = *a; }
+ TPoolAllocator& getAllocator() const { return allocator; }
+
+ protected:
+
diff --git a/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch b/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
new file mode 100644
index 00000000000..f2ecdc3f32b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-compiler-r10.patch
@@ -0,0 +1,185 @@
+From a1207cc75454e653030716948d27ec27412f6fe8 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sat, 16 Jun 2019 15:43:27 +0100
+Subject: [PATCH] Disable various compiler configs
+
+---
+ build/config/compiler/BUILD.gn | 64 +++++++++++++---------------------
+ 1 file changed, 25 insertions(+), 39 deletions(-)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index a3f21b7..0a7bec6 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -230,8 +230,6 @@ config("compiler") {
+
+ configs += [
+ # See the definitions below.
+- ":clang_revision",
+- ":compiler_cpu_abi",
+ ":compiler_codegen",
+ ":compiler_deterministic",
+ ]
+@@ -471,20 +469,6 @@ config("compiler") {
+ }
+ }
+
+- if (is_clang && !is_nacl && !use_xcode_clang) {
+- cflags += [ "-fcrash-diagnostics-dir=" +
+- rebase_path("//tools/clang/crashreports", root_build_dir) ]
+-
+- cflags += [
+- # TODO(hans): Remove this once Clang generates better optimized debug info
+- # by default. https://crbug.com/765793
+- "-Xclang",
+- "-mllvm",
+- "-Xclang",
+- "-instcombine-lower-dbg-declare=0",
+- ]
+- }
+-
+ # C11/C++11 compiler flags setup.
+ # ---------------------------
+ if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") {
+@@ -1431,6 +1415,12 @@ config("default_warnings") {
+ "-Wno-narrowing",
+ ]
+
++ # -Wno-class-memaccess warns about hash table and vector in blink.
++ # But the violation is intentional.
++ if (!is_nacl) {
++ cflags_cc += [ "-Wno-class-memaccess" ]
++ }
++
+ # -Wunused-local-typedefs is broken in gcc,
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872
+ cflags += [ "-Wno-unused-local-typedefs" ]
+@@ -1525,7 +1515,7 @@ config("chromium_code") {
+ defines = [ "_HAS_NODISCARD" ]
+ }
+ } else {
+- cflags = [ "-Wall" ]
++ cflags = []
+ if (treat_warnings_as_errors) {
+ cflags += [ "-Werror" ]
+
+@@ -1534,10 +1524,6 @@ config("chromium_code") {
+ # well.
+ ldflags = [ "-Werror" ]
+ }
+- if (is_clang) {
+- # Enable extra warnings for chromium_code when we control the compiler.
+- cflags += [ "-Wextra" ]
+- }
+
+ # In Chromium code, we define __STDC_foo_MACROS in order to get the
+ # C99 macros on Mac and Linux.
+@@ -1546,15 +1532,6 @@ config("chromium_code") {
+ "__STDC_FORMAT_MACROS",
+ ]
+
+- if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
+- current_cpu != "s390" && current_cpu != "ppc64" &&
+- current_cpu != "mips" && current_cpu != "mips64") {
+- # Non-chromium code is not guaranteed to compile cleanly with
+- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
+- # disabled, so only do that for Release build.
+- defines += [ "_FORTIFY_SOURCE=2" ]
+- }
+-
+ if (is_mac) {
+ cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
+ cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
+@@ -1943,7 +1920,8 @@ config("default_stack_frames") {
+ }
+
+ # Default "optimization on" config.
+-config("optimize") {
++config("optimize") { }
++config("xoptimize") {
+ if (is_win) {
+ # TODO(thakis): Remove is_clang here, https://crbug.com/598772
+ if (is_official_build && full_wpo_on_official && !is_clang) {
+@@ -1977,7 +1955,8 @@ config("optimize") {
+ }
+
+ # Same config as 'optimize' but without the WPO flag.
+-config("optimize_no_wpo") {
++config("optimize_no_wpo") { }
++config("xoptimize_no_wpo") {
+ if (is_win) {
+ # Favor size over speed, /O1 must be before the common flags. The GYP
+ # build also specifies /Os and /GF but these are implied by /O1.
+@@ -2000,7 +1979,8 @@ config("optimize_no_wpo") {
+ }
+
+ # Turn off optimizations.
+-config("no_optimize") {
++config("no_optimize") { }
++config("xno_optimize") {
+ if (is_win) {
+ cflags = [
+ "/Od", # Disable optimization.
+@@ -2028,7 +2008,8 @@ config("no_optimize") {
+ # Turns up the optimization level. On Windows, this implies whole program
+ # optimization and link-time code generation which is very expensive and should
+ # be used sparingly.
+-config("optimize_max") {
++config("optimize_max") { }
++config("xoptimize_max") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2075,7 +2056,8 @@ config("optimize_max") {
+ #
+ # TODO(crbug.com/621335) - rework how all of these configs are related
+ # so that we don't need this disclaimer.
+-config("optimize_speed") {
++config("optimize_speed") { }
++config("xoptimize_speed") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2113,7 +2095,8 @@ config("optimize_speed") {
+ }
+ }
+
+-config("optimize_fuzzing") {
++config("optimize_fuzzing") { }
++config("xoptimize_fuzzing") {
+ cflags = [ "-O1" ] + common_optimize_on_cflags
+ ldflags = common_optimize_on_ldflags
+ visibility = [ ":default_optimization" ]
+@@ -2215,7 +2198,8 @@ config("win_pdbaltpath") {
+ }
+
+ # Full symbols.
+-config("symbols") {
++config("symbols") { }
++config("xsymbols") {
+ if (is_win) {
+ if (use_goma || is_clang) {
+ # Note that with VC++ this requires is_win_fastlink, enforced elsewhere.
+@@ -2325,7 +2309,8 @@ config("symbols") {
+ # Minimal symbols.
+ # This config guarantees to hold symbol for stack trace which are shown to user
+ # when crash happens in unittests running on buildbot.
+-config("minimal_symbols") {
++config("minimal_symbols") { }
++config("xminimal_symbols") {
+ if (is_win) {
+ # Linker symbols for backtraces only.
+ cflags = []
+@@ -2382,7 +2367,8 @@ config("minimal_symbols") {
+ }
+
+ # No symbols.
+-config("no_symbols") {
++config("no_symbols") { }
++config("xno_symbols") {
+ if (!is_win) {
+ cflags = [ "-g0" ]
+ asmflags = cflags
+--
+2.21.0
+
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch b/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
new file mode 100644
index 00000000000..4cb9503a93f
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-char_traits.patch
@@ -0,0 +1,14 @@
+--- a/base/strings/char_traits.h
++++ b/base/strings/char_traits.h
+@@ -67,9 +67,9 @@
+ return __builtin_memcmp(s1, s2, n);
+ #else
+ for (; n; --n, ++s1, ++s2) {
+- if (*s1 < *s2)
++ if ((unsigned char)*s1 < (unsigned char)*s2)
+ return -1;
+- if (*s1 > *s2)
++ if ((unsigned char)*s1 > (unsigned char)*s2)
+ return 1;
+ }
+ return 0;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
new file mode 100644
index 00000000000..15da794cbba
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-commandline-include.patch
@@ -0,0 +1,44 @@
+Electron patches the file to use base::CommandLine, but forgot to include
+the necessary header for it.
+--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc.orig 2020-04-27 13:49:41.408592941 +0200
++++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc 2020-04-27 13:49:53.841071830 +0200
+@@ -4,6 +4,7 @@
+
+ #include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+
++#include "base/command_line.h"
+ #include "cc/paint/skia_paint_canvas.h"
+ #include "components/viz/common/resources/resource_format_utils.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+--- a/third_party/blink/public/platform/web_rtc_rtp_source.h.orig 2020-04-27 14:16:05.323085814 +0200
++++ b/third_party/blink/public/platform/web_rtc_rtp_source.h 2020-04-27 14:16:17.279480838 +0200
+@@ -7,6 +7,7 @@
+
+ #include "base/optional.h"
+ #include "third_party/blink/public/platform/web_common.h"
++#include <memory>
+
+ namespace base {
+ class TimeTicks;
+--- a/chrome/browser/chrome_content_browser_client.cc.orig 2020-04-27 16:16:27.291208394 +0200
++++ b/chrome/browser/chrome_content_browser_client.cc 2020-04-27 16:16:49.283984217 +0200
+@@ -2896,6 +2896,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+--- a/chrome/browser/chrome_content_browser_client.h.orig 2020-04-27 16:15:41.932359753 +0200
++++ b/chrome/browser/chrome_content_browser_client.h 2020-04-27 16:16:09.798318845 +0200
+@@ -303,6 +303,8 @@
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
++ const std::vector<std::string>& additional_features,
++ const scoped_refptr<network::ResourceRequestBody>& body,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) override;
diff --git a/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
new file mode 100644
index 00000000000..4dc024693e6
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-fix-sucess-definition.patch
@@ -0,0 +1,15 @@
+X11.h defines a macro called "Success", which is 0. This breaks an enum
+that is generated in Chromium that has a member "Success", so undefine
+it.
+--- a/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc.orig 2020-04-27 18:42:15.457297544 +0200
++++ b/chrome/browser/ui/libgtkui/select_file_dialog_impl_kde.cc 2020-04-27 18:42:21.760454304 +0200
+@@ -24,7 +24,9 @@
+ #include "base/task/post_task.h"
+ #include "base/task/task_traits.h"
+ #include "base/threading/thread_restrictions.h"
++#undef Success
+ #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h"
++#define Success 0
+ #include "content/public/browser/browser_thread.h"
+ #include "ui/aura/window_tree_host.h"
+ #include "ui/base/l10n/l10n_util.h"
diff --git a/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch b/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
new file mode 100644
index 00000000000..1e09cb8044c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gcc-lto.patch
@@ -0,0 +1,131 @@
+From 15d9b2515631cedcbd427e4c6de2dd4e7a0bfa36 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Sat, 4 Jan 2020 16:03:03 -0500
+Subject: [PATCH] GCC LTO Support
+
+---
+ build/config/BUILD.gn | 6 +++++-
+ build/config/compiler/BUILD.gn | 30 ++++++++++++++++++++++--------
+ build/config/compiler/compiler.gni | 2 +-
+ sandbox/linux/BUILD.gn | 3 +++
+ 4 files changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
+index 514ab7b..f8d36fe 100644
+--- a/build/config/BUILD.gn
++++ b/build/config/BUILD.gn
+@@ -260,9 +260,13 @@ config("default_libs") {
+ } else if (is_linux) {
+ libs = [
+ "dl",
+- "pthread",
+ "rt",
+ ]
++ ldflags = [
++ "-Wl,--no-as-needed",
++ "-lpthread",
++ "-Wl,--as-needed"
++ ]
+ }
+ }
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index a3f21b7..48747f7 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -558,12 +558,13 @@ config("compiler") {
+ # TODO(pcc): Make this conditional on is_official_build rather than on gn
+ # flags for specific features.
+ if (!is_debug && use_thin_lto && is_a_target_toolchain) {
+- assert(use_lld || target_os == "chromeos",
+- "gold plugin only supported with ChromeOS")
+-
+- cflags += [ "-flto=thin" ]
++ if (is_clang) {
++ cflags += [ "-flto=thin" ]
++ } else {
++ cflags += [ "-flto=2", "-fno-fat-lto-objects", "-fuse-linker-plugin" ]
++ }
+
+- if (target_os != "chromeos") {
++ if (target_os != "chromeos" && is_clang) {
+ cflags += [ "-fsplit-lto-unit" ]
+ }
+
+@@ -586,7 +587,11 @@ config("compiler") {
+ "-mllvm:-import-instr-limit=10",
+ ]
+ } else {
+- ldflags += [ "-flto=thin" ]
++ if (is_clang) {
++ ldflags += [ "-flto=thin" ]
++ } else {
++ ldflags += [ "-flto=8", "-fno-fat-lto-objects", "-fuse-linker-plugin" ]
++ }
+
+ # Limit the parallelism to avoid too aggressive competition between
+ # linker jobs. This is still suboptimal to a potential dynamic
+@@ -607,7 +612,7 @@ config("compiler") {
+ "-Wl,--thinlto-cache-policy,$cache_policy",
+ ]
+ }
+- } else {
++ } else if (is_clang) {
+ ldflags += [ "-Wl,-plugin-opt,jobs=8" ]
+ }
+
+@@ -630,7 +635,7 @@ config("compiler") {
+
+ # TODO(pcc): Re-enable this flag on Android. This will require libc++ to be
+ # built with ThinLTO (see https://crbug.com/767901) as well as the GVR shim.
+- if (!is_android) {
++ if (!is_android && is_clang) {
+ cflags += [ "-fwhole-program-vtables" ]
+ if (!is_win) {
+ ldflags += [ "-fwhole-program-vtables" ]
+@@ -697,6 +702,15 @@ config("compiler") {
+ }
+ }
+
++config("compiler_no_lto") {
++ cflags = []
++ ldflags = []
++ if (!is_debug && use_thin_lto && is_a_target_toolchain) {
++ cflags += ["-fno-lto"]
++ ldflags += ["-fno-lto"]
++ }
++}
++
+ # This provides the basic options to select the target CPU and ABI.
+ # It is factored out of "compiler" so that special cases can use this
+ # without using everything that "compiler" brings in. Options that
+diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
+index c351d6b..e567372 100644
+--- a/build/config/compiler/compiler.gni
++++ b/build/config/compiler/compiler.gni
+@@ -57,7 +57,7 @@ declare_args() {
+
+ # Enables support for ThinLTO, which links 3x-10x faster than full LTO. See
+ # also http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
+- use_thin_lto = is_cfi || (is_android && is_official_build)
++ use_thin_lto = false
+
+ # Tell VS to create a PDB that references information in .obj files rather
+ # than copying it all. This should improve linker performance. mspdbcmf.exe
+diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn
+index b00a88c..e4615c0 100644
+--- a/sandbox/linux/BUILD.gn
++++ b/sandbox/linux/BUILD.gn
+@@ -256,6 +256,9 @@ component("seccomp_bpf") {
+ "//base",
+ "//base/third_party/dynamic_annotations",
+ ]
++ configs += [
++ "//build/config/compiler:compiler_no_lto"
++ ]
+
+ if (is_nacl_nonsfi) {
+ cflags = [ "-fgnu-inline-asm" ]
+--
+2.24.1
+
diff --git a/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch b/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
new file mode 100644
index 00000000000..098b6832242
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gcc-shared.patch
@@ -0,0 +1,20 @@
+--- a/build/toolchain/gcc_toolchain.gni 2019-11-19 02:27:43.000000000 +0100
++++ - 2020-07-21 00:59:09.201421469 +0200
+@@ -371,7 +371,7 @@
+ # .TOC file, overwrite it, otherwise, don't change it.
+ tocfile = sofile + ".TOC"
+
+- link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
++ link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -shared @\"$rspfile\""
+
+ # Generate a map file to be used for binary size analysis.
+ # Map file adds ~10% to the link time on a z620.
+@@ -450,7 +450,7 @@
+ unstripped_sofile = sofile
+ }
+
+- command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" @\"$rspfile\""
++ command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" -shared @\"$rspfile\""
+
+ if (defined(invoker.strip)) {
+ strip_command = "${invoker.strip} -o \"$sofile\" \"$unstripped_sofile\""
diff --git a/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
new file mode 100644
index 00000000000..e9f95f09cae
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
new file mode 100644
index 00000000000..27cd2cefc46
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-libc_malloc.patch
@@ -0,0 +1,26 @@
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
+@@ -21,6 +21,12 @@
+ #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
+ #endif
+
++#if defined(LIBC_GLIBC)
++extern "C" {
++extern void *__libc_malloc(size_t size);
++}
++#endif
++
+ namespace base {
+
+ size_t g_oom_size = 0U;
+--- a/base/process/memory_linux.cc.orig 2017-09-15 08:46:55.000000000 +0000
++++ b/base/process/memory_linux.cc 2017-09-15 08:51:34.422016858 +0000
+@@ -107,7 +107,7 @@
+ (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC))
+ *result = malloc(size);
+ #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+- *result = __libc_malloc(size);
++ *result = ::__libc_malloc(size);
+ #elif defined(USE_TCMALLOC)
+ *result = tc_malloc_skip_new_handler(size);
+ #endif
diff --git a/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch b/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
new file mode 100644
index 00000000000..0dace261a08
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-toolchain-host.patch
@@ -0,0 +1,11 @@
+--- src/build/toolchain/linux/unbundle/BUILD.gn 2020-07-21 17:36:34.064748261 +0200
++++ - 2020-07-21 17:39:03.115740522 +0200
+@@ -35,7 +35,7 @@
+ extra_ldflags = getenv("BUILD_LDFLAGS")
+
+ toolchain_args = {
+- current_cpu = current_cpu
++ current_cpu = host_cpu
+ current_os = current_os
+ }
+ }
diff --git a/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch b/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
new file mode 100644
index 00000000000..951a2adb196
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-unbundle-zlib-r1.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn
+index 3bc618a..e0ddf6d 100644
+--- a/third_party/perfetto/gn/BUILD.gn
++++ b/third_party/perfetto/gn/BUILD.gn
+@@ -244,7 +244,7 @@ if (enable_perfetto_trace_processor || perfetto_build_standalone ||
+ "//buildtools:zlib",
+ ]
+ } else {
+- public_configs = [ "//third_party/zlib:zlib_config" ]
++ public_configs = [ "//third_party/zlib:system_zlib" ]
+ public_deps = [
+ "//third_party/zlib",
+ ]
diff --git a/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch b/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
new file mode 100644
index 00000000000..d018a87094d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/chromium-upstream-force-mp3-files-to-have-a-start-time-of-zero.patch
@@ -0,0 +1,38 @@
+From 192fc3899f76e9487d77895f31df8d2d13bf9619 Mon Sep 17 00:00:00 2001
+From: Dale Curtis <dalecurtis@chromium.org>
+Date: Fri, 26 Jun 2020 01:10:55 +0000
+Subject: [PATCH] Force mp3 files to have a start time of zero.
+
+This will allow us to remove our custom patch which breaks upstream
+ffmpeg functionality for unknown reasons.
+
+R=sandersd
+
+Fixed: 1062037
+Change-Id: I253011843dee4dd6a8c958b14990ad836a9f1dca
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2268221
+Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
+Reviewed-by: Dan Sanders <sandersd@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#782792}
+---
+ media/filters/ffmpeg_demuxer.cc | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index 01266e1a072..a7ed542b5fc 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -1522,6 +1522,12 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
+ if (glue_->container() == container_names::CONTAINER_AVI)
+ format_context->flags |= AVFMT_FLAG_GENPTS;
+
++ // FFmpeg will incorrectly adjust the start time of MP3 files into the future
++ // based on discard samples. We were unable to fix this upstream without
++ // breaking ffmpeg functionality. https://crbug.com/1062037
++ if (glue_->container() == container_names::CONTAINER_MP3)
++ start_time_ = base::TimeDelta();
++
+ // For testing purposes, don't overwrite the timeline offset if set already.
+ if (timeline_offset_.is_null()) {
+ timeline_offset_ =
diff --git a/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
new file mode 100644
index 00000000000..916dba9dc3b
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch
@@ -0,0 +1,42 @@
+From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Thu, 12 Dec 2019 16:12:18 -0500
+Subject: [PATCH] Add a script to list patch targets
+
+---
+ script/list_patch_targets.py | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+ create mode 100755 script/list_patch_targets.py
+
+diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py
+new file mode 100755
+index 000000000..55173bac9
+--- /dev/null
++++ b/script/list_patch_targets.py
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python
++
++import argparse
++import json
++
++
++def parse_args():
++ parser = argparse.ArgumentParser(description='Apply Electron patches')
++ parser.add_argument('config', nargs='+',
++ type=argparse.FileType('r'),
++ help='patches\' config(s) in the JSON format')
++ return parser.parse_args()
++
++
++def main():
++ configs = parse_args().config
++ for config_json in configs:
++ for patch_dir, repo in json.load(config_json).iteritems():
++ print(repo)
++
++
++if __name__ == '__main__':
++ main()
+--
+2.23.0
+
diff --git a/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
new file mode 100644
index 00000000000..a591c2edf62
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-Build-fixes.patch.patch
@@ -0,0 +1,57 @@
+diff --git a/build/args/all.gn b/build/args/all.gn
+index 8bbb86e28..8476d09ea 100644
+--- a/build/args/all.gn
++++ b/build/args/all.gn
+@@ -1,5 +1,4 @@
+ is_electron_build = true
+-use_jumbo_build = true
+ root_extra_deps = [ "//electron" ]
+
+ # Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
+diff --git a/build/args/release.gn b/build/args/release.gn
+index e5017f6e1..59207b389 100644
+--- a/build/args/release.gn
++++ b/build/args/release.gn
+@@ -1,6 +1,4 @@
+ import("all.gn")
+-is_component_build = false
+-is_official_build = true
+
+ # This may be guarded behind is_chrome_branded alongside
+ # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321,
+@@ -8,9 +6,3 @@ is_official_build = true
+ # The initialization of the decoder depends on whether ffmpeg has
+ # been built with H.264 support.
+ rtc_use_h264 = proprietary_codecs
+-
+-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order
+-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or
+-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library,
+-# we build ffmpeg as a shared library.
+-is_component_ffmpeg = true
+diff --git a/build/npm.gni b/build/npm.gni
+index a1987d095..fb33a14c3 100644
+--- a/build/npm.gni
++++ b/build/npm.gni
+@@ -35,7 +35,6 @@ template("npm_action") {
+ if (!defined(deps)) {
+ deps = []
+ }
+- deps += [ ":npm_pre_flight_" + target_name ]
+
+ script = "//electron/build/npm-run.py"
+ args = [
+diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+index 0dc9916be..7eaa46bf5 100644
+--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch
+@@ -30,7 +30,7 @@
+ + # these values being accurate.
+ + 'build_v8_with_gn': 'false',
+ + 'enable_lto%': 'false',
+-+
+++ 'openssl_fips': '',
+ 'conditions': [
+ ['target_arch=="arm64"', {
+ # Disabled pending https://github.com/nodejs/node/issues/23913.
+
diff --git a/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
new file mode 100644
index 00000000000..fb134748025
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-dont-assume-python-is-python2.patch
@@ -0,0 +1,17 @@
+--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200
++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
+
+--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200
++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from __future__ import print_function
+ import os
+ import subprocess
diff --git a/srcpkgs/electron7/files/patches/electron-fix-includes.patch b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
new file mode 100644
index 00000000000..9df1fd6946d
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-fix-includes.patch
@@ -0,0 +1,19 @@
+--- a/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch.orig 2020-04-27 16:37:09.934271227 +0200
++++ b/patches/chromium/feat_offscreen_rendering_with_viz_compositor.patch 2020-04-27 16:37:50.903207166 +0200
+@@ -350,7 +350,7 @@
+ index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
+ --- /dev/null
+ +++ b/components/viz/service/display_embedder/software_output_device_proxy.h
+-@@ -0,0 +1,88 @@
++@@ -0,0 +1,89 @@
+ +// Copyright 2014 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.
+@@ -364,6 +364,7 @@
+ +
+ +#include <memory>
+ +
+++#include "base/threading/thread_checker.h"
+ +#include "components/viz/host/host_display_client.h"
+ +#include "components/viz/service/display/software_output_device.h"
+ +#include "components/viz/service/viz_service_export.h"
diff --git a/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
new file mode 100644
index 00000000000..2567540869c
--- /dev/null
+++ b/srcpkgs/electron7/files/patches/electron-mjsunit-not-exsit.patch.patch
@@ -0,0 +1,47 @@
+diff --git a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+index bafd0b0..949cb2d 100644
+--- a/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
++++ b/patches/v8/make_createdynamicfunction_throw_if_disallowed.patch
+@@ -25,42 +25,3 @@ index f75014d034626643ae83dc8f167a473b7291522c..b5c2e8b25f10f2fff9011a0a1bd1aeef
+ }
+
+ // Build the source string.
+-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
+-index 134a49f7480c87acbb08133a2d6a4d028bbdd090..7dcaa412199770d7c4f688d7f8a66d887130bf82 100644
+---- a/test/mjsunit/mjsunit.status
+-+++ b/test/mjsunit/mjsunit.status
+-@@ -232,6 +232,9 @@
+- # BUG(v8:6306).
+- 'wasm/huge-memory': [SKIP],
+-
+-+ # Needs to be adapted after changes to Function constructor. chromium:1065094
+-+ 'cross-realm-filtering': [SKIP],
+-+
+- # Allocates a huge string and then flattens it, very slow in debug mode.
+- 'regress/regress-752764': [PASS, ['mode == debug', SLOW]],
+-
+-diff --git a/test/mjsunit/regress-1065094.js b/test/mjsunit/regress-1065094.js
+-new file mode 100644
+-index 0000000000000000000000000000000000000000..365e20285bb0505dec3f84c4df57db0525e7acc3
+---- /dev/null
+-+++ b/test/mjsunit/regress-1065094.js
+-@@ -0,0 +1,19 @@
+-+// Copyright 2020 the V8 project authors. All rights reserved.
+-+// Use of this source code is governed by a BSD-style license that can be
+-+// found in the LICENSE file.
+-+
+-+// Flags: --allow-natives-syntax
+-+
+-+function f(fnConstructor) {
+-+ return Object.is(new fnConstructor(), undefined);
+-+}
+-+
+-+const realmIndex = Realm.createAllowCrossRealmAccess();
+-+const otherFunction = Realm.global(realmIndex).Function;
+-+Realm.detachGlobal(realmIndex);
+-+
+-+%PrepareFunctionForOptimization(f);
+-+assertFalse(f(Function));
+-+assertThrows(_ => f(otherFunction));
+-+%OptimizeFunctionOnNextCall(f);
+-+assertThrows(_ => f(otherFunction));
diff --git a/srcpkgs/electron7/template b/srcpkgs/electron7/template
new file mode 100644
index 00000000000..40f9ccbf5bf
--- /dev/null
+++ b/srcpkgs/electron7/template
@@ -0,0 +1,341 @@
+# Template file for 'electron7'
+pkgname=electron7
+version=7.3.2
+revision=1
+_nodever=12.8.1
+_chromiumver=78.0.3904.108
+archs="x86_64* aarch64* i686"
+create_wrksrc=yes
+build_wrksrc="src"
+hostmakedepends="$(vopt_if clang clang) yasm python pkgconf perl gperf bison ninja nodejs hwids
+ libwebp-devel freetype-devel harfbuzz-devel libpng-devel nss-devel which git libevent-devel
+ pciutils-devel libatomic-devel ffmpeg-devel libxml2-devel libglib-devel yarn openjdk libxslt-devel
+ opus-devel libXcursor-devel libXcomposite-devel libXtst-devel libXrandr-devel libXScrnSaver-devel
+ alsa-lib-devel re2-devel snappy-devel mit-krb5-devel"
+makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel
+ libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel
+ libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel
+ libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel
+ libxml2-devel libxslt-devel $(vopt_if pulseaudio pulseaudio-devel) libexif-devel
+ libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel
+ libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel
+ minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel
+ re2-devel fontconfig-devel freetype-devel opus-devel libatomic-devel
+ ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel"
+short_desc="Application development framework based on web technologies"
+maintainer="John <me@johnnynator.dev>"
+license="BSD-3-Clause"
+homepage="https://electronjs.org"
+distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz
+ https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz
+ https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz"
+checksum="4ede501f0d5ee3068474c9e2ac154cd23fdb3580c0cff5230d4ddcffe542e6ba
+ f9c53839f306d2973de27723360024f7904101d426b9e7e9cdb56e8bcc775b0e
+ 11648d586f68ee5fc38e4cadf3974541aac4a67709fa028e9075aff42e28d9b9"
+
+no_generic_pkgconfig_link=yes
+lib32disabled=yes
+nodebug=yes
+nopie=yes # contains tools that are not PIE, enables PIE itself
+
+# XXX: pulseaudio broken at compile time
+build_options="pulseaudio clang"
+build_options_default="pulseaudio"
+
+if [ -z "$CROSS_BUILD" ]; then
+ build_options_default+=" clang"
+fi
+
+if [ "$build_option_clang" ]; then
+ nocross="No proper setup for using clang as cross compiler in void yet"
+elif [ "$CROSS_BUILD" ] && [ "${XBPS_TARGET_MACHINE%%-musl}" = "aarch64" ]; then
+ broken="{standard input}: Error: unaligned opcodes detected in executable segment"
+ # This might also happen with non-cross gcc?
+fi
+
+_buildtype=Release
+_is_debug=false
+
+CFLAGS="-Wno-unknown-warning-option -fPIC"
+CXXFLAGS="-Wno-unknown-warning-option -fPIC"
+
+_apply_patch() {
+ local args="$1" pname="$(basename $2)"
+
+ if [ ! -f ".${pname}_done" ]; then
+ msg_normal "$pkgver: patching: ${pname}.\n"
+ patch -N $args -i $2
+ touch .${pname}_done
+ fi
+}
+
+_get_chromium_arch() {
+ case "$1" in
+ x86_64*) echo x64 ;;
+ i686*) echo x86 ;;
+ arm*) echo arm ;;
+ aarch64*) echo arm64 ;;
+ ppc64*) echo ppc64 ;;
+ ppc*) echo ppc ;;
+ mipsel*) echo mipsel ;;
+ mips*) echo mips ;;
+ *) msg_error "$pkgver: cannot be compiled for ${XBPS_TARGET_MACHINE}.\n" ;;
+ esac
+}
+
+post_extract() {
+ ln -s chromium-$_chromiumver src
+ mkdir -p src/third_party/
+ ln -s ../../node-$_nodever src/third_party/electron_node
+ ln -s ../electron-${version} src/electron
+
+}
+
+post_patch() {
+ cd $wrksrc
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ electron*.patch)
+ cd src/electron
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+
+ # Sigh, electron uses git am...
+ python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do
+ cd "$wrksrc"/"$repopath"
+ git init -q
+ git config "gc.auto" 0
+ if [ "$repopath" != "src" ]; then
+ echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore"
+ fi
+ git add .
+ git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \
+ commit -q -m "." || true
+ done
+ cd $wrksrc
+ python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json
+
+ for x in $FILESDIR/patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+
+ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+ for x in $FILESDIR/musl-patches/*; do
+ case "${x##*/}" in
+ chromium*.patch)
+ cd src
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ electron*.patch)
+ cd src/electron
+ _apply_patch -p1 "$x"
+ cd "$wrksrc";;
+ esac
+ done
+ fi
+}
+
+pre_configure() {
+ cd "$wrksrc/$build_wrksrc"
+
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion
+ touch chrome/test/data/webui/i18n_process_css_test.html
+ # Use the file at run time instead of effectively compiling it in
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # reusable system library settings
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ yasm
+ zlib
+ "
+ for _lib in $use_system libjpeg_turbo; do
+ msg_normal "Removing buildscripts for system provided $_lib\n"
+ find -type f -path "*third_party/$_lib/*" \
+ \! -path "*third_party/$_lib/chromium/*" \
+ \! -path "*third_party/$_lib/google/*" \
+ \! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
+ \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
+ \! -path './third_party/yasm/run_yasm.py' \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+
+
+ msg_normal "Replacing gn files\n"
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries \
+ $use_system
+ third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+do_configure() {
+ local target_arch="$(_get_chromium_arch ${XBPS_TARGET_MACHINE})"
+ local host_arch="$(_get_chromium_arch ${XBPS_MACHINE})"
+ # the build system will set march for use, adding it to cflags will break builds
+ export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} )
+ export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} )
+ local conf=()
+ cd third_party/electron_node
+ if [ "$CROSS_BUILD" ]; then
+ conf_args=" --dest-cpu=${target_arch} --cross-compiling"
+ fi
+ ./configure --prefix=/usr \
+ --shared-zlib \
+ --shared-libuv \
+ --shared-openssl \
+ --shared-cares \
+ --openssl-use-def-ca-store \
+ --without-npm \
+ --without-dtrace \
+ --without-bundled-v8 \
+ ${conf_args}
+
+ cd "$wrksrc/$build_wrksrc"/electron
+ yarn install
+ cd "$wrksrc/$build_wrksrc"
+
+ if [ "$build_option_clang" ]; then
+ export CC=clang
+ export CXX=clang++
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ else
+ export CXXFLAGS="$CXXFLAGS -fpermissive"
+ export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive"
+ export BUILD_AR="$AR_host"
+ export BUILD_NM="$NM_host"
+ fi
+
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Void Linux use ONLY.
+ conf+=(
+ 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"'
+ 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"'
+ 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"'
+ )
+
+ conf+=(
+ 'blink_symbol_level=0'
+ 'clang_use_chrome_plugins=false'
+ 'closure_compile=true'
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ )
+ if [ "$CROSS_BUILD" ]; then
+ conf+=(
+ 'host_toolchain="//build/toolchain/linux/unbundle:host"'
+ 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"'
+ "host_pkg_config=\"$PKG_CONFIG_FOR_BUILD\""
+ "pkg_config=\"$PKG_CONFIG\""
+ )
+ else
+ conf+=(
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"'
+ )
+ fi
+ conf+=(
+ 'enable_hangout_services_extension=true'
+ 'enable_nacl_nonsfi=false'
+ 'enable_nacl=false'
+ 'enable_precompiled_headers=false'
+ 'fatal_linker_warnings=false'
+ 'ffmpeg_branding="Chrome"'
+ 'fieldtrial_testing_like_official_build=true'
+ 'gold_path="/usr/bin/ld.gold"'
+ 'icu_use_data_file=true'
+ "is_clang=$(vopt_if clang true false)"
+ 'is_component_build=false'
+ "is_debug=$_is_debug"
+ 'is_desktop_linux=true'
+ 'linux_use_bundled_binutils=false'
+ 'proprietary_codecs=true'
+ 'symbol_level=0'
+ 'treat_warnings_as_errors=false'
+ 'use_allocator_shim=false'
+ 'use_allocator="none"'
+ 'use_cups=true'
+ 'use_custom_libcxx=false'
+ 'use_gnome_keyring=false'
+ 'use_gold=false'
+ 'use_lld=false'
+ "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')"
+ 'use_sysroot=false'
+ 'use_system_harfbuzz=true'
+ "target_cpu=\"$target_arch\""
+ "host_cpu=\"$host_arch\""
+ 'import("//electron/build/args/release.gn")'
+ )
+
+ msg_normal "Bootstrapping GN\n"
+ CC="${CC_FOR_BUILD:-$CC}" CXX="${CXX_FOR_BUILD:-$CXX}" LD="${LD_FOR_BUILD:-$LD}" \
+ CFLAGS="${CFLAGS_FOR_BUILD:-$CFLAGS}" CXXFLAGS="${CXXFLAGS_FOR_BUILD:-$CXXFLAGS}" \
+ LDFLAGS="${XBPS_LDFLAGS}" \
+ python2 tools/gn/bootstrap/bootstrap.py -s -v --skip-generate-buildfiles
+
+ msg_normal "Configuring build\n"
+ out/Release/gn gen out/$_buildtype --args="${conf[*]}"
+}
+
+do_build() {
+ export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} )
+ export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} )
+ if [ "$build_option_clang" ]; then
+ export CC=clang
+ export CXX=clang++
+ export HOST_CC=clang
+ export HOST_CXX=clang++
+ else
+ export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive"
+ export CXXFLAGS="$CXXFLAGS -fpermissive"
+ export BUILD_AR="$AR_host"
+ export BUILD_NM="$NM_host"
+ fi
+ msg_normal "Ninja turtles GO!\n"
+ ninja ${makejobs} -C out/$_buildtype electron third_party/electron_node:headers
+ # finish rest of the build
+ strip -s out/$_buildtype/electron
+ ninja ${makejobs} -C out/$_buildtype electron_dist_zip
+}
+
+do_install() {
+ vmkdir /usr/lib/$pkgname
+ vmkdir /usr/include/$pkgname
+ bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname"
+
+ chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox"
+
+ cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname
+
+ vlicense ${wrksrc}/src/LICENSE chromium.LICENSE
+ vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE
+ vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE
+
+ vmkdir /usr/bin
+ ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin/$pkgname
+}
diff --git a/srcpkgs/electron7/update b/srcpkgs/electron7/update
new file mode 100644
index 00000000000..3af8e58b535
--- /dev/null
+++ b/srcpkgs/electron7/update
@@ -0,0 +1,2 @@
+site=https://www.electronjs.org/releases/stable?version=${version%%.*}
+pattern='tag/v\K[\d\.]+(?=")'
From 9de29e8779de4eec372307f71affae022a0ca9b1 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Fri, 8 May 2020 19:17:09 +0200
Subject: [PATCH 2/2] vscode: built against system electron
[ci skip]
---
common/shlibs | 1 -
.../vscode/patches/dont-download-ffmpeg.patch | 14 ++++++++++
srcpkgs/vscode/patches/fix_dir.patch | 6 ++--
srcpkgs/vscode/template | 28 +++++++++++++------
4 files changed, 36 insertions(+), 13 deletions(-)
create mode 100644 srcpkgs/vscode/patches/dont-download-ffmpeg.patch
diff --git a/common/shlibs b/common/shlibs
index 4d3dfa3c7fe..993b3d4c18b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -125,7 +125,6 @@ libGLESv2.so discord-0.0.7_1
libGLESv2.so keybase-desktop-3.1.2_1
libGLESv2.so riot-desktop-0.17.9_2
libGLESv2.so wire-desktop-3.6.2885_1
-libGLESv2.so vscode-1.36.1_1
libGLESv2.so Signal-Desktop-1.23.2_1
libGLESv2.so slack-desktop-3.4.2_1
libbrcmEGL.so rpi-userland-20180103_2
diff --git a/srcpkgs/vscode/patches/dont-download-ffmpeg.patch b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
new file mode 100644
index 00000000000..95eee361e1b
--- /dev/null
+++ b/srcpkgs/vscode/patches/dont-download-ffmpeg.patch
@@ -0,0 +1,14 @@
+diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
+index 3488d7b51c..731282a881 100644
+--- a/build/gulpfile.vscode.js
++++ b/build/gulpfile.vscode.js
+@@ -267,7 +267,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
+ let result = all
+ .pipe(util.skipDirectories())
+ .pipe(util.fixWin32DirectoryPermissions())
+- .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
++ .pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: false })))
+ .pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version'], { dot: true }));
+
+ if (platform === 'linux') {
+
diff --git a/srcpkgs/vscode/patches/fix_dir.patch b/srcpkgs/vscode/patches/fix_dir.patch
index f4251e89bcb..8132ac7e28c 100644
--- a/srcpkgs/vscode/patches/fix_dir.patch
+++ b/srcpkgs/vscode/patches/fix_dir.patch
@@ -20,7 +20,7 @@ index b85525fbd042..dc7617051b95 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --open-url %U
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --open-url %U
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
@@ -33,7 +33,7 @@ index b975e1094a2c..a094cc36e810 100644
Comment=Code Editing. Redefined.
GenericName=Text Editor
-Exec=@@EXEC@@ --no-sandbox --unity-launch %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --unity-launch %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -42,5 +42,5 @@ index b975e1094a2c..a094cc36e810 100644
[Desktop Action new-empty-window]
Name=New Empty Window
-Exec=@@EXEC@@ --no-sandbox --new-window %F
-+Exec=/usr/lib/@@NAME@@/@@NAME@@ --no-sandbox --new-window %F
++Exec=/usr/lib/@@NAME@@/bin/@@NAME@@ --no-sandbox --new-window %F
Icon=@@ICON@@
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index 9624022dcd0..79266fd5288 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -1,10 +1,11 @@
# Template file for 'vscode'
pkgname=vscode
version=1.47.3
-revision=1
+revision=2
+_electronver=7.3.2
hostmakedepends="pkg-config python nodejs-lts-10 yarn tar"
-makedepends="libxkbfile-devel libsecret-devel"
-depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils"
+makedepends="libxkbfile-devel libsecret-devel electron7"
+depends="libXtst libxkbfile nss dejavu-fonts-ttf xdg-utils ripgrep electron7"
short_desc="Microsoft Code for Linux"
maintainer="shizonic <realtiaz@gmail.com>"
license="MIT"
@@ -13,10 +14,6 @@ distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz"
checksum=463c8d5c3e02035ada5c0b9dcbb8718841fa27f6258838bfa4bab3a916ca16f3
patch_args="-Np1"
-# Due to electron
-archs="x86_64"
-nostrip_files="code-oss"
-
pre_build() {
# Use yarn to install dependencies
echo "" > build/npm/preinstall.js
@@ -26,6 +23,9 @@ pre_build() {
_TELEMETRY_URLS="(dc\.services\.visualstudio\.com)|(vortex\.data\.microsoft\.com)"
_REPLACEMENT="s/$_TELEMETRY_URLS/0\.0\.0\.0/g"
grep -rl --exclude-dir=.git -E $_TELEMETRY_URLS | xargs sed -i -E $_REPLACEMENT
+
+ # set used electron version
+ sed -i "s/^target .*/target \"${_electronver}\"/" .yarnrc
}
do_build() {
@@ -35,18 +35,28 @@ do_build() {
_mem_limit="--max_old_space_size=4095"
export NODE_OPTIONS="${_mem_limit}"
- yarn install --ignore-engines --arch=x64
+ /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp install \
+ --target=$_electronver \
+ --tarball=/usr/include/electron7/node_headers.tar.gz
+ yarn install --ignore-engines --frozen-lockfile --arch=x64
+ export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
}
do_install() {
vmkdir usr/lib/code-oss
- vcopy ../VSCode-linux-x64/* usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/resources usr/lib/code-oss
+ vcopy ../VSCode-linux-x64/bin usr/lib/code-oss
vmkdir usr/bin
ln -sf /usr/lib/code-oss/bin/code-oss ${DESTDIR}/usr/bin/
vmkdir usr/share/applications
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.desktop ${DESTDIR}/usr/share/applications/code-oss.desktop
vmkdir usr/share/pixmaps
ln -sf /usr/lib/code-oss/resources/app/resources/linux/code.png ${DESTDIR}/usr/share/pixmaps/code-oss.png
+ ln -sf /usr/bin/rg ${DESTDIR}/usr/lib/code-oss/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
+ vsed \
+ -e "s|ELECTRON=.*|ELECTRON=/usr/lib/electron${_electronver%%.*}/electron|g" \
+ -e 's|"$CLI"|"$CLI" --app="${VSCODE_PATH}/resources/app"|g' \
+ -i "$DESTDIR"/usr/lib/code-oss/bin/code-oss
vlicense LICENSE.txt
}
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PR PATCH] [Closed]: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (16 preceding siblings ...)
2020-08-16 15:45 ` Johnnynator
@ 2020-08-16 21:11 ` Johnnynator
2020-08-16 23:31 ` fosslinux
` (2 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Johnnynator @ 2020-08-16 21:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
There's a closed pull request on the void-packages repository
system wide electron package
https://github.com/void-linux/void-packages/pull/21758
Description:
Test repo: https://void.johnnynator.dev/electron/
to do: reintroduce system zlib patch
to do: electron8 package for all the other electron apps
to do: bring the template more in line with the chromium one stile wise
Thanks to @Cogitri who did prepare most of this work
P.s. I'm already sorry for the build server to get a 3rd chromium package to build occasionally.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (17 preceding siblings ...)
2020-08-16 21:11 ` [PR PATCH] [Closed]: " Johnnynator
@ 2020-08-16 23:31 ` fosslinux
2020-11-04 15:48 ` kedodrill
2020-11-04 15:50 ` Duncaen
20 siblings, 0 replies; 22+ messages in thread
From: fosslinux @ 2020-08-16 23:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
New comment by fosslinux on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-674592362
Comment:
Woo!
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (18 preceding siblings ...)
2020-08-16 23:31 ` fosslinux
@ 2020-11-04 15:48 ` kedodrill
2020-11-04 15:50 ` Duncaen
20 siblings, 0 replies; 22+ messages in thread
From: kedodrill @ 2020-11-04 15:48 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
New comment by kedodrill on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-721811341
Comment:
> Woo!
Bit confused here, as this is closed I assume it did not make it into `master`? Or is the push / merge process different somehow?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: system wide electron package
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
` (19 preceding siblings ...)
2020-11-04 15:48 ` kedodrill
@ 2020-11-04 15:50 ` Duncaen
20 siblings, 0 replies; 22+ messages in thread
From: Duncaen @ 2020-11-04 15:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/21758#issuecomment-721812726
Comment:
The PR was closed with a commit https://github.com/void-linux/void-packages/commit/bb5f851c9fdf408423488f1db3c776a6d7fd1845.
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2020-11-04 15:50 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 19:40 [PR PATCH] [really wip] system wide electron package Johnnynator
2020-05-08 20:04 ` [PR PATCH] [Updated] " Johnnynator
2020-05-08 20:30 ` Anachron
2020-05-08 21:15 ` ericonr
2020-05-08 22:16 ` [PR PATCH] [Updated] " Johnnynator
2020-05-09 16:37 ` Johnnynator
2020-05-09 16:52 ` Johnnynator
2020-05-09 17:04 ` Johnnynator
2020-05-09 17:12 ` Johnnynator
2020-05-09 17:40 ` [PR PATCH] [Updated] " Johnnynator
2020-07-17 10:26 ` Johnnynator
2020-07-18 14:12 ` Johnnynator
2020-07-18 14:18 ` Duncaen
2020-07-18 14:21 ` Johnnynator
2020-07-18 14:21 ` Johnnynator
2020-08-16 0:10 ` fosslinux
2020-08-16 13:36 ` [PR PATCH] [Updated] " Johnnynator
2020-08-16 15:45 ` Johnnynator
2020-08-16 21:11 ` [PR PATCH] [Closed]: " Johnnynator
2020-08-16 23:31 ` fosslinux
2020-11-04 15:48 ` kedodrill
2020-11-04 15:50 ` Duncaen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).