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

Building on macOS 10.15 fails. Can't locate Mac/Memory.pm #3990

Closed
alchaplinsky opened this issue Jun 21, 2019 · 15 comments
Closed

Building on macOS 10.15 fails. Can't locate Mac/Memory.pm #3990

alchaplinsky opened this issue Jun 21, 2019 · 15 comments
Labels

Comments

@alchaplinsky
Copy link
Contributor

@alchaplinsky alchaplinsky commented Jun 21, 2019

Which version of electron-builder are you using?

  • 20.44.4:

What target are you building for?

  • Mac(dmg):

I'm on MacOs 10.15 (beta2). While trying to build dmg I get following exception:

Error: Exit code: 2. Command failed: /usr/bin/perl /private/var/folders/9c/tprqfcrs66qff3x86tdp3_xw0000gn/T/t-yGVUjs/1-dmgProperties.pl
Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4/darwin-thread-multi-2level /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/9c/tprqfcrs66qff3x86tdp3_xw0000gn/T/t-yGVUjs/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/9c/tprqfcrs66qff3x86tdp3_xw0000gn/T/t-yGVUjs/1-dmgProperties.pl line 4.

Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4/darwin-thread-multi-2level /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/9c/tprqfcrs66qff3x86tdp3_xw0000gn/T/t-yGVUjs/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/9c/tprqfcrs66qff3x86tdp3_xw0000gn/T/t-yGVUjs/1-dmgProperties.pl line 4.

Possible issue with Perl on new Mac OS?

@alchaplinsky alchaplinsky changed the title Building on macOs 10.15 fails. Can't locate Mac/Memory.pm Building on macOS 10.15 fails. Can't locate Mac/Memory.pm Jun 21, 2019
@nielsoo

This comment has been minimized.

Copy link

@nielsoo nielsoo commented Jun 25, 2019

I am on macOS beta 2 as well having the same issue here... using electron-builder@20.44.4 / electron@4.2.5

@imrickywong

This comment has been minimized.

Copy link

@imrickywong imrickywong commented Jul 1, 2019

same issue

@internetztube

This comment has been minimized.

Copy link

@internetztube internetztube commented Jul 1, 2019

same here

@develar

This comment has been minimized.

Copy link
Member

@develar develar commented Jul 1, 2019

Guys, today I am going to setup my Raspberry PI and make snap for ARM working. Then, later this week, I will take a look on this issue. Sorry for delay, if it is important for you, you can send PR or donation.

@UdaraJay

This comment has been minimized.

Copy link

@UdaraJay UdaraJay commented Jul 1, 2019

Same issue; pretty sure it's related to Catalina not shipping with Perl installed.

I tried installing it myself, but Mac::Carbon and Mac::Memory don't install on 64bit Perl. Went as far as trying to rebuild Perl for 32bit, but looks liked xCode deprecated building for 32bit altogether.

@dotconnor

This comment has been minimized.

Copy link

@dotconnor dotconnor commented Jul 2, 2019

Not only xcode but look like the entire operating system doesn't allow 32bit programs. Running wine to build for win32 or just using wine by itself doesn't work:

file /usr/local/bin/wine
/usr/local/bin/wine: Mach-O executable i386

wine -v
zsh: bad CPU type in executable: wine
@alchaplinsky

This comment has been minimized.

Copy link
Contributor Author

@alchaplinsky alchaplinsky commented Jul 2, 2019

@dotconnor Yup, you're right macOS Catalina does not Support 32-bit Apps.

@UdaraJay

This comment has been minimized.

Copy link

@UdaraJay UdaraJay commented Jul 2, 2019

Also, for anyone that stumbles into this; this is only a problem when trying to package you app into a dmg. It works fine if you make a pkg instead (more recommended to distribute apps as packages anyways).

*May be different if you're distributing into the mac app store.

@develar

This comment has been minimized.

Copy link
Member

@develar develar commented Jul 2, 2019

Yes, it is only for DMG, because no official tool and open API to perform customization of DMG. electron-builder uses 3rd-party solution, that written in Perl. Should be ported to Go language (from this perl code or from python).

@danielhuoo

This comment has been minimized.

Copy link

@danielhuoo danielhuoo commented Jul 16, 2019

@UdaraJay Thanks a lot.
And to whom don't know how to build pkg instead of dmg, you could edit the package.json:

"build":{
      "mac": {
          "icon": "build/icons/icon.icns",
          "target":"pkg"
       }
}
@develar

This comment has been minimized.

Copy link
Member

@develar develar commented Jul 18, 2019

All existing solutions, including appdmg, are bad and cannot help to create correctly positioned DMG Windows. Problem — window position is computed from bottom, and not from top. So, as you don't know user display screen height, you cannot correctly set window bounds.

If you will set only size, then Finder will ignore size, and your background image will look ugly.
Apple keep silent and don't provide not only tool to customize DMG, but even docs about DSStore format.

Irony that used by electron-builder solution in Perl is able to set windows position from top because uses deprecated format. And now Apple killed mac carbon 32-bit completely. Enjoy :(

As I don't have time to convert Perl solution in Go (as Go is the only language that should be used for such tools, forget about nodejs or python), for now following solution is implemented:

  • if you don't set window position at all, then:
    • if background color is used — window bounds is not set and Finder will position your windows in center of the screen with some OS specific size.
    • if background image is set — then x is set to 400 (as before), and y is set to (1440 - backgroundHeight) / 2 where backgroundHeight it is computed automatically height of specified background image. Yes, assumed that 1440 it is height of user display (lesser of two evils).
  • if you set window bounds:
    • if you set only size — x/y is set as for "background image is set" step.
    • if you set both x/y and width/height — it is used as is.

I do not have time and plans to implement decent solution (as it was in Perl). First, because Perl solution format is deprecated for ages already, and maybe Apple will drop it sometime. Second, burn in hell, Apple (yes, it seems Apple don't care about developers who don't distribute apps via AppStore).

DropDMG app creates correctly positioned DMG windows. Maybe I will ask ability to reuse DropDMG CLI / support it.

Release will be in 2 days.

develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 19, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 20, 2019
develar added a commit to develar/electron-builder that referenced this issue Jul 20, 2019
@develar develar closed this in 8f099f5 Jul 20, 2019
@mobiniusHarshajagadish

This comment has been minimized.

Copy link

@mobiniusHarshajagadish mobiniusHarshajagadish commented Sep 23, 2019

@develar ,
Could you please let me know what changes are required to fix this issue on Catalina?

@huijunye

This comment has been minimized.

Copy link

@huijunye huijunye commented Oct 9, 2019

update electron-builder version to 21.2.0

@qcgm1978

This comment has been minimized.

Copy link

@qcgm1978 qcgm1978 commented Nov 5, 2019

sudo npm i electron-builder@latest -S worked for me

@sunzongzheng

This comment has been minimized.

Copy link

@sunzongzheng sunzongzheng commented Nov 14, 2019

But higher version electron-builder needs higher node version.

macos@10.15 needs electron-builder@21.2.0
electron-builder@21.2.0 needs node>=8.12

So I can not fix it with node@8.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.