Displaying full filenames in dune-site before load
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Desired Behavior
I'd like dune-site to have more fine-grained ways to obtain debugging/logging information about which files it is loading.
More specifically, I'm trying to debug why Frama-C (WP plug-in in particular) fails to load when using a Cygwin-compiled OCaml (without MinGW), while it works when a MinGW-based installation is present. Currently, all I have is the message:
Dynlink.Error (Dynlink.Cannot_open_dll "Dynlink.Error (Dynlink.Cannot_open_dll \"Failure(\\\"Permission denied\\\")\")")
But I have no idea which file is causing this, and I don't see an easy way to get this information. I tried using strace, and it seems to indicate something related to .opam\4.14.1\lib\ocaml\nums.cmxs, but it's hard to understand the log.
And since dune-site is the one actually responsible for defining the actual filename (after lookup and possibly some conversions, including concatenation of the directory name), when I try to debug it from Frama-C, I get no useful feedback (only that the plug-in that failed to load is WP, which I already knew).
Ideally, some environment variable, or some other setting (e.g. an optional argument) should allow outputting the specific information about which file(s) and directory(ies) are being loaded, so that if something fails later, the user can more easily understand what happened.
Example
Assuming e.g. a DUNE_SITE_VERBOSE=1 environment variable, when Dune_site_plugins.V1.load is called, it would print (to stderr or somewhere else) phrases such as dune-site: Loading '<file>', so that any subsequent errors would be easier to debug.
If there is already something like that, please let me know so I can try it.
Contributor guide
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 at Dune_site_plugins.V1.load and trace how filenames and directories are resolved before loading. Define the diagnostic output around the requested DUNE_SITE_VERBOSE setting or equivalent, then verify that failed loads identify the specific file and directory involved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100