nix-npm-buildpackage
nix-npm-buildpackage copied to clipboard
remove symlink resolve and add force flag to copy cache operation
this could be an darwin specific issue, but after the latest merge I'm unable to build (see my comment here https://github.com/serokell/nix-npm-buildpackage/pull/54#issuecomment-1254908364). But I did also experience the same issue as this PR https://github.com/serokell/nix-npm-buildpackage/pull/54 addresses and was able to make the cache copy operation happy. It seems it wants to copy directories into itself and that sorts of stuff.
this change causes issues on linux 🤦
foo> npm ERR! code EXDEV
foo> npm ERR! syscall link
foo> npm ERR! path /build/source/npm-cache/_cacache/tmp/a2e9d406
foo> npm ERR! errno -18
foo> npm ERR! EXDEV: cross-device link not permitted, link '/build/source/npm-cache/_cacache/tmp/a2e9d406' -> '/build/source/npm-cache/_cacache/content-v2/sha512/94/fe/38e5fc939771f66dca9ee1c4205509b866f1f43703ae74d97f1a5317379b3797228c862642d98a6b91580bc5ab79a13a94cb558025138e3f79e2d9c0433d'
foo>
foo> npm ERR! A complete log of this run can be found in:
foo> npm ERR! /build/source/npm-cache/_logs/2022-09-23T12_56_25_222Z-debug-0.log
foo>
that extra commit creates support for both linux and darwin, but I'd love to have another darwin user confirm this
Hi!
I was running in to another issue related to the npm-cache on darwin:
error: builder for '/nix/store/n21bw1ia9aivg0fq3d4mzf452w1040lg-foo-1.0.0.drv' failed with exit code 1;
last 8 log lines:
> unpacking sources
> unpacking source archive /nix/store/6rivb57skw999c1qiwr54ch2v1jhmhhb-11sr8qcnqlchbrgvkdchzbm1ar7cig53-source
> source root is 11sr8qcnqlchbrgvkdchzbm1ar7cig53-source
> patching sources
> configuring
> cp: cannot create special file '/private/tmp/nix-build-foo-1.0.0.drv-0/11sr8qcnqlchbrgvkdchzbm1ar7cig53-source/npm-cache/_cacache/tmp/com.apple.launchd.jUMDGJPbBh/Listeners': Operation not permitted
> cp: cannot create special file '/private/tmp/nix-build-foo-1.0.0.drv-0/11sr8qcnqlchbrgvkdchzbm1ar7cig53-source/npm-cache/_cacache/tmp/mongodb-27017.sock': Operation not permitted
> cp: cannot copy a directory, '/nix/store/nfxfhqlckv4z3w93j5r3k69k6awv0q0g-foo-1.0.0-node-modules/npm-cache', into itself, '/private/tmp/nix-build-foo-1.0.0.drv-0/11sr8qcnqlchbrgvkdchzbm1ar7cig53-source/npm-cache'
For full logs, run 'nix log /nix/store/n21bw1ia9aivg0fq3d4mzf452w1040lg-foo-1.0.0.drv'.
When trying out your fork @hlolli I managed to get a bit further in the process, but the build fails because I for some reason have root owned files in npm-cache? No idea why as of yet.
error: builder for '/nix/store/4sjiwiqnzsglwac6lxxi9jawdwzs19r5-foo-1.0.0.drv' failed with exit code 243;
last 10 log lines:
> npm ERR!
> npm ERR! Your cache folder contains root-owned files, due to a bug in
> npm ERR! previous versions of npm which has since been addressed.
> npm ERR!
> npm ERR! To permanently fix this problem, please run:
> npm ERR! sudo chown -R 501:20 "/nix/store/1wk888bpzy9m0k21b02qyhqakr2855as-foo-1.0.0-node-modules/npm-cache"
>
> npm ERR! Log files were not written due to an error writing to the directory: /nix/store/1wk888bpzy9m0k21b02qyhqakr2855as-foo-1.0.0-node-modules/npm-cache/_logs
> npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
>
For full logs, run 'nix log /nix/store/4sjiwiqnzsglwac6lxxi9jawdwzs19r5-foo-1.0.0.drv'.
@iensu could it be related that you're running as nixbld user and not root? I keep seeing $whoami => root, which could explain why I don't see it. But in the case you're not root user while building, I guess we'll need chmod?