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

Error when trying to pull v0.7.2 #144

Closed
eliasjpr opened this issue Oct 3, 2019 · 14 comments
Closed

Error when trying to pull v0.7.2 #144

eliasjpr opened this issue Oct 3, 2019 · 14 comments

Comments

@eliasjpr
Copy link
Contributor

eliasjpr commented Oct 3, 2019

I got the following error when doing shards update for a project for version v0.7.2

Failed git ls-tree -r --full-tree --name-only v7.0.1 -- shard.yml (). Maybe a commit, branch or file doesn't exist?

shards.yml

  clear:
    github: anykeyh/clear
    version: ~> 0.7.2
@eliasjpr eliasjpr closed this as completed Oct 3, 2019
@eliasjpr eliasjpr reopened this Oct 3, 2019
@anykeyh
Copy link
Owner

anykeyh commented Oct 10, 2019

There is a pb here:

Failed git ls-tree -r --full-tree --name-only v7.0.1

It's related to the fact that I destroyed this tag. I think the shards binary freak-out

You should probably do that:

# In your project directory
rm -r lib/clear
rm lib/clear.sha1

Tell me if it fixes your break !

@anykeyh
Copy link
Owner

anykeyh commented Oct 13, 2019

Did it fix it?

@remydev
Copy link
Contributor

remydev commented Oct 18, 2019

Hi
On a fresh test i have this bug too

Miranda-II/lukc ~/Sources > git clone https://github.com/remydev/clear_test
Cloning into 'clear_test'...
/usr/lib/git-core/git-remote-https: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/lib/git-core/git-remote-https)
cd cleremote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 20 (delta 4), reused 12 (delta 2), pack-reused 0
Unpacking objects: 100% (20/20), done.
Miranda-II/lukc ~/Sources > cd clear_test
Miranda-II/lukc ~/Sources/clear_test > ls
HttpExamples.elm  README.md  shard.yml  src
Miranda-II/lukc ~/Sources/clear_test > shards install
Fetching https://github.com/anykeyh/clear.git
Failed git ls-tree -r --full-tree --name-only v7.0.1 -- shard.yml (). Maybe a commit, branch or file doesn't exist?

@anykeyh
Copy link
Owner

anykeyh commented Oct 21, 2019

Well, testing on my side will not crash... shards utility will hang on:

Fetching https://github.com/anykeyh/generate.cr.git 

Using verbose I can see an endless loop. I'm going to check with shards utility maintainer

@anykeyh
Copy link
Owner

anykeyh commented Oct 21, 2019

Quick fix: Adding version: "~> 0.7.2" in your shards.yml file will make it works perfectly

@eliasjpr
Copy link
Contributor Author

Im still getting the following error

shard.yml

  clear:
    github: anykeyh/clear
    version: ~> 0.7.2

running shards install

➜  slim git:(master) ✗ make build    
Fetching https://github.com/onyxframework/onyx.git
Fetching https://github.com/gdotdesign/cr-dotenv.git
Fetching https://github.com/anykeyh/clear.git
Failed git ls-tree -r --full-tree --name-only v7.0.1 -- shard.yml (). Maybe a commit, branch or file doesn't exist?
make: *** [lib] Error 1

@eliasjpr
Copy link
Contributor Author

I think the v0.7.2 tag is corrupt. Maybe making a new release will fix it v0.7.3 or deleting the tag from the releases section on github and re-releasing the same tag. 🤷‍♂

@eliasjpr
Copy link
Contributor Author

Something is up with the repo. I forked the repo and pointed the shard to the repo and I was able to run shards install with no errors using the following in the yaml file.

clear:
    github: anykeyh/clear
    version: ~> 0.7.2

@anykeyh
Copy link
Owner

anykeyh commented Oct 21, 2019

Sorry, now I understand. It's related to shards.lock file.

This should be the definitive fix:

  • Remove reference to clear into shards.lock (or if you're not scared to update every shards, simply delete shards.lock)
  • Remove lib/clear folder
  • Remove lib/clear.sha1 file
  • Call shard update
  • Profit 😄

@anykeyh
Copy link
Owner

anykeyh commented Oct 21, 2019

What happens is your shards.lock is locked to 7.0.1 or above. Well, there is no above 7.x (and won't before I get grand-father at least haha). The problem now is shards freak out because the tag doesn't exist anymore.

Simply removing all references to 7.0.1 by destroying shards.lock file should do the trick

@eliasjpr
Copy link
Contributor Author

I tried the above and still the same error.

@anykeyh
Copy link
Owner

anykeyh commented Oct 21, 2019

Very weird. I cannot reproduce, it works perfectly on new project :

$ mkdir new_project
$ cd new_project/
$ shards init
Created shard.yml
$ cat > shard.yml <<EOF
name: new_project
version: 0.1.0

dependencies:
  clear:
    github: anykeyh/clear
    version: ~> 0.7.2
EOF 
$ shards update
Resolving dependencies
Fetching https://github.com/anykeyh/clear.git
Fetching https://github.com/jwaldrip/admiral.cr.git
Fetching https://github.com/anykeyh/generate.cr.git
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/phoffer/inflector.cr.git
Installing clear (0.7.2)
Installing admiral (1.8.0 at 0892415a8775fe59ff4c6de6cb5b21da8c9acd8e)
Installing generate (0.1.0 at 27a59d663ded8ce39a361e3a88b8dd747f59ce42)
Installing pg (0.19.0 at 650b16faf3c916b7bc30c9ec558871e2c396e212)
Installing inflector (0.1.8)
Installing db (0.7.0)
Writing shard.lock

I'll probably release 0.8.0 in a few days/weeks; meanwhile, you can use your own fork. And if you find out how to fix it, I would be curious to know what was the problem :)

@eliasjpr
Copy link
Contributor Author

I'll look into it today. Thanks.

I really like Clear, great ORM. Noticed that is missing some documentation will add some when I can

@anykeyh
Copy link
Owner

anykeyh commented Feb 3, 2020

Hello, I'm closing this as we released v0.8

@anykeyh anykeyh closed this as completed Feb 3, 2020
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

No branches or pull requests

3 participants