Skip to content

Compatibility for cmdliner 2.0.0#512

Merged
avsm merged 2 commits intotarides:mainfrom
psafont:dev/pau/up
Jan 29, 2026
Merged

Compatibility for cmdliner 2.0.0#512
avsm merged 2 commits intotarides:mainfrom
psafont:dev/pau/up

Conversation

@psafont
Copy link
Contributor

@psafont psafont commented Nov 20, 2025

The type Arg.conv was made abstract and now needs to be handled with specialized functions. I've tested that it still works with cmdliner 1.3.0. and verified that the function was introduced in 1.0.0. Unfortunately 1.1.0 is not available in opam anymore, so I did not test that.

@Leonidas-from-XIV
Copy link
Member

Thanks, looks good! Can you bump the required version in the metadata? It probably does not need a changelog entry even as it probably isn't a user visible change.

@Leonidas-from-XIV Leonidas-from-XIV added the no changelog Add this to your PRs to disable the changelog update check label Nov 20, 2025
@Leonidas-from-XIV
Copy link
Member

@mtelvers got the CI to work again, so we can run the tests in CI again :)

@psafont Turns out that Cmdliner does not accept "prefix" options anymore:

+  Usage: dune-release distrib [--help] [OPTION]…
+  dune-release: unknown option '--skip-test'. Did you mean '--skip-tests'?
+  [124]

I think our tests need to be updated to use the full wording and unfortunately (my apologies!) I have to get back on my previous statement, as this is a user-visible change it needs a changelog entry, something akin to this:

- Updated to use Cmdliner 2.0. This means that option switches have to be specified completely, prefix-matches don't work anymore (e.g. `--skip-tests` instead of `--skip-test`) (#512, @psafont)

@Leonidas-from-XIV Leonidas-from-XIV removed the no changelog Add this to your PRs to disable the changelog update check label Nov 21, 2025
@psafont
Copy link
Contributor Author

psafont commented Nov 21, 2025

We can solve this in other ways rather than changing user-facing behaviour:

  • Limit the version to 1.3.0, and defer on what should be done for 2.0.0
  • Add the common prefix options as explicit aliases, unsure if this would be compatible with 1.3.0
  • Limit the version to 2.0.0, behaviour is changed, and there is no ambiguity on the behaviour of the tool depending on the library version used.

@Leonidas-from-XIV
Copy link
Member

These are good points. Personally I am not a fan of ambiguous behavior and multiple ways to do the same, so I prefer the behavior of Cmdliner 2.0. Technically the old behavior can still be enabled, but it sounds like this isn't the way to go forward.

The issue I see is that we don't really know which prefix options we should introduce explicitely. I guess all the ones that end in a plural, but technically nothing prevented users from writing --skip-te.

@samoht what do you think? Should we bite the bullet and break some invocations or try to work around it?

cmdliner 2.0.0 will remove these

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
The type Arg.conv was made abstract and now needs to be handled with
specialized functions.

Shortened versions of the parameters do not work anymore.

Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
@avsm
Copy link
Contributor

avsm commented Jan 24, 2026

Could we advance this one? Just go with the cmdliner 2.0 option of not autocompleting; scripts are easy to fix.

@psafont
Copy link
Contributor Author

psafont commented Jan 26, 2026

Just go with the cmdliner 2.0 option of not autocompleting; scripts are easy to fix.

Just in case it helps getting it merged: this is what the PR is currently doing

@samoht
Copy link
Contributor

samoht commented Jan 27, 2026

@samoht what do you think? Should we bite the bullet and break some invocations or try to work around it?

I've completely missing the ping... but yea, let's just fix the scripts to call full invocations.

@avsm avsm merged commit ede1ecc into tarides:main Jan 29, 2026
3 checks passed
avsm added a commit to avsm/opam-repository that referenced this pull request Jan 29, 2026
CHANGES:

### Breaking

- Update to use cmdliner 2.0.0. Shortened arguments will not work anymore. (tarides/dune-release#512, @psafont)
@avsm
Copy link
Contributor

avsm commented Jan 29, 2026

thanks, merged and released in ocaml/opam-repository#29307

@psafont psafont deleted the dev/pau/up branch January 29, 2026 13:20
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

Successfully merging this pull request may close these issues.

4 participants