Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.43k stars 435 forks source link

OpenBSD support #253

Open frankie-loves-jesus opened 9 years ago

frankie-loves-jesus commented 9 years ago

Expanding on https://github.com/ariya/phantomjs/issues/10996 -- npm install phantomjs on OpenBSD will attempt to fetch the MacOS X binaries when OpenBSD binaries are available (http://openports.se/www/phantomjs):

# npm install phantomjs -g
-
> phantomjs@1.9.12 install /usr/local/lib/node_modules/phantomjs
> node install.js

Looks like an `npm install -g`; unable to check for already installed version.
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-macosx.zip
Saving to /usr/local/lib/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-macosx.zip
Receiving...
  [====------------------------------------] 9% 0.0s^C#
nicks commented 9 years ago

What problem does this solve? I was under the impression that the mac osx binaries work fine on openbsd? is that not true?

The reason I'm a bit nervous about this is because of the version skew problems. The OpenBSD package you're pointing to is lagging the official release (official phantomjs is at 1.9.8; that package is only at 1.9.7).

does that mean we'd have to install different versions of phantomjs on different platforms? or that we'd have to block all releases until the openbsd binaries catch up?

frankie-loves-jesus commented 9 years ago

What problem does this solve? I was under the impression that the mac osx binaries work fine on openbsd? is that not true?

I'm not so sure given that they are two completely different operating systems. I'm currently getting this (which I'm not getting in Linux):

phantom stderr:
child_process.js:936
  var r = this._handle.spawn(options);
                       ^
TypeError: Bad argument
    at ChildProcess.spawn (child_process.js:936:24)
    at exports.spawn (child_process.js:736:9)
    at Object.<anonymous> (/home/frank/myapp/node_modules/phantomjs/bin/phantomjs:22:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

The reason I'm a bit nervous about this is because of the version skew problems. The OpenBSD package you're pointing to is lagging the official release (official phantomjs is at 1.9.8; that package is only at 1.9.7).

I completely understand that, however I just managed to get in touch with the port maintainer and he says he'll try to update the port this weekend.

WuShell commented 9 years ago

Yeah, I didn't have the chance to update the port yet. Will look into it through the weekend and send an update submission to the project as soon as everything works.

WuShell commented 9 years ago

Nick, also, OpenBSD is a different OS indeed than OSx. About delaying release until OpenBSD packages are up-to-date, well I don't think that is needed. Usually after a release, the port for OpenBSD should be updated in a few days.

Maybe for next time it would help to know a bit in advance when the release will be done. Any place to be aware of that? a mailing list I should subscribe to, maybe?

nicks commented 9 years ago

I am not aware of an official mailing list for phantomjs releases, but maybe @ariya can speak to this. If the NPM installer is going to gate on an openbsd release, then the main phantomjs people should probably be aware of that.

frankie-loves-jesus commented 9 years ago

Thanks a lot for coming through @WuShell!

ariya commented 9 years ago

@WuShell Some more info about 1.9.8 is in #12670 (check https://github.com/ariya/phantomjs/compare/1.9.7...1.9.8 for the detailed diff).

For tracking future releases, phantomjs-dev list is a good starting point. However, for whatever reason (probably the rush to get it out), I didn't recall posting anything to phantomjs-dev regarding this 1.9.8.

WuShell commented 9 years ago

Thanks for the info @ariya An update for the OpenBSD port has been sent already to the ports team, once it is reviewed and validated, it should go through and packages would be updated for -current and available for the next stable release also.

ariya commented 9 years ago

Good job, thanks @WuShell!

nanaya commented 8 years ago

What problem does this solve? I was under the impression that the mac osx binaries work fine on openbsd? is that not true?

This can't be serious.

FWIW, it's currently getting OSX binary for FreeBSD as well. And no, FreeBSD is not OSX either.

$ uname -a
FreeBSD nonoka.myconan.net 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
$ grep version package.json
  "version": "1.9.18",
$ file ./lib/phantom/bin/phantomjs
./lib/phantom/bin/phantomjs: Mach-O i386 executable
$ ./lib/phantom/bin/phantomjs
-su: ./lib/phantom/bin/phantomjs: cannot execute binary file: Exec format error
ghost commented 8 years ago

phantomjs@1.9.19 install /usr/home/apache/hosts/WSBprojects/SX-Ecommerce/node_modules/svg2png/node_modules/phantomjs node install.js

PhantomJS not found on PATH Download already available at /tmp/phantomjs/phantomjs-1.9.8-macosx.zip Verified checksum of previously downloaded file Extracting zip contents Removing /usr/home/apache/hosts/WSBprojects/SX-Ecommerce/node_modules/svg2png/node_modules/phantomjs/lib/phantom Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1450180123360/phantomjs-1.9.8-macosx -> /usr/home/apache/hosts/WSBprojects/SX-Ecommerce/node_modules/svg2png/node_modules/phantomjs/lib/phantom Writing location.js file Done. Phantomjs binary available at /usr/home/apache/hosts/WSBprojects/SX-Ecommerce/node_modules/svg2png/node_modules/phantomjs/lib/phantom/bin/phantomjs

Phantom.js is still getting the Mac OS X version from npm on FreeBSD this isn't right?

nicks commented 8 years ago

yes, the last comment said that we are still waiting on an OpenBSD port. If there is a port, we would welcome a pull request that uses it.

nicks commented 8 years ago

(the owners of this package don't have a freebsd machine, so we can't test any change ourselves. we would need someone to put together a pr and verify it)

WuShell commented 8 years ago

? There has been an OpenBSD port for quite some time:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/www/phantomjs/

I didn't have the time to port phantomjs 2 yet though :/

WuShell commented 8 years ago

And about freebsd... you should install the package or from ports, not using npm I guess.

jirib commented 7 years ago

Please at least change https://github.com/Medium/phantomjs/blob/master/lib/util.js#L106

This 'or' is really ridiculous. Yes, there are differences between operating system and as "you" do not ship prebuilt packages for all operating systems just fail here. (This comment shows how wrong are presupposed ideas https://github.com/Medium/phantomjs/issues/253#issuecomment-61125716.) So just, fail if your project doesn't have prebuilt package for a platform/OS. Thank you.

UbuntuEvangelist commented 6 years ago

screenshot from 2018-07-05 19 06 50 same here