Keytar platform/arch
Summary: There appears to be an issue with login on M1 Macs right now. To address this, this resolves the native binary based on a `(platform, arch)` tuple. The binaries are from here: https://github.com/atom/node-keytar/releases/tag/v7.9.0 The binary size increase here is notable so as a follow-up we could remove the non-relevant binaries as part of the packing process. Reviewed By: aigoncharov Differential Revision: D34685236 fbshipit-source-id: d860a59517a769a59055dfca24d01baecd8d1430
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2a3491442b
commit
35428ca039
@@ -37,7 +37,7 @@ import {
|
||||
import constants from './fb-stubs/constants';
|
||||
import {initializeElectron} from './electron/initializeElectron';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
enableMapSet();
|
||||
|
||||
@@ -64,9 +64,17 @@ async function start() {
|
||||
let keytar: any = undefined;
|
||||
try {
|
||||
if (!isTest()) {
|
||||
keytar = electronRequire(
|
||||
path.join(appPath, 'native-modules', `keytar-${process.platform}.node`),
|
||||
const keytarPath = path.join(
|
||||
staticPath,
|
||||
'native-modules',
|
||||
`keytar-${process.platform}-${process.arch}.node`,
|
||||
);
|
||||
if (!(await fs.pathExists(keytarPath))) {
|
||||
throw new Error(
|
||||
`Keytar binary does not exist for platform ${process.platform}-${process.arch}`,
|
||||
);
|
||||
}
|
||||
keytar = electronRequire(keytarPath);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to load keytar:', e);
|
||||
|
||||
Reference in New Issue
Block a user