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 · 16 comments · Fixed by Ogmo-Editor-3/OgmoEditor3-CE#130
Closed

Comments

@alchaplinsky
Copy link
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?

@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
Copy link

nielsoo commented Jun 25, 2019

I am on macOS beta 2 as well having the same issue here... using [email protected] / [email protected]

@rickythink
Copy link

same issue

@internetztube
Copy link

same here

@develar
Copy link
Member

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
Copy link

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
Copy link

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
Copy link
Contributor Author

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

@UdaraJay
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
Member

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
@mobiniusHarshajagadish
Copy link

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

@huijunye
Copy link

huijunye commented Oct 9, 2019

update electron-builder version to 21.2.0

cvarley100 pushed a commit to iotaledger/trinity-wallet that referenced this issue Dec 16, 2019
* chore: update electron-builder to 21.2.0

Compiling for mac fails on macOS 10.15.1 with the following error:

"Can't locate Mac/Memory.pm"

The error originates from electron-builder which is now fixed in their latest version.

See: electron-userland/electron-builder#3990

* fix: re-add afterSign script
@murzhang
Copy link

murzhang commented Feb 8, 2020

In the end, I changed it to zip type and it succeeded without affecting the automatic update.

"build":{
"mac": {
"icon": "build/icons/icon.icns",
"target":"zip"
}
}

echowxsy added a commit to echowxsy/SnippetStore that referenced this issue Feb 15, 2020
echowxsy added a commit to echowxsy/SnippetStore that referenced this issue Feb 15, 2020
platykun added a commit to platykun/electron-webpack-quick-start that referenced this issue Feb 24, 2020
ghost pushed a commit to qcif/data-curator that referenced this issue May 11, 2020
…out breaking (electron-userland/electron-builder#3990). Updated CLI colour so visible on black/white bgrounds. Updated dev config so shows full e2e for just dev as in all.
Hazzard13 pushed a commit to Hazzard13/livesplit-electron that referenced this issue May 26, 2020
This fixes building on Catalina. 
Refer to this discussion on electron-builder for why: 
electron-userland/electron-builder#3990
trombik added a commit to trombik/lw.comm-server that referenced this issue Jul 14, 2020
hdiutil was removed because it uses old APIs, and fails to build. there
is no reference in the commit in which it was added to package.json.
it looks to me that hdiutil is not maintained.

update electron-builder. version 14.5.x is too old and has bugs on macos
and Windows. at least, 21.2.x is required to build the code.
see electron-userland/electron-builder#3990
for example.

for ARCH, `amd64` and `i386` are chosen because they are widely used,
and what `uname -m` returns. i'm open for alternatives.

there are too many `if: matrix.OS == 'windows'`. just to absorb path
separator difference. when Windows Subsystem for Linux, or WSL, is
available on hosted GitHub Actions runners, they can be removed. maybe,
MSYS2 has solutions, but i did not go father because i need a working
workflow first. see available software at:
https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
ghost pushed a commit to qcif/data-curator that referenced this issue Apr 21, 2021
…out breaking (electron-userland/electron-builder#3990). Updated CLI colour so visible on black/white bgrounds. Updated dev config so shows full e2e for just dev as in all.
matiasgarciaisaia added a commit to instedd/maap-collector that referenced this issue Jun 28, 2021
macOS Catalina (the oldest macOS version supported by Github Actions)[0]
is not supported by our current electron-builder version to build .dmg
images[1]. Upgrading electron-builder seems to require upgrading NodeJS'
version - and I don't want to get lost into that rabbit hole now.

The workaround is to build .pkg versions for macOS distribution - that is
supported by our current electron-build

[0] https://github.com/actions/virtual-environments/blob/cd920950ecab4754858eb395a1a763ae20deb342/README.md
[1] electron-userland/electron-builder#3990 (comment)
matiasgarciaisaia added a commit to instedd/maap-collector that referenced this issue Jul 8, 2021
* Add Github Actions to test project can build on pushes

* Checkout code before trying to build in CI

* Delete old TravisCI config

So long, and thanks for all the fish!

* Fix NodeJS version on CI builds

* Run End-to-End tests in CI using xvfb-run

* Build on CI on Windows/macOS as a matrix

* Preview releasing instances' build from Github Actions

I've commented out the country instances for now, just in case

* Expose GITHUB_TOKEN for release CI script

* Release 1.2.1.1 to test new CI builds

* Release 1.2.2 to test new CI releases

* Test builds for staging & demo only

We're still drafting the workflow, so I don't want to wait for all the instances

* Build macOS releases as .pkg

macOS Catalina (the oldest macOS version supported by Github Actions)[0]
is not supported by our current electron-builder version to build .dmg
images[1]. Upgrading electron-builder seems to require upgrading NodeJS'
version - and I don't want to get lost into that rabbit hole now.

The workaround is to build .pkg versions for macOS distribution - that is
supported by our current electron-build

[0] https://github.com/actions/virtual-environments/blob/cd920950ecab4754858eb395a1a763ae20deb342/README.md
[1] electron-userland/electron-builder#3990 (comment)

* Run builds by platform to avoid creating multiple drafts

The matrix key's order defines which job runs first[0], so this
change will hopefully make all Windows builds ran before their
macOS counter-parts, effectively avoiding the race condition
between two `release.js` scripts listing the releases at the
same time - and then both creating a draft each.

It's not a hard guarantee, but if it may be a cheap workaround -
and it's not that much of an issue if the workaround fail.

[0] https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix

* Avoid repeating INSTANCES list in Github Actions

This allows us to split release creation and installers upload in
two separate jobs, so we avoid creating two different drafts for
each release

* Test if we need to manually create the Github Release

`electron-builder` must be doing it by default

* Avoid creating Release Drafts from CI script

electron-builder takes care of that

* Move Release job into a separate workflow

That'll allow us to re-run that step independently.
We'll then split it into a workflow per instance.

* Rollback version change

It was a temporal change to be able to debug the builds.

This commit rolls it back so we can merge this branch.

See a2f831c
andotorg added a commit to andot-fork/electron-vue-admin that referenced this issue Aug 15, 2021
fix mac os 10.15 build error log is "Can't locate Mac/Finder/DSStore.pm in @inc"
from: electron-userland/electron-builder#3990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.