Skip to content

Commit 24f2565

Browse files
committed
fix: snap - can't push to snapcraft anymore because of execstack
Close #2608
1 parent 58933e0 commit 24f2565

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/electron-builder-lib/src/linuxPackager.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Arch, AsyncTaskManager, log } from "builder-util"
1+
import { Arch, AsyncTaskManager, log, executeAppBuilder } from "builder-util"
22
import { rename } from "fs-extra-p"
33
import * as path from "path"
44
import sanitizeFileName from "sanitize-filename"
@@ -81,8 +81,15 @@ export class LinuxPackager extends PlatformPackager<LinuxConfiguration> {
8181
}
8282
}
8383

84-
protected postInitApp(packContext: AfterPackContext): Promise<any> {
85-
return rename(path.join(packContext.appOutDir, this.electronDistExecutableName), path.join(packContext.appOutDir, this.executableName))
84+
protected async postInitApp(packContext: AfterPackContext): Promise<void> {
85+
const executable = path.join(packContext.appOutDir, this.executableName)
86+
await rename(path.join(packContext.appOutDir, this.electronDistExecutableName), executable)
87+
try {
88+
await executeAppBuilder(["clear-exec-stack", "--input", executable])
89+
}
90+
catch (e) {
91+
log.debug({error: e}, "cannot clear exec stack")
92+
}
8693
}
8794
}
8895

0 commit comments

Comments
 (0)