Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error thrown on some systems #1

Closed
badunk opened this Issue Feb 13, 2013 · 17 comments

Comments

Projects
None yet
4 participants
Contributor

badunk commented Feb 13, 2013

When I attempt to use "imagemin" task through yeoman build, it suspiciously throws an error with:

Fatal error: ENOENT, no such file or directory '[my output path].png'

I say suspicious because it shouldn't be checking my output path (which hasn't completed yet) in order to do the image compression.

Drilling down into the dependencies, I discovered on the systems that work, I can execute optipng fine. The ones that don't, throw a different error: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory. Some googling reveals this has to do with using 32 vs 64 bit version of glibc.

Wondering if someone knows what the issue is - is it necessary to package both 32 bit and 64 bit compiled versions?

Contributor

badunk commented Feb 13, 2013

When I execute the binary directly, I get that last error: bad ELF interpreter: No such file or directory.

Owner

sindresorhus commented Feb 13, 2013

Hmm, I was pretty sure a 64bit wasn't needed.

What system are you on, os, version, 32/64?

Contributor

badunk commented Feb 13, 2013

The system that works is OSX 10.8, 64 bit
The system I'm trying to get working is CentOS 6.x 64 bit.

I have a colleague that uses a slightly older version of OSX, but I'm not sure 32/64. He had the same issue as on CentOS. I'll check tomorrow - thanks!

Contributor

badunk commented Feb 14, 2013

Yes, he is using OSX 10.7, but also 64 bit

@badunk badunk referenced this issue in gruntjs/grunt-contrib-imagemin Feb 14, 2013

Closed

failing tests #11

I'm seeing a similar problem with the binary on OSX 10.7.5 using the following:

$ npm install optipng-bin
npm http GET https://registry.npmjs.org/optipng-bin
npm http 304 https://registry.npmjs.org/optipng-bin
optipng-bin@0.1.0 node_modules/optipng-bin
$ ./node_modules/optipng-bin/vendor/osx/optipng
[1]    60643 segmentation fault  ./node_modules/optipng-bin/vendor/osx/optipng

Anything else I can check that would help?

(Three hours later...)

Upgrading to OSX 10.8.2 (Mountain Lion) and Xcode 4.6 (4H127) fixed it. Seems like distributing the binary is not an ideal approach. Why not a) Use the system wide optipng/jpegtran (installable via Homebrew), or b) Build the binary from source as part of this npm package?

Contributor

badunk commented Feb 14, 2013

If its a choice between the 2, I much much prefer b

I think the original point of this project was to wrap optipng/jpegtran into its own per-project dependency for yeoman, rather than depending on having the system wide version installed. I personally think it was a huge step forward.

Owner

sindresorhus commented Feb 14, 2013

a.) Not an option, that's why this module was created.
b.) The downside of building from source is that it's slow and problematic on Windows.

I don't see why there is a difference between 10.7 and 10.8 running it though...

Anyone have any insight?

Contributor

badunk commented Feb 14, 2013

I realized that the CentOS build server I am attempting to run this on does not have the 32bit libraries support installed (http://stackoverflow.com/questions/8328250/centos-64-bit-bad-elf-interpreter).

I would much prefer to build the binary from source if that is an option.

I'll investigate the environment difference I'm seeing for 10.7 vs 10.8

Contributor

badunk commented Feb 14, 2013

is it possible to build from source on osx/linux and ship the binary on windows?

Owner

sindresorhus commented Feb 14, 2013

@badunk yes, should be possible. Just a postinstall script that checks if it's linux/osx and executes the build. Eg:

if (process.platform === 'darwin') {
  // do build
}

Would love it if you could take a look at this :D

Contributor

badunk commented Feb 14, 2013

PR here: yeoman#2

I can perhaps do something similar for jpegtran and follow the structure you want in this project. I couldn't find example node projects that do compilation on postinstall without node-gyp, but I'm all for following convention.

This occurs when you try to access to vendor binary using paths (relative or absolute).

$ ./optipng
Synopsis:
    optipng [options] files ...
[...]
$ node_modules/optipng-bin/vendor/osx/optipng
Segmentation Fault: 11

Impatient solution: Install optipng (via brew, fink, ports or manually) and then after removing incorrect one, point to the new one.
Patient solution: Wait for optipng-bin crew to create a valid optipng binary! :)

Contributor

badunk commented Feb 19, 2013

Hi @glerchundi, what OS are you using? 32 bit or 64 bit?

Hi @badunk, Mac OS X 10.7.5, 64bit.

Hope it helps,

$ uname -a
Darwin iMac.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
Owner

sindresorhus commented Feb 22, 2013

Fixed by #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment