From 24f2565d3c55b8da5809ab9c4e4b3d812aadd2a2 Mon Sep 17 00:00:00 2001 From: develar Date: Tue, 20 Feb 2018 12:55:20 +0100 Subject: [PATCH] fix: snap - can't push to snapcraft anymore because of execstack Close #2608 --- packages/electron-builder-lib/src/linuxPackager.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/electron-builder-lib/src/linuxPackager.ts b/packages/electron-builder-lib/src/linuxPackager.ts index f1990e95493..6f00315f171 100644 --- a/packages/electron-builder-lib/src/linuxPackager.ts +++ b/packages/electron-builder-lib/src/linuxPackager.ts @@ -1,4 +1,4 @@ -import { Arch, AsyncTaskManager, log } from "builder-util" +import { Arch, AsyncTaskManager, log, executeAppBuilder } from "builder-util" import { rename } from "fs-extra-p" import * as path from "path" import sanitizeFileName from "sanitize-filename" @@ -81,8 +81,15 @@ export class LinuxPackager extends PlatformPackager { } } - protected postInitApp(packContext: AfterPackContext): Promise { - return rename(path.join(packContext.appOutDir, this.electronDistExecutableName), path.join(packContext.appOutDir, this.executableName)) + protected async postInitApp(packContext: AfterPackContext): Promise { + const executable = path.join(packContext.appOutDir, this.executableName) + await rename(path.join(packContext.appOutDir, this.electronDistExecutableName), executable) + try { + await executeAppBuilder(["clear-exec-stack", "--input", executable]) + } + catch (e) { + log.debug({error: e}, "cannot clear exec stack") + } } }