ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.24k stars 353 forks source link

Cygwin depext doesn't report errors for non-existent packages #5839

Open dra27 opened 8 months ago

dra27 commented 8 months ago

Cygwin setup doesn't return an error code for a package name which doesn't exist, there's simply a line in the console output:

Package 'does-not-exist' not found.

We should already have the information available to be able to display an error at this stage:

C:\Users\DRA>opam install conf-zstd
The following actions will be performed:
=== install 2 packages
  βˆ— conf-mingw-w64-zstd-i686 1     [required by conf-zstd]
  βˆ— conf-zstd                1.3.8

Proceed with βˆ— 2 installations? [y/n] y

The following system packages will first need to be installed:
    xxx-mingw64-i686-zstd

instead of:

<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><>  🐫

+ C:\Users\DRA\AppData\Local\opam\.cygwin\setup-x86_64.exe "--root" "C:\\Users\\DRA\\AppData\\Local\\opam\\.cygwin\\root" "--quiet-mode" "hidden" "--no-shortcuts" "--no-startmenu" "--no-desktop" "--no-admin" "--packages" "xxx-mingw64-i686-zstd" "--symlink-type" "native" "--upgrade-also" "--only-site" "--no-version-check" "--site" "https://cygwin.mirror.constant.com/" "--local-package-dir" "C:\\Users\\DRA\\AppData\\Local\\opam\\.cygwin\\cache"
- Starting cygwin install, version 2.930
- User has NO backup/restore rights
- User has NO symlink creation right
- Current Directory: C:\Users\DRA\AppData\Local\opam\.cygwin\cache
- root: C:\Users\DRA\AppData\Local\opam\.cygwin\root user
- Changing gid back to original
- Selected local directory: C:\Users\DRA\AppData\Local\opam\.cygwin\cache
- net: Preconfig
- site: https://cygwin.mirror.constant.com/
- Package 'xxx-mingw64-i686-zstd' not found.
- solving: 0 tasks, update: yes, use test packages: no
- solving: 0 tasks, update: no, use test packages: no
- Augmented Transaction List: is empty
- Registry value set: HKEY_CURRENT_USER\Software\Cygwin\setup\rootdir = "C:\Users\DRA\AppData\Local\opam\.cygwin\root"
- running: C:\Users\DRA\AppData\Local\opam\.cygwin\root\bin\dash.exe "/etc/postinstall/0p_000_autorebase.dash"
- running: C:\Users\DRA\AppData\Local\opam\.cygwin\root\bin\dash.exe "/etc/postinstall/0p_update-info-dir.dash"
- running: C:\Users\DRA\AppData\Local\opam\.cygwin\root\bin\dash.exe "/etc/postinstall/zp_man-db-update-index.dash"
- Ending cygwin install

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ERROR] The compilation of conf-mingw-w64-zstd-i686.1 failed at "pkgconf --personality=i686-w64-mingw32 libzstd".

#=== ERROR while compiling conf-mingw-w64-zstd-i686.1 =========================#
# context     2.2.0~beta2~dev | win32/x86_64 | ocaml-arch-x86_32.1 ocaml-system-mingw.1 | git+file://C:/Devel/opam-repository5#windows-initial
# path        ~\AppData\Local\opam\manpath\.opam-switch\build\conf-mingw-w64-zstd-i686.1
# command     ~\AppData\Local\opam\.cygwin\root\bin\pkgconf.exe --personality=i686-w64-mingw32 libzstd
# exit-code   1
# env-file    ~\AppData\Local\opam\log\conf-mingw-w64-zstd-i686-8284-af926c.env
# output-file ~\AppData\Local\opam\log\conf-mingw-w64-zstd-i686-8284-af926c.out

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
β”Œβ”€ The following actions failed
β”‚ Ξ» build conf-mingw-w64-zstd-i686 1
└─
╢─ No changes have been performed

(in fact, wouldn't this be better for depext on all platforms?)

dra27 commented 8 months ago

I'm regarding it as a bug because the requested external dependency was not installed, yet opam continued, even though the reason for that is not strictly opam's fault! πŸ™‚