Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

.npmignore problem: it is picking up dot-files under an ignored dir #2144

Closed
trentm opened this Issue · 20 comments

5 participants

@trentm
[trentm@banana:~/tm/node-bunyan]$ npm unpublish bunyan@0.6.2
npm http GET https://registry.npmjs.org/bunyan
npm http 304 https://registry.npmjs.org/bunyan
- bunyan@0.6.2

[trentm@banana:~/tm/node-bunyan]$ cat .gitignore
/tmp
/npm-debug.log
/node_modules
*.log

[trentm@banana:~/tm/node-bunyan]$ cat .npmignore
/tmp

[trentm@banana:~/tm/node-bunyan]$ ls -alF tmp
total 1440
drwxr-xr-x   8 trentm  staff   272B Feb 10 14:04 ./
drwxr-xr-x  20 trentm  staff   680B Feb 10 13:59 ../
drwxr-xr-x   5 trentm  staff   170B Feb 10 13:53 build/
-rw-r--r--   1 trentm  staff   363B Feb  3 23:34 error.log
-rw-r--r--   1 trentm  staff   329B Feb  6 23:16 notes.txt
drwxr-xr-x  20 trentm  staff   680B Feb  6 23:11 pycairo-1.10.0/
-rw-r--r--   1 trentm  staff   241K Apr 18  2011 pycairo-1.10.0.tar.bz2
-rw-r--r--   1 trentm  staff   465K Aug 26  2009 pycairo-1.8.8.tar.gz


[trentm@banana:~/tm/node-bunyan]$ npm --loglevel=silly publish > publish.log 2>&1

That "publish.log": https://gist.github.com/1793437#file_publish.log

No "package.json" files under "tmp/" so this isn't issue #1097:

[trentm@banana:~/tm/node-bunyan]$ find tmp -name package.json 
[trentm@banana:~/tm/node-bunyan]$

Download the published package to take a look:

[trentm@banana:~/tmp/checkpublish]$ wget http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
--2012-02-10 14:15:55--  http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
Resolving registry.npmjs.org... 107.20.159.167
Connecting to registry.npmjs.org|107.20.159.167|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 670767 (655K) [application/octet-stream]
Saving to: `bunyan-0.6.2.tgz'

100%[======================================>] 670,767      254K/s   in 2.6s    

2012-02-10 14:15:58 (254 KB/s) - `bunyan-0.6.2.tgz' saved [670767/670767]

[trentm@banana:~/tmp/checkpublish]$ tar xf bunyan-0.6.2.tgz 
[trentm@banana:~/tmp/checkpublish]$ ls -alF package/tmp
total 0
drwxr-xr-x   4 trentm  staff   136B Feb 10 14:09 ./
drwxr-xr-x  17 trentm  staff   578B Feb 10 14:16 ../
drwxr-xr-x   3 trentm  staff   102B Feb 10 14:09 build/
drwxr-xr-x   7 trentm  staff   238B Feb 10 14:09 pycairo-1.10.0/

Some of the content under "tmp/" is included. Furthermore, it is only some of the files under those directories:

in original "tmp/": https://gist.github.com/1793437#file_tmp+files+in+original
in "tmp/" in published package: https://gist.github.com/1793437#file_tmp+files+in+published+package

From what I could see there isn't any info in the silly-log about how and what "ignore"'ing is being done.

Ideas what is going on here? Is this just a bug with "$ignoredDir/*/.blah", i.e. *dot-files and dirs under and otherwise meant-to-be-ignored dir?

@trentm

I've since unpublished the bunyan@0.6.2 package. Let me know if I can help provide other details.

@trentm
[trentm@banana:~/tm/node-bunyan]$ node --version
v0.6.10
[trentm@banana:~/tm/node-bunyan]$ npm --version
1.1.1
@isaacs
Owner

What about if you put a trailing slash in your .npmignore?

/tmp/
@trentm

I had tried it with each of:

/tmp/
tmp/
tmp/*
tmp
@trentm

Just tried again with:

[trentm@banana:~/tm/node-bunyan]$ cat .npmignore 
/tmp/

Same result:

[trentm@banana:~/tmp/checkpublish2]$ wget http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
--2012-02-10 20:06:55--  http://registry.npmjs.org/bunyan/-/bunyan-0.6.2.tgz
Resolving registry.npmjs.org... 107.20.159.167
Connecting to registry.npmjs.org|107.20.159.167|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 670773 (655K) [application/octet-stream]
Saving to: `bunyan-0.6.2.tgz'

100%[======================================>] 670,773      261K/s   in 2.5s    

2012-02-10 20:06:58 (261 KB/s) - `bunyan-0.6.2.tgz' saved [670773/670773]

[trentm@banana:~/tmp/checkpublish2]$ tar xf bunyan-0.6.2.tgz 
[trentm@banana:~/tmp/checkpublish2]$ l package/
total 104
-rw-r--r--   1 trentm  staff     6B Feb 10 20:06 .npmignore
-rw-r--r--   1 trentm  staff    62B Feb  5 20:02 AUTHORS.txt
-rw-r--r--   1 trentm  staff   4.1K Feb 10 00:16 CHANGES.md
-rw-r--r--   1 trentm  staff   930B Feb  9 21:41 Makefile
-rw-r--r--   1 trentm  staff    15K Feb  9 20:47 README.md
-rw-r--r--   1 trentm  staff   3.1K Feb 10 13:40 TODO.md
drwxr-xr-x   3 trentm  staff   102B Feb 10 20:06 bin/
drwxr-xr-x  10 trentm  staff   340B Feb 10 20:06 examples/
-rw-r--r--   1 trentm  staff   1.2K Feb  8 15:26 foo.log
drwxr-xr-x   3 trentm  staff   102B Feb 10 20:06 lib/
-rw-r--r--   1 trentm  staff   429B Feb 10 00:16 package.json
-rw-r--r--   1 trentm  staff   1.4K Feb 10 20:06 publish.log
drwxr-xr-x   3 trentm  staff   102B Feb 10 20:06 test/
drwxr-xr-x   4 trentm  staff   136B Feb 10 20:06 tmp/
drwxr-xr-x   9 trentm  staff   306B Feb 10 20:06 tools/
[trentm@banana:~/tmp/checkpublish2]$ find package/tmp
package/tmp
package/tmp/build
package/tmp/build/pycairo
package/tmp/build/pycairo/.waf-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6
package/tmp/build/pycairo/.waf-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib
package/tmp/build/pycairo/.waf-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/__init__.py
package/tmp/build/pycairo/.waf-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/__init__.pyc
...
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6/cache_run_c_code
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6/test.c
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6/testbuild
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6/testbuild/.wafpickle-98
package/tmp/pycairo-1.10.0/build_directory/.conf_check_be145d2fb86e4c25ca7a1f20372696e6/testbuild/test.c.0.o
package/tmp/pycairo-1.10.0/build_directory/.lock-wafbuild
package/tmp/pycairo-1.10.0/build_directory/.wafpickle-98
package/tmp/pycairo-1.10.0/doc
package/tmp/pycairo-1.10.0/doc/_build
package/tmp/pycairo-1.10.0/doc/_build/html
@isaacs
Owner

Ah, this looks like an issue with .folders. The glob isn't matching because it's got a bit that starts with a dot.

By the way, you don't need to publish to see what the tarball looks like. Just do npm pack and then you'll get a tgz in the cwd.

@trentm

Politely requesting raised priority on this. It can cause WTF subtleties. Observe how the 'zutil_bindings.node' for zutil@0.2.0 is not built in the following:

[root@jenkins ~/tmp/trent/foo]# ls
package.json
[root@jenkins ~/tmp/trent/foo]# cat package.json 
{
  "name": "foo",
  "version": "1.0.0",
  "dependencies": {
    "zutil": "0.2.0"
  }
}
[root@jenkins ~/tmp/trent/foo]# cat ~/.npmrc
[root@jenkins ~/tmp/trent/foo]# rm -rf ~/.npm/zutil
[root@jenkins ~/tmp/trent/foo]# node --version
v0.6.10
[root@jenkins ~/tmp/trent/foo]# npm --version
1.1.1
[root@jenkins ~/tmp/trent/foo]# which python
/opt/local/bin/python
[root@jenkins ~/tmp/trent/foo]# python -V
Python 2.4.5
[root@jenkins ~/tmp/trent/foo]# npm --loglevel=silly install
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/opt/npm/1.1.1/bin/npm',
npm verb cli   '--loglevel=silly',
npm verb cli   'install' ]
npm info using npm@1.1.1
npm info using node@v0.6.10
npm verb /opt/node/0.6/bin/node node symlink
npm verb config file /root/.npmrc
npm verb config file /opt/node/0.6/etc/npmrc
npm verb config file /opt/npm/1.1.1/lib/node_modules/npm/npmrc
npm verb caching /root/tmp/trent/foo/package.json
npm verb loadDefaults foo@1.0.0
npm verb where, deps [ '/root/tmp/trent/foo', [ 'zutil' ] ]
npm verb from cache /root/tmp/trent/foo/package.json
npm info preinstall foo@1.0.0
npm verb from cache /root/tmp/trent/foo/package.json
npm verb cache add [ 'zutil@0.2.0', null ]
npm sill cache add: name, spec, args [ undefined,
npm sill cache add: name, spec, args   'zutil@0.2.0',
npm sill cache add: name, spec, args   [ 'zutil@0.2.0', null ] ]
npm verb parsed url { pathname: 'zutil@0.2.0',
npm verb parsed url   path: 'zutil@0.2.0',
npm verb parsed url   href: 'zutil@0.2.0' }
npm sill cache add: name, spec, args [ 'zutil',
npm sill cache add: name, spec, args   '0.2.0',
npm sill cache add: name, spec, args   [ 'zutil', '0.2.0' ] ]
npm verb parsed url { pathname: '0.2.0',
npm verb parsed url   path: '0.2.0',
npm verb parsed url   href: '0.2.0' }
npm verb addNamed [ 'zutil', '0.2.0' ]
npm verb addNamed [ '0.2.0', '0.2.0' ]
npm verb raw, before any munging zutil/0.2.0
npm verb url resolving [ 'https://registry.npmjs.org/',
npm verb url resolving   './zutil/0.2.0' ]
npm verb url resolved https://registry.npmjs.org/zutil/0.2.0
npm http GET https://registry.npmjs.org/zutil/0.2.0
npm http 200 https://registry.npmjs.org/zutil/0.2.0
npm sill get cb [ 200,
npm sill get cb   { vary: 'Accept',
npm sill get cb     server: 'CouchDB/1.1.0 (Erlang OTP/R14B04)',
npm sill get cb     etag: '"41ST22UFC9OXHDFEN3YGN5T7X"',
npm sill get cb     date: 'Mon, 20 Feb 2012 21:28:15 GMT',
npm sill get cb     'content-type': 'application/json',
npm sill get cb     'content-length': '2651' } ]
npm verb mkdir (expected) error ENOENT, no such file or directory '/root/.npm/zutil'
npm verb mkdir (expected) error ENOENT, no such file or directory '/root/.npm/zutil/0.2.0'
npm verb mkdir done: /root/.npm/zutil/0.2.0 755
npm verb bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8q-v83.6.6.20-sunos-ia32-5.11',
npm verb bin dist   { shasum: 'b92a3e73f0493de79f1aa1e072eb149da5e2d683',
npm verb bin dist     tarball: 'http://registry.npmjs.org/zutil/-/zutil-0.2.0.tgz' } ]
npm verb addRemoteTarball [ 'https://registry.npmjs.org/zutil/-/zutil-0.2.0.tgz',
npm verb addRemoteTarball   'b92a3e73f0493de79f1aa1e072eb149da5e2d683' ]
npm verb mkdir (expected) error ENOENT, no such file or directory '/tmp/npm-1329773295402'
npm verb mkdir (expected) error ENOENT, no such file or directory '/tmp/npm-1329773295402/1329773295402-0.8360881395637989'
npm verb mkdir done: /tmp/npm-1329773295402/1329773295402-0.8360881395637989 755
npm verb fetch to /tmp/npm-1329773295402/1329773295402-0.8360881395637989/tmp.tgz
npm http GET https://registry.npmjs.org/zutil/-/zutil-0.2.0.tgz
npm http 200 https://registry.npmjs.org/zutil/-/zutil-0.2.0.tgz
npm sill updated sha bytes 40960
npm sill updated sha bytes 5261
npm info shasum b92a3e73f0493de79f1aa1e072eb149da5e2d683
npm info shasum /tmp/npm-1329773295402/1329773295402-0.8360881395637989/tmp.tgz
npm verb mkdir (expected) error ENOENT, no such file or directory '/tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm'
npm verb mkdir done: /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm 755
npm verb unpack_ uid, gid [ 0, 0 ]
npm verb unpackTarget /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package
npm sill gunzTarPerm modes [ '755', '644' ]
npm sill afterUntar undefined
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/.npmignore
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/LICENSE
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/package.json
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/README.md
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/wscript
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/build
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/build/.wafpickle-7
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/demo
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/demo/example.js
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/devtools
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/devtools/cpplint.py
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/lib
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/lib/zutil.js
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zone.cc
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zone.h
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zonecfg.cc
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zonecfg.h
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zutil_bindings.cc
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/src/zutil_common.h
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/tst
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/tst/zone.test.js
npm sill asyncMap in gTP /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package/tst/zonecfg.test.js
npm verb gunzed /tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package
npm verb rm'ed /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package
npm verb renamed [ '/tmp/npm-1329773295402/1329773295402-0.8360881395637989/___package.npm/package',
npm verb renamed   '/tmp/npm-1329773295402/1329773295402-0.8360881395637989/package' ]
npm verb has wscript [ undefined,
npm verb has wscript   { file: '/tmp/npm-1329773295402/1329773295402-0.8360881395637989/package/package.json',
npm verb has wscript     contributors: false,
npm verb has wscript     serverjs: false,
npm verb has wscript     wscript: true } ]
npm verb caching /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package/package.json
npm verb loadDefaults zutil@0.2.0
npm verb tarball contents [ 'tmp.tgz', 'package' ]
npm verb from cache /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package/package.json
npm verb pack /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package
npm verb pack /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package /root/.npm/zutil/0.2.0/package.tgz
npm sill makeList /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package
npm sill dir, dirLen [ '/tmp/npm-1329773295402/1329773295402-0.8360881395637989/package',
npm sill dir, dirLen   64 ]
npm verb tarball /root/.npm/zutil/0.2.0/package.tgz
npm verb parent /tmp/npm-1329773295402/1329773295402-0.8360881395637989/package
npm verb mkdir (expected) error ENOENT, no such file or directory '/root/.npm/zutil/0.2.0/___package.npm'
npm verb mkdir done: /root/.npm/zutil/0.2.0/___package.npm 755
npm verb unpack_ uid, gid [ 0, 0 ]
npm verb unpackTarget /root/.npm/zutil/0.2.0/package
npm sill gunzTarPerm modes [ '755', '644' ]
npm sill afterUntar undefined
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/wscript
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/README.md
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/LICENSE
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/.npmignore
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/package.json
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/demo
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/demo/example.js
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zonecfg.cc
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zone.h
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zone.cc
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zutil_bindings.cc
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zutil_common.h
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/src/zonecfg.h
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/lib
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/lib/zutil.js
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/build
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/build/.wafpickle-7
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/tst
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/tst/zone.test.js
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/tst/zonecfg.test.js
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/devtools
npm sill asyncMap in gTP /root/.npm/zutil/0.2.0/___package.npm/package/devtools/cpplint.py
npm verb gunzed /root/.npm/zutil/0.2.0/___package.npm/package
npm verb rm'ed /root/.npm/zutil/0.2.0/package
npm verb renamed [ '/root/.npm/zutil/0.2.0/___package.npm/package',
npm verb renamed   '/root/.npm/zutil/0.2.0/package' ]
npm verb has wscript [ undefined,
npm verb has wscript   { file: '/root/.npm/zutil/0.2.0/package/package.json',
npm verb has wscript     contributors: false,
npm verb has wscript     serverjs: false,
npm verb has wscript     wscript: true } ]
npm verb caching /root/.npm/zutil/0.2.0/package/package.json
npm verb loadDefaults zutil@0.2.0
npm sill updated sha bytes 40960
npm sill updated sha bytes 5257
npm info shasum 3a4d55f7857f0bb5d9e969c2207e413c9f05ebc5
npm info shasum /root/.npm/zutil/0.2.0/package.tgz
npm verb from cache /root/.npm/zutil/0.2.0/package/package.json
npm verb chmod /root/.npm/zutil/0.2.0/package.tgz 644
npm verb chown [ '/root/.npm/zutil/0.2.0/package.tgz',
npm verb chown   0,
npm verb chown   0 ]
npm sill resolved [ { name: 'zutil',
npm sill resolved     description: 'A SunOS-specific wrapper over zone.h and libzonecfg.h APIs',
npm sill resolved     version: '0.2.0',
npm sill resolved     repository: 
npm sill resolved      { type: 'git',
npm sill resolved        url: 'git://github.com/mcavage/node-zutil.git' },
npm sill resolved     author: 
npm sill resolved      { name: 'Mark Cavage',
npm sill resolved        email: 'mcavage@gmail.com',
npm sill resolved        url: 'http://www.joyent.com' },
npm sill resolved     main: 'lib/zutil.js',
npm sill resolved     scripts: { preinstall: 'node-waf configure build' },
npm sill resolved     devDependencies: 
npm sill resolved      { nodeunit: '>=0.7',
npm sill resolved        'node-uuid': '1.3.3' },
npm sill resolved     engines: { node: '>=0.6' },
npm sill resolved     _id: 'zutil@0.2.0',
npm sill resolved     dependencies: {},
npm sill resolved     optionalDependencies: {},
npm sill resolved     _engineSupported: true,
npm sill resolved     _npmVersion: '1.1.1',
npm sill resolved     _nodeVersion: 'v0.6.10',
npm sill resolved     _defaultsLoaded: true,
npm sill resolved     dist: { shasum: '3a4d55f7857f0bb5d9e969c2207e413c9f05ebc5' } } ]
npm info into /root/tmp/trent/foo zutil@0.2.0
npm info installOne zutil@0.2.0
npm info unbuild /root/tmp/trent/foo/node_modules/zutil
npm verb from cache /root/.npm/zutil/0.2.0/package/package.json
npm verb mkdir (expected) error ENOENT, no such file or directory '/root/tmp/trent/foo/node_modules'
npm verb mkdir (expected) error ENOENT, no such file or directory '/root/tmp/trent/foo/node_modules/___zutil.npm'
npm verb mkdir done: /root/tmp/trent/foo/node_modules/___zutil.npm 755
npm verb unpack_ uid, gid [ 0, 0 ]
npm verb unpackTarget /root/tmp/trent/foo/node_modules/zutil
npm sill gunzTarPerm modes [ '755', '644' ]
npm sill afterUntar undefined
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/package.json
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/wscript
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/.npmignore
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/README.md
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/LICENSE
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/tst
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/tst/zone.test.js
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/tst/zonecfg.test.js
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/demo
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/demo/example.js
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zutil_common.h
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zone.cc
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zonecfg.h
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zutil_bindings.cc
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zonecfg.cc
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/src/zone.h
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/devtools
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/devtools/cpplint.py
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/lib
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/lib/zutil.js
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/build
npm sill asyncMap in gTP /root/tmp/trent/foo/node_modules/___zutil.npm/package/build/.wafpickle-7
npm verb gunzed /root/tmp/trent/foo/node_modules/___zutil.npm/package
npm verb rm'ed /root/tmp/trent/foo/node_modules/zutil
npm verb renamed [ '/root/tmp/trent/foo/node_modules/___zutil.npm/package',
npm verb renamed   '/root/tmp/trent/foo/node_modules/zutil' ]
npm verb has wscript [ undefined,
npm verb has wscript   { file: '/root/tmp/trent/foo/node_modules/zutil/package.json',
npm verb has wscript     contributors: false,
npm verb has wscript     serverjs: false,
npm verb has wscript     wscript: true } ]
npm verb caching /root/tmp/trent/foo/node_modules/zutil/package.json
npm verb loadDefaults zutil@0.2.0
npm info preinstall zutil@0.2.0
npm verb unsafe-perm in lifecycle false

> zutil@0.2.0 preinstall /root/tmp/trent/foo/node_modules/zutil
> node-waf configure build

npm sill exec sh "-c" "node-waf configure build"
npm sill spawning [ 'sh',
npm sill spawning   [ '-c', 'node-waf configure build' ],
npm sill spawning   '/root/tmp/trent/foo/node_modules/zutil' ]
Checking for program g++ or c++          : /opt/local/bin/g++ 
Checking for program cpp                 : /opt/local/bin/cpp 
Checking for program ar                  : /opt/local/bin/ar 
Checking for program ranlib              : /opt/local/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /opt/local/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/node/0.6.10 
'configure' finished successfully (0.090s)
Waf: Entering directory `/Users/mark/work/node-zutil/build'
Waf: Leaving directory `/Users/mark/work/node-zutil/build'
'build' finished successfully (0.005s)
npm verb from cache /root/tmp/trent/foo/node_modules/zutil/package.json
npm sill resolved []
npm verb about to build /root/tmp/trent/foo/node_modules/zutil
npm info build /root/tmp/trent/foo/node_modules/zutil
npm verb from cache /root/tmp/trent/foo/node_modules/zutil/package.json
npm verb linkStuff [ false,
npm verb linkStuff   false,
npm verb linkStuff   false,
npm verb linkStuff   '/root/tmp/trent/foo/node_modules' ]
npm info linkStuff zutil@0.2.0
npm verb linkBins zutil@0.2.0
npm verb linkMans zutil@0.2.0
npm verb rebuildBundles zutil@0.2.0
npm info install zutil@0.2.0
npm info postinstall zutil@0.2.0
npm verb installOne cb zutil@0.2.0
npm info build /root/tmp/trent/foo
npm verb from cache /root/tmp/trent/foo/package.json
npm verb linkStuff [ false,
npm verb linkStuff   false,
npm verb linkStuff   false,
npm verb linkStuff   '/root/tmp/trent' ]
npm info linkStuff foo@1.0.0
npm verb linkBins foo@1.0.0
npm verb linkMans foo@1.0.0
npm verb rebuildBundles foo@1.0.0
npm verb rebuildBundles [ 'zutil' ]
npm info install foo@1.0.0
npm info postinstall foo@1.0.0
zutil@0.2.0 ./node_modules/zutil
npm verb exit [ 0, true ]
npm info ok
[root@jenkins ~/tmp/trent/foo]# 

The reason is that the zutil@0.2.0 package includes "build/.wafpickle-7", even though the build dir is ignored (https://github.com/mcavage/node-zutil/blob/master/.gitignore). That waf pickle includes a reference to "/Users/mark/work/node-zutil/build".

So arguably there are waf bugs here (it should probably know not to reuse that pickle file, it should stop when that dir doesn't exist, etc. etc.). However, npm really needs to fix this ignore problem.

@davepacheco

I appear to have run into the same issue. Here's a reliable test case:

dap@devel test $ node -v
v0.6.12

dap@devel test $ npm -v
1.1.4

dap@devel test $ git clone https://github.com/bcantrill/node-libdtrace.git
Cloning into node-libdtrace...
remote: Counting objects: 58, done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 58 (delta 24), reused 12 (delta 1)
Unpacking objects: 100% (58/58), done.

dap@devel test $ cd node-libdtrace/
dap@devel node-libdtrace $ node-waf configure build
Checking for program g++ or c++          : /opt/local/bin/g++
Checking for program cpp                 : /opt/local/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /opt/local/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /home/dap/install
'configure' finished successfully (0.040s)
Waf: Entering directory `/home/dap/test/node-libdtrace/build'
[1/2] cxx: libdtrace.cc -> build/Release/libdtrace_1.o
[2/2] cxx_link: build/Release/libdtrace_1.o -> build/Release/libdtrace.node
Waf: Leaving directory `/home/dap/test/node-libdtrace/build'
'build' finished successfully (0.566s)

dap@devel node-libdtrace $ cd ..
dap@devel test $ mkdir foo
dap@devel test $ cd foo
dap@devel foo $ npm install ../node-libdtrace/

> libdtrace@0.0.2 install /home/dap/test/foo/node_modules/libdtrace
> node-waf configure build

Checking for program g++ or c++          : /opt/local/bin/g++
Checking for program cpp                 : /opt/local/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /opt/local/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /home/dap/install
'configure' finished successfully (0.038s)
Waf: Entering directory `/home/dap/test/node-libdtrace/build'
Waf: Leaving directory `/home/dap/test/node-libdtrace/build'
'build' finished successfully (0.005s)
libdtrace@0.0.2 ./node_modules/libdtrace

dap@devel foo $ find . -name '*.node'

A few things to note about the above output:

  • The first, manual build was successful. We can see it generate libdtrace.node.
  • The "npm install" reran node-waf configure build, but the build went into the wrong directory (!) and didn't build a .node file. Based on Trent's analysis above, this seems to be a result of npm preserving the .wafpickle-7 file in node-libdtrace/build.
  • I'd expect this to happen with pretty much any binary module.
@davepacheco

That was node v0.6.12 RC0, by the way.

@niftylettuce

:+1: looking for a fix

@ErikDubbelboer

The issue still exists with npm 1.1.4.

package/build/.wafpickle-7 still gets included in the tgz with build/ in the .npmignore

@isaacs isaacs closed this in 41de32a
@trentm

So fixed in node 0.6.13 / npm 1.1.9
Thanks!

@isaacs
Owner

No, it's fixed in npm 1.1.10, which will be in node 0.6.14.

@isaacs
Owner

Can you try with npm 1.1.13 and see if this problem still exists? Thanks.

@trentm

@isaacs Attempting to install the latest npm into my node 0.6.14 install on Mac (10.6.8) failed: https://gist.github.com/2220343

@isaacs
Owner

Ah, nice. Force-republishing over that. that's a pretty terrible bug.

@isaacs
Owner

@trentm Can you try again?

@trentm

Failure again:

$ curl http://npmjs.org/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  7881  101  7881    0     0  11881      0 --:--:-- --:--:-- --:--:-- 52540
tar=/usr/bin/tar
version:
bsdtar 2.6.2 - libarchive 2.6.2
install npm@1.1
fetching: {
npm-install-33372.sh: line 228: cd: /var/folders/a1/a1q548caE+ytwn0liWfg7E+++TI/-Tmp-//npm.33374/*: No such file or directory
It failed
[14:34:30 trentm@banana:~]
$ which node
/Users/trentm/opt/node-0.6/bin/node
[14:34:41 trentm@banana:~]
$ node --version
v0.6.14
@trentm

K, latest npm install worked.

Also verified that the new npm version ignore stuff works.

Failing case (with older npm I had around):

[trentm@banana:~/tm/node-bunyan]$ PATH=$HOME/opt/node-0.6.7/bin:$PATH npm --version
1.1.0-beta-10
[trentm@banana:~/tm/node-bunyan]$ cat .gitignore 
/tmp
/npm-debug.log
/node_modules
*.log
[trentm@banana:~/tm/node-bunyan]$ PATH=$HOME/opt/node-0.6.7/bin:$PATH npm pack
./bunyan-0.6.9.tgz
[trentm@banana:~/tm/node-bunyan]$ tar tf bunyan-0.6.9.tgz  | grep tmp
package/tmp/
package/tmp/foo/
package/tmp/foo/.foo
package/tmp/foo/.npmignore
[trentm@banana:~/tm/node-bunyan]$

Passing case with latest:

[trentm@banana:~/tm/node-bunyan]$ npm --version
1.1.13
[trentm@banana:~/tm/node-bunyan]$ npm pack
./bunyan-0.6.9.tgz
[trentm@banana:~/tm/node-bunyan]$ tar tf bunyan-0.6.9.tgz  | grep tmp
[trentm@banana:~/tm/node-bunyan]$
@trentm trentm referenced this issue from a commit in joyent/sdc-amon
@trentm trentm MON-30: attempted workaround npm/npm#2144 (comment) 4b48839
@trentm trentm referenced this issue from a commit in joyent/sdc-amon
@trentm trentm MON-30: attempted workaround npm/npm#2144 (comment) (take 2) faca21c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.