Do depexts status check at opam update time#6489
Conversation
a9ed214 to
6be401b
Compare
dac6fd8 to
4af5735
Compare
c715f6a to
48e64e4
Compare
48e64e4 to
9d59425
Compare
9d59425 to
28b4831
Compare
src/state/opamSysInteract.ml
Outdated
| match latest with | ||
| | Some p -> OpamSysPkg.Map.add p ps provides | ||
| | None -> provides (* Bad pacman output ?? *) | ||
| | None -> provides (* FIXME: Bad pacman output ?? *) |
There was a problem hiding this comment.
what is the resaon of the fixme ?
There was a problem hiding this comment.
I will have to recheck my tests on Altlinux
32ec8d6 to
d311299
Compare
4b63e8f to
61bf34d
Compare
5e1d836 to
201aae0
Compare
37e29e2 to
f3d5c95
Compare
171fa5b to
845b2c6
Compare
kit-ty-kate
left a comment
There was a problem hiding this comment.
LGTM modulo some minor things to fix
tests/reftests/depexts.test
Outdated
| ### : <><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : [default] Initialised | ||
| ### : | ||
| ### : <><> Creating initial switch 'comp' (invariant ["comp"]) ><><><><><><><><><><><> | ||
| ### : | ||
| ### : <><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : Switch invariant: ["comp"] | ||
| ### : [NOTE] External dependency handling not supported for OS family 'unknown'. | ||
| ### : You can disable this check using 'opam option --global depext=false' | ||
| ### : | ||
| ### : <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : -> installed comp.1 | ||
| ### : Done. |
There was a problem hiding this comment.
why add comments like this?
tests/reftests/depext-only.test
Outdated
| # Return code 2 # | ||
| ### opam option depext=false | ||
| Set to 'false' the field depext in global configuration | ||
| ### opam install foo --depext-only |
There was a problem hiding this comment.
I'm not sure i agree this shouldn't do anything. I can see a case for disabling depext by default but selectively installing them when needed.
There was a problem hiding this comment.
If it's too complicated to do with the new system though, we should at least display an error message saying to set opam option depext=true and exit <> 0, but doing it automatically for the duration of the command would be best i think.
There was a problem hiding this comment.
it's easily doable with
--- a/src/client/opamCommands.ml
+++ b/src/client/opamCommands.ml
@@ -1875,6 +1875,11 @@ let install cli =
else "no-depexts"))
else
OpamGlobalState.with_ `Lock_none @@ fun gt ->
+ if depext_only && OpamStateConfig.no_depexts gt then
+ `Error (true,
+ Printf.sprintf "Depexts mechanism is disabled, \
+ --depext-only can't be used.")
+ else
OpamSwitchState.with_ `Lock_write gt @@ fun st ->
let pure_atoms =
List.filter_map (function `Atom a -> Some a | _ -> None)
tests/reftests/depexts.test
Outdated
| <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
| -> retrieved other.dev (file://${BASEDIR}/other) | ||
| -> installed other.dev | ||
| [NOTE] Requirement for system package other-depext overridden in this switch. Use `opam option 'depext-bypass-="other-depext"'' to revert. |
There was a problem hiding this comment.
| [NOTE] Requirement for system package other-depext overridden in this switch. Use `opam option 'depext-bypass-="other-depext"'' to revert. | |
| [NOTE] Requirement for system package other-depext overridden in this switch. Use `opam option 'depext-bypass-="other-depext"'` to revert. |
tests/reftests/depexts.test
Outdated
| ### : <><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : [default] Initialised | ||
| ### : | ||
| ### : <><> Creating initial switch 'comp' (invariant ["comp"]) ><><><><><><><><><><><> | ||
| ### : | ||
| ### : <><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : Switch invariant: ["comp"] | ||
| ### : [NOTE] External dependency handling not supported for OS family 'unknown'. | ||
| ### : You can disable this check using 'opam option --global depext=false' | ||
| ### : | ||
| ### : <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
| ### : -> installed comp.1 | ||
| ### : Done. |
There was a problem hiding this comment.
I kept it for reference at some point while enabling/disabling the main behaviour of polling depexts on update/init
It's a developement artifact at this point and should be removed
| ### : <><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><> | |
| ### : [default] Initialised | |
| ### : | |
| ### : <><> Creating initial switch 'comp' (invariant ["comp"]) ><><><><><><><><><><><> | |
| ### : | |
| ### : <><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><> | |
| ### : Switch invariant: ["comp"] | |
| ### : [NOTE] External dependency handling not supported for OS family 'unknown'. | |
| ### : You can disable this check using 'opam option --global depext=false' | |
| ### : | |
| ### : <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | |
| ### : -> installed comp.1 | |
| ### : Done. |
de66de8 to
ef3c0bc
Compare
tests/reftests/depext-only.test
Outdated
| - sys-foo | ||
| ### :I:5: No depext | ||
| ### opam switch create no-depext --empty | ||
| ### OPAMNODEPEXTS=1 opam install foo --depext-only |
There was a problem hiding this comment.
| ### OPAMNODEPEXTS=1 opam install foo --depext-only | |
| ### OPAMNODEPEXTS=1 opam install foo --depext-only | sed-cmd echo |
…and installed These polling functions are also now no-op if given argument is an empty set. Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
It can be used to detect if opam is launched in a sandboxed environment, like when it is launched in inner commands (build, install, remove actions).
…e it Compute and cache depexts availability during repository state loading and integrate this information into switch state management. This enables efficient access to system package availability without repeated system queries. This repository state cache is also updated with 'opam update --depexts'. For pinned packages, during switch state loading (or pin update), systms packages status is retrrieved at the moment and completed to existing one. Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
ef3c0bc to
b9b9168
Compare
Co-authored-by: Kate <kit-ty-kate@exn.st>
|
Igoring the unrelated Thanks a lot! |
Fixes #6461
Fixes #4172