@@ -2,6 +2,7 @@ import { Arch, AsyncTaskManager, log, executeAppBuilder } from "builder-util"
22import { rename } from "fs-extra-p"
33import * as path from "path"
44import sanitizeFileName from "sanitize-filename"
5+ import * as semver from "semver"
56import { AfterPackContext } from "./configuration"
67import { DIR_TARGET , Platform , Target , TargetSpecificOptions } from "./core"
78import { LinuxConfiguration } from "./options/linuxOptions"
@@ -24,6 +25,10 @@ export class LinuxPackager extends PlatformPackager<LinuxConfiguration> {
2425 this . executableName = executableName == null ? this . appInfo . sanitizedName . toLowerCase ( ) : sanitizeFileName ( executableName )
2526 }
2627
28+ get isElectron2 ( ) : boolean {
29+ return semver . gte ( this . config . electronVersion || "1.8.3" , "2.0.0-beta.1" )
30+ }
31+
2732 get defaultTarget ( ) : Array < string > {
2833 return [ "snap" , "appimage" ]
2934 }
@@ -84,11 +89,14 @@ export class LinuxPackager extends PlatformPackager<LinuxConfiguration> {
8489 protected async postInitApp ( packContext : AfterPackContext ) : Promise < void > {
8590 const executable = path . join ( packContext . appOutDir , this . executableName )
8691 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+
93+ if ( ! this . isElectron2 ) {
94+ try {
95+ await executeAppBuilder ( [ "clear-exec-stack" , "--input" , executable ] )
96+ }
97+ catch ( e ) {
98+ log . debug ( { error : e } , "cannot clear exec stack" )
99+ }
92100 }
93101 }
94102}
0 commit comments