Giter Site home page Giter Site logo

Comments (8)

slinkp avatar slinkp commented on August 25, 2024

I wondered if it might be a difference between rg 13.0.0 and rg 12.1.1 but the output looks the same given the same input.

from rg.el.

dajva avatar dajva commented on August 25, 2024

Thanks for the detailed report. I have no official support for Mac and no way to test so can't help much here, more than give some pointers for you to start debugging yourself.
Ripgrep 13 should not be a problem in general since that is what is currently running in CI. Would be interesting if it reproduces on 12.1.1 on Mac and/or on emacs 27 on Mac for instance. That may give some leads.

I would also test if other compilation-mode derived modes work, like grep.el, or running the same ripgrep command via M-x compile.
grep.el should support ripgrep these days, not sure if that made it into emacs 28 but if so, there should be some setting for it. So that would also be interesting to try since grep.el and rg.el are fairly similar in the architecture.

from rg.el.

slinkp avatar slinkp commented on August 25, 2024

Thanks for the troubleshooting tip!
It appears that compile never finishes. It stays like this indefinitely:

Screen Shot 2022-05-20 at 1 51 47 PM

Interestingly, M-x grep seems to work. Given the same test directory & files, I can type M-x grep birds * <ENTER> with these results:
Screen Shot 2022-05-20 at 1 56 38 PM

I'm going to see what else I can find out.

from rg.el.

slinkp avatar slinkp commented on August 25, 2024

I was able to install 27.1 on mac via homebrew, also disabling the native compilation to remove one more difference between platforms. Same behavior as reported.

ALso tried removing that and downloading the 28.1-4 binary from https://emacsformacosx.com/
Same behavior

from rg.el.

slinkp avatar slinkp commented on August 25, 2024

Here's a minimal repro:

M-x compile <ENTER> rg -e hello
That hangs in the "Compiling" state, never shows any output. But only on my mac.

With any file or directory arg, it completes (either with matches or without, but it completes):
M-x compile <ENTER> rg -e hello .

Any tips on debugging why compile gets stuck?

Is it possible it's waiting for EOF on stdin?
M-x compile <ENTER> grep -e hello similarly hangs, but that's expected because it looks at stdin if no files are specified.

man ripgrep says this:

       ripgrep will automatically detect if stdin exists and search stdin for a regex
       pattern, e.g. ls | rg foo. In some environments, stdin may exist when it shouldn’t. To
       turn off stdin detection explicitly specify the directory to search, e.g. rg foo ./.

Similarly, if I copy the exact command line that's run by M-x rg, add a directory to the end, and pass that to M-x compile then it gets results.

from rg.el.

dajva avatar dajva commented on August 25, 2024

Ah, great debugging. There is a fix for this on windows, maybe the same is needed for os X unless there is something specific with your system that is causing this behavior.
Anyway, try changing 'windows-nt to 'darwin in this line and see how it works.
A bit peculiar that no one else has reported this on for Mac but I think we could try this as a general solution if it works for you and handle any potential regressions if they show up.

from rg.el.

slinkp avatar slinkp commented on August 25, 2024

That works!! Thanks for the quick responses!
I can ask around if I know anybody else willing to test it. So far the other mac emacs users I know are using other search packages.

from rg.el.

slinkp avatar slinkp commented on August 25, 2024

I reverted my local change and pulled latest master and it's working great now! THank you!!

from rg.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.