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

Yarn cache bug w/ Github URL packages #6256

Closed
luwes opened this issue Aug 9, 2018 · 6 comments · Fixed by #6393
Closed

Yarn cache bug w/ Github URL packages #6256

luwes opened this issue Aug 9, 2018 · 6 comments · Fixed by #6393
Assignees
Labels

Comments

@luwes
Copy link
Contributor

luwes commented Aug 9, 2018

Bug

What is the current behavior?

yarn install fails to install subsequent Github URL packages with format
git+ssh://git@github.com:luwes/chameleon.git#cricket-v0.0.1-beta.3
git+ssh://git@github.com:luwes/chameleon.git#grasshopper-v0.0.1-beta.4

error Command failed.
Exit code: 128

screen shot 2018-08-09 at 14 22 00

What is the expected behavior?

yarn install installs the package

Node 10.6.0, Yarn 1.9.4, MacOS 10.13.3

@ghost ghost assigned arcanis Aug 9, 2018
@ghost ghost added the triaged label Aug 9, 2018
@luwes
Copy link
Contributor Author

luwes commented Aug 16, 2018

Is it possible yarn caches GH packages only based on repository URL and version number?
If so I think it should also take in account the package name or at least the prefix of the full version after the hash e.g core-v1.1.2

@arcanis
Copy link
Member

arcanis commented Aug 16, 2018

I need an actual repro, player/player isn't a valid repository.

@luwes
Copy link
Contributor Author

luwes commented Aug 20, 2018

Related issue: #3303
This comment feels spot on: #3303 (comment)

I think yarn is reusing the cache directory, but git doesn't like overwriting one branch with another in that directory.

@luwes
Copy link
Contributor Author

luwes commented Aug 20, 2018

I reproduced it with these public git tags:

yarn global add git+ssh://git@github.com:luwes/chameleon.git#cricket-v0.0.1-beta.1
yarn global add git+ssh://git@github.com:luwes/chameleon.git#cricket-v0.0.1-beta.2
yarn global add git+ssh://git@github.com:luwes/chameleon.git#grasshopper-v0.0.1-beta.3
yarn global add git+ssh://git@github.com:luwes/chameleon.git#cricket-v0.0.1-beta.3
yarn global add git+ssh://git@github.com:luwes/chameleon.git#grasshopper-v0.0.1-beta.4
yarn global add git+ssh://git@github.com:luwes/chameleon.git#cricket-v0.0.1-beta.4

@luwes
Copy link
Contributor Author

luwes commented Sep 12, 2018

Any more insights into this issue?

@luwes
Copy link
Contributor Author

luwes commented Sep 15, 2018

@arcanis I think the issue is that the cloned repo in that .tmp cache folder does not have the latest git tags.

It tries to create an git archive <tree-ish but exits with code 128. When I manually went in that folder and ran the git archive ... command it outputted fatal: not a tree object.

git tag in that folder did not list the newly added tag.

I traced it back to this line of code which does a git pull if there is a cached repo, but git pull does not add the new tags to the repo.
https://github.com/yarnpkg/yarn/blob/master/src/util/git.js#L322

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

Successfully merging a pull request may close this issue.

2 participants