will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
462 stars 77 forks source link

shards update/install/build failing at the crystal-pg step #215

Closed rishavs closed 3 years ago

rishavs commented 3 years ago

On using shards build/update on my exiting projects, the shards process is failing. I am using wsl on a windows 10 device.

rishav@Romana:/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi$ shards build
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/gdotdesign/cr-dotenv.git
Fetching https://github.com/crystal-lang/crystal-db.git
Shard "pg" version (0.21.1) doesn't match tag version (0.22.0)
Installing db (0.10.0)
Failed git archive --format=tar --prefix= refs/tags/v0.10.0 | tar -x -f - -C '/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi/lib/db' (). Maybe a commit, branch or file doesn't exist?

Slightly more verbose error;

git ls-remote --get-url origin
Fetching https://github.com/crystal-lang/crystal-db.git
git fetch --all --quiet
git tag --list --column=never
git ls-tree -r --full-tree --name-only refs/tags/v0.10.0 -- shard.yml
git show refs/tags/v0.10.0:shard.yml
Shard "pg" version (0.21.1) doesn't match tag version (0.22.0)
Installing db (0.10.0)
rm -rf ''/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi/lib/db''
git archive --format=tar --prefix= refs/tags/v0.10.0 | tar -x -f - -C '/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi/lib/db'
Failed git archive --format=tar --prefix= refs/tags/v0.10.0 | tar -x -f - -C '/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi/lib/db' (). Maybe a commit, branch or file doesn't exist?

Here is my env etails;

rishav@Romana:/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi$ crystal -v
Crystal 0.35.1 [5999ae29b] (2020-06-19)

LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu
rishav@Romana:/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi$ shards --version
Shards 0.11.1 [3b7d490] (2020-06-19)
rishav@Romana:/mnt/c/Users/Mockingbird/Documents/GitHub/kaipi$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

Here is my shards.yml

name: Kaipi
version: 0.1.0

authors:
  - your-name-here <your-email-here>

targets:
    kaipi:
        main: src/kaipi.cr

dependencies:
    pg:
        github: will/crystal-pg
    dotenv:
        github: gdotdesign/cr-dotenv

crystal: 0.35.0

license: MIT

Currently I am blocked on restarting with my older projects.

will commented 3 years ago

Oops, looks like I forgot to change shard.yml when doing the last release. I just pushed v0.22.1 which should fix this I think. Can you verify?

rishavs commented 3 years ago

On further investigation, i found that the actual issue is on my side. wsl is having permissions issue with mounted directories. I believe that the tag mismatch is just a warning

Anyway, just tried again and 22.1 doesn't gives any warnings. Closing the issue. Thanks for the superfast fix :)

^Crishav@Romana:~/dev/kaipi$ shards update
Resolving dependencies
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/gdotdesign/cr-dotenv.git
Fetching https://github.com/crystal-lang/crystal-db.git
Using db (0.10.0)
Installing pg (0.22.1)
Using dotenv (0.7.0)
Writing shard.lock
rishav@Romana:~/dev/kaipi$