build: remove dead symlink from MAS build (#23831)
* build: remove dead symlink from MAS build * chore: new out cache * fix gn check errors Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
parent
673169a7ba
commit
7a216a8fab
10 changed files with 93 additions and 19 deletions
|
@ -418,6 +418,7 @@ step-electron-build: &step-electron-build
|
||||||
fi
|
fi
|
||||||
cd src
|
cd src
|
||||||
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
|
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
|
||||||
|
node electron/script/check-symlinks.js
|
||||||
|
|
||||||
step-native-unittests-build: &step-native-unittests-build
|
step-native-unittests-build: &step-native-unittests-build
|
||||||
run:
|
run:
|
||||||
|
@ -830,7 +831,7 @@ step-restore-out-cache: &step-restore-out-cache
|
||||||
paths:
|
paths:
|
||||||
- ./src/out/Default
|
- ./src/out/Default
|
||||||
keys:
|
keys:
|
||||||
- v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
- v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||||
name: Restoring out cache
|
name: Restoring out cache
|
||||||
|
|
||||||
step-set-git-cache-path: &step-set-git-cache-path
|
step-set-git-cache-path: &step-set-git-cache-path
|
||||||
|
@ -854,7 +855,7 @@ step-save-out-cache: &step-save-out-cache
|
||||||
save_cache:
|
save_cache:
|
||||||
paths:
|
paths:
|
||||||
- ./src/out/Default
|
- ./src/out/Default
|
||||||
key: v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
key: v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||||
name: Persisting out cache
|
name: Persisting out cache
|
||||||
|
|
||||||
step-run-electron-only-hooks: &step-run-electron-only-hooks
|
step-run-electron-only-hooks: &step-run-electron-only-hooks
|
||||||
|
|
18
BUILD.gn
18
BUILD.gn
|
@ -326,7 +326,6 @@ source_set("electron_lib") {
|
||||||
"//chrome/app/resources:platform_locale_settings",
|
"//chrome/app/resources:platform_locale_settings",
|
||||||
"//chrome/services/printing/public/mojom",
|
"//chrome/services/printing/public/mojom",
|
||||||
"//components/certificate_transparency",
|
"//components/certificate_transparency",
|
||||||
"//components/crash/core/app",
|
|
||||||
"//components/language/core/browser",
|
"//components/language/core/browser",
|
||||||
"//components/net_log",
|
"//components/net_log",
|
||||||
"//components/network_hints/browser",
|
"//components/network_hints/browser",
|
||||||
|
@ -434,6 +433,9 @@ source_set("electron_lib") {
|
||||||
"*\bviews/*",
|
"*\bviews/*",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
if (!is_mas_build) {
|
||||||
|
deps += [ "//components/crash/core/app" ]
|
||||||
|
}
|
||||||
|
|
||||||
set_sources_assignment_filter(
|
set_sources_assignment_filter(
|
||||||
sources_assignment_filter + extra_source_filters)
|
sources_assignment_filter + extra_source_filters)
|
||||||
|
@ -459,10 +461,13 @@ source_set("electron_lib") {
|
||||||
deps += [
|
deps += [
|
||||||
"//components/remote_cocoa/app_shim",
|
"//components/remote_cocoa/app_shim",
|
||||||
"//content/common:mac_helpers",
|
"//content/common:mac_helpers",
|
||||||
"//third_party/crashpad/crashpad/client",
|
|
||||||
"//ui/accelerated_widget_mac",
|
"//ui/accelerated_widget_mac",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (!is_mas_build) {
|
||||||
|
deps += [ "//third_party/crashpad/crashpad/client" ]
|
||||||
|
}
|
||||||
|
|
||||||
libs = [
|
libs = [
|
||||||
"AVFoundation.framework",
|
"AVFoundation.framework",
|
||||||
"Carbon.framework",
|
"Carbon.framework",
|
||||||
|
@ -773,8 +778,10 @@ if (is_mac) {
|
||||||
framework_contents = [
|
framework_contents = [
|
||||||
"Resources",
|
"Resources",
|
||||||
"Libraries",
|
"Libraries",
|
||||||
"Helpers",
|
|
||||||
]
|
]
|
||||||
|
if (!is_mas_build) {
|
||||||
|
framework_contents += [ "Helpers" ]
|
||||||
|
}
|
||||||
public_deps = [
|
public_deps = [
|
||||||
":electron_framework_libraries",
|
":electron_framework_libraries",
|
||||||
":electron_lib",
|
":electron_lib",
|
||||||
|
@ -1005,13 +1012,16 @@ if (is_mac) {
|
||||||
|
|
||||||
group("electron_symbols") {
|
group("electron_symbols") {
|
||||||
deps = [
|
deps = [
|
||||||
":crashpad_handler_syms",
|
|
||||||
":electron_app_syms",
|
":electron_app_syms",
|
||||||
":electron_framework_syms",
|
":electron_framework_syms",
|
||||||
":swiftshader_egl_syms",
|
":swiftshader_egl_syms",
|
||||||
":swiftshader_gles_syms",
|
":swiftshader_gles_syms",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (!is_mas_build) {
|
||||||
|
deps += [ ":crashpad_handler_syms" ]
|
||||||
|
}
|
||||||
|
|
||||||
foreach(helper_params, content_mac_helpers) {
|
foreach(helper_params, content_mac_helpers) {
|
||||||
_helper_target = helper_params[0]
|
_helper_target = helper_params[0]
|
||||||
deps += [ ":electron_helper_syms_${_helper_target}" ]
|
deps += [ ":electron_helper_syms_${_helper_target}" ]
|
||||||
|
|
42
script/check-symlinks.js
Normal file
42
script/check-symlinks.js
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const utils = require('./lib/utils');
|
||||||
|
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
console.log('Not checking symlinks on non-darwin platform');
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const appPath = path.resolve(__dirname, '..', '..', 'out', utils.getOutDir(), 'Electron.app');
|
||||||
|
const visited = new Set();
|
||||||
|
const traverse = (p) => {
|
||||||
|
if (visited.has(p)) return;
|
||||||
|
|
||||||
|
visited.add(p);
|
||||||
|
if (!fs.statSync(p).isDirectory()) return;
|
||||||
|
|
||||||
|
for (const child of fs.readdirSync(p)) {
|
||||||
|
const childPath = path.resolve(p, child);
|
||||||
|
let realPath;
|
||||||
|
try {
|
||||||
|
realPath = fs.realpathSync(childPath);
|
||||||
|
} catch (err) {
|
||||||
|
if (err.path) {
|
||||||
|
console.error('Detected an invalid symlink');
|
||||||
|
console.error('Source:', childPath);
|
||||||
|
let link = fs.readlinkSync(childPath);
|
||||||
|
if (!link.startsWith('.')) {
|
||||||
|
link = `../${link}`;
|
||||||
|
}
|
||||||
|
console.error('Target:', path.resolve(childPath, link));
|
||||||
|
process.exit(1);
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
traverse(realPath);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
traverse(appPath);
|
|
@ -3,7 +3,6 @@ Electron.app/Contents/
|
||||||
Electron.app/Contents/Frameworks/
|
Electron.app/Contents/Frameworks/
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/
|
Electron.app/Contents/Frameworks/Electron Framework.framework/
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework
|
Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Helpers
|
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Libraries
|
Electron.app/Contents/Frameworks/Electron Framework.framework/Libraries
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Resources
|
Electron.app/Contents/Frameworks/Electron Framework.framework/Resources
|
||||||
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/
|
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/no_destructor.h"
|
#include "base/no_destructor.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "components/crash/core/app/crash_reporter_client.h"
|
#include "components/crash/core/app/crash_reporter_client.h" // nogncheck
|
||||||
|
|
||||||
class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
|
class ElectronCrashReporterClient : public crash_reporter::CrashReporterClient {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "base/strings/string_split.h"
|
#include "base/strings/string_split.h"
|
||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||||
#include "components/crash/core/app/crashpad.h"
|
|
||||||
#include "components/crash/core/common/crash_key.h"
|
#include "components/crash/core/common/crash_key.h"
|
||||||
#include "components/crash/core/common/crash_keys.h"
|
#include "components/crash/core/common/crash_keys.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
|
@ -64,6 +63,10 @@
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MAS_BUILD)
|
||||||
|
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/task/thread_pool/thread_pool_instance.h"
|
#include "base/task/thread_pool/thread_pool_instance.h"
|
||||||
#include "base/threading/thread_task_runner_handle.h"
|
#include "base/threading/thread_task_runner_handle.h"
|
||||||
#include "components/crash/core/app/crashpad.h"
|
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "electron/electron_version.h"
|
#include "electron/electron_version.h"
|
||||||
#include "gin/array_buffer.h"
|
#include "gin/array_buffer.h"
|
||||||
|
@ -43,6 +42,10 @@
|
||||||
#include "chrome/child/v8_crashpad_support_win.h"
|
#include "chrome/child/v8_crashpad_support_win.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(MAS_BUILD)
|
||||||
|
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Initialize Node.js cli options to pass to Node.js
|
// Initialize Node.js cli options to pass to Node.js
|
||||||
|
|
|
@ -16,25 +16,28 @@
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/threading/thread_restrictions.h"
|
#include "base/threading/thread_restrictions.h"
|
||||||
#include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
|
|
||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#include "components/crash/core/app/crashpad.h"
|
|
||||||
#include "components/crash/core/common/crash_key.h"
|
|
||||||
#include "components/upload_list/crash_upload_list.h"
|
#include "components/upload_list/crash_upload_list.h"
|
||||||
#include "components/upload_list/text_log_upload_list.h"
|
#include "components/upload_list/text_log_upload_list.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "gin/arguments.h"
|
#include "gin/arguments.h"
|
||||||
#include "gin/data_object_builder.h"
|
#include "gin/data_object_builder.h"
|
||||||
#include "services/service_manager/embedder/switches.h"
|
#include "services/service_manager/embedder/switches.h"
|
||||||
#include "shell/app/electron_crash_reporter_client.h"
|
|
||||||
#include "shell/common/crash_keys.h"
|
|
||||||
#include "shell/common/electron_paths.h"
|
#include "shell/common/electron_paths.h"
|
||||||
#include "shell/common/gin_converters/callback_converter.h"
|
#include "shell/common/gin_converters/callback_converter.h"
|
||||||
#include "shell/common/gin_converters/file_path_converter.h"
|
#include "shell/common/gin_converters/file_path_converter.h"
|
||||||
#include "shell/common/gin_converters/time_converter.h"
|
#include "shell/common/gin_converters/time_converter.h"
|
||||||
#include "shell/common/gin_helper/dictionary.h"
|
#include "shell/common/gin_helper/dictionary.h"
|
||||||
#include "shell/common/node_includes.h"
|
#include "shell/common/node_includes.h"
|
||||||
#include "third_party/crashpad/crashpad/client/crashpad_info.h"
|
|
||||||
|
#if !defined(MAS_BUILD)
|
||||||
|
#include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
|
||||||
|
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||||
|
#include "components/crash/core/common/crash_key.h"
|
||||||
|
#include "shell/app/electron_crash_reporter_client.h"
|
||||||
|
#include "shell/common/crash_keys.h"
|
||||||
|
#include "third_party/crashpad/crashpad/client/crashpad_info.h" // nogncheck
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
#include "components/crash/core/app/breakpad_linux.h"
|
#include "components/crash/core/app/breakpad_linux.h"
|
||||||
|
@ -62,6 +65,14 @@ namespace api {
|
||||||
|
|
||||||
namespace crash_reporter {
|
namespace crash_reporter {
|
||||||
|
|
||||||
|
#if defined(MAS_BUILD)
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void NoOp() {}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
#endif
|
||||||
|
|
||||||
bool IsCrashReporterEnabled() {
|
bool IsCrashReporterEnabled() {
|
||||||
return g_crash_reporter_initialized;
|
return g_crash_reporter_initialized;
|
||||||
}
|
}
|
||||||
|
@ -203,8 +214,13 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||||
void* priv) {
|
void* priv) {
|
||||||
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
gin_helper::Dictionary dict(context->GetIsolate(), exports);
|
||||||
dict.SetMethod("start", &electron::api::crash_reporter::Start);
|
dict.SetMethod("start", &electron::api::crash_reporter::Start);
|
||||||
|
#if defined(MAS_BUILD)
|
||||||
|
dict.SetMethod("addExtraParameter", &electron::api::crash_reporter::NoOp);
|
||||||
|
dict.SetMethod("removeExtraParameter", &electron::api::crash_reporter::NoOp);
|
||||||
|
#else
|
||||||
dict.SetMethod("addExtraParameter", &electron::crash_keys::SetCrashKey);
|
dict.SetMethod("addExtraParameter", &electron::crash_keys::SetCrashKey);
|
||||||
dict.SetMethod("removeExtraParameter", &electron::crash_keys::ClearCrashKey);
|
dict.SetMethod("removeExtraParameter", &electron::crash_keys::ClearCrashKey);
|
||||||
|
#endif
|
||||||
dict.SetMethod("getParameters", &GetParameters);
|
dict.SetMethod("getParameters", &GetParameters);
|
||||||
dict.SetMethod("getUploadedReports", &GetUploadedReports);
|
dict.SetMethod("getUploadedReports", &GetUploadedReports);
|
||||||
dict.SetMethod("setUploadToServer", &SetUploadToServer);
|
dict.SetMethod("setUploadToServer", &SetUploadToServer);
|
||||||
|
|
|
@ -173,8 +173,8 @@
|
||||||
#include "base/debug/leak_annotations.h"
|
#include "base/debug/leak_annotations.h"
|
||||||
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
#include "components/crash/content/browser/crash_handler_host_linux.h"
|
||||||
#include "components/crash/core/app/breakpad_linux.h"
|
#include "components/crash/core/app/breakpad_linux.h"
|
||||||
#include "components/crash/core/app/crash_switches.h"
|
#include "components/crash/core/app/crash_switches.h" // nogncheck
|
||||||
#include "components/crash/core/app/crashpad.h"
|
#include "components/crash/core/app/crashpad.h" // nogncheck
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "shell/common/electron_constants.h"
|
#include "shell/common/electron_constants.h"
|
||||||
#include "shell/common/options_switches.h"
|
#include "shell/common/options_switches.h"
|
||||||
#include "third_party/crashpad/crashpad/client/annotation.h"
|
#include "third_party/crashpad/crashpad/client/annotation.h" // nogncheck
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue