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.21k stars 348 forks source link

Disentangle `OpamProcess.resolve_command` and `OpamSystem.resolve_command` #5991

Closed dra27 closed 4 weeks ago

dra27 commented 1 month ago

The opam init menu overhaul wants to be able to use resolve_command from within OpamStd.Sys (to be used with some low-level functions), but this isn't possible at present because the default for OpamSystem.resolve_command's ~env argument is OpamProcess.default_env.

However, since #3348 there's already been a slightly unholy mess (added by me...) to allow OpamProcess to use resolve_command. This PR disentagles it slightly, by moving the bulk of the logic to OpamStd.Sys and leaving the default argument handling in OpamProcess and then simply making OpamSystem.resolve_command an alias for OpamProcess.resolve_command. Not totally sure why I didn't do that in 2018...

kit-ty-kate commented 4 weeks ago

Thanks!