Skip to content

paket.template dependency ~> LOCKEDVERSION gives inconsistent behaviour for x.y.0 versions #3727

Closed

Description

@cmeeren

When the currently locked package version has patch = zero, using ~> LOCKEDVERSION in paket.template results in a package compatible with all packages up to the next major version. However, when the locked package has a non-zero patch number, the package is compatible with only versions up (and not including) to the next minor version.

This is causing some headache for me. I am trying to depend on Feliz. It's at 0.x, so I want to be compatible with the minor version I'm currently on. In my paket.dependencies I have simply

nuget Feliz

but the same happens for a specified version with zero patch:

nuget Feliz 0.68.0

In the lock file, this results in

Feliz (0.68)

In my paket.template, I have

dependencies
  Feliz ~> LOCKEDVERSION

And the final nuget package (created using paket pack) is now compatible with Feliz [0.68, 1.0.0).

However, if the locked Feliz version is, say, 0.68.1, then the final NuGet version compatibility is Feliz [0.68.1, 0.69.0) which is what I want.

I find it confusing that the end result depends in this manner on whether the currently installed version has a zero patch or not, so I consider this to be a bug.

Activity

  1. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    I've root-caused this: the bare LOCKEDVERSION/CURRENTVERSION placeholder substitutes the raw, un-normalized locked version text (e.g. "0.68") rather than a normalized Major.Minor.Patch form. Since ~> infers which segment to bump from the number of numeric fragments present, a 2-segment locked version like 0.68 and a 3-segment version like 0.68.1 get treated differently by the twiddle operator, producing the inconsistent ranges reported here.

    I've opened a draft fix that normalizes the substituted version to at least 3 segments before it reaches the ~> parser, with regression tests covering 2-segment, 3-segment (explicit .0), and 3-segment (non-zero patch) cases. A maintainer will need to review and merge.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.
    Comment /repo-assist to run again

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions