Skip to content

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

Closed
Ogmo-Editor-3/OgmoEditor3-CE
#130
@alchaplinsky

Description

@alchaplinsky
Contributor

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?

Activity

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 [/+] on Jun 21, 2019
nielsoo

nielsoo commented on Jun 25, 2019

@nielsoo

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

rickythink

rickythink commented on Jul 1, 2019

@rickythink

same issue

internetztube

internetztube commented on Jul 1, 2019

@internetztube

same here

develar

develar commented on Jul 1, 2019

@develar
Member

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

UdaraJay commented on Jul 1, 2019

@UdaraJay

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

dotconnor commented on Jul 2, 2019

@dotconnor

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

alchaplinsky commented on Jul 2, 2019

@alchaplinsky
ContributorAuthor

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

UdaraJay

UdaraJay commented on Jul 2, 2019

@UdaraJay

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

develar commented on Jul 2, 2019

@develar
Member

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

danielhuoo commented on Jul 16, 2019

@danielhuoo

@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

develar commented on Jul 18, 2019

@develar
Member

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.

55 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @develar@alchaplinsky@UdaraJay@qcgm1978@huijunye

      Issue actions

        Building on macOS 10.15 fails. Can't locate Mac/Memory.pm · Issue #3990 · electron-userland/electron-builder