Unlink error when building Oni #53
Comments
I've got similar [wizzup@ cg-local-ext](master)$ cat default.nix
with (import <nixpkgs> {});
rec {
cg-local-ext = mkYarnPackage {
name = "cg-local-ext";
src = ./.;
packageJson = ./package.json;
yarnLock = ./yarn.lock;
# NOTE: this is optional and generated dynamically if omitted
yarnNix = ./yarn.nix;
};
}
[wizzup@ cg-local-ext](master)$ nix-build
these derivations will be built:
/nix/store/q99j1pfiim8iwr4a38sk0cdll0jimhpx-cg-local-ext-modules-1.0.1.drv
/nix/store/bc55psm4g94f2l7hlwcrlxg184dqi37r-cg-local-ext.drv
building '/nix/store/q99j1pfiim8iwr4a38sk0cdll0jimhpx-cg-local-ext-modules-1.0.1.drv'...
configuring
building
yarn config v1.5.1
success Set "yarn-offline-mirror" to "/nix/store/d1rkhaqawfyk2w5alc3j98ff7i1drymf-offline".
Done in 0.16s.
yarn install v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "EACCES: permission denied, unlink '/nix/store/d1rkhaqawfyk2w5alc3j98ff7i1drymf-offline/strip-bom-3.0.0.tgz'".
info If you think this is a bug, please open a bug report with the information provided in "/tmp/nix-build-cg-local-ext-modules-1.0.1.drv-0/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
builder for '/nix/store/q99j1pfiim8iwr4a38sk0cdll0jimhpx-cg-local-ext-modules-1.0.1.drv' failed with exit code 1
cannot build derivation '/nix/store/bc55psm4g94f2l7hlwcrlxg184dqi37r-cg-local-ext.drv': 1 dependencies couldn't be built
error: build of '/nix/store/bc55psm4g94f2l7hlwcrlxg184dqi37r-cg-local-ext.drv' failed while there is no no problem when running [wizzup@ cg-local-ext](master)$ nix-shell -p yarn yarn2nix nodejs-9_x
[nix-shell:/data/works/coding_challenges/codingame/extensions/cg-local/cg-local-ext]$ yarn
yarn install v1.5.1
[1/4] Resolving packages...
success Already up-to-date.
Done in 1.30s. |
I also encounter this error: |
Same for heroku in NixOS/nixpkgs#42869 |
I've debugged this for an hour and couldn't find a way to prevent yarn from unlinking. I think the next step should be to figure out what line actually does unlinking. Unfortunately error we get from node includes no traceback, so I've opened yarnpkg/yarn#6058 |
I have a similar error and maybe a clue. First, what I did:
What I found: A mismatching hash. The
what I guess is happening after that: After the TarballFetcher fails, https://github.com/yarnpkg/yarn/blob/master/src/package-fetcher.js#L47 kicks in, trying to delete the .tgz with the wrong hash. So now I know (at least in my case) how this error is triggered, but I'm not much wiser on how to react in the case of a wrong hash. Make yarn2nix validate all hashes and throw an exception earlier in the build? Add an option to yarn2nix to force-override all hashes? |
Oh, for reproductions sake, here's a derivation with problems: { mkYarnPackage, ...}:
mkYarnPackage rec {
name = "vscode";
version = "1.27.2";
src = builtins.fetchTarball {
url = "https://github.com/Microsoft/vscode/archive/${version}.tar.gz" ;
sha256 = "0b42c2xa2cpmhxmazpcwgxay2n4jmv74rwxqizh38cg8390jpvp2";
};
} |
Okay, one more weird thing: when I download "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz" by hand, it has the expected sha1sum of a35008b20f41383eec1fb914f4cd5df79a264284 This might actually be an error on the side of yarn2nix, not a corrupted yarn.lock |
Yup, it's with yarn2nix. It mixes up those two:
|
This issue is fixed in master and should be closed, but yarn2nix in nixpkgs is very outdated: NixOS/nixpkgs#20637 (comment) |
Re: NixOS/nixpkgs#38231
I attempted to build Oni using yarn2nix, but with this expression:
I had this error
I don't really know enough about
yarn
to know the root cause of this, but I suspect it is something to do with the unlink command attempting to interfere with nixpkgs symlinks? Will attempt to investigate further later in the week.The text was updated successfully, but these errors were encountered: