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

remove symlink resolve and add force flag to copy cache operation #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hlolli
Copy link
Contributor

@hlolli hlolli commented Sep 23, 2022

this could be an darwin specific issue, but after the latest merge I'm unable to build (see my comment here #54 (comment)). But I did also experience the same issue as this PR #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.

@hlolli hlolli changed the title remove symlink resolve and add force flag to copy cache operation [wip] remove symlink resolve and add force flag to copy cache operation Sep 23, 2022
@hlolli
Copy link
Contributor Author

hlolli commented Sep 23, 2022

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>

@hlolli hlolli force-pushed the feature/force-copy branch 2 times, most recently from 4f4c7a2 to 5016c7a Compare September 23, 2022 13:17
@hlolli hlolli changed the title [wip] remove symlink resolve and add force flag to copy cache operation remove symlink resolve and add force flag to copy cache operation Sep 23, 2022
@hlolli
Copy link
Contributor Author

hlolli commented Sep 23, 2022

that extra commit creates support for both linux and darwin, but I'd love to have another darwin user confirm this

@iensu
Copy link

iensu commented Oct 1, 2022

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'.

@hlolli
Copy link
Contributor Author

hlolli commented Nov 24, 2022

@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?

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

Successfully merging this pull request may close these issues.

2 participants