Skip to content

Commit

Permalink
fix: bundle swiftshader and ANGLE libraries on mac (#18870)
Browse files Browse the repository at this point in the history
Fixes #18639. Not sure what exactly caused this to start breaking now, but these libraries appeared in https://chromium-review.googlesource.com/c/chromium/src/+/955949/ and got enabled by default on mac here https://chromium-review.googlesource.com/c/chromium/src/+/1005017/. The call during gpu process startup that was causing this crash was added here https://chromium-review.googlesource.com/c/chromium/src/+/1599993.
  • Loading branch information
nornagon authored and codebytere committed Jun 20, 2019
1 parent dca583a commit 23286fe
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
47 changes: 47 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import("filenames.gni")
if (is_mac) {
import("//build/config/mac/rules.gni")
import("//third_party/icu/config.gni")
import("//ui/gl/features.gni")
import("//v8/gni/v8.gni")
}

Expand Down Expand Up @@ -679,6 +680,50 @@ if (is_mac) {
group("electron_framework_libraries") {
}
}
if (use_egl) {
# Add the ANGLE .dylibs in the Libraries directory of the Framework.
bundle_data("electron_angle_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libEGL.dylib",
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:angle_library_copy",
]
}

# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
bundle_data("electron_swiftshader_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:swiftshader_library_copy",
]
}
}
group("electron_angle_library") {
if (use_egl) {
deps = [
":electron_angle_binaries",
]
}
}

group("electron_swiftshader_library") {
if (use_egl) {
deps = [
":electron_swiftshader_binaries",
]
}
}

bundle_data("electron_crashpad_helper") {
sources = [
Expand All @@ -705,8 +750,10 @@ if (is_mac) {
":electron_lib",
]
deps = [
":electron_angle_library",
":electron_framework_libraries",
":electron_framework_resources",
":electron_swiftshader_library",
]
if (!is_mas_build) {
deps += [ ":electron_crashpad_helper" ]
Expand Down
4 changes: 4 additions & 0 deletions script/dist_zip.mac.x64.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libEGL.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libGLESv2.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/
Expand Down
4 changes: 4 additions & 0 deletions script/dist_zip.mac_mas.x64.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libEGL.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libEGL.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libswiftshader_libGLESv2.dylib
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Info.plist
Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/am.lproj/
Expand Down

0 comments on commit 23286fe

Please sign in to comment.