dune icon indicating copy to clipboard operation
dune copied to clipboard

Look for META files rather than just directories to list plugins

Open shym opened this issue 1 year ago • 2 comments

This PR proposes a possible fix for #10457.

If the plugin directory contains anything but directories that each contain a META file, loading plugins fails. This PR proposes to check additionally for the presence of the META files and ignore other entries in the plugin directory.

shym avatar Apr 25 '24 17:04 shym

Thank you for your review!

I wasn’t sure about the best way to test this behaviour. I have added such a possible test, where the empty directory is explicitly created to mimick what happens with OPAM.

Your suggestion to go with filter_map sent me on another exploration. Checking that Sys.file_exists on each candidate directory is not enough to ensure readdir will not fail. So I ended up with the following proposition: just try to Sys.readdir each plugins directory and handle the errors as empty directories.

shym avatar Apr 26 '24 13:04 shym

ping @anmonteiro

rgrinberg avatar May 08 '24 17:05 rgrinberg

Thanks. Can you add a changelog entry in doc/changes/?

emillon avatar May 22 '24 08:05 emillon