Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

Commit ce65c7e

Browse files
authored
Fix arm64 keytar binary is used for x64 build when building with CI (#620)
For unknown reason, if the app is built on GitHub Actions, `app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node` is ARM64 binary (couldn't reproduce to on M1 Mac) so we opt to use universal binary instead.
1 parent 28d6d80 commit ce65c7e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

patches/keytar+7.7.0.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
diff --git a/node_modules/keytar/README.md b/node_modules/keytar/README.md
2+
index 91141b7..e70d398 100644
3+
--- a/node_modules/keytar/README.md
4+
+++ b/node_modules/keytar/README.md
5+
@@ -1,3 +1,5 @@
6+
+For unknown reason, if the app is built on GitHub Actions, `app-x64.asar.unpacked/node_modules/keytar/build/Release/keytar.node` is ARM64 binary (couldn't reproduce to on M1 Mac) so we opt to use universal binary instead.
7+
+
8+
# keytar - Node module to manage system keychain
9+
10+
[![Travis Build Status](https://travis-ci.org/atom/node-keytar.svg?branch=master)](https://travis-ci.org/atom/node-keytar)
11+
diff --git a/node_modules/keytar/binding.gyp b/node_modules/keytar/binding.gyp
12+
index 9be3dcb..df66b96 100644
13+
--- a/node_modules/keytar/binding.gyp
14+
+++ b/node_modules/keytar/binding.gyp
15+
@@ -7,7 +7,18 @@
16+
],
17+
'cflags!': [ '-fno-exceptions' ],
18+
'cflags_cc!': [ '-fno-exceptions' ],
19+
- 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
20+
+ 'xcode_settings': {
21+
+ 'OTHER_CFLAGS': [
22+
+ '-arch x86_64',
23+
+ '-arch arm64'
24+
+ ],
25+
+ 'OTHER_LDFLAGS': [
26+
+ '-Wl, -bind_at_load',
27+
+ '-framework CoreFoundation -framework CoreServices',
28+
+ '-arch x86_64',
29+
+ '-arch arm64'
30+
+ ],
31+
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
32+
'CLANG_CXX_LIBRARY': 'libc++',
33+
'MACOSX_DEPLOYMENT_TARGET': '10.7',
34+
},
35+
diff --git a/node_modules/keytar/package.json b/node_modules/keytar/package.json
36+
index 4616f65..1108853 100644
37+
--- a/node_modules/keytar/package.json
38+
+++ b/node_modules/keytar/package.json
39+
@@ -30,7 +30,7 @@
40+
],
41+
"types": "./keytar.d.ts",
42+
"scripts": {
43+
- "install": "prebuild-install || npm run build",
44+
+ "install": "npm run build",
45+
"build": "node-gyp rebuild",
46+
"lint": "npm run cpplint",
47+
"cpplint": "node-cpplint --filters legal-copyright,build-include,build-namespaces src/*.cc",
48+
@@ -50,8 +50,7 @@
49+
"prebuild": "^10.0.1"
50+
},
51+
"dependencies": {
52+
- "node-addon-api": "^3.0.0",
53+
- "prebuild-install": "^6.0.0"
54+
+ "node-addon-api": "^3.0.0"
55+
},
56+
"binary": {
57+
"napi_versions": [

0 commit comments

Comments
 (0)