`odep dune` fails with a non-default `OPAMROOT`
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 41
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I encounter the following error:
[ERROR] Opam has not been initialised, please run `opam init'
odep: internal error, uncaught exception:
OpamStd.OpamSys.Exit(50)
when running odep dune with a valid non-default OPAMROOT when there is no $HOME/.opam.
I think this is because the opam state is not initialized in create_findlib_map in opam_findlib.ml as it is in g_of_installed in opam_installed_graph.ml (see https://github.com/search?q=repo%3Asim642%2Fodep+OpamStateConfig&type=code). Probably, mimicking the initialization code in g_of_installed and adding it to create_findlib_map (or extracting a common helper) would fix the issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in opam_findlib.ml at create_findlib_map and compare its opam-state handling with g_of_installed in opam_installed_graph.ml. Reproduce the failure by running odep dune with a valid non-default OPAMROOT and no $HOME/.opam. Done means the command no longer reports that opam has not been initialised in this setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100