Skip to content

shards install silently allows version mismatch in lib/ and fails to replace incorrect code #706

@sbsoftware

Description

@sbsoftware

I am actually describing two issues here. First, on one of my server instances, shards install checked out dependency code into lib/ that did not match the version specified in shard.lock and lib/.shards.info. The code in lib/ was from a different tag (or main/HEAD), but the lockfiles were correct.

This will probably be hard to reproduce and fix, so let's focus on my second issue:

Subsequent shards install runs did not replace the incorrect code in lib/, even though shard.lock and lib/.shards.info specified a different version. There was no warning or error about the version mismatch.

Expected Behavior

I would have expected one of the following:

  • shards install always replacing the code in lib/ to match shard.lock.
  • Error out or at least print a warning when the version in lib/<shard>/shard.yml does not match shard.lock.

Actual Behavior

Incorrect code persisted in lib/ across multiple shards install runs. No feedback was provided about the mismatch.

Environment

Shards version: 0.20.0 (2025-12-19)
OS: Ubuntu Noble (arm64) on EC2

Notes

  • The cached repository in ~/.cache/shards/ was correct.
  • Only deleting lib/ and manually and reinstalling resolved the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions