Add entitlements monkey-patch

This commit is contained in:
confused-Techie 2023-04-10 15:32:37 -07:00
parent fe89387509
commit b7195f9990
3 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>

View File

@ -181,8 +181,6 @@ let options = {
"category": "public.app-category.developer-tools",
"minimumSystemVersion": "10.8",
"hardenedRuntime": true,
"entitlements": "resources/mac/entitlements.plist",
"entitlementsInherit": "resources/mac/entitlements.plist",
"extendInfo": {
// This contains extra values that will be inserted into the App's plist
"CFBundleExecutable": "Pulsar",
@ -241,6 +239,28 @@ let options = {
}
/**
The below optional entitlements is needed for the following reasons:
- `allow-jit` needs to be applied on silicon builds for WASM to work:
https://github.com/pulsar-edit/pulsar/pull/454
- But setting `allow-jit` on Intel decreases performance of `fork()` operations
e.g. `require('child_process').spanw(...)`
- This monkey patch will no longer be needed when we can bump Electron
and get `libuv` `v1.42.0` as this issue is fixed upstream there
- See: https://github.com/microsoft/vscode/issues/105446
*/
if (process.env.CIRRUS_TASK_NAME === "silicon_mac_task") {
options.mac.entitlements = "resources/mac/entitlements.silicon.plist";
options.mac.entitlementsInherit = "resources/mac/entitlements.silicon.plist";
} else if (process.env.CIRRUS_TASK_NAME === "intel_mac_task") {
options.mac.entitlements = "resources/mac/entitlements.intel.plist";
options.mac.entitlementsInherit = "resources/mac/entitlements.intel.plist";
}
function whatToBuild() {
const argvStartingWith = process.argv.findIndex(e => e.match('electron-builder.js'))
const what = process.argv[argvStartingWith + 1]