Skip to content

Commit

Permalink
Bump version to v0.17.0-rc1
Browse files Browse the repository at this point in the history
Add workaround to remove debug information from Electron production binaries on Linux.
  • Loading branch information
fxha committed Jan 29, 2022
1 parent 10a94eb commit 1d1c499
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .electron-vue/electron-builder/afterPack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict'
const fs = require('fs')
const path = require('path')
const { exec: execNode } = require("child_process")
const util = require('util')

const exec = util.promisify(execNode)

// interface AfterPackContext {
// outDir: string
// appOutDir: string
// packager: PlatformPackager<any>
// electronPlatformName: string
// arch: Arch
// targets: Array<Target>
// }

/**
*
* @param {AfterPackContext} context
*/
const afterPack = async (context) => {
// Workaround to remove debug information from production binaries on Linux (Electron#32669).
if (context.packager.platform.name === 'linux') {
console.log('[afterPack] Removing Electron debug information on Linux')

const { appOutDir } = context
const chromeCrashpadHandlerPath = path.join(appOutDir, 'chrome_crashpad_handler')
const libvkPath = path.join(appOutDir, 'libvk_swiftshader.so')

if (fs.existsSync(chromeCrashpadHandlerPath)) {
const { err } = await exec(`strip "${chromeCrashpadHandlerPath}"`)
if (err) {
console.log('[afterPack] Unable to strip "chrome_crashpad_handler".')
}
} else {
console.log(`[afterPack] "chrome_crashpad_handler" doesn't exists: "${chromeCrashpadHandlerPath}".`)
}

if (fs.existsSync(libvkPath)) {
const { err } = await exec(`strip "${libvkPath}"`)
if (err) {
console.log('[afterPack] Unable to strip "libvk_swiftshader.so".')
}
} else {
console.log(`[afterPack] "libvk_swiftshader.so" doesn't exists: "${libvkPath}".`)
}
}
}

exports.default = afterPack
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extraResources:
to: "hunspell_dictionaries/"
filter:
- "!**/LICENSE-hunspell.txt"
afterPack: './.electron-vue/electron-builder/afterPack.js'

fileAssociations:
- ext:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marktext",
"version": "0.16.3",
"version": "0.17.0-rc.1",
"homepage": "https://marktext.app/",
"description": "Next generation markdown editor",
"license": "MIT",
Expand Down

0 comments on commit 1d1c499

Please sign in to comment.