-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Error when launching electron after copying the snapshot file
Version mismatch between V8 binary and snapshot.
V8 binary version: 10.4.132.24-electron.0
Snapshot version: 10.4.132.20-electron.0
yes - I have done ELECTRON_CUSTOM_VERSION=20.3.5 yarn install
OS: MacOS 12.6 (ARM64)
Files successfully copied to app/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources
Scripts used to generate the snapshots
Code
const childProcess = require('child_process')
const vm = require('vm')
const path = require('path')
const fs = require('fs')
const electronLink = require('electron-link')
const excludedModules = {}
async function main () {
const baseDirPath = path.resolve(__dirname, '..')
console.log('Creating a linked script..')
const result = await electronLink({
baseDirPath: baseDirPath,
mainPath: `${baseDirPath}/src/snapshot/imports.js`,
cachePath: `${baseDirPath}/cache`,
shouldExcludeModule: (modulePath) => excludedModules.hasOwnProperty(modulePath)
})
const snapshotScriptPath = `${baseDirPath}/cache/snapshot.js`
fs.writeFileSync(snapshotScriptPath, result.snapshotScript)
// Verify if we will be able to use this in `mksnapshot`
vm.runInNewContext(result.snapshotScript, undefined, {filename: snapshotScriptPath, displayErrors: true})
const outputBlobPath = path.resolve(__dirname, "../cache/")
console.log(`Generating startup blob in "${outputBlobPath}"`)
childProcess.execFileSync(
path.resolve(
__dirname,
'..',
'node_modules',
'.bin',
'mksnapshot' + (process.platform === 'win32' ? '.cmd' : '')
),
[snapshotScriptPath, '--output_dir', outputBlobPath]
)
}
main().catch(err => console.error(err))skececi
Metadata
Metadata
Assignees
Labels
No labels


