Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux build fails at icon conversion #239

Closed
jkudish opened this issue Mar 13, 2016 · 50 comments · Fixed by #241 · May be fixed by qcif/data-curator#563
Closed

Linux build fails at icon conversion #239

jkudish opened this issue Mar 13, 2016 · 50 comments · Fixed by #241 · May be fixed by qcif/data-curator#563
Assignees
Labels

Comments

@jkudish
Copy link

jkudish commented Mar 13, 2016

Building a deb with the latest release (2.9.5) I get the following error:

Unhandled rejection Error: Command failed: gm convert: Unable to open file (/tmp/electron-builder-30935NzzLT2KzUll7/icon_128x128x32.png) [No such file or directory].

I have provided a build/icon.icns file (generated using these steps: http://blog.macsales.com/28492-create-your-own-custom-icons-in-10-7-5-or-later). When I look what's in the /tmp/electron-builder-30935NzzLT2KzUll7/ folder, I see that it created the following icons:

icon_16x16x32.png
icon_256x256x32.png
icon_32x32x32.png
icon_512x512x32.png

Looks like 64 and 128 is missing.

I am building the linux deb from an Ubuntu 15.10 machine.

Any ideas what's going on? Alternatively, could I just provide the icons "manually" (I already have all those pngs anyways)?

@develar
Copy link
Member

develar commented Mar 14, 2016

Thanks, will be fixed.

Do you have 48x48 icon (just curios)?

develar added a commit to develar/electron-builder that referenced this issue Mar 14, 2016
@develar
Copy link
Member

develar commented Mar 14, 2016

You can try pre-release version — set version to https://github.com/develar/electron-complete-builder/releases/download/vNext/electron-builder-0.0.0-semantic-release-4.tgz

Reproduced — on Travis server icns2png doesn't work at all — No elements were extracted from.

@jbleuzen
Copy link

Thanks the electron-builder-0.0.0-semantic-release-4.tgz build works...

@develar
Copy link
Member

develar commented Mar 14, 2016

@jbleuzen Thanks for confirmation. What I want — since you in any case have to provide icns file for OS X, it will be better if tool will use it to generate linux icon set. Well, it seems that icns2png is broken on Linux. Well, "could I just provide the icons "manually"" makes sense.

develar added a commit that referenced this issue Mar 14, 2016
fix: Linux build fails at icon conversion #239
@jkudish
Copy link
Author

jkudish commented Mar 15, 2016

Confirmed here too, Linux builds correctly now. Thanks for the fix!

develar added a commit to develar/electron-builder that referenced this issue Mar 16, 2016
@knvpk
Copy link

knvpk commented Apr 29, 2016

Hi , im facing the same problem so i thought o update the electron-builder verstion to master in package.json, but it is not working.

@develar
Copy link
Member

develar commented Apr 29, 2016

@pavankumarkatakam On CI server or dev machine? This fix is released already.

@knvpk
Copy link

knvpk commented Apr 29, 2016

Im using actually "electron-builder": "^3.13.1", , is this fixed in that version, if it is the case im getting same error in my local ubuntu machine running ubuntu16.04

@develar
Copy link
Member

develar commented Apr 29, 2016

@pavankumarkatakam Please attach build log here. Please check that your icns file is correct.

@knvpk
Copy link

knvpk commented Apr 29, 2016

Hi @develar , Here is my logs

> rm -rf build/* && cp  desktop/* host/ && ./node_modules/.bin/build --platform=linux --arch=x64 --dist=./build

license in the development package.json is deprecated, please move to the application package.json
Rebuilding app dependencies for arch x64 to /home/storage/work/gitlab/pamilya2/host
----------------------------------------------------
Reading icns family from /home/storage/work/gitlab/pamilya2/build/icon.icns...

Unhandled rejection Error: gm convert: Unable to open file (/tmp/electron-builder-3424qnoEDhf4F9Ip/icon_256x256x32.png) [No such file or directory].

Error: Command failed: gm convert -size 64x64 /tmp/electron-builder-3424qnoEDhf4F9Ip/icon_256x256x32.png -resize 64x64 /tmp/electron-builder-3424qnoEDhf4F9Ip/icon_64x64x32.png
gm convert: Unable to open file (/tmp/electron-builder-3424qnoEDhf4F9Ip/icon_256x256x32.png) [No such file or directory].

    at /home/storage/work/gitlab/pamilya2/node_modules/electron-builder/src/util.ts:92:18
    at ChildProcess.exithandler (child_process.js:209:5)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:475:12)

I have installed the required packages mentioned in wiki page.

And im just checking my app with electron first time here is my development package json for building the linux


  "build": {
    "iconUrl": "http://eatodo.s3.amazonaws.com/icon.ico",
    "linux": {
      "maintainer": "Invizo Technologies Pvt Ltd"
    }
  },

@develar
Copy link
Member

develar commented Apr 29, 2016

rm -rf build/* && cp desktop/* host/ && ./node_modules/.bin/build --platform=linux --arch=x64 --dist=./build

Hmm... it seems you delete your build directory, isn't?

--dist arg is a boolean. You cannot change out dir using this param.

Also, you should not clean output directory — electron-builder does it automatically.

@knvpk
Copy link

knvpk commented Apr 29, 2016

Hi @develar , I have changed that command to
"buildApp1": "cp desktop/* host/ && ./node_modules/.bin/build --platform=linux --arch=x64 --dist",
in package.json ,

But still getting the same error.

also this is my package.json


  "build": {
    "iconUrl": "http://eatodo.s3.amazonaws.com/icon.ico",
    "linux": {
      "maintainer": "Invizo Technologies Pvt Ltd"
    }
  },
  "directories": {
    "app": "./host"
  },

@develar
Copy link
Member

develar commented Apr 29, 2016

Please icns2png --version

And

mkdir /tmp/test-ico
icns2png -x -o /tmp/test-ico build/icon.icns

Please list content of the /tmp/test-ico directory.

@knvpk
Copy link

knvpk commented Apr 29, 2016

version is


icns2png 1.5                                                                  

Copyright (c) 2001-2012 Mathew Eis                                            
This is free software; see the source for copying conditions.  There is NO    
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   

Written by Mathew Eis           

output of second statement

----------------------------------------------------
Reading icns family from build/icon.icns...
Unable to open file build/icon.icns!

output of command ls -al /tmp/test-ico

total 108
drwxrwxr-x  2 administrator administrator   4096 Apr 29 15:45 .
drwxrwxrwt 26 root          root          102400 Apr 29 15:46 ..

@develar
Copy link
Member

develar commented Apr 29, 2016

Unable to open file build/icon.icns!

Please change path in the command to your icns file.

@knvpk
Copy link

knvpk commented Apr 29, 2016

As i mentioned before im not using any icns file, i just mentioned "iconUrl": "http://eatodo.s3.amazonaws.com/icon.ico", copied from wiki page.

@develar
Copy link
Member

develar commented Apr 29, 2016

Docs:
"
Linux icon set will be generated automatically on the fly from the OS X icns file (or you can put them into the build/icons directory — filename must contains size (e.g. 32x32.png)).
"

You must have build/icon.icns file or "build/icons directory — filename must contains size (e.g. 32x32.png))"

@knvpk
Copy link

knvpk commented Apr 29, 2016

I have added the build/icons/X*X.png files, but now it is showing the another error.

Error: spawn fpm ENOENT
    at exports._errnoException (util.js:890:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:

I have installed gem install fpm

@knvpk
Copy link

knvpk commented Apr 29, 2016

Output of gem list

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
arr-pm (0.0.10)
backports (3.6.8)
bigdecimal (1.2.6)
cabin (0.8.1)
childprocess (0.5.9)
clamp (0.6.5)
corefines (1.9.0)
ffi (1.9.10)
fpm (1.5.0)
io-console (0.4.3)
io-like (0.3.0)
json (1.8.1)
minitest (5.4.3)
power_assert (0.2.2)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
ruby-xz (0.2.3)
test-unit (3.0.8)

@knvpk
Copy link

knvpk commented May 2, 2016

I have just updated to 3.15.0, but im getting the same error, i have also installed and update the xz-utils


xz (XZ Utils) 5.2.2
liblzma 5.2.2

install fpm as well

@develar
Copy link
Member

develar commented May 2, 2016

getting the same error

spawn fpm ENOENT? Does it work in the terminal: fpm --version

@develar
Copy link
Member

develar commented Jun 1, 2016

not picking up the icon path from the osx build options

It is DMG icon "which will be shown when mounted". Yeah, it is not user-friendly and confusing.

@mzmousa
Copy link

mzmousa commented Jun 1, 2016

Okay, last question about icons since what you said worked out for me :)
For Windows, we need the icon to be from an http URL, right? But for OSX and Linux, we can have our icon(s) hosted locally? Since Windows must have the icon from an http URL, can the OSX and Linux icons also be from an http URL?
Sorry if I'm overcomplicating it. Just trying to find a consistent workflow for win/osx/linux.

@develar
Copy link
Member

develar commented Jun 2, 2016

Since Windows must have the icon from an http URL, can the OSX and Linux icons also be from an http URL?

No, it is windows only fail. And to be honest – we can fix this Squirrel.Windows bug.

Just trying to find a consistent workflow for win/osx/linux.

It is better to fix Squirrel.Windows bug and do not require http url.

@mzmousa
Copy link

mzmousa commented Jun 2, 2016

After updating to electron-builder 4.2.0, it seems to detect that I have ./build/icon.icns, but it's always giving me this error. I didn't post a new issue because the linux build also fails for icon conversion.

Reading icns family from .../build/appicon.icns...

Unhandled rejection Error: Unable to open file .../build/appicon.icns!
Errors while extracting icns data from .../build/appicon.icns!

And on osx, it detects the icon, but never sets it properly for my .app file. :( Here are my osx settings:

    "osx": {
      "title": "myapp",
      "icon": "./build/appicon.icns",
      "icon-size": 128,
      "contents": [
        {
          "x": 410,
          "y": 220,
          "type": "link",
          "path": "/Applications"
        },
        {
          "x": 130,
          "y": 220,
          "type": "file"
        }
      ]

@mzmousa
Copy link

mzmousa commented Jun 2, 2016

Fixed. Need to change the name to from appicon.icns to icon.icns.

@JimiC
Copy link

JimiC commented Jun 7, 2016

@develar
Little help here pls.
I'm trying to programmatically build (builder.build) on an Ubuntu 16.04 and I get the "spawn icns2png ENOENT" error. Build options is basic configuration:

{
    "devMetadata": {
         "build": {
         }
    }
}

Project structure contains build/icon.icns on root.
Project structure is:
`root
| - build
|-- | icon.icns
| - src
| - tools
| -- | packager
|-------| bin
|----------| installBuilder
gulpfile.js
package.json

build should appear in "installBuilder" (package gets created but .deb creation fails)
Any suggestions?

P.S. Assume I know nothing about linux box.

@develar
Copy link
Member

develar commented Jun 7, 2016

@develar
Copy link
Member

develar commented Jun 7, 2016

P.S. Assume I know nothing about linux box.

For such case we provide docker image — https://github.com/electron-userland/electron-builder/tree/master/docker — but it is not documented and, so, for advanced users only.

@JimiC
Copy link

JimiC commented Jun 7, 2016

@develar OK. I have to admit it. I fail miserably when it comes to RTFM (Read The F****ing Manual) 😳

@JimiC
Copy link

JimiC commented Jun 7, 2016

@develar If I'm to use build/icons folder do I need to add all png resolutions
(i.e 24,32,48,64,128,256)?

@develar
Copy link
Member

develar commented Jun 7, 2016

@JimiC we use it as is. Just convert to standard layout without any size requirements. It is your responsibility now to provide required sizes. No checks on our side.

@mzmousa
Copy link

mzmousa commented Jun 7, 2016

@JimiC develar had an example where he named the png files in build/icons folder to be

24x24.png
32x32.png
48x48.png
64x64.png
128x128.png
256x256.png

And it worked for me after trying that, if you're just trying to get something up and running. Of course you can always just specify an icon.icns file in your build.osx options, which should be located in the build folder, and the linux build will pick it up.

@JimiC
Copy link

JimiC commented Jun 7, 2016

@mzmousa @develar I suspect that in case of using icon.icns it has to be 256x256 just like in Windows, right?

@develar
Copy link
Member

develar commented Jun 7, 2016

@JimiC No. For OS X 512x512 is required (no checks on our side) and better to provide 1024x1024.

@JimiC
Copy link

JimiC commented Jun 7, 2016

@develar 😱 It's worst than I thought. Even for Linux?

@JimiC
Copy link

JimiC commented Jun 7, 2016

@develar Resolved. As usually the user didn't paid attention to the specified options. 👊

@develar
Copy link
Member

develar commented Jun 8, 2016

It's worst than I thought. Even for Linux?
@JimiC

      createMapping("16"),
      createMapping("24"),
      createMapping("32"),
      createMapping("48"),
      createMapping("64"),
      createMapping("96"),
      createMapping("128"),
      createMapping("256"),
      createMapping("512"),

i.e. we create mapping for 512 and assume that this file is exist.

@Mercieral
Copy link

@develar

I am having a similar (if not the same) issue

Unhandled rejection Error: Command failed: gm convert -size 16x16 /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-2uq-ir4w5olx-0/icon_256x256x32.png -resize 16x16 /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-2uq-ir4w5olx-0/icon_16x16x32.png
gm convert: Unable to open file (/var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-2uq-ir4w5olx-0/icon_256x256x32.png) [No such file or directory].

gm convert: Unable to open file (/var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-2uq-ir4w5olx-0/icon_256x256x32.png) [No such file or directory].

    at /Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/util.ts:98:16
    at ChildProcess.exithandler (child_process.js:220:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:475:12)
From previous event:
    at Object.exec (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/util.ts:78:9)
    at resize (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:115:18)
    at LinuxTargetHelper.<anonymous> (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/targets/LinuxTargetHelper.ts:120:21)
From previous event:
    at tsAwaiter (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at Object.build (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/builder.ts:193:52)
    at Object.<anonymous> (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/build-cli.ts:27:28)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

I have a icon.icns 128 x 128 in my specified buildResources directory which is working properly when generating a MacOS installer but failing when generating a Linux installer on MacOS.

I apologize in advance if this is a simple issue that I am overlooking 😅

@develar
Copy link
Member

develar commented Jul 27, 2016

I have a icon.icns 128 x 128

@Mercieral "For OS X 512x512 is required (no checks on our side) and better to provide 1024x1024." To generate linux icons from icns, at least 256x256 must be — 128 x 128 is not enough.

@Mercieral
Copy link

@develar

I now have a 1024x1024 icon.icns but I am still getting an error that seems to be related to the icon

Packaging for platform linux x64 using electron 1.2.7 to dist/linux

Error: Command failed: /Users/amercier/.cache/fpm/fpm-1.5.1-20150715-2.2.2-osx/fpm -s dir -t deb --architecture amd64 --name G.Gapp --force --after-install /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/after-install --after-remove /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/after-remove --description 
 G.G Desktop Application --maintainer myCompany <[email protected]> --vendor myCompany <[email protected]> --version 0.1.0 --package /Users/amercier/myCompany/myProject/dist/G.Gapp-0.1.0.deb --url http://www.G.Gapp --deb-compression xz --depends libappindicator1 --depends libnotify-bin --license  /Users/amercier/myCompany/myProject/dist/linux/=/opt/G.Gapp /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_16x16x32.png=/usr/share/icons/hicolor/16x16/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_24x24x32.png=/usr/share/icons/hicolor/24x24/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_32x32x32.png=/usr/share/icons/hicolor/32x32/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_48x48x32.png=/usr/share/icons/hicolor/48x48/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_64x64x32.png=/usr/share/icons/hicolor/64x64/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_96x96x32.png=/usr/share/icons/hicolor/96x96/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_128x128x32.png=/usr/share/icons/hicolor/128x128/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_256x256x32.png=/usr/share/icons/hicolor/256x256/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_512x512x32.png=/usr/share/icons/hicolor/512x512/apps/G.Gapp.png /var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/G.Gapp.desktop=/usr/share/applications/G.Gapp.desktop

{:timestamp=>"2016-07-27T12:56:30.691842-0400", :message=>"Invalid package configuration: Cannot package the path '/var/folders/fb/_hrnxyqs4cvb4f8plq1tv1xr0000gp/T/electron-builder-linux-9b7-ir54v87i-0/icon_32x32x32.png', does it exist?", :level=>:error}

    at /Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/util.ts:98:16
    at ChildProcess.exithandler (child_process.js:220:5)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:475:12)
From previous event:
    at Object.exec (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/util.ts:78:9)
    at FpmTarget.<anonymous> (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/targets/fpm.ts:128:15)
    at next (native)
From previous event:
    at tsAwaiter (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at Object.build (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/builder.ts:193:52)
    at Object.<anonymous> (/Users/amercier/myCompany/myProject/node_modules/electron-builder/src/build-cli.ts:27:28)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

@develar
Copy link
Member

develar commented Jul 27, 2016

@Mercieral As a workaround, convert your icns using https://iconverticons.com/online/ (PNG - download all) and put all png files to build/icons directory. BTW, consider to use AppImage target instead of deb.

@Mercieral
Copy link

@develar That seemed to work, thank you! Also, I was just using build --linux so I assume deb was the default target.

@probonopd
Copy link

@Mercieral deb is the default for Linux but possibly you might be interested in the AppImage target, too.

@develar
Copy link
Member

develar commented Jul 28, 2016

AppImage target will be set as a default target Linux soon (once all known AppImage issues will be solved) — I decided to to bump major version to 6 and don't wait NSIS auto-update feature. Because AppImage is better than deb and electron-builder should promote it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
8 participants