calligraphy icon indicating copy to clipboard operation
calligraphy copied to clipboard

Always "No files matched your search criteria.."

Open simonmichael opened this issue 1 year ago • 7 comments

Thanks for calligraphy!

I tried every variant of the MODULE argument and working directory I could think of, but I couldn't figure out how to make it find files. Eg in this repo:

~/src/calligraphy$ calligraphy Calligraphy
No files matched your search criteria..

simonmichael avatar Aug 14 '24 07:08 simonmichael

Did you generate HIE files? If I run this in this repo, it correctly produces the call graph for the Calligraphy module: cabal run --ghc-options=-fwrite-ide-info calligraphy -- Calligraphy --stdout-dot

jonascarpay avatar Aug 14 '24 07:08 jonascarpay

(I had forgotten to generate them after switching to the calligraphy repo to test there, but doing so didn't help.)

I have been using stack. Switching to cabal, I can reproduce success with your command cabal run --ghc-options=-fwrite-ide-info calligraphy -- Calligraphy --stdout-dot. But that's the only command I've found that works, so I still have questions:

~/src/calligraphy$ cabal run --ghc-options=-fwrite-ide-info calligraphy -- Calligraphy --stdout-dot  # works
~/src/calligraphy$ calligraphy -- Calligraphy --stdout-dot
Warning: no output options specified, run with --help to see options
  • The hie files are in place, but the cabal run part is still needed somehow ?
  • Isn't --stdout-dot an output option ?
  • The help implies that just calligraphy with no arguments should do something using defaults

simonmichael avatar Aug 14 '24 08:08 simonmichael

Ah, I should have removed the -- when I ran calligraphy by itself, then it works normally (my bad). And I think the original failure is because it finds .hie files generated by a cabal build, but not the ones generated by a stack build.

simonmichael avatar Aug 14 '24 09:08 simonmichael

(sample hie file locations:) cabal: dist-newstyle/build/aarch64-osx/ghc-9.8.2/calligraphy-0.1.6/build/extra-compilation-artifacts/hie/* stack: .stack-work/dist/aarch64-osx/ghc-9.8.2/build/*

simonmichael avatar Aug 14 '24 09:08 simonmichael

Very strange. For context, this is what happens for me:

$ find . -name '*.hie' | head
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Compat/Debug.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Compat/Lib.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Compat/GHC.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Prelude.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Util/Lens.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Util/LexTree.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Util/Types.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Util/Printer.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Util/Optparse.hie
./dist-newstyle/build/x86_64-linux/ghc-9.2.8/calligraphy-0.1.6/build/Calligraphy/Phases/Parse.hie
$ calligraphy --stdout-dot Calligraphy | head
digraph calligraphy {
    node [style=filled fillcolor="#ffffffcf"];
    graph [outputorder=edgesfirst];
    subgraph cluster_node_0 {
        style=invis;
        node_0 [label="AppConfig",shape=octagon,style="dashed, filled"];
        subgraph cluster_node_1 {
            style=invis;
            node_1 [label="AppConfig",shape=box,style="dashed, filled"];
            node_2 [label="debugConfig",shape=box,style="rounded, dashed, filled"];

jonascarpay avatar Aug 14 '24 09:08 jonascarpay

Ah, I hadn't seen your new messages. I'm not very familiar with stack, maybe there's an easy way to pick up stack build artifacts too

jonascarpay avatar Aug 14 '24 09:08 jonascarpay

Thanks for your help. Another small improvement might be to have the error say "no .hie files were found, have you built with CMD" - I thought it was failing to find my source files and wasted time on that.

simonmichael avatar Aug 14 '24 09:08 simonmichael

Upvoting myself since I rediscovered calligraphy and hit the same problem again today.

simonmichael avatar May 01 '25 11:05 simonmichael