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

Can't compile in directories with spaces in the name #45

Closed
pwfff opened this issue Sep 12, 2014 · 15 comments
Closed

Can't compile in directories with spaces in the name #45

pwfff opened this issue Sep 12, 2014 · 15 comments
Labels

Comments

@pwfff
Copy link

pwfff commented Sep 12, 2014

Trying to install this via jenkins in a job that had spaces in the name (QA Tools):

⚠ pre-build test failed, compiling from source...
✖ { [Error: Command failed: pngrtran.c:97:1: warning: ‘png_rtran_ok’ defined but not used [-Wunused-function]
pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37:4: warning: comparison is always false due to limited range of data type [-Wtype-limits]
rm: cannot remove `/var/lib/jenkins/workspace/QA': Is a directory
rm: cannot remove `Tools': Is a directory
make[1]: [install] Error 1 (ignored)
rm: cannot remove `/var/lib/jenkins/workspace/QA': Is a directory
rm: cannot remove `Tools': Is a directory
make[1]: [install] Error 1 (ignored)
cp: omitting directory `/var/lib/jenkins/workspace/QA'
cp: omitting directory `Tools'
make[1]: *** [install] Error 1
make: *** [install] Error 2
] killed: false, code: 2, signal: null }
@pwfff
Copy link
Author

pwfff commented Sep 12, 2014

Related to #11 maybe?

@kevva
Copy link
Contributor

kevva commented Sep 12, 2014

It should take that into account https://github.com/imagemin/optipng-bin/blob/master/lib/install.js#L18.

@kevva
Copy link
Contributor

kevva commented Oct 14, 2014

@pwfff, did this get fixed?

@encounter
Copy link

This is still an issue for me when running with optipng-bin@2.0.1 and npm@2.1.5.

> optipng-bin@2.0.1 postinstall /usr/local/devtools/jenkins/data/workspace/Deploy order-container - ALPHA/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
> node lib/install.js

     �[33mwarn�[m : optipng pre-build test failed
     �[36minfo�[m : compiling from source
    �[31merror�[m : Error: Command failed: pngrtran.c:97: warning: ‘png_rtran_ok’ defined but not used
pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37: warning: comparison is always false due to limited range of data type
rm: cannot remove `/usr/local/devtools/jenkins/data/workspace/Deploy': Is a directory
rm: cannot remove `order-container': Is a directory
rm: cannot remove `-': Is a directory
make[1]: [install] Error 1 (ignored)
rm: cannot remove `/usr/local/devtools/jenkins/data/workspace/Deploy': Is a directory
rm: cannot remove `order-container': Is a directory
rm: cannot remove `-': Is a directory
make[1]: [install] Error 1 (ignored)
cp: omitting directory `/usr/local/devtools/jenkins/data/workspace/Deploy'
cp: omitting directory `order-container'
cp: omitting directory `-'
make[1]: *** [install] Error 1
make: *** [install] Error 2

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Socket.<anonymous> (child_process.js:969:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)

@kevva kevva added the bug label Nov 11, 2014
@jmnarloch
Copy link

I am facing the same issue with Jenkins builds that put spaces in the working directories after updating to imagemin-contrib: 0.9.4

@colinrotherham
Copy link

Same issue here when trying to install grunticon-lib.

I can see it's missing quotes around the /bin/sh -c parameter:

> optipng-bin@3.0.2 postinstall /Volumes/Sites/Directory With Spaces/core/node_modules/gulpicon/node_modules/grunticon-lib/node_modules/svg-to-png/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
> node lib/install.js

  ⚠ Command failed: /bin/sh -c /Volumes/Sites/Directory With Spaces/core/node_modules/gulpicon/node_modules/grunticon-lib/node_modules/svg-to-png/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng --version
/bin/sh: /Volumes/Sites/Directory: No such file or directory

@kenlyon
Copy link

kenlyon commented Jul 22, 2015

I encountered this problem and was about to log it now. I'm a little discouraged to see it's been known about for almost a year with no action.

We rely on this as a dependency of grunticon and this seems to be the only module in our dependency tree that doesn't handle spaces in directory names.

Repro steps from my perspective were to create a package.json in a folder with a space in the name, adding a dependency to optipng-bin and running npm install.

My output looked like this:

C:\grunt test>npm install
npm WARN package.json my-project-name@0.1.0 No description
npm WARN package.json my-project-name@0.1.0 No repository field.
npm WARN package.json my-project-name@0.1.0 No README data
/

optipng-bin@3.0.2 postinstall C:\grunt test\node_modules\optipng-bin
node lib/install.js

‼ Command failed: C:\Windows\system32\cmd.exe /s /c "C:\grunt test\node_modules\optipng-bin\vendor\optipng.exe --version"
'C:\grunt' is not recognized as an internal or external command,
operable program or batch file.

‼ optipng pre-build test failed
i compiling from source
x Error: ./configure --with-system-zlib --prefix="C:\grunt test\node_modules\optipng-bin\vendor" --bindir="C:\grunt test\node_modules\optipng-bin\vendor" && make install
Command failed: C:\Windows\system32\cmd.exe /s /c "./configure --with-system-zlib --prefix="C:\grunt test\node_modules\optipng-bin\vendor" --bindir="C:\grunt test\node_modules\optipng-bin\vendor""
'.' is not recognized as an internal or external command,
operable program or batch file.

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Please consider fixing this. It's too bad the whole hierarchy of the node dependencies fails based on the weakest link like this.

@kraftner
Copy link

The problem really starts here:

.dest(path.join(__dirname, '../vendor'))

This really is a nasty bug. I wonder if it really is necessary to have an absolute path? Wouldn't it work to just use ../vendor. Or is there anything I didn't think about?

Also this should probably be fixed right in bin-version: sindresorhus/binary-version#5

And on a final note this whole bug throws a lot of fancy errors, but what really fails is the check if the download worked after the download. So the download itself may have still worked leaving optipng-bin in a working state anyway. (As it was in my case)

@yvanavermaet
Copy link

We're experiencing the exact same issue. Any eta on when this space-issue will be fixed?

@mshick
Copy link

mshick commented Oct 9, 2015

Same issue here.

@shinnn
Copy link
Contributor

shinnn commented Dec 9, 2015

Fixed in optipng-bin v3.0.4.

@techiekeith
Copy link

techiekeith commented Apr 24, 2017

This issue doesn't appear to be entirely fixed - I'm getting this error as of optipng-bin version 3.1.4:

optipng-bin@3.1.4 postinstall /opt/jenkins/workspace/websites-frontend-php develop DEV/node_modules/optipng-bin
node lib/install.js

⚠ self signed certificate in certificate chain
⚠ optipng pre-build test failed
ℹ compiling from source
✖ Error: ./configure --with-system-zlib --prefix="/opt/jenkins/workspace/websites-frontend-php develop DEV/node_modules/optipng-bin/vendor" --bindir="/opt/jenkins/workspace/websites-frontend-php develop DEV/node_modules/optipng-bin/vendor" && make install
Command failed: make install
pngrtran.c:98: warning: ‘png_rtran_ok’ defined but not used
pngxmem.c: In function ‘pngx_malloc_rows_extended’:
pngxmem.c:37: warning: comparison is always false due to limited range of data type
rm: cannot remove /opt/jenkins/workspace/websites-frontend-php': Is a directory rm: cannot remove develop': Is a directory
make[1]: [install] Error 1 (ignored)
rm: cannot remove /opt/jenkins/workspace/websites-frontend-php': Is a directory rm: cannot remove develop': Is a directory
make[1]: [install] Error 1 (ignored)
cp: omitting directory /opt/jenkins/workspace/websites-frontend-php' cp: omitting directory develop'
make[1]: *** [install] Error 1
make: *** [install] Error 2

at ChildProcess.exithandler (child_process.js:211:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)

I'm seeing the same error if I revert to version 3.0.4 as well.

@viveknaskar
Copy link

Error: spawn cmd ENOENT
at exports._errnoException (util.js:1020:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

When I am running gulp server, I am getting the above message.

@shinnn
Copy link
Contributor

shinnn commented Sep 5, 2017

@keithdeath1 @viveknaskar Read the issue title. You both post unrelated comments.

@techiekeith
Copy link

@shinnn how so? AFAICT the output I'm seeing is very close to what the originator of this issue posted.

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