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

Add: cmdliner.1.3.0 #25924

Merged
merged 1 commit into from
May 23, 2024
Merged

Add: cmdliner.1.3.0 #25924

merged 1 commit into from
May 23, 2024

Conversation

dbuenzli
Copy link
Contributor

  • Add: cmdliner.1.3.0 home, doc, issues
    Declarative definition of command line interfaces for OCaml

cmdliner v1.3.0 2024-05-23 La Forclaz (VS)

  • Add let operators in Cmdliner.Term.Syntax (#173). Thanks to Benoit
    Montagu for suggesting, Gabriel Scherer for reminding us of language
    punning obscurities and Sebastien Mondet for strengthening the case
    to add them.
  • Pager. Support full path command lookups on Windows.
    (#185). Thanks to @kit-ty-kate for the report.
  • In manpage specifications use $(iname) in the default
    introduction of the ENVIRONMENT section. Follow up to
    #168.
  • Add Cmd.eval_value' a variation on Cmd.eval_value.

Use b0 -- .opam publish cmdliner.1.3.0 to update the pull request.

@raphael-proust
Copy link
Contributor

The CI has error but they are unrelated to this package:

  • the dune linting rule but IIRC it's on purpose here because dune is not used by opam, just added so that duniverse/monorepo/vendoring works (anyone, please, correct me if that's not the reasone)
  • a lot of timeouts in revdeps
  • a lot of random failures in revdeps (I've attempted one fix for pecu)

@mseri mseri merged commit b602322 into ocaml:master May 23, 2024
1 check failed
@mseri
Copy link
Member

mseri commented May 23, 2024

Thanks

@dbuenzli
Copy link
Contributor Author

Thank you all !

@dbuenzli dbuenzli deleted the b0-publish-cmdliner.1.3.0 branch May 23, 2024 13:24
@hannesm
Copy link
Member

hannesm commented May 23, 2024

I'm not sure whether this is the right place, but I observe on arm32 and x86-32 CI some issues with cmdliner 1.3.0:

#=== ERROR while compiling hxd.0.3.2 ==========================================#
# context     2.1.5 | linux/arm32 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path        ~/.opam/5.2/.opam-switch/build/hxd.0.3.2
# command     ~/.opam/5.2/bin/dune build -p hxd -j 79
# exit-code   1
# env-file    ~/.opam/log/hxd-7-9bdd43.env
# output-file ~/.opam/log/hxd-7-9bdd43.out
### output ###
# File "bin/dune", line 11, characters 16-24:
# 11 |  (libraries hxd cmdliner hxd_unix))
#                      ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by _build/default/bin/caml.exe
# -> required by _build/install/default/bin/hxd.caml
# -> required by _build/default/hxd.install
# -> required by alias install
# File "bin/dune", line 5, characters 16-24:
# 5 |  (libraries hxd cmdliner hxd_unix))
#                     ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by _build/default/bin/xxd.exe
# -> required by _build/install/default/bin/hxd.xxd
# -> required by _build/default/hxd.install
# -> required by alias install


#=== ERROR while compiling decompress.1.5.3 ===================================#
# context     2.1.5 | linux/arm32 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path        ~/.opam/5.2/.opam-switch/build/decompress.1.5.3
# command     ~/.opam/5.2/bin/dune build -p decompress -j 79
# exit-code   1
# env-file    ~/.opam/log/decompress-7-eb46ad.env
# output-file ~/.opam/log/decompress-7-eb46ad.out
### output ###
# File "bin/dune", line 13, characters 2-10:
# 13 |   cmdliner))
#        ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by _build/default/bin/decompress.exe
# -> required by _build/install/default/bin/decompress
# -> required by _build/default/decompress.install
# -> required by alias install


#=== ERROR while compiling crowbar.0.2.1 ======================================#
# context     2.1.5 | linux/arm32 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path        ~/.opam/5.2/.opam-switch/build/crowbar.0.2.1
# command     ~/.opam/5.2/bin/dune build -p crowbar -j 79 --promote-install-files=false @install
# exit-code   1
# env-file    ~/.opam/log/crowbar-7-7b8507.env
# output-file ~/.opam/log/crowbar-7-7b8507.out
### output ###
# File "src/dune", line 3, characters 12-20:
# 3 |  (libraries cmdliner ocplib-endian afl-persistent str))
#                 ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by library "crowbar" in _build/default/src
# -> required by _build/default/META.crowbar
# -> required by _build/install/default/lib/crowbar/META
# -> required by _build/default/crowbar.install
# -> required by alias install


#=== ERROR while compiling ca-certs-nss.3.98 ==================================#
# context     2.1.5 | linux/arm32 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path        ~/.opam/5.2/.opam-switch/build/ca-certs-nss.3.98
# command     ~/.opam/5.2/bin/dune build -p ca-certs-nss -j 79 @install
# exit-code   1
# env-file    ~/.opam/log/ca-certs-nss-7-8b38f8.env
# output-file ~/.opam/log/ca-certs-nss-7-8b38f8.out
### output ###
# File "bin/dune", line 4, characters 59-67:
# 4 |  (libraries logs logs.fmt logs.cli fmt fmt.tty fmt.cli bos cmdliner x509))
#                                                                ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by _build/default/bin/extract_from_certdata.exe
# -> required by _build/install/default/bin/extract-from-certdata
# -> required by _build/default/ca-certs-nss.install
# -> required by alias install


#=== ERROR while compiling alcotest.1.7.0 =====================================#
# context     2.1.5 | linux/arm32 | ocaml-base-compiler.5.2.0 | file:///home/opam/opam-repository
# path        ~/.opam/5.2/.opam-switch/build/alcotest.1.7.0
# command     ~/.opam/5.2/bin/dune build -p alcotest -j 79 @install
# exit-code   1
# env-file    ~/.opam/log/alcotest-7-d87c6e.env
# output-file ~/.opam/log/alcotest-7-d87c6e.out
### output ###
# File "src/alcotest-engine/dune", line 25, characters 2-10:
# 25 |   cmdliner
#        ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by library "alcotest.engine" in
#    _build/default/src/alcotest-engine
# -> required by _build/default/META.alcotest
# -> required by _build/install/default/lib/alcotest/META
# -> required by _build/default/alcotest.install
# -> required by alias install
# File "src/alcotest-stdlib-ext/dune", line 4, characters 20-28:
# 4 |  (libraries astring cmdliner uutf)
#                         ^^^^^^^^
# Error: Library "cmdliner" in /home/opam/.opam/5.2/lib/cmdliner is hidden
# (unsatisfied 'exist_if').
# -> required by library "alcotest.stdlib_ext" in
#    _build/default/src/alcotest-stdlib-ext
# -> required by _build/default/META.alcotest
# -> required by _build/install/default/lib/alcotest/META
# -> required by _build/default/alcotest.install
# -> required by alias install

The job is e.g. https://ocaml.ci.dev/github/robur-coop/miragevpn/commit/e6075ab9a739380fa13ce53d89606fc4dfdb6573/variant/debian-12-5.2_arm32_opam-2.1 but also at https://ocaml.ci.dev/github/mirage/mirage-tcpip/commit/4bdb2b509bf42d50163d6138893989ea5775bb4c/variant/debian-12-5.2_arm32_opam-2.1 and https://ocaml.ci.dev/github/mirage/mirage-tcpip/commit/4bdb2b509bf42d50163d6138893989ea5775bb4c/variant/debian-12-5.2_x86_32_opam-2.1

As said, I've no clue what the root of the issue is, neither do I have a 32bit system to reproduce this issue.

@dbuenzli
Copy link
Contributor Author

dbuenzli commented May 23, 2024

The META file of cmdliner was changed in this commit notably it adds this line:

exists_if = "cmdliner.cma cmdliner.cmxa"

I suspect that dune does not interpret the field correctly. The package should be hidden only "if none of the files exist". See this page.

(I guess on 32-bits cmdliner.cmxa no longer exists after 5.0.0)

@dbuenzli
Copy link
Contributor Author

The offending line. I opened ocaml/dune#10563 in dune.

@dbuenzli
Copy link
Contributor Author

Not sure if it's possible to express the conflict with conflicts:.

@kit-ty-kate
Copy link
Member

Yes, using:

conflicts: [
  "ocaml-option-bytecode-only"
]

@dbuenzli
Copy link
Contributor Author

dbuenzli commented May 23, 2024

But cmdliner perfectly supports bytecode only. It should be

conflicts: [
  dune {<= "3.15.2"} & "ocaml-option-bytecode-only"
]

but according to the docs that's not allowed.

@hannesm
Copy link
Member

hannesm commented May 24, 2024

Thanks for your investigation, debugging, providing a fix, and opening issue and PR upstream.

What I remember from optional dependencies days in MirageOS and opam, the conjunction is not allowed in conflicts. What we then did was a mirage-no-solo5 package and have a depends: [ "mirage-no-solo5" | ("mirage-solo5" & ...)].

So, in this case, something along these lines may work:

depends: [ "no-dune" | ("dune" {> "3.15.1"} & "ocaml-option-bytecode-only") | "dune" ]

Where "no-dune" would be a package that conflicts with "dune".

But we can as well try to motivate the dune team to release a fixed version and not bother with old releases (of course, it would be nice if there'd be a way to express this conflict in opam, I hope someone else has an idea). :)

@emillon
Copy link
Contributor

emillon commented May 24, 2024

we're going to release a dune version with the fix today.

@raphael-proust
Copy link
Contributor

Maybe we should have something along the lines of flags: [ avoid-version { ocaml-options-bytecode-only } ] in the old versions of dune. But I don't think that it's supported as a syntax.

@emillon
Copy link
Contributor

emillon commented May 24, 2024

Done in #25931

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants