electron / packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI

Home Page:https://npm.im/@electron/packager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building Mac applications on Windows generates no output

stephnr opened this issue · comments

electron-packager . ${APP_NAME} --platform=darwin --arch=x64 --version=${ELECTRON_VERSION} --out=${OUTPUT_DIR}/mac64

Apparently the above command doesn't output anything

commented

Hi, can you answer these questions to help us triage your issue? https://github.com/maxogden/electron-packager/blob/master/CONTRIBUTING.md

Version: 4.1.3
CLI Arguments:
- Platform: Darwin
- Arch: x64
- Version: 0.28.1
- Out: /dist
Platform: Building for Mac

There was no stack trace.

@Stephn-R to clarify, are you building on a mac as well?

no I am building on a windows machine

+1 same issue, building mac on Windows. same params.

When running it with node, I get this error in the callback:

{ [Error: EXDEV, rename 'C:\Users\User\AppData\Local\Temp\electron-packager-mac\
AppName.app']
errno: 52,
code: 'EXDEV',
path: 'C:\\Users\\User\\AppData\\Local\\Temp\\electron-packager-mac\\AppName.app' }`

Ah, looks like a cross-device error which we've run into before. @normmcgarry is there a stack trace or a line number associated with that?

Looks like electron-packager\mac.js:83:27

Trace: { [Error: EXDEV, rename 'C:\Users\User\AppData\Local\Temp\electron-packag
er-mac\AppName.app']
  errno: 52,
  code: 'EXDEV',
  path: 'C:\\Users\\User\\AppData\\Local\\Temp\\electron-packager-mac\\AppName.app' }
    at s:\path-to-app\app\index.js:19:15
    at moved (s:\path-to-app\app\node_modules\electron-packager\mac.js:83:27)
    at Object.oncomplete (fs.js:107:15)

Looks like #60. I'll file a PR later today.

Same Problem here...

@s-a whose problem is the same as yours?

@malept same as Stephn r. I am on Windows too. I See you are on there. Just wrote a message to paticipate this issue and receive updates about this topic.

I"ve noticed more along the lines of what the original comment in this issue states, as well - even running on the OS drive of a Windows machine, if I tell electron to build for darwin, it seems to immediately exit after saying "Packaging app for platform darwin x64". No error is output whatsoever in this case. I'm hoping to trace through later today to see how far it's actually getting.

I'm finding that the process is dying silently in extract-zip when running with --platform=darwin on Windows. The call to extract never fires its callback. I'm wondering if this could have something to do with the OS X .app having symlinks in it?

Yep...pretty sure it's the symlinks doing it. Just tested again on a Windows VM running as administrator, and it completes successfully there. (AFAIK Windows inexplicably requires elevation to create symlinks, yet doesn't to create junctions.)

Thank you @kfranqueiro for the confirmation. I can also confirm that building my app on OSX with the same command had no issues

The fs.symlink callback in writeSymlink in extract-zip/index.js reports an error, but that error is never properly passed to the callback passed to extract in electron-packager/index.js, so it gets entirely lost.

It occurs to me that even if you manage to get past the symlink issue when running electron-packager, I'm not sure you have too many options for actually packing the application up into a zip or anything either, because Windows trips on the symlinks there too (even with admin permissions).

"build:macos": "npm run clean:macos && electron-packager ./app \"fileSharp\" --out=dist/macos --platform=darwin --arch=x64 --version=0.25.3 --icon=assets/macos/icon.icns"
Outputs nothing and fails silent.

"build:macos": "npm run clean:macos && electron-packager ./app \"fileSharp\" --out=dist/macos --platform=darwin --arch=ia32 --version=0.25.3 --icon=assets/macos/icon.icns",

returns

> npm run clean:macos && electron-packager ./app "fileSharp" --out=dist/macos --platform=darwin --arch=ia32 --version=0.25.3 --icon=assets/macos/icon.icns


> fileSharp@0.1.0 clean:macos C:\git\fileSharp
> rm -rf ./dist/macos

Downloading electron-v0.25.3-darwin-ia32.zip
Error: GET https://github.com/atom/electron/releases/download/v0.25.3/electron-v0.25.3-darwin-ia32.zip returned 404
[ [Error: GET https://github.com/atom/electron/releases/download/v0.25.3/electron-v0.25.3-darwin-ia32.zip returned 404] ] undefined

let me know if I can test something out

@s-a The Darwin v0.25.3 ia32 package does not exist. Selected versions and architectures should match those that exist in the Electron releases.

Ref: Electron Releases

@Stephn-R Thanks for this info . osx is not my world 😄

Since @kfranqueiro added the warning message when symlinks cannot be copied, it "fixes" the original bug of there not being any output when building on Windows for the target OSX platform. I don't know what else we want to do here, other than perhaps close this and create a new bug that adds docs about building on Windows for OSX.

Why switching the issue into symlinks discussion?

I have same failure building for darwin x64

The electron-v0.35.0-darwin-x64.zip has been downloaded succefully and then cmd on win 10 exits.

Sorry for being that guy but... Any update or workaround for this?

Building for darwin does absolutely nothing 😿

We need a community member who uses Windows to debug this. I don't believe any of the current maintainers has consistent access to a Windows development environment.

I have access to Windows and I'm who added the "skip" workaround to begin with. Windows requires elevation to create symlinks, but even then, I haven't managed to properly create archives out of builds that would seem to retain symlinks the same way they're retained on other platforms. So I've been at a loss as to whether there's really a real "solution" to this other than "build for OS X on OS X or Linux".

(Also, even though I do have a couple of machines running Windows, I've also done Electron app testing in a modern.ie VM on a MBP, which is something anyone can do.)

This might be worth documenting somewhere, either in the readme or as a runtime warning.

Electron-packager fails when building for Darwin (on Windows host).
I used to create Mac packages successfully on version 8.7.2.
I'm running cmd.exe as Admin.

Similar issues: #164 and my comment from 2016 (symlink was working)

# npx electron-packager --version
Electron Packager 13.0.1
Node v11.3.0
Host Operating system: win32 (x64)

# npx electron-packager . --platform=win32 --arch=x64 --electron-version=4.0.0
Packaging app for platform win32 x64 using electron v4.0.0
Wrote new app to d:\Projects\Public\atomic-tweetdeck\master\Atomic TweetDeck-win32-x64

# npx electron-packager . --platform=linux --arch=x64 --electron-version=4.0.0
Packaging app for platform linux x64 using electron v4.0.0
Wrote new app to d:\Projects\Public\atomic-tweetdeck\master\Atomic TweetDeck-linux-x64

# npx electron-packager . --platform=darwin --arch=x64 --electron-version=4.0.0
Packaging app for platform darwin x64 using electron v4.0.0
EPERM: operation not permitted, stat 'C:\Users\dogan\AppData\Local\Temp\electron-packager\darwin-x64\Atomic TweetDeck-darwin-x64\Atomic TweetDeck.app\Contents\Frameworks\Squirrel.framework\Versions\Current'

# npx electron-packager . --platform=darwin --arch=x64 --electron-version=4.0.0 --no-tmpdir
Packaging app for platform darwin x64 using electron v4.0.0
Cannot copy '.' to a subdirectory of itself, 'd:\Projects\Public\atomic-tweetdeck\master\Atomic TweetDeck-darwin-x64\Electron.app\Contents\Resources\app'.

# npx electron-packager . --platform=darwin --arch=x64 --electron-version=4.0.0 --no-tmpdir -out=build
Packaging app for platform darwin x64 using electron v4.0.0
Cannot copy '.' to a subdirectory of itself, 'd:\Projects\Public\atomic-tweetdeck\master\Atomic TweetDeck-darwin-x64\Electron.app\Contents\Resources\app'.

# I set a parent directory as build folder: "..\build"
# npx electron-packager . --platform=darwin --arch=x64 --electron-version=4.0.0 --no-tmpdir -out=..\build
Packaging app for platform darwin x64 using electron v4.0.0
Cannot copy '.' to a subdirectory of itself, 'd:\Projects\Public\atomic-tweetdeck\master\Atomic TweetDeck-darwin-x64\Electron.app\Contents\Resources\app'.

It probably has something to do with the fact that your app directory is on one drive and the temp directory is on the other. Also, it's --out, not -out.