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

opam2 returns zero exit code too often for opam list #3525

Closed
avsm opened this issue Aug 31, 2018 · 2 comments · Fixed by #3533
Closed

opam2 returns zero exit code too often for opam list #3525

avsm opened this issue Aug 31, 2018 · 2 comments · Fixed by #3533
Milestone

Comments

@avsm
Copy link
Member

avsm commented Aug 31, 2018

# opam --version
1.2.2
# opam list --installed conf-libev
No packages found.
/ # echo $?
1

but with opam2

$ opam --version
2.0.0
$ opam list --installed conf-libev
# Packages matching: installed & name-match(conf-libev)
# No matches found
$ echo $?
0
$ opam list
# Packages matching: installed
# Name        # Installed # Synopsis
base-bigarray base        Bigarray library distributed with the OCaml compiler
base-threads  base        Threads library distributed with the OCaml compiler
base-unix     base        Unix library distributed with the OCaml compiler
conf-m4       1           Virtual package relying on m4
dune          1.1.1       Fast, portable and opinionated build system
ocaml         4.07.0      The OCaml compiler (virtual package)
ocaml-system  4.07.0      The OCaml compiler (system version, from outside of opam)
ocamlfind     1.8.0       A library manager for OCaml

This subsequently results in bugs like Lwt's configure script misdetecting libev when opam2 is installed...

avsm added a commit to avsm/lwt that referenced this issue Aug 31, 2018
This simplifies the configure scripts to:

- disable libev build by default unless it is supplied on the
  configure line.  This does not affect most installations such
  as via opam (where the flag is explicitly specified depending
  on the presence of conf-libev) or OS packaging (where libev is
  typically a concrete dependency specified in the package data).
  However, this does make the build of Lwt much more portable
  by default when libev is not available.

- remove writing of setup.data, which seems to be vestigial from
  the oasis build days. Simplifies the discovery script.

- remove the auto-detection of libev on opam, which is not
  necessary since the opam package specifies it. Due to an
  unfortunate bug in opam 2.0.0 (ocaml/opam#3525) this is
  always true and so has different behaviour on opam1 vs 2.

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
@rjbou
Copy link
Collaborator

rjbou commented Sep 4, 2018

Shouldn't have as return code 5, the value of Not_found?

@rjbou
Copy link
Collaborator

rjbou commented Sep 5, 2018

After discussion with @AltGr, opam list returning an empty list is not an error itself and shouldn't be treated as one.
I added in #3533 a option --silent, that don't display output, and return 1 if the list is empty, 0 otherwise (also for depexts).

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 a pull request may close this issue.

2 participants