[arch-commits] Commit in electron/repos (10 files)

Nicola Squartini tensor5 at archlinux.org
Thu May 27 05:29:23 UTC 2021


    Date: Thursday, May 27, 2021 @ 05:29:22
  Author: tensor5
Revision: 948101

archrelease: copy trunk to community-staging-x86_64

Added:
  electron/repos/community-staging-x86_64/
  electron/repos/community-staging-x86_64/PKGBUILD
    (from rev 948100, electron/trunk/PKGBUILD)
  electron/repos/community-staging-x86_64/add-clang-nomerge-attribute-to-CheckError.patch
    (from rev 948100, electron/trunk/add-clang-nomerge-attribute-to-CheckError.patch)
  electron/repos/community-staging-x86_64/chromium-glibc-2.33.patch
    (from rev 948100, electron/trunk/chromium-glibc-2.33.patch)
  electron/repos/community-staging-x86_64/default_app-icon.patch
    (from rev 948100, electron/trunk/default_app-icon.patch)
  electron/repos/community-staging-x86_64/electron-launcher.sh
    (from rev 948100, electron/trunk/electron-launcher.sh)
  electron/repos/community-staging-x86_64/electron.desktop
    (from rev 948100, electron/trunk/electron.desktop)
  electron/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
    (from rev 948100, electron/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
  electron/repos/community-staging-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch
    (from rev 948100, electron/trunk/unbundle-use-char16_t-as-UCHAR_TYPE.patch)
  electron/repos/community-staging-x86_64/use-system-libraries-in-node.patch
    (from rev 948100, electron/trunk/use-system-libraries-in-node.patch)

---------------------------------------------------+
 PKGBUILD                                          |  221 ++++++++++++++++++
 add-clang-nomerge-attribute-to-CheckError.patch   |   44 +++
 chromium-glibc-2.33.patch                         |  144 ++++++++++++
 default_app-icon.patch                            |   21 +
 electron-launcher.sh                              |   20 +
 electron.desktop                                  |    7 
 sql-make-VirtualCursor-standard-layout-type.patch |  238 ++++++++++++++++++++
 unbundle-use-char16_t-as-UCHAR_TYPE.patch         |   30 ++
 use-system-libraries-in-node.patch                |   52 ++++
 9 files changed, 777 insertions(+)

Copied: electron/repos/community-staging-x86_64/PKGBUILD (from rev 948100, electron/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,221 @@
+# Maintainer: Nicola Squartini <tensor5 at gmail.com>
+
+pkgname=electron
+pkgver=13.0.1
+_commit=51213f656bfac341f40da9fb84eff27df25d9d68
+_chromiumver=91.0.4472.69
+_gcc_patchset=5
+pkgrel=1
+pkgdesc='Build cross platform desktop apps with web technologies'
+arch=('x86_64')
+url='https://electronjs.org/'
+license=('MIT' 'custom')
+depends=('c-ares' 'ffmpeg' 'gtk3' 'libevent' 'libnghttp2' 'libxslt' 'minizip'
+         'nss' 're2' 'snappy')
+makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser'
+             'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja'
+             'npm' 'pciutils' 'pipewire' 'python2' 'wget' 'yarn')
+optdepends=('kde-cli-tools: file deletion support (kioclient5)'
+            'libappindicator-gtk3: StatusNotifierItem support'
+            'pipewire: WebRTC desktop sharing under Wayland'
+            'trash-cli: file deletion support (trash-put)'
+            "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+source=('git+https://github.com/electron/electron.git'
+        'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git'
+        "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
+        "${pkgname}-launcher.sh"
+        "${pkgname}.desktop"
+        'default_app-icon.patch'
+        'use-system-libraries-in-node.patch'
+        'add-clang-nomerge-attribute-to-CheckError.patch'
+        'chromium-glibc-2.33.patch'
+        'sql-make-VirtualCursor-standard-layout-type.patch'
+        'unbundle-use-char16_t-as-UCHAR_TYPE.patch'
+       )
+sha256sums=('SKIP'
+            'SKIP'
+            '171525009003a9ed1182cfcb6f407d7169d9a731a474304e263029376719f55a'
+            '20c50e217fcb20f72fd2b465ad19659abe51feff4814515767a3065a009d58a5'
+            '5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39'
+            'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
+            'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
+            '50133dd196d288ad538bb536aa51dccd6cb4aacfd9a60160f77e8fb16034b460'
+            '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
+            'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+            '59a59a60a08b335fe8647fdf0f9d2288d236ebf2cc9626396d0c4d032fd2b25d'
+           )
+
+_system_libs=('ffmpeg'
+              'flac'
+              'fontconfig'
+              'freetype'
+              'harfbuzz-ng'
+              'icu'
+              'libdrm'
+              'libevent'
+              'libjpeg'
+              'libpng'
+#              'libvpx'
+              'libwebp'
+              'libxml'
+              'libxslt'
+#              'openh264'
+              'opus'
+              're2'
+              'snappy'
+              'zlib'
+             )
+
+prepare() {
+  mkdir -p "${srcdir}"/python2-path
+  ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+  export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+
+  echo "Fetching chromium..."
+  git clone --branch=${_chromiumver} --depth=1 \
+      https://chromium.googlesource.com/chromium/src.git
+
+  echo "solutions = [
+  {
+    \"name\": \"src/electron\",
+    \"url\": \"file://${srcdir}/electron@${_commit}\",
+    \"deps_file\": \"DEPS\",
+    \"managed\": False,
+    \"custom_deps\": {
+      \"src\": None,
+    },
+    \"custom_vars\": {},
+  },
+]" > .gclient
+
+  python2 "${srcdir}/depot_tools/gclient.py" sync \
+      --with_branch_heads \
+      --with_tags \
+      --nohooks
+
+  sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
+
+  echo "Running hooks..."
+  # python2 "${srcdir}/depot_tools/gclient.py" runhooks
+  python2 src/build/landmines.py
+  python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
+  python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
+    --revision-id-only --header src/gpu/config/gpu_lists_version.h
+  python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
+    -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
+  # Create sysmlink to system clang-format
+  ln -s /usr/bin/clang-format src/buildtools/linux64
+  # Create sysmlink to system Node.js
+  mkdir -p src/third_party/node/linux/node-linux-x64/bin
+  ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
+  #python2 src/third_party/depot_tools/download_from_google_storage.py \
+  #  --no_resume --extract --no_auth --bucket chromium-nodejs \
+  #  -s src/third_party/node/node_modules.tar.gz.sha1
+  cd src/third_party/node
+  npm ci
+  cd ../../..
+  vpython src/tools/download_optimization_profile.py \
+    --newest_state=src/chrome/android/profiles/newest.txt \
+    --local_state=src/chrome/android/profiles/local.txt \
+    --output_name=src/chrome/android/profiles/afdo.prof \
+    --gs_url_base=chromeos-prebuilt/afdo-job/llvm
+  #vpython src/tools/update_pgo_profiles.py \
+  #  --target=linux \
+  #  update \
+  #  --gs-url-base=chromium-optimization-profiles/pgo_profiles
+  python2 src/electron/script/apply_all_patches.py \
+      src/electron/patches/config.json
+  cd src/electron
+  yarn install --frozen-lockfile
+  cd ..
+
+  echo "Applying local patches..."
+  # Fixes for building with libstdc++ instead of libc++
+  patch -Np1 -i ../patches/chromium-90-ruy-include.patch
+
+  patch -Rp1 -i ../add-clang-nomerge-attribute-to-CheckError.patch
+  patch -Np1 -i ../chromium-glibc-2.33.patch
+  patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+  patch -Np1 -i ../unbundle-use-char16_t-as-UCHAR_TYPE.patch
+  patch -Np1 -i ../use-system-libraries-in-node.patch
+  patch -Np1 -i ../default_app-icon.patch  # Icon from .desktop file
+
+  echo "Patching Chromium for using system libraries..."
+  sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+      tools/generate_shim_headers/generate_shim_headers.py
+  for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
+      third_party_dir="third_party/${lib}"
+      if [ ! -d ${third_party_dir} ]; then
+        third_party_dir="base/${third_party_dir}"
+      fi
+      find ${third_party_dir} -type f \
+          \! -path "${third_party_dir}/chromium/*" \
+          \! -path "${third_party_dir}/google/*" \
+          \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
+          \! -regex '.*\.\(gn\|gni\|isolate\)' \
+          -delete
+  done
+  python2 build/linux/unbundle/replace_gn_files.py \
+      --system-libraries \
+      "${_system_libs[@]}"
+}
+
+build() {
+  export CC=clang
+  export CXX=clang++
+  export AR=ar
+  export NM=nm
+
+  # Do not warn about unknown warning options
+  CFLAGS+='   -Wno-unknown-warning-option'
+  CXXFLAGS+=' -Wno-unknown-warning-option'
+
+  cd src
+  export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+  GN_EXTRA_ARGS='
+    blink_symbol_level = 0
+    chrome_pgo_phase = 0
+    clang_use_chrome_plugins = false
+    custom_toolchain = "//build/toolchain/linux/unbundle:default"
+    host_toolchain = "//build/toolchain/linux/unbundle:default"
+    icu_use_data_file = false
+    is_component_ffmpeg = false
+    link_pulseaudio = true
+    rtc_use_pipewire = true
+    treat_warnings_as_errors = false
+    use_custom_libcxx = false
+    use_gnome_keyring = false
+    use_sysroot = false
+  '
+  gn gen out/Release \
+      --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
+  ninja -C out/Release electron
+  # Strip before zip to avoid
+  # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
+  strip -s out/Release/electron
+  ninja -C out/Release electron_dist_zip
+  # ninja -C out/Release third_party/electron_node:headers
+}
+
+package() {
+  install -dm755 "${pkgdir}/usr/lib/${pkgname}"
+  bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
+
+  chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
+
+  install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+  for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
+    ln -s  \
+      "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
+      "${pkgdir}/usr/share/licenses/${pkgname}"
+  done
+
+  install -Dm755 "${srcdir}/${pkgname}-launcher.sh" \
+    "${pkgdir}/usr/bin/${pkgname}${pkgver%%.*}"
+  ln "${pkgdir}/usr/bin/${pkgname}${pkgver%%.*}" "${pkgdir}/usr/bin/${pkgname}"
+
+  # Install .desktop and icon file (see default_app-icon.patch)
+  install -Dm644 -t "${pkgdir}/usr/share/applications" "${pkgname}.desktop"
+  install -Dm644 src/electron/default_app/icon.png \
+          "${pkgdir}/usr/share/pixmaps/${pkgname}.png"  # hicolor has no 1024x1024
+}

Copied: electron/repos/community-staging-x86_64/add-clang-nomerge-attribute-to-CheckError.patch (from rev 948100, electron/trunk/add-clang-nomerge-attribute-to-CheckError.patch)
===================================================================
--- community-staging-x86_64/add-clang-nomerge-attribute-to-CheckError.patch	                        (rev 0)
+++ community-staging-x86_64/add-clang-nomerge-attribute-to-CheckError.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,44 @@
+From 9909f146b28d56c9c0411329a056ed959b33f76a Mon Sep 17 00:00:00 2001
+From: Zequan Wu <zequanwu at google.com>
+Date: Wed, 10 Feb 2021 03:26:00 +0000
+Subject: [PATCH] Reland "Add [[clang::nomerge]] attribute to ~CheckError()."
+
+This is a reland of 8860253376c38c090d585bda4b20b801e3aa3ce3
+
+Original change's description:
+> Add [[clang::nomerge]] attribute to ~CheckError().
+>
+> To disable merging multiple ~CheckError() destructor for accurate crash logs.
+>
+> Bug: 1153188
+> Change-Id: If6d153661667a63f13b645f6d284eb3d5ea3a300
+> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611331
+> Commit-Queue: Nico Weber <thakis at chromium.org>
+> Auto-Submit: Zequan Wu <zequanwu at google.com>
+> Reviewed-by: Nico Weber <thakis at chromium.org>
+> Cr-Commit-Position: refs/heads/master@{#844989}
+
+Bug: 1153188
+Change-Id: I303c5ff9fb88f7a30663400622b327a910d0b108
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2686331
+Reviewed-by: Nico Weber <thakis at chromium.org>
+Commit-Queue: Nico Weber <thakis at chromium.org>
+Commit-Queue: Zequan Wu <zequanwu at google.com>
+Cr-Commit-Position: refs/heads/master@{#852453}
+---
+ base/check.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/base/check.h b/base/check.h
+index c94ab68db90..17048e45539 100644
+--- a/base/check.h
++++ b/base/check.h
+@@ -85,7 +85,7 @@ class BASE_EXPORT CheckError {
+   // Stream for adding optional details to the error message.
+   std::ostream& stream();
+ 
+-  ~CheckError();
++  NOMERGE ~CheckError();
+ 
+   CheckError(const CheckError& other) = delete;
+   CheckError& operator=(const CheckError& other) = delete;

Copied: electron/repos/community-staging-x86_64/chromium-glibc-2.33.patch (from rev 948100, electron/trunk/chromium-glibc-2.33.patch)
===================================================================
--- community-staging-x86_64/chromium-glibc-2.33.patch	                        (rev 0)
+++ community-staging-x86_64/chromium-glibc-2.33.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,144 @@
+# Patch made by Kevin Kofler <Kevin at tigcc.ticalc.org>
+# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
+
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix	2021-01-25 10:11:45.427436398 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc	2021-01-25 10:12:51.337699003 -0500
+@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+     return RestrictKillTarget(current_pid, sysno);
+   }
+ 
++#if defined(__NR_newfstatat)
++  if (sysno == __NR_newfstatat) {
++    return RewriteFstatatSIGSYS();
++  }
++#endif
++
++#if defined(__NR_fstatat64)
++  if (sysno == __NR_fstatat64) {
++    return RewriteFstatatSIGSYS();
++  }
++#endif
++
+   if (SyscallSets::IsFileSystem(sysno) ||
+       SyscallSets::IsCurrentDirectory(sysno)) {
+     return Error(fs_denied_errno);
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix	2021-01-25 10:13:10.179774081 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc	2021-01-25 10:16:18.790525746 -0500
+@@ -6,6 +6,8 @@
+ 
+ #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+ 
++#include <errno.h>
++#include <fcntl.h>
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
+@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
+   return -ENOSYS;
+ }
+ 
++intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++                              void* aux) {
++  switch (args.nr) {
++#if defined(__NR_newfstatat)
++    case __NR_newfstatat:
++#endif
++#if defined(__NR_fstatat64)
++    case __NR_fstatat64:
++#endif
++#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
++      if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
++          && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
++        return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
++                                    reinterpret_cast<struct stat64 *>(args.args[2]));
++      } else {
++        errno = EACCES;
++        return -1;
++      }
++      break;
++#endif
++  }
++
++  CrashSIGSYS_Handler(args, aux);
++
++  // Should never be reached.
++  RAW_CHECK(false);
++  return -ENOSYS;
++}
++
+ bpf_dsl::ResultExpr CrashSIGSYS() {
+   return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
+ }
+@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
+   return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
+ }
+ 
++bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
++  return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
++}
++
+ void AllocateCrashKeys() {
+ #if !defined(OS_NACL_NONSFI)
+   if (seccomp_crash_key)
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix	2021-01-25 10:16:36.982598236 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h	2021-01-25 10:18:45.705111027 -0500
+@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
+ // sched_setparam(), sched_setscheduler()
+ SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
+                                            void* aux);
++// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
++// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
++SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, 
++                                             void* aux);
+ 
+ // Variants of the above functions for use with bpf_dsl.
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
+@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
++SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
+ 
+ // Allocates a crash key so that Seccomp information can be recorded.
+ void AllocateCrashKeys();
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix	2021-01-25 10:18:53.307141311 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc	2021-01-25 10:19:46.982355293 -0500
+@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
+ 
+ #endif  // defined(MEMORY_SANITIZER)
+ 
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
++{
++#if defined(__NR_fstat64)
++    return syscall(__NR_fstat64, fd, buf);
++#else
++    return syscall(__NR_fstat, fd, buf);
++#endif
++}
++
+ }  // namespace sandbox
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix	2021-01-25 10:19:53.115379741 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h	2021-01-25 10:20:45.485588421 -0500
+@@ -17,6 +17,7 @@ struct sock_fprog;
+ struct rlimit64;
+ struct cap_hdr;
+ struct cap_data;
++struct stat64;
+ 
+ namespace sandbox {
+ 
+@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
+                                  const struct sigaction* act,
+                                  struct sigaction* oldact);
+ 
++// Recent glibc rewrites fstat to fstatat.
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
++
+ }  // namespace sandbox
+ 
+ #endif  // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_

Copied: electron/repos/community-staging-x86_64/default_app-icon.patch (from rev 948100, electron/trunk/default_app-icon.patch)
===================================================================
--- community-staging-x86_64/default_app-icon.patch	                        (rev 0)
+++ community-staging-x86_64/default_app-icon.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.ts
++++ b/electron/default_app/default_app.ts
+@@ -60,7 +60,7 @@
+   };
+ 
+   if (process.platform === 'linux') {
+-    options.icon = path.join(__dirname, 'icon.png');
++    options.icon = '/usr/share/pixmaps/electron.png';
+   }
+ 
+   mainWindow = new BrowserWindow(options);
+--- a/electron/filenames.gni
++++ b/electron/filenames.gni
+@@ -6,7 +6,6 @@
+   ]
+ 
+   default_app_static_sources = [
+-    "default_app/icon.png",
+     "default_app/index.html",
+     "default_app/package.json",
+     "default_app/styles.css",

Copied: electron/repos/community-staging-x86_64/electron-launcher.sh (from rev 948100, electron/trunk/electron-launcher.sh)
===================================================================
--- community-staging-x86_64/electron-launcher.sh	                        (rev 0)
+++ community-staging-x86_64/electron-launcher.sh	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,20 @@
+#!/usr/bin/bash
+
+set -euo pipefail
+
+name=electron
+flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
+
+declare -a flags
+
+if [[ -f "${flags_file}" ]]; then
+    mapfile -t < "${flags_file}"
+fi
+
+for line in "${MAPFILE[@]}"; do
+    if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+        flags+=("${line}")
+    fi
+done
+
+exec /usr/lib/${name}/electron "$@" "${flags[@]}"

Copied: electron/repos/community-staging-x86_64/electron.desktop (from rev 948100, electron/trunk/electron.desktop)
===================================================================
--- community-staging-x86_64/electron.desktop	                        (rev 0)
+++ community-staging-x86_64/electron.desktop	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron
+Icon=electron
+Exec=electron %u
+Categories=Development;GTK;
+StartupNotify=true

Copied: electron/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (from rev 948100, electron/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
===================================================================
--- community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch	                        (rev 0)
+++ community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,238 @@
+From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Tue, 4 May 2021 15:00:19 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
+raw pointers.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc  | 21 +++++++++++++++------
+ sql/recover_module/btree.h   | 17 +++++++++++++----
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h  |  2 +-
+ sql/recover_module/pager.cc  |  7 +++----
+ sql/recover_module/pager.h   |  5 +++--
+ 6 files changed, 47 insertions(+), 29 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index 9ecaafe8a3..839318abf9 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
+               "Move the destructor to the .cc file if it's non-trival");
+ #endif  // !DCHECK_IS_ON()
+ 
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+-    : page_id_(db_reader->page_id()),
+-      db_reader_(db_reader),
+-      cell_count_(ComputeCellCount(db_reader)),
+-      next_read_index_(0),
+-      last_record_size_(0) {
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++  DCHECK(db_reader);
+   DCHECK(IsOnValidPage(db_reader));
++  page_id_ = db_reader->page_id();
++  db_reader_ = db_reader;
++  cell_count_ = ComputeCellCount(db_reader);
++  next_read_index_ = 0;
++  last_record_size_ = 0;
+   DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+ 
++void LeafPageDecoder::Reset() {
++  db_reader_ = nullptr;
++  page_id_ = 0;
++  cell_count_ = 0;
++  next_read_index_ = 0;
++  last_record_size_ = 0;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index d76d076bf6..33114b01fa 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -102,7 +102,7 @@ class LeafPageDecoder {
+   //
+   // |db_reader| must have been used to read an inner page of a table B-tree.
+   // |db_reader| must outlive this instance.
+-  explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++  explicit LeafPageDecoder() noexcept = default;
+   ~LeafPageDecoder() noexcept = default;
+ 
+   LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -150,6 +150,15 @@ class LeafPageDecoder {
+   // read as long as CanAdvance() returns true.
+   bool TryAdvance();
+ 
++  // Initialize with DatabasePageReader
++  void Initialize(DatabasePageReader* db_reader);
++
++  // Reset internal DatabasePageReader
++  void Reset();
++
++  // True if DatabasePageReader is valid
++  bool IsValid() { return (db_reader_ != nullptr); }
++
+   // True if the given reader may point to an inner page in a table B-tree.
+   //
+   // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -163,14 +172,14 @@ class LeafPageDecoder {
+   static int ComputeCellCount(DatabasePageReader* db_reader);
+ 
+   // The number of the B-tree page this reader is reading.
+-  const int64_t page_id_;
++  int64_t page_id_;
+   // Used to read the tree page.
+   //
+   // Raw pointer usage is acceptable because this instance's owner is expected
+   // to ensure that the DatabasePageReader outlives this.
+-  DatabasePageReader* const db_reader_;
++  DatabasePageReader* db_reader_;
+   // Caches the ComputeCellCount() value for this reader's page.
+-  const int cell_count_ = ComputeCellCount(db_reader_);
++  int cell_count_;
+ 
+   // The reader's cursor state.
+   //
+diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
+index 0029ff9295..42548bc4b5 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
+ int VirtualCursor::First() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   inner_decoders_.clear();
+-  leaf_decoder_ = nullptr;
++  leaf_decoder_.Reset();
+ 
+   AppendPageDecoder(table_->root_page_id());
+   return Next();
+@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   record_reader_.Reset();
+ 
+-  while (!inner_decoders_.empty() || leaf_decoder_.get()) {
+-    if (leaf_decoder_.get()) {
+-      if (!leaf_decoder_->CanAdvance()) {
++  while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
++    if (leaf_decoder_.IsValid()) {
++      if (!leaf_decoder_.CanAdvance()) {
+         // The leaf has been exhausted. Remove it from the DFS stack.
+-        leaf_decoder_ = nullptr;
++        leaf_decoder_.Reset();
+         continue;
+       }
+-      if (!leaf_decoder_->TryAdvance())
++      if (!leaf_decoder_.TryAdvance())
+         continue;
+ 
+-      if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
+-                                      leaf_decoder_->last_record_offset())) {
++      if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
++                                      leaf_decoder_.last_record_offset())) {
+         continue;
+       }
+       if (!record_reader_.Initialize())
+@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
+ int64_t VirtualCursor::RowId() {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+   DCHECK(record_reader_.IsInitialized());
+-  DCHECK(leaf_decoder_.get());
+-  return leaf_decoder_->last_record_rowid();
++  DCHECK(leaf_decoder_.IsValid());
++  return leaf_decoder_.last_record_rowid();
+ }
+ 
+ void VirtualCursor::AppendPageDecoder(int page_id) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(leaf_decoder_.get() == nullptr)
++  DCHECK(!leaf_decoder_.IsValid())
+       << __func__
+       << " must only be called when the current path has no leaf decoder";
+ 
+@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
+     return;
+ 
+   if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
+-    leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
++    leaf_decoder_.Initialize(&db_reader_);
+     return;
+   }
+ 
+diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
+index afcd6900e1..b15c31d425 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -129,7 +129,7 @@ class VirtualCursor {
+   std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
+ 
+   // Decodes the leaf page containing records.
+-  std::unique_ptr<LeafPageDecoder> leaf_decoder_;
++  LeafPageDecoder leaf_decoder_;
+ 
+   SEQUENCE_CHECKER(sequence_checker_);
+ };
+diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
+index 58e75de270..5fe96204e5 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
+               "ints are not appropriate for representing page IDs");
+ 
+ DatabasePageReader::DatabasePageReader(VirtualTable* table)
+-    : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
+-      table_(table) {
++    : page_data_(), table_(table) {
+   DCHECK(table != nullptr);
+   DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
+                     std::numeric_limits<int64_t>::max(),
+                 "The |read_offset| computation above may overflow");
+ 
+-  int sqlite_status =
+-      RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++  int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
++                              const_cast<uint8_t*>(page_data_.data()));
+ 
+   // |page_id_| needs to be set to kInvalidPageId if the read failed.
+   // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 0e388ddc3b..99314e30ff 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -5,6 +5,7 @@
+ #ifndef SQL_RECOVER_MODULE_PAGER_H_
+ #define SQL_RECOVER_MODULE_PAGER_H_
+ 
++#include <array>
+ #include <cstdint>
+ #include <memory>
+ 
+@@ -70,7 +71,7 @@ class DatabasePageReader {
+     DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+     DCHECK_NE(page_id_, kInvalidPageId)
+         << "Successful ReadPage() required before accessing pager state";
+-    return page_data_.get();
++    return page_data_.data();
+   }
+ 
+   // The number of bytes in the page read by the last ReadPage() call.
+@@ -137,7 +138,7 @@ class DatabasePageReader {
+   int page_id_ = kInvalidPageId;
+   // Stores the bytes of the last page successfully read by ReadPage().
+   // The content is undefined if the last call to ReadPage() did not succeed.
+-  const std::unique_ptr<uint8_t[]> page_data_;
++  const std::array<uint8_t, kMaxPageSize> page_data_;
+   // Raw pointer usage is acceptable because this instance's owner is expected
+   // to ensure that the VirtualTable outlives this.
+   VirtualTable* const table_;

Copied: electron/repos/community-staging-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch (from rev 948100, electron/trunk/unbundle-use-char16_t-as-UCHAR_TYPE.patch)
===================================================================
--- community-staging-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch	                        (rev 0)
+++ community-staging-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,30 @@
+From 79819c94f27524005889def53740c97a32cd7747 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Fri, 16 Apr 2021 20:57:15 +0000
+Subject: [PATCH] [unbundle] Use char16_t as UCHAR_TYPE
+
+Overriding UCHAR_TYPE was dropped with:
+https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2732628
+
+Bug: 911896
+Change-Id: I4c1172aab445c82ba247b1162b8484ed0db9c381
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830820
+Commit-Queue: Stephan Hartmann <stha09 at googlemail.com>
+Reviewed-by: Lei Zhang <thestig at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#873470}
+---
+ build/linux/unbundle/icu.gn | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
+index 0f52fc11e79e6..6f3f8438bd854 100644
+--- a/build/linux/unbundle/icu.gn
++++ b/build/linux/unbundle/icu.gn
+@@ -16,7 +16,6 @@ config("icu_config") {
+   defines = [
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+-    "UCHAR_TYPE=uint16_t",
+ 
+     # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
+     # on classes through the U_COMMON_API and U_I18N_API macros (among others).

Copied: electron/repos/community-staging-x86_64/use-system-libraries-in-node.patch (from rev 948100, electron/trunk/use-system-libraries-in-node.patch)
===================================================================
--- community-staging-x86_64/use-system-libraries-in-node.patch	                        (rev 0)
+++ community-staging-x86_64/use-system-libraries-in-node.patch	2021-05-27 05:29:22 UTC (rev 948101)
@@ -0,0 +1,52 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+   node_module_version = ""
+ }
+ 
++if (is_linux) {
++  import("//build/config/linux/pkg_config.gni")
++
++  pkg_config("cares") {
++    packages = [ "libcares" ]
++  }
++
++  pkg_config("nghttp2") {
++    packages = [ "libnghttp2" ]
++  }
++}
++
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+ assert(!node_use_etw, "node_use_etw not supported in GN")
+ 
+@@ -190,10 +202,8 @@
+ component("node_lib") {
+   deps = [
+     ":node_js2c",
+-    "deps/cares",
+     "deps/histogram",
+     "deps/llhttp",
+-    "deps/nghttp2",
+     "deps/uvwasi",
+     "//third_party/zlib",
+     "//third_party/brotli:dec",
+@@ -209,6 +219,19 @@
+   public_configs = [ ":node_lib_config" ]
+   include_dirs = [ "src" ]
+   libs = []
++  if (is_linux) {
++    configs += [
++      ":cares",
++      ":nghttp2",
++    ]
++    libs += [ "http_parser" ]
++  } else {
++    deps += [
++      "deps/cares",
++      "deps/http_parser",
++      "deps/nghttp2",
++    ]
++  }
+   frameworks = []
+   cflags_cc = [
+     "-Wno-deprecated-declarations",



More information about the arch-commits mailing list