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

EXDEV when moving temporary package folder #4

Closed
tim-smart opened this issue Jul 2, 2013 · 7 comments
Closed

EXDEV when moving temporary package folder #4

tim-smart opened this issue Jul 2, 2013 · 7 comments

Comments

@tim-smart
Copy link

$ npmd install request
request@2.21.0 -> /home/tim/node_modules

/home/tim/.local/lib/node_modules/npmd/index.js:85
      if(err) throw err
                    ^
Error: EXDEV, rename '/tmp/tim/13727359679500.3233381509780884/package'

To move files between partitions you will need to copy them using pipe etc. Maybe absorb EXDEV errors and fallback to copying in those cases; or allow the user to set the temporary directory which would be on the same partition.

@dominictarr
Copy link
Owner

hmm. interesting.
the reason to move the file is to make it as atomic as possible, and fast.
(performance is important for npmd, especially for high latency users in the antipodes ;)

If I knew that the /tmp was in a separate partition, then i'd be unpacking stuff somewhere else...

why do you have /tmp on a separate partition?

right now, I'm leaning towards having a configuration option for tmpdir...

@tim-smart
Copy link
Author

$ uname -a
Linux tim-macbook-arch 3.9.8-1-ARCH #1 SMP PREEMPT Thu Jun 27 21:37:31 CEST 2013 x86_64 GNU/Linux
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)

It must be an arch linux thing. A config option would be my choice too.

@dominictarr
Copy link
Owner

argh. I guess I'm gonna have to use a config option for this... it's gonna uglify some stuff, though...

@dominictarr
Copy link
Owner

okay, try npmd@0.3.0

npmd install request --tmp ~/.npmd-tmp

@tim-smart
Copy link
Author

Can we have a config file? Otherwise:

$ npmd install request --tmp ~/.cache/npmd
request@2.21.0 -> /home/tim/node_modules
qs@0.6.5 -> /home/tim/node_modules/request/node_modules
json-stringify-safe@4.0.0 -> /home/tim/node_modules/request/node_modules
forever-agent@0.5.0 -> /home/tim/node_modules/request/node_modules
tunnel-agent@0.3.0 -> /home/tim/node_modules/request/node_modules
http-signature@0.9.11 -> /home/tim/node_modules/request/node_modules
hawk@0.13.1 -> /home/tim/node_modules/request/node_modules
aws-sign@0.3.0 -> /home/tim/node_modules/request/node_modules
oauth-sign@0.3.0 -> /home/tim/node_modules/request/node_modules
cookie-jar@0.3.0 -> /home/tim/node_modules/request/node_modules
node-uuid@1.4.0 -> /home/tim/node_modules/request/node_modules
mime@1.2.9 -> /home/tim/node_modules/request/node_modules
form-data@0.0.8 -> /home/tim/node_modules/request/node_modules
assert-plus@0.1.2 -> /home/tim/node_modules/request/node_modules/http-signature/node_modules
asn1@0.1.11 -> /home/tim/node_modules/request/node_modules/http-signature/node_modules
ctype@0.5.2 -> /home/tim/node_modules/request/node_modules/http-signature/node_modules
hoek@0.8.5 -> /home/tim/node_modules/request/node_modules/hawk/node_modules
boom@0.4.2 -> /home/tim/node_modules/request/node_modules/hawk/node_modules
cryptiles@0.2.1 -> /home/tim/node_modules/request/node_modules/hawk/node_modules
sntp@0.2.4 -> /home/tim/node_modules/request/node_modules/hawk/node_modules
combined-stream@0.0.4 -> /home/tim/node_modules/request/node_modules/form-data/node_modules
async@0.2.9 -> /home/tim/node_modules/request/node_modules/form-data/node_modules
hoek@0.9.1 -> /home/tim/node_modules/request/node_modules/hawk/node_modules/boom/node_modules
hoek@0.9.1 -> /home/tim/node_modules/request/node_modules/hawk/node_modules/sntp/node_modules
delayed-stream@0.0.5 -> /home/tim/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules

npmd install --tmp ~/tmp/npmd request 1.24s user 0.18s system 30% cpu 4.674 total

FYI npm uses ~/tmp

@dominictarr
Copy link
Owner

yes.

npmd uses https://npmjs.org/package/rc for config. which gets config from opts, envvar, or config files, in the most sensible places.

@tim-smart
Copy link
Author

Yay! Thanks for this.

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

No branches or pull requests

2 participants