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 packages on OS X silently fails during ncp call #150

Closed
davej opened this issue Oct 6, 2015 · 13 comments
Closed

Building packages on OS X silently fails during ncp call #150

davej opened this issue Oct 6, 2015 · 13 comments
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛

Comments

@davej
Copy link

davej commented Oct 6, 2015

Using electron-packager v5.1.0 on OS X 10.10.5 and Node v4.1.1

➜ electron-packager . MyApp --overwrite --platform=darwin --arch=x64 --version=0.33.6

Packaging app for platform darwin x64 using electron v0.33.6

No errors, it just exits about 10 seconds after displaying the message "Packaging app for platform darwin x64 using electron v0.33.6" and there are no files written to my CWD.

I realise that this is very sparse on info but I'm not sure what other details I can give. When I last ran this command about three weeks ago it worked fine.

@malept
Copy link
Member

malept commented Oct 6, 2015

Can you bisect which released version of electron-packager is the last one that works for you?

@malept malept added the needs info Issue reporter needs to provide more information for maintainers to take action label Oct 6, 2015
@davej
Copy link
Author

davej commented Oct 6, 2015

I believe I was using 5.1.0 when it worked before... I tried moving back to an earlier version anyway but it still didn't work. Could this be something related to something in my app code base (I see symlink issues are mentioned a lot, I have symlinked modules).

@malept
Copy link
Member

malept commented Oct 6, 2015

Could you try specifying an --out directory?

Otherwise, I think we're going to need reproduction steps on a minimal Electron app.

@davej
Copy link
Author

davej commented Oct 6, 2015

Still isn't working with --out.

I'm doing a bit of debugging, seems to be failing here, the callback function (cb) is never fired.

@malept
Copy link
Member

malept commented Oct 6, 2015

Hmm. Very odd. I noticed that Travis CI only tests under Node 0.12. Let me add some more Node versions, and see if that surfaces anything.

@davej
Copy link
Author

davej commented Oct 6, 2015

Possibly related to AvianFlu/ncp#98?

@malept
Copy link
Member

malept commented Oct 6, 2015

Possibly, but that's a really vague bug report with no follow-up.

@davej
Copy link
Author

davej commented Oct 6, 2015

Yup.

FYI, tried a couple of other node versions, I'm getting the same issue with Node-v0.12.2 and iojs-v2.0.1.

@malept malept changed the title Silently failing for me on OS X Building packages on OS X silently fails during ncp call Oct 6, 2015
@davej
Copy link
Author

davej commented Oct 6, 2015

The actual copying of files works fine by the way, all the files are copied correctly, it's just that the callback isn't fired.

I put the callback in a setTimeout just to get it working and the app packaged itself correctly and runs as expected.

  var ncpCallbackFired = false
  ncp(opts.dir, appPath, {filter: userIgnoreFilter(opts), dereference: true}, function(err) {
    ncpCallbackFired = true;
    cb(err);
  });
  // callback above isn't being fired by ncp for some reason,
  // so call it synthetically after 20 secs if it hasn't been fired.
  // https://github.com/maxogden/electron-packager/issues/150
  setTimeout(function() {
    if (!ncpCallbackFired) {
      cb(null);
    }
  }, 20000);

@davej
Copy link
Author

davej commented Oct 6, 2015

Just want to mention that a number of people have found ncp inconsistent and buggy, also it isn't being actively maintained anymore: AvianFlu/ncp#100

I also noticed that the fs-extra module dropped ncp because of bugs surrounding non-firing/double-firing of callbacks.

@max-mapper
Copy link
Contributor

we should switch to using https://www.npmjs.com/package/tar-fs: tarfs.pack().pipe(tarfs.extract()), its like JSON.parse(JSON.stringify(obj)) but for filesystems :)

@malept malept added bug 🐛 help wanted Needs a contributor from the community and removed needs info Issue reporter needs to provide more information for maintainers to take action help wanted Needs a contributor from the community labels Oct 7, 2015
@malept
Copy link
Member

malept commented Oct 7, 2015

We should open a new issue for that.

@malept malept added the blocked 🚫 Depends on another issue either in this project or a dependency's project label Oct 7, 2015
nathancarter added a commit to nathancarter/makerland that referenced this issue Oct 22, 2015
Dropping ncp, as others are doing, from unfixed bugs re: callbacks not
being called.  See
electron/packager#150 (comment)
5832894
ide referenced this issue in ide/electron-packager Mar 30, 2016
ncp sometimes has issues (see #150 and #151) -- use cptar instead
develar referenced this issue in develar/electron-packager Apr 10, 2016
Closes #213, #150, #151
develar referenced this issue in develar/electron-packager Apr 10, 2016
Closes #213, #150, #151
develar referenced this issue in develar/electron-packager Apr 11, 2016
Closes #213, #150, #151
develar referenced this issue in develar/electron-packager Apr 11, 2016
Closes #213, #150, #151
malept pushed a commit that referenced this issue Apr 12, 2016
Use fs-extra copy instead of ncp

Fixes #213, #150.
@jlord
Copy link
Contributor

jlord commented Aug 11, 2016

Looks like this was intended to be closed in #150.

@jlord jlord closed this as completed Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛
Projects
None yet
Development

No branches or pull requests

4 participants