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

Installed version in lib does not match version in shard.lock #581

Closed
straight-shoota opened this issue Mar 27, 2023 · 3 comments
Closed
Assignees
Labels

Comments

@straight-shoota
Copy link
Member

straight-shoota commented Mar 27, 2023

Originally posted by @jwoertink in #572 (comment)

I [@jwoertink] did a soft release of Lucky and Avram 1.0.0 over the weekend, and now my apps won't pull 1.0.0-rc1 anymore.

My shard.yml file has this:

dependencies:
  lucky:
    github: luckyframework/lucky
    version: 1.0.0-rc1
  avram:
    github: luckyframework/avram
    version: 1.0.0-rc1

I run rm -rf lib/ shard.lock ~/.cache/ then shards install. When it's installing, I see this:

image

My shard.lock file has the correct version:

❯ cat shard.lock 
version: 2.0
shards:
  CrystalEmail:
    git: https://github.com/jwoertink/crystalemail.git
    version: 0.2.6+git.commit.960e1b9ad02288ae56110d39fe9d7ca3bbcdcd1e

  ameba:
    git: https://github.com/crystal-ameba/ameba.git
    version: 1.3.1

  authentic:
    git: https://github.com/luckyframework/authentic.git
    version: 0.9.0

  authly:
    git: https://github.com/azutoolkit/authly.git
    version: 1.2

  avram:
    git: https://github.com/luckyframework/avram.git
    version: 1.0.0-rc1
...
  lucky:
    git: https://github.com/luckyframework/lucky.git
    version: 1.0.0-rc1

Running shards list --tree shows the correct list

❯ shards list --tree
Shards installed:
  * lucky (1.0.0-rc1)
    * lucky_task (0.1.1)
    * habitat (0.4.7)
    * wordsmith (0.4.0)
    * lucky_router (0.5.1)
    * shell-table (0.9.3)
    * cry (0.4.3)
    * exception_page (0.3.0)
      * backtracer (1.2.2)
    * dexter (0.3.4)
    * pulsar (0.2.3)
    * teeplate (0.8.5)
  * avram (1.0.0-rc1)
    * lucky_task (0.1.1)
    * pg (0.26.0)
      * db (0.11.0)
    * habitat (0.4.7)

but the actual versions that show up in lib are wrong...

❯ cat lib/lucky/shard.yml 
name: lucky
version: 1.0.0

crystal: ">=1.6.0"

❯ cat lib/avram/shard.yml 
name: avram
version: 1.0.0

crystal: ">= 1.6.0"

These are installing 1.0.0 and not 1.0.0-rc1 even though it's saying that it is.

Now one very strange thing is, after I run shards install, if I rm -rf lib/lucky/ then shards update lucky that will install the rc1 version. It only installs the wrong version on shards install and shards update.

Edit: using shards 0.17.2

@straight-shoota
Copy link
Member Author

I cannot reproduce this behaviour.

I'm using a fresh docker image to exclude any outside influences.

$ docker run --rm -it crystallang/crystal:1.7.2 /bin/bash
root@2ff99339acfd:/# mkdir -p /app && cd app
root@2ff99339acfd:/app# cat > shard.yml
name: pre-release
version: 0.1.0

dependencies:
  lucky:
    github: luckyframework/lucky
    version: 1.0.0-rc1
  avram:
    github: luckyframework/avram
    version: 1.0.0-rc1
root@2ff99339acfd:/app# shards install
Resolving dependencies
Fetching https://github.com/luckyframework/lucky.git
Fetching https://github.com/luckyframework/avram.git
Fetching https://github.com/luckyframework/lucky_task.git
Fetching https://github.com/luckyframework/habitat.git
Fetching https://github.com/luckyframework/wordsmith.git
Fetching https://github.com/luckyframework/lucky_router.git
Fetching https://github.com/luckyframework/shell-table.cr.git
Fetching https://github.com/luckyframework/cry.git
Fetching https://github.com/crystal-loot/exception_page.git
Fetching https://github.com/luckyframework/dexter.git
Fetching https://github.com/luckyframework/pulsar.git
Fetching https://github.com/luckyframework/teeplate.git
Fetching https://github.com/will/crystal-pg.git
Fetching https://github.com/luckyframework/lucky_cache.git
Fetching https://github.com/cadmiumcr/transliterator.git
Fetching https://github.com/sija/backtracer.cr.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/wyhaines/splay_tree_map.cr.git
Installing lucky_task (0.1.1)
Installing habitat (0.4.7)
Installing wordsmith (0.4.0)
Installing lucky_router (0.5.2)
Installing shell-table (0.9.3)
Installing cry (0.4.3)
Installing backtracer (1.2.2)
Installing exception_page (0.3.0)
Installing dexter (0.3.4)
Installing pulsar (0.2.3)
Installing teeplate (0.8.5)
Installing lucky (1.0.0-rc1)
Postinstall of lucky: BUILD_WITHOUT_DEVELOPMENT=true script/precompile_tasks
Installing db (0.11.0)
Installing pg (0.26.0)
Installing splay_tree_map (0.2.2)
Installing lucky_cache (0.1.1)
Installing cadmium_transliterator (0.1.0 at 46c4c14)
Installing avram (1.0.0-rc1)
Postinstall of avram: BUILD_WITHOUT_DEVELOPMENT=true script/precompile_tasks
Writing shard.lock
root@2ff99339acfd:/app# head -n2 lib/{avram,lucky}/shard.yml
==> lib/avram/shard.yml <==
name: avram
version: 1.0.0-rc1

==> lib/lucky/shard.yml <==
name: lucky
version: 1.0.0-rc1

It's likely that some things have changed in the lucky and avram repositories.

@jwoertink As I can see the v1.0.0 tag was only created on March 12, so I'm wondering what version of 1.0.0 was picked up when you originally tried this? What was this so called "soft release"? Can you recall the state of the repository, especially tags?

@straight-shoota
Copy link
Member Author

P.S. Apparently the version in shard.yml was only updated on March 12 as well (luckyframework/lucky@f964709), so if you had some prior commit tagged as 1.0.0, is it possible that you had the correctly tagged version, but shard.yml just didn't match that?

@jwoertink
Copy link

Hmm that's strange. Yeah, I did the release on March 12th, but on March 14th was when I was having the issue. I was clearing cache, removing files, and all kinds of stuff, but could not get it to pull 1.0.0-rc1 for the life of me. Oddly enough, I also can't recreate it now.... so, I'll chalk it up to Monday morning goblins in my computer at that time 🙃

Thanks for the follow up, I think we can close this out.

@straight-shoota straight-shoota closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants