opam
opam copied to clipboard
Opam cannot recognize Emacs that is built from source
- Opam version: 2.1.0
- Emacs version: 28.0.90 (built from source code)
When installing tuareg
, Opam shows the following message:
The following system packages will first need to be installed:
emacs
I've installed emacs
via source code (make install
), so I clearly have it in /usr/local/bin/emacs
path. However, it seems Opam cannot recognize this installation.
Does Opam not look for /usr/local/bin
path when looking for system packages? If so, why is that?
Thanks!
I know there is additional options like --assume-depexts
or depext-run-install=false
, but I just want to understand this behaviour.
Does Opam not look for
/usr/local/bin
path when looking for system packages? If so, why is that?
Indeed it does not.
The reason is that opam-depext was formally a plugin not integrated to opam and only had the depexts
field to use. No installability check was done and the relevant system packages were only installed when the plugin was used explicitly.
The plugin model caused many problems and was integrated with added installability check into opam in 2.1.0 with --assume-depexts
as an escape hatch for manual installations for example.
Checking for the presence of a binary instead of a system package requires a new field if we want to do it properly, which would make it incompatible with previous opam version, thus it was more pushed as a feature for opam 3.0 when it was discussed some time ago. Plus given the availability of escape hatches such as --assume-depexts
, --no-depexts
or opam option depext=false
, it was judged low priority.
@kit-ty-kate Wow, thanks for your kind and detailed explanation! I didn't know the history behind this feature until your comment.
Indeed, I can bypass this by --assume-depexts
, but sometimes it is very helpful to let opam install packages by itself.
Sorry for the low priority. I will wait for the opm 3.0!
Note also that, while the current interface and cli flags may be confusing, the upcoming version should be pretty clear in how you can work around that lack of detection. See https://github.com/ocaml/opam/pull/5053#issuecomment-1036509239 for a sneak peek.