app-builder icon indicating copy to clipboard operation
app-builder copied to clipboard

Crash while building linux after changing icon.icns

Open amazingmarvin opened this issue 2 years ago • 1 comments

I found what may be the same crash reported in electron-userland/electron-builder#5844

I recently changed my app's macos icon (the build works and the icon displays correctly), and now when I build for linux, the build crashes here:

https://github.com/develar/app-builder/blob/b44c18756a8e8cc8cddebde0fb6e5fce2ec6bcb7/pkg/icons/icns-to-png.go#L60

The error message is panic: runtime error: index out of range [-1], meaning this result slice is empty.

Here's the old icon: https://s3.amazonaws.com/community.amazingmarvin.com/old_icon.icns and the new icon: https://s3.amazonaws.com/community.amazingmarvin.com/new_icon.icns

Interestingly the old icon shows correctly in Finder whereas the new icon shows a generic image icon, so possibly the file format is invalid somehow (though using an online icns->png converter works): image

amazingmarvin avatar Sep 13 '21 08:09 amazingmarvin

I rebuilt the icon using iconutil and it both looks correct in Finder and fixes the build. I will leave this open since I think it might be worth panicking with a better error when len(result) == 0, but feel free to close at your convenience!

amazingmarvin avatar Sep 13 '21 15:09 amazingmarvin