Yarn: GitFetcher fetchFromLocal compares the wrong hashes

Created on 20 Apr 2017  ·  4Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Report a bug.

What is the current behavior?
GitFetcher fetchFromLocal compares the git commit hash with the hash of the tarball itself. So, installing this way fails:

❯ yarn
yarn install v0.23.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Bad hash. Expected "a43715a08af0b06ac140db652da0c09dc6eacf01" but got "86e25a19f2ae5d44ca5de710a2775a71f6c3f35f" 
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

In this case, "a43715a08af0b06ac140db652da0c09dc6eacf01" is the git commit of the git dependency. "86e25a19f2ae5d44ca5de710a2775a71f6c3f35f" is the hash of the tarball in the mirror.

If the current behavior is a bug, please provide the steps to reproduce.
Attempt to install a git dependency that exists in a local mirror.

What is the expected behavior?
The proper hashes are compared, and the install succeeds.

Please mention your node.js, yarn and operating system version.
Node: v4.9.0
Yarn: v0.23.2
OS: macOS 10.12.4

cat-bug high-priority triaged

Most helpful comment

@arcanis is on this, we should fix it soom

All 4 comments

@arcanis is on this, we should fix it soom

@arcanis were you able to fix this on master?

Yes, this has been fixed in 0.23 (#3449)

Was this page helpful?
0 / 5 - 0 ratings