Skip to content

Commit f6a1fcd

Browse files
authored
Bump version to v0.17.0-rc1 (marktext#2952)
Add workaround to remove debug information from Electron production binaries on Linux.
1 parent 10a94eb commit f6a1fcd

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
'use strict'
2+
const fs = require('fs')
3+
const path = require('path')
4+
const { exec: execNode } = require("child_process")
5+
const util = require('util')
6+
7+
const exec = util.promisify(execNode)
8+
9+
// interface AfterPackContext {
10+
// outDir: string
11+
// appOutDir: string
12+
// packager: PlatformPackager<any>
13+
// electronPlatformName: string
14+
// arch: Arch
15+
// targets: Array<Target>
16+
// }
17+
18+
/**
19+
*
20+
* @param {AfterPackContext} context
21+
*/
22+
const afterPack = async (context) => {
23+
// Workaround to remove debug information from production binaries on Linux (Electron#32669).
24+
if (context.packager.platform.name === 'linux') {
25+
console.log('[afterPack] Removing Electron debug information on Linux')
26+
27+
const { appOutDir } = context
28+
const chromeCrashpadHandlerPath = path.join(appOutDir, 'chrome_crashpad_handler')
29+
const libvkPath = path.join(appOutDir, 'libvk_swiftshader.so')
30+
31+
if (fs.existsSync(chromeCrashpadHandlerPath)) {
32+
const { err } = await exec(`strip "${chromeCrashpadHandlerPath}"`)
33+
if (err) {
34+
console.log('[afterPack] Unable to strip "chrome_crashpad_handler".')
35+
}
36+
} else {
37+
console.log(`[afterPack] "chrome_crashpad_handler" doesn't exists: "${chromeCrashpadHandlerPath}".`)
38+
}
39+
40+
if (fs.existsSync(libvkPath)) {
41+
const { err } = await exec(`strip "${libvkPath}"`)
42+
if (err) {
43+
console.log('[afterPack] Unable to strip "libvk_swiftshader.so".')
44+
}
45+
} else {
46+
console.log(`[afterPack] "libvk_swiftshader.so" doesn't exists: "${libvkPath}".`)
47+
}
48+
}
49+
}
50+
51+
exports.default = afterPack

electron-builder.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ extraResources:
5858
to: "hunspell_dictionaries/"
5959
filter:
6060
- "!**/LICENSE-hunspell.txt"
61+
afterPack: './.electron-vue/electron-builder/afterPack.js'
6162

6263
fileAssociations:
6364
- ext:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "marktext",
3-
"version": "0.16.3",
3+
"version": "0.17.0-rc.1",
44
"homepage": "https://marktext.app/",
55
"description": "Next generation markdown editor",
66
"license": "MIT",

0 commit comments

Comments
 (0)