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 constants from './fb-stubs/constants';
|
||||||
import {initializeElectron} from './electron/initializeElectron';
|
import {initializeElectron} from './electron/initializeElectron';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs-extra';
|
||||||
|
|
||||||
enableMapSet();
|
enableMapSet();
|
||||||
|
|
||||||
@@ -64,9 +64,17 @@ async function start() {
|
|||||||
let keytar: any = undefined;
|
let keytar: any = undefined;
|
||||||
try {
|
try {
|
||||||
if (!isTest()) {
|
if (!isTest()) {
|
||||||
keytar = electronRequire(
|
const keytarPath = path.join(
|
||||||
path.join(appPath, 'native-modules', `keytar-${process.platform}.node`),
|
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) {
|
} catch (e) {
|
||||||
console.error('Failed to load keytar:', e);
|
console.error('Failed to load keytar:', e);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
setLoggerInstance,
|
setLoggerInstance,
|
||||||
} from 'flipper-common';
|
} from 'flipper-common';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs-extra';
|
||||||
|
|
||||||
export async function startFlipperServer(
|
export async function startFlipperServer(
|
||||||
rootDir: string,
|
rootDir: string,
|
||||||
@@ -59,13 +59,17 @@ export async function startFlipperServer(
|
|||||||
let keytar: any = undefined;
|
let keytar: any = undefined;
|
||||||
try {
|
try {
|
||||||
if (!isTest()) {
|
if (!isTest()) {
|
||||||
keytar = electronRequire(
|
const keytarPath = path.join(
|
||||||
path.join(
|
|
||||||
staticPath,
|
staticPath,
|
||||||
'native-modules',
|
'native-modules',
|
||||||
`keytar-${process.platform}.node`,
|
`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) {
|
} catch (e) {
|
||||||
console.error('Failed to load keytar:', e);
|
console.error('Failed to load keytar:', e);
|
||||||
|
|||||||
BIN
desktop/static/native-modules/keytar-darwin-arm64.node
Executable file
BIN
desktop/static/native-modules/keytar-darwin-arm64.node
Executable file
Binary file not shown.
BIN
desktop/static/native-modules/keytar-darwin-x64.node
Executable file
BIN
desktop/static/native-modules/keytar-darwin-x64.node
Executable file
Binary file not shown.
Binary file not shown.
BIN
desktop/static/native-modules/keytar-linux-x64.node
Executable file
BIN
desktop/static/native-modules/keytar-linux-x64.node
Executable file
Binary file not shown.
Binary file not shown.
BIN
desktop/static/native-modules/keytar-win32-x64.node
Normal file
BIN
desktop/static/native-modules/keytar-win32-x64.node
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user