When creating packages, I noticed that it is always the phantomjs binary shipped in the repo that is included in the packages. The problem is that this binary target x64 platform and I try do build .deb for arm, so, of course, this binary cannot be use.
On x86, during npm install, we should end up with the good binary version somewhere in node_modules/ so this should be the one included.
In my case, due to a misbehave phantomjs npm module (see #376), I have to install phantomjs myself globaly before running npm install, and this should be this global install that should be included in the package.
So, it would be nice that during package creation:
i hit this today while building grafana on my Raspberry Pi 2 cluster.
@fg2it did you find any work around?
ok. i got it working by grabbing the arm binary from here: https://github.com/aeberhardo/phantomjs-linux-armv6l and replacing it with the one present in node_modules/phantomjs/lib/phantom/bin/phantomjs
I didn't fix that at the deb level. I replace /usr/share/grafana/vendor/phantomjs/phantomjs with my binary. I am pretty sure that, before package, replacing vendor/phantomjs/phantomjs in your local repo should work.
@ranjib not sure that this one will be package in your .deb file. Try replacing vendor/phantomjs/phantomjs.
Anyway, phantomjs seems to be used mainly to create png. So if you don't need that feature, you can force building packages by changing build.go, line 76, with grunt("--force","release").
@torkelo Since nobody seems to be in a hurry with this issue, I could try to come up with a PR depending on what you have in mind to fix it. If we stick to my proposal, this should be manageable for me.
@fg2it yes, I would love a PR based on your proposal (to use binary from npm)
@torkelo ok, will try to submit something in the coming days
@torkelo A few thoughts :
go build .
Let me know what you think about that.
The third way (ie using grunt task), is lighter than I expected. It is a matter of adding a file in tasks/options and adding the new task to default and build. Would have my preference.
If that is ok, remains the question of removing the default phantomjs binary from the repo, which I think would be a good thing : we would not break anything; it would allow a clean build (otherwise getGitSha() from build.go will report a dirty working dir); once the binary would be in place, simply checking the existence of vendor/phantomjs/phantoms would allow to avoid copying the binary for new run of default or build tasks.
grunt task sound like a good option
fixed in #2832