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

Some clarifications about depexts #4671

Merged
merged 2 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions doc/pages/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,14 +973,18 @@ files.
considered incompatible. This is useful to define sets of mutually conflicting
packages.

- <a id="opamfield-depexts">
`depexts: [ [ <string> ... ] { <filter> } ... ]`</a>:
the package external dependencies. This field may be used to describe the
dependencies of the package toward software or packages external to the <span
class="opam">opam</span> ecosystem, for various systems. Each
`[ <string> ... ] { <filter> }` element declares the strings to the left as
identifiers to required system-managed packages, while the filter to the right
allows one to select the systems they will be active on.
- <a id="opamfield-depexts"> `depexts: [ [ <string> ... ] { <filter> } ... ]`</a>:
the package external dependencies. This field is used to describe the
dependencies of the package toward packages external to the <span
class="opam">opam</span> ecosystem; <span class="opam">opam</span> will then
use its knowledge of the system package manager to determine the availability
of the package, and install these external dependencies on the system as
prerequisites of the package, asking the user for administrator rights if
required.

Each `[ <string> ... ] { <filter> }` element declares the strings to the
left as identifiers to required system-managed packages, while the filter to
the right allows one to select the systems they will be active on.

The filters typically use variables [`arch`](#opamvar-arch),
[`os`](#opamvar-os), [`os-distribution`](#opamvar-os-distribution),
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ New option/command/subcommand are prefixed with ◈.
* Improve messages to hint that answering `no` doesn't abort installation [#4591 @AltGr]
* Add support for non-interactive mode in macports [#4676 @kit-ty-kate]
* Handling of packages of tagged repositories for alpine [#4700 @rjbou - fix #4670]
* Clarify some `assume-depexts` related messages [#4671 @AltGr - partial fix #4662]

## Sandbox
* Fix the conflict with the environment variable name used by dune [#4535 @smorimoto - fix ocaml/dune#4166]
Expand Down
10 changes: 6 additions & 4 deletions src/state/opamSwitchState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,14 +1094,16 @@ let unavailable_reason st ?(default="") (name, vformula) =
in
let msg =
match missing with
| [pkg] ->
" '" ^ pkg ^ "'"
| [pkg] -> " '" ^ pkg ^ "'"
| pkgs ->
"s " ^ (OpamStd.Format.pretty_list (List.rev_map (Printf.sprintf "'%s'") pkgs))
"s " ^ (OpamStd.Format.pretty_list
(List.rev_map (Printf.sprintf "'%s'") pkgs))
in
Printf.sprintf
"depends on the unavailable system package%s. Use \
`--assume-depexts' to attempt installation anyway." msg
`--no-depexts' to attempt installation anyway, or it is \
possible that a depext package name in the opam file \
is incorrect." msg
| None -> default

let update_package_metadata nv opam st =
Expand Down